Commit 079d77bc588c9b463b25a663d81df548c8a16895
1 parent
8bb0fbb0
reCommit
Showing
2 changed files
with
154 additions
and
70 deletions
src/main/java/com/bsth/service/impl/SectionServiceImpl.java
| @@ -996,28 +996,56 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -996,28 +996,56 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 996 | Integer id = Integer.valueOf(sectionCode); | 996 | Integer id = Integer.valueOf(sectionCode); |
| 997 | repository.systemSave(sectionCode, sectionName, crosesRoad, endNode, startNode, middleNode, gsectionVector, bsectionVector, sectionType, csectionVector, roadCoding, sectionDistance, sectionTime, dbType, speedLimit, descriptions, versions, id); | 997 | repository.systemSave(sectionCode, sectionName, crosesRoad, endNode, startNode, middleNode, gsectionVector, bsectionVector, sectionType, csectionVector, roadCoding, sectionDistance, sectionTime, dbType, speedLimit, descriptions, versions, id); |
| 998 | Section section = repository.findById(id).get(); | 998 | Section section = repository.findById(id).get(); |
| 999 | + | ||
| 999 | Line line = lineRepository.findById(lineId).get(); | 1000 | Line line = lineRepository.findById(lineId).get(); |
| 1000 | - // 路段路由 | ||
| 1001 | - SectionRoute sectionRoute = new SectionRoute(); | ||
| 1002 | - Integer routeCode = null; | ||
| 1003 | - if(!sectionrouteCode.equals("")){ | ||
| 1004 | - String sectionrouteCodeArray[] = sectionrouteCode.split("_"); | ||
| 1005 | - routeCode = Integer.valueOf(sectionrouteCodeArray[0])+1; | ||
| 1006 | - }else { | ||
| 1007 | - routeCode = 1; | ||
| 1008 | - } | ||
| 1009 | - routeRepository.sectionUpdSectionRouteCode(lineId, directions, routeCode); | ||
| 1010 | - sectionRoute.setSectionrouteCode(routeCode); | ||
| 1011 | - sectionRoute.setLineCode(lineCode); | ||
| 1012 | - sectionRoute.setSection(section); | ||
| 1013 | - sectionRoute.setSectionCode(sectionCode); | ||
| 1014 | - sectionRoute.setDirections(directions); | ||
| 1015 | - sectionRoute.setDescriptions(descriptions); | ||
| 1016 | - sectionRoute.setDestroy(destroy); | ||
| 1017 | - sectionRoute.setVersions(versions); | ||
| 1018 | - sectionRoute.setLine(line); | ||
| 1019 | - sectionRoute.setIsRoadeSpeed(0); | ||
| 1020 | - routeRepository.save(sectionRoute); | 1001 | + |
| 1002 | + | ||
| 1003 | + if(map.get("status") == null || Integer.parseInt(map.get("status").toString()) == 1) { | ||
| 1004 | + // 路段路由 | ||
| 1005 | + SectionRoute sectionRoute = new SectionRoute(); | ||
| 1006 | + Integer routeCode = null; | ||
| 1007 | + if(!sectionrouteCode.equals("")){ | ||
| 1008 | + String sectionrouteCodeArray[] = sectionrouteCode.split("_"); | ||
| 1009 | + routeCode = Integer.valueOf(sectionrouteCodeArray[0])+1; | ||
| 1010 | + }else { | ||
| 1011 | + routeCode = 1; | ||
| 1012 | + } | ||
| 1013 | + routeRepository.sectionUpdSectionRouteCode(lineId, directions, routeCode); | ||
| 1014 | + sectionRoute.setSectionrouteCode(routeCode); | ||
| 1015 | + sectionRoute.setLineCode(lineCode); | ||
| 1016 | + sectionRoute.setSection(section); | ||
| 1017 | + sectionRoute.setSectionCode(sectionCode); | ||
| 1018 | + sectionRoute.setDirections(directions); | ||
| 1019 | + sectionRoute.setDescriptions(descriptions); | ||
| 1020 | + sectionRoute.setDestroy(destroy); | ||
| 1021 | + sectionRoute.setVersions(versions); | ||
| 1022 | + sectionRoute.setLine(line); | ||
| 1023 | + sectionRoute.setIsRoadeSpeed(0); | ||
| 1024 | + routeRepository.save(sectionRoute); | ||
| 1025 | + }else if(Integer.parseInt(map.get("status").toString()) == 2) { | ||
| 1026 | + | ||
| 1027 | + LsSectionRoute sectionRoute = new LsSectionRoute(); | ||
| 1028 | + Integer routeCode = null; | ||
| 1029 | + if(!sectionrouteCode.equals("")){ | ||
| 1030 | + String sectionrouteCodeArray[] = sectionrouteCode.split("_"); | ||
| 1031 | + routeCode = Integer.valueOf(sectionrouteCodeArray[0])+1; | ||
| 1032 | + }else { | ||
| 1033 | + routeCode = 1; | ||
| 1034 | + } | ||
| 1035 | + sectionRoute.setSectionrouteCode(routeCode); | ||
| 1036 | + sectionRoute.setLineCode(lineCode); | ||
| 1037 | + sectionRoute.setSection(section); | ||
| 1038 | + sectionRoute.setSectionCode(sectionCode); | ||
| 1039 | + sectionRoute.setDirections(directions); | ||
| 1040 | + sectionRoute.setDescriptions(descriptions); | ||
| 1041 | + sectionRoute.setDestroy(destroy); | ||
| 1042 | + sectionRoute.setVersions(versions); | ||
| 1043 | + sectionRoute.setLine(line); | ||
| 1044 | + sectionRoute.setIsRoadeSpeed(0); | ||
| 1045 | + lsRouteRepository.save(sectionRoute); | ||
| 1046 | + } | ||
| 1047 | + | ||
| 1048 | + | ||
| 1021 | resultMap.put("status", ResponseCode.SUCCESS); | 1049 | resultMap.put("status", ResponseCode.SUCCESS); |
| 1022 | } catch (Exception e) { | 1050 | } catch (Exception e) { |
| 1023 | resultMap.put("status", ResponseCode.ERROR); | 1051 | resultMap.put("status", ResponseCode.ERROR); |
src/main/java/com/bsth/service/impl/StationServiceImpl.java
| @@ -840,58 +840,114 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -840,58 +840,114 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 840 | repository.stationSave(stationCod, zdmc, roadCoding, dbType, bJwpoints, | 840 | repository.stationSave(stationCod, zdmc, roadCoding, dbType, bJwpoints, |
| 841 | gLonx, gLaty, x, y, gPloygonGrid,bPloygonGrid, destroy, radius, | 841 | gLonx, gLaty, x, y, gPloygonGrid,bPloygonGrid, destroy, radius, |
| 842 | shapesType, versions, descriptions, createBy, updateBy,stationId); | 842 | shapesType, versions, descriptions, createBy, updateBy,stationId); |
| 843 | - | ||
| 844 | Station station = repository.findById(stationId).get(); | 843 | Station station = repository.findById(stationId).get(); |
| 845 | - StationRoute arg0 = new StationRoute(); | ||
| 846 | - // 距离 | ||
| 847 | - Double distances = map.get("distances").equals("") ? 0.0d : Double.parseDouble(map.get("distances").toString()); | ||
| 848 | - // 时间 | ||
| 849 | - Double toTime = map.get("toTime").equals("") ? 0.0d : Double.parseDouble(map.get("toTime").toString()); | ||
| 850 | - // 站点路由名称 | ||
| 851 | - String stationName = map.get("stationName").equals("") ? "" : map.get("stationName").toString(); | ||
| 852 | - // 线路ID | ||
| 853 | - int line = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString()); | ||
| 854 | - // 线路信息 | ||
| 855 | - Line resultLine = lineRepository.findById(line).get(); | ||
| 856 | - // 站点路由序号 | ||
| 857 | - String stationRouteCodeStr = map.get("stationRouteCode").equals("") ? "" : map.get("stationRouteCode").toString(); | ||
| 858 | - // 站点类型 | ||
| 859 | - String stationMark = map.get("stationMark").equals("") ? "" : map.get("stationMark").toString(); | ||
| 860 | - Integer stationRouteCode = null; | ||
| 861 | - if(stationRouteCodeStr!="") { | ||
| 862 | - String stationRouteCodeArray [] = stationRouteCodeStr.split("_"); | ||
| 863 | - stationRouteCode = Integer.parseInt(stationRouteCodeArray[0].toString())+1; | 844 | + |
| 845 | + if(map.get("status") == null || Integer.parseInt(map.get("status").toString()) == 1) { | ||
| 846 | + StationRoute arg0 = new StationRoute(); | ||
| 847 | + // 距离 | ||
| 848 | + Double distances = map.get("distances").equals("") ? 0.0d : Double.parseDouble(map.get("distances").toString()); | ||
| 849 | + // 时间 | ||
| 850 | + Double toTime = map.get("toTime").equals("") ? 0.0d : Double.parseDouble(map.get("toTime").toString()); | ||
| 851 | + // 站点路由名称 | ||
| 852 | + String stationName = map.get("stationName").equals("") ? "" : map.get("stationName").toString(); | ||
| 853 | + // 线路ID | ||
| 854 | + int line = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString()); | ||
| 855 | + // 线路信息 | ||
| 856 | + Line resultLine = lineRepository.findById(line).get(); | ||
| 857 | + // 站点路由序号 | ||
| 858 | + String stationRouteCodeStr = map.get("stationRouteCode").equals("") ? "" : map.get("stationRouteCode").toString(); | ||
| 859 | + // 站点类型 | ||
| 860 | + String stationMark = map.get("stationMark").equals("") ? "" : map.get("stationMark").toString(); | ||
| 861 | + Integer stationRouteCode = null; | ||
| 862 | + if(stationRouteCodeStr!="") { | ||
| 863 | + String stationRouteCodeArray [] = stationRouteCodeStr.split("_"); | ||
| 864 | + stationRouteCode = Integer.parseInt(stationRouteCodeArray[0].toString())+1; | ||
| 865 | + }else { | ||
| 866 | + stationRouteCode = 100; | ||
| 867 | + } | ||
| 868 | + // 线路 | ||
| 869 | + arg0.setLine(resultLine); | ||
| 870 | + arg0.setLineCode(resultLine.getLineCode()); | ||
| 871 | + arg0.setIndustryCode(industryCode); | ||
| 872 | + // 站点 | ||
| 873 | + arg0.setStation(station); | ||
| 874 | + // 站点路由名称 | ||
| 875 | + arg0.setStationName(stationName); | ||
| 876 | + // 站点路由编码 | ||
| 877 | + arg0.setStationCode(station.getStationCod()); | ||
| 878 | + // 站点路由序号 | ||
| 879 | + arg0.setStationRouteCode(stationRouteCode); | ||
| 880 | + // 站点路由类型 | ||
| 881 | + arg0.setStationMark(stationMark); | ||
| 882 | + // 站点路由站点方向 | ||
| 883 | + arg0.setDirections(directions); | ||
| 884 | + // 站点路由到站距离 | ||
| 885 | + arg0.setDistances(distances); | ||
| 886 | + // 站点路由到站时间 | ||
| 887 | + arg0.setToTime(toTime); | ||
| 888 | + // 站点版本号 | ||
| 889 | + arg0.setVersions(versions); | ||
| 890 | + // 是否撤销 | ||
| 891 | + arg0.setDestroy(destroy); | ||
| 892 | + // 站点路由说明 | ||
| 893 | + arg0.setDescriptions(descriptions); | ||
| 894 | + routeRepository.stationUpdStationRouteCode(line, directions, stationRouteCode); | ||
| 895 | + routeRepository.save(arg0); | ||
| 864 | }else { | 896 | }else { |
| 865 | - stationRouteCode = 100; | 897 | + LsStationRoute arg0 = new LsStationRoute(); |
| 898 | + // 距离 | ||
| 899 | + Double distances = map.get("distances").equals("") ? 0.0d : Double.parseDouble(map.get("distances").toString()); | ||
| 900 | + // 时间 | ||
| 901 | + Double toTime = map.get("toTime").equals("") ? 0.0d : Double.parseDouble(map.get("toTime").toString()); | ||
| 902 | + // 站点路由名称 | ||
| 903 | + String stationName = map.get("stationName").equals("") ? "" : map.get("stationName").toString(); | ||
| 904 | + // 线路ID | ||
| 905 | + int line = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString()); | ||
| 906 | + // 线路信息 | ||
| 907 | + Line resultLine = lineRepository.findById(line).get(); | ||
| 908 | + // 站点路由序号 | ||
| 909 | + String stationRouteCodeStr = map.get("stationRouteCode").equals("") ? "" : map.get("stationRouteCode").toString(); | ||
| 910 | + // 站点类型 | ||
| 911 | + String stationMark = map.get("stationMark").equals("") ? "" : map.get("stationMark").toString(); | ||
| 912 | + Integer stationRouteCode = null; | ||
| 913 | + if(stationRouteCodeStr!="") { | ||
| 914 | + String stationRouteCodeArray [] = stationRouteCodeStr.split("_"); | ||
| 915 | + stationRouteCode = Integer.parseInt(stationRouteCodeArray[0].toString())+1; | ||
| 916 | + }else { | ||
| 917 | + stationRouteCode = 100; | ||
| 918 | + } | ||
| 919 | + // 线路 | ||
| 920 | + arg0.setLine(resultLine); | ||
| 921 | + arg0.setLineCode(resultLine.getLineCode()); | ||
| 922 | + arg0.setIndustryCode(industryCode); | ||
| 923 | + // 站点 | ||
| 924 | + arg0.setStation(station); | ||
| 925 | + // 站点路由名称 | ||
| 926 | + arg0.setStationName(stationName); | ||
| 927 | + // 站点路由编码 | ||
| 928 | + arg0.setStationCode(station.getStationCod()); | ||
| 929 | + // 站点路由序号 | ||
| 930 | + arg0.setStationRouteCode(stationRouteCode); | ||
| 931 | + // 站点路由类型 | ||
| 932 | + arg0.setStationMark(stationMark); | ||
| 933 | + // 站点路由站点方向 | ||
| 934 | + arg0.setDirections(directions); | ||
| 935 | + // 站点路由到站距离 | ||
| 936 | + arg0.setDistances(distances); | ||
| 937 | + // 站点路由到站时间 | ||
| 938 | + arg0.setToTime(toTime); | ||
| 939 | + // 站点版本号 | ||
| 940 | + arg0.setVersions(versions); | ||
| 941 | + // 是否撤销 | ||
| 942 | + arg0.setDestroy(destroy); | ||
| 943 | + // 站点路由说明 | ||
| 944 | + arg0.setDescriptions(descriptions); | ||
| 945 | + lsStationRouteRepository.stationUpdStationRouteCode(line, directions, stationRouteCode); | ||
| 946 | + lsStationRouteRepository.save(arg0); | ||
| 866 | } | 947 | } |
| 867 | - // 线路 | ||
| 868 | - arg0.setLine(resultLine); | ||
| 869 | - arg0.setLineCode(resultLine.getLineCode()); | ||
| 870 | - arg0.setIndustryCode(industryCode); | ||
| 871 | - // 站点 | ||
| 872 | - arg0.setStation(station); | ||
| 873 | - // 站点路由名称 | ||
| 874 | - arg0.setStationName(stationName); | ||
| 875 | - // 站点路由编码 | ||
| 876 | - arg0.setStationCode(station.getStationCod()); | ||
| 877 | - // 站点路由序号 | ||
| 878 | - arg0.setStationRouteCode(stationRouteCode); | ||
| 879 | - // 站点路由类型 | ||
| 880 | - arg0.setStationMark(stationMark); | ||
| 881 | - // 站点路由站点方向 | ||
| 882 | - arg0.setDirections(directions); | ||
| 883 | - // 站点路由到站距离 | ||
| 884 | - arg0.setDistances(distances); | ||
| 885 | - // 站点路由到站时间 | ||
| 886 | - arg0.setToTime(toTime); | ||
| 887 | - // 站点版本号 | ||
| 888 | - arg0.setVersions(versions); | ||
| 889 | - // 是否撤销 | ||
| 890 | - arg0.setDestroy(destroy); | ||
| 891 | - // 站点路由说明 | ||
| 892 | - arg0.setDescriptions(descriptions); | ||
| 893 | - routeRepository.stationUpdStationRouteCode(line, directions, stationRouteCode); | ||
| 894 | - routeRepository.save(arg0); | 948 | + |
| 949 | + | ||
| 950 | + | ||
| 895 | resultMap.put("status", ResponseCode.SUCCESS); | 951 | resultMap.put("status", ResponseCode.SUCCESS); |
| 896 | } catch (Exception e) { | 952 | } catch (Exception e) { |
| 897 | resultMap.put("status", ResponseCode.ERROR); | 953 | resultMap.put("status", ResponseCode.ERROR); |