Commit f8d7df5b301216c68817869cfa2c05724d1cfd37
1 parent
0c738875
update...
Showing
1 changed file
with
18 additions
and
2 deletions
src/main/java/com/bsth/server_ws/util/ScheduleCalculator.java
| @@ -131,13 +131,29 @@ public class ScheduleCalculator { | @@ -131,13 +131,29 @@ public class ScheduleCalculator { | ||
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | /** | 133 | /** |
| 134 | - * 空驶公里(进场 + 出场) | 134 | + * 空驶公里(2点间空驶 + 进场 + 出场 + 子任务空驶) |
| 135 | * | 135 | * |
| 136 | * @param list | 136 | * @param list |
| 137 | * @return | 137 | * @return |
| 138 | */ | 138 | */ |
| 139 | public static double calcKSLC(List<ScheduleRealInfo> list) { | 139 | public static double calcKSLC(List<ScheduleRealInfo> list) { |
| 140 | - return Arith.add(calcCCLC(list), calcJCLC(list)); | 140 | + double sum = 0; |
| 141 | + | ||
| 142 | + Set<ChildTaskPlan> cts; | ||
| 143 | + for (ScheduleRealInfo sch : list) { | ||
| 144 | + cts = sch.getcTasks(); | ||
| 145 | + //有子任务 | ||
| 146 | + if (cts != null && cts.size() > 0) { | ||
| 147 | + for (ChildTaskPlan ct : cts) { | ||
| 148 | + if (ct.getMileageType().equals("empty")) | ||
| 149 | + sum = Arith.add(sum, ct.getMileage()); | ||
| 150 | + } | ||
| 151 | + } | ||
| 152 | + else if ((isInOut(sch) || sch.getBcType().equals("ldks")) && sch.getStatus() != -1) { | ||
| 153 | + sum = Arith.add(sum, sch.getJhlc()); | ||
| 154 | + } | ||
| 155 | + } | ||
| 156 | + return sum; | ||
| 141 | } | 157 | } |
| 142 | 158 | ||
| 143 | /** | 159 | /** |