Commit 58578f66 by huangjinxin

Merge remote-tracking branch 'origin/develop' into develop

2 parents 2384fc1f 192e0273
......@@ -119,6 +119,7 @@ public class ScheduleServiceImpl implements ScheduleService {
Collectors.groupingBy(EngineerInfoEntity::getEngineerCode));
List<ScheduleOverviewResp.Item> children = new ArrayList<>();
Integer teamDistance = 0;
for (Map.Entry<String, List<EngineerInfoEntity>> entry : engineers.entrySet()) {
ScheduleOverviewResp.Item child = new ScheduleOverviewResp.Item();
......@@ -134,7 +135,9 @@ public class ScheduleServiceImpl implements ScheduleService {
child.setLevel("engineer");
child.setOrder(this.getTeamOrderSum(orders2, skillMapping));
child.setOrderDesc(Integer.toString(orders2.size()));
child.setDistanceDesc("");
Integer distanceSum = orders2.stream().map(order -> Objects.nonNull(order.getArriveDistance()) ? order.getArriveDistance() : 0).reduce(Integer::sum).orElse(0);
teamDistance += distanceSum;
child.setDistanceDesc(distanceSum + "");
children.add(child);
}
......@@ -142,7 +145,7 @@ public class ScheduleServiceImpl implements ScheduleService {
team.setChildren(children);
team.setOrderDesc(String.format("人均:%d", teamEngineers.size() > 0 ? (orders.size() / teamEngineers.size()) : 0));
team.setDistanceDesc("");
team.setDistanceDesc(teamDistance + "");
teams.add(team);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!