Commit d692c45fdd9ed5573d57987bdca3467c74ffaf44
1 parent
2615acf1
防范线路数据缺失造成的营运非营运线路查询出现的空指针报错
Showing
3 changed files
with
12 additions
and
12 deletions
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
| @@ -755,11 +755,11 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -755,11 +755,11 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 755 | for (int i = 0; i < listAll.size(); i++) { | 755 | for (int i = 0; i < listAll.size(); i++) { |
| 756 | CalcStatistics c=listAll.get(i); | 756 | CalcStatistics c=listAll.get(i); |
| 757 | if(nature.equals("1")){ | 757 | if(nature.equals("1")){ |
| 758 | - if(lineMap.get(c.getXl())){ | 758 | + if(lineMap.containsKey(c.getXl()) && lineMap.get(c.getXl())){ |
| 759 | list.add(c); | 759 | list.add(c); |
| 760 | } | 760 | } |
| 761 | }else{ | 761 | }else{ |
| 762 | - if(!lineMap.get(c.getXl())){ | 762 | + if(lineMap.containsKey(c.getXl()) && !lineMap.get(c.getXl())){ |
| 763 | list.add(c); | 763 | list.add(c); |
| 764 | } | 764 | } |
| 765 | } | 765 | } |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -2845,11 +2845,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2845,11 +2845,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2845 | if (nature.equals("0")) { | 2845 | if (nature.equals("0")) { |
| 2846 | list.add(s); | 2846 | list.add(s); |
| 2847 | }else if(nature.equals("1")){ | 2847 | }else if(nature.equals("1")){ |
| 2848 | - if(lineMap.get(s.getXlBm())){ | 2848 | + if(lineMap.containsKey(s.getXlBm()) && lineMap.get(s.getXlBm())){ |
| 2849 | list.add(s); | 2849 | list.add(s); |
| 2850 | } | 2850 | } |
| 2851 | }else{ | 2851 | }else{ |
| 2852 | - if(!lineMap.get(s.getXlBm())){ | 2852 | + if(lineMap.containsKey(s.getXlBm()) && !lineMap.get(s.getXlBm())){ |
| 2853 | list.add(s); | 2853 | list.add(s); |
| 2854 | } | 2854 | } |
| 2855 | } | 2855 | } |
| @@ -3040,11 +3040,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3040,11 +3040,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3040 | if (nature.equals("0")) { | 3040 | if (nature.equals("0")) { |
| 3041 | list.add(s); | 3041 | list.add(s); |
| 3042 | }else if(nature.equals("1")){ | 3042 | }else if(nature.equals("1")){ |
| 3043 | - if(lineMap.get(s.getXlBm())){ | 3043 | + if(lineMap.containsKey(s.getXlBm()) && lineMap.get(s.getXlBm())){ |
| 3044 | list.add(s); | 3044 | list.add(s); |
| 3045 | } | 3045 | } |
| 3046 | }else{ | 3046 | }else{ |
| 3047 | - if(!lineMap.get(s.getXlBm())){ | 3047 | + if(lineMap.containsKey(s.getXlBm()) && !lineMap.get(s.getXlBm())){ |
| 3048 | list.add(s); | 3048 | list.add(s); |
| 3049 | } | 3049 | } |
| 3050 | } | 3050 | } |
src/main/java/com/bsth/service/report/impl/CalcSheetServiceImpl.java
| @@ -115,11 +115,11 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | @@ -115,11 +115,11 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | ||
| 115 | if (nature.equals("0")) { | 115 | if (nature.equals("0")) { |
| 116 | list.add(lists.get(i)); | 116 | list.add(lists.get(i)); |
| 117 | }else if(nature.equals("1")){ | 117 | }else if(nature.equals("1")){ |
| 118 | - if(lineMap.get(lists.get(i).getXl())){ | 118 | + if(lineMap.containsKey(lists.get(i).getXl()) && lineMap.get(lists.get(i).getXl())){ |
| 119 | list.add(lists.get(i)); | 119 | list.add(lists.get(i)); |
| 120 | } | 120 | } |
| 121 | }else{ | 121 | }else{ |
| 122 | - if(!lineMap.get(lists.get(i).getXl())){ | 122 | + if(lineMap.containsKey(lists.get(i).getXl()) && !lineMap.get(lists.get(i).getXl())){ |
| 123 | list.add(lists.get(i)); | 123 | list.add(lists.get(i)); |
| 124 | } | 124 | } |
| 125 | } | 125 | } |
| @@ -866,7 +866,7 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | @@ -866,7 +866,7 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | ||
| 866 | xlMap.put(m.get("xl").toString(), m.get("xl").toString()); | 866 | xlMap.put(m.get("xl").toString(), m.get("xl").toString()); |
| 867 | } | 867 | } |
| 868 | }else if(nature.equals("1")){ | 868 | }else if(nature.equals("1")){ |
| 869 | - if(lineMap.get(m.get("xl").toString())){ | 869 | + if(lineMap.containsKey(m.get("xl").toString()) && lineMap.get(m.get("xl").toString())){ |
| 870 | list.add(m); | 870 | list.add(m); |
| 871 | jhcc += Integer.valueOf(m.get("jhcc").toString()); | 871 | jhcc += Integer.valueOf(m.get("jhcc").toString()); |
| 872 | sjcc += Integer.valueOf(m.get("sjcc").toString()); | 872 | sjcc += Integer.valueOf(m.get("sjcc").toString()); |
| @@ -878,7 +878,7 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | @@ -878,7 +878,7 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | ||
| 878 | } | 878 | } |
| 879 | } | 879 | } |
| 880 | }else{ | 880 | }else{ |
| 881 | - if(!lineMap.get(m.get("xl").toString())){ | 881 | + if(lineMap.containsKey(m.get("xl").toString()) && !lineMap.get(m.get("xl").toString())){ |
| 882 | list.add(m); | 882 | list.add(m); |
| 883 | jhcc += Integer.valueOf(m.get("jhcc").toString()); | 883 | jhcc += Integer.valueOf(m.get("jhcc").toString()); |
| 884 | sjcc += Integer.valueOf(m.get("sjcc").toString()); | 884 | sjcc += Integer.valueOf(m.get("sjcc").toString()); |
| @@ -1026,7 +1026,7 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | @@ -1026,7 +1026,7 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | ||
| 1026 | xlMap.put(m.get("xl").toString(), m.get("xl").toString()); | 1026 | xlMap.put(m.get("xl").toString(), m.get("xl").toString()); |
| 1027 | } | 1027 | } |
| 1028 | }else if(nature.equals("1")){ | 1028 | }else if(nature.equals("1")){ |
| 1029 | - if(lineMap.get(m.get("xl").toString())){ | 1029 | + if(lineMap.containsKey(m.get("xl").toString()) && lineMap.get(m.get("xl").toString())){ |
| 1030 | list.add(m); | 1030 | list.add(m); |
| 1031 | jhcc += Integer.valueOf(m.get("jhcc").toString()); | 1031 | jhcc += Integer.valueOf(m.get("jhcc").toString()); |
| 1032 | sjcc += Integer.valueOf(m.get("sjcc").toString()); | 1032 | sjcc += Integer.valueOf(m.get("sjcc").toString()); |
| @@ -1040,7 +1040,7 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | @@ -1040,7 +1040,7 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | ||
| 1040 | } | 1040 | } |
| 1041 | } | 1041 | } |
| 1042 | }else{ | 1042 | }else{ |
| 1043 | - if(!lineMap.get(m.get("xl").toString())){ | 1043 | + if(lineMap.containsKey(m.get("xl").toString()) && !lineMap.get(m.get("xl").toString())){ |
| 1044 | list.add(m); | 1044 | list.add(m); |
| 1045 | jhcc += Integer.valueOf(m.get("jhcc").toString()); | 1045 | jhcc += Integer.valueOf(m.get("jhcc").toString()); |
| 1046 | sjcc += Integer.valueOf(m.get("sjcc").toString()); | 1046 | sjcc += Integer.valueOf(m.get("sjcc").toString()); |