Commit d2498107 by Ren Ping

fix:排班里程数据库公里改成米

1 parent c3ed56ad
...@@ -163,7 +163,7 @@ public class RoadDistanceUtils { ...@@ -163,7 +163,7 @@ public class RoadDistanceUtils {
String text = requestGetAK(url, params); String text = requestGetAK(url, params);
// System.out.println(url + " : " + gson.toJson(params) + " : " + text); // System.out.println(url + " : " + gson.toJson(params) + " : " + text);
BDResult webResult = gson.fromJson(text, BDResult.class); BDResult webResult = gson.fromJson(text, BDResult.class);
float dis = webResult.getResult().get(0).getDistance().getValue() / 1000F; float dis = webResult.getResult().get(0).getDistance().getValue();
int time = webResult.getResult().get(0).getDuration().getValue(); int time = webResult.getResult().get(0).getDuration().getValue();
Distance d = new Distance(); Distance d = new Distance();
......
...@@ -26,7 +26,7 @@ public class ScheduleEngineerOverviewResp { ...@@ -26,7 +26,7 @@ public class ScheduleEngineerOverviewResp {
/** /**
* 在途公里数 * 在途公里数
*/ */
private Integer distance; private String distance;
/** /**
* 上门时间 * 上门时间
*/ */
......
...@@ -128,10 +128,10 @@ public class ScheduleServiceImpl implements ScheduleService { ...@@ -128,10 +128,10 @@ public class ScheduleServiceImpl implements ScheduleService {
List<ScheduleOverviewResp.Item> children = new ArrayList<>(); List<ScheduleOverviewResp.Item> children = new ArrayList<>();
Integer teamDistance = 0; Integer teamDistance = 0;
Integer minOrderSum=0; Integer minOrderSum = 0;
Integer maxOrderSum=0; Integer maxOrderSum = 0;
Integer minDistance=0; Integer minDistance = 0;
Integer maxDistance=0; Integer maxDistance = 0;
for (Map.Entry<String, List<EngineerInfoEntity>> entry : engineers.entrySet()) { for (Map.Entry<String, List<EngineerInfoEntity>> entry : engineers.entrySet()) {
ScheduleOverviewResp.Item child = new ScheduleOverviewResp.Item(); ScheduleOverviewResp.Item child = new ScheduleOverviewResp.Item();
...@@ -153,27 +153,27 @@ public class ScheduleServiceImpl implements ScheduleService { ...@@ -153,27 +153,27 @@ public class ScheduleServiceImpl implements ScheduleService {
children.add(child); children.add(child);
if(null==minOrderSum||null==maxOrderSum){ if (null == minOrderSum || null == maxOrderSum) {
minOrderSum=child.getOrder().getTotal(); minOrderSum = child.getOrder().getTotal();
maxOrderSum=child.getOrder().getTotal(); maxOrderSum = child.getOrder().getTotal();
}else { } else {
if(child.getOrder().getTotal()<minOrderSum){ if (child.getOrder().getTotal() < minOrderSum) {
minOrderSum=child.getOrder().getTotal(); minOrderSum = child.getOrder().getTotal();
} }
if(child.getOrder().getTotal()>maxOrderSum){ if (child.getOrder().getTotal() > maxOrderSum) {
maxOrderSum=child.getOrder().getTotal(); maxOrderSum = child.getOrder().getTotal();
} }
} }
if(null==minDistance||null==maxDistance){ if (null == minDistance || null == maxDistance) {
minDistance=distanceSum; minDistance = distanceSum;
maxDistance=distanceSum; maxDistance = distanceSum;
}else { } else {
if(distanceSum<minDistance){ if (distanceSum < minDistance) {
minDistance=distanceSum; minDistance = distanceSum;
} }
if(distanceSum>maxDistance){ if (distanceSum > maxDistance) {
maxDistance=distanceSum; maxDistance = distanceSum;
} }
} }
} }
...@@ -267,7 +267,7 @@ public class ScheduleServiceImpl implements ScheduleService { ...@@ -267,7 +267,7 @@ public class ScheduleServiceImpl implements ScheduleService {
.divide(new BigDecimal(60), 2, RoundingMode.HALF_UP) .divide(new BigDecimal(60), 2, RoundingMode.HALF_UP)
.stripTrailingZeros() .stripTrailingZeros()
+ "时"); + "时");
dynamics.setRoadTotalDistance(sumDistance + "公里"); dynamics.setRoadTotalDistance(sumDistance / 1000.0 + "公里");
if (Objects.nonNull(engineerBusinessEntity)) { if (Objects.nonNull(engineerBusinessEntity)) {
dynamics.setWorkTime(engineerBusinessEntity.getWorkOn() + "-" + engineerBusinessEntity.getWorkOff()); dynamics.setWorkTime(engineerBusinessEntity.getWorkOn() + "-" + engineerBusinessEntity.getWorkOff());
} else { } else {
...@@ -289,7 +289,7 @@ public class ScheduleServiceImpl implements ScheduleService { ...@@ -289,7 +289,7 @@ public class ScheduleServiceImpl implements ScheduleService {
item.setSkill(o.getSkill()); item.setSkill(o.getSkill());
item.setOrderStatus(o.getAppointmentStatus()); item.setOrderStatus(o.getAppointmentStatus());
item.setOrderStatusName(""); item.setOrderStatusName("");
item.setDistance(o.getArriveDistance()); item.setDistance(Objects.nonNull(o.getArriveDistance()) ? o.getArriveDistance() / 1000.0 + "" : null);
item.setTimeType("auto"); item.setTimeType("auto");
if (Objects.nonNull(o.getArriveElapsed())) { if (Objects.nonNull(o.getArriveElapsed())) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!