Commit d2498107 by Ren Ping

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

1 parent c3ed56ad
......@@ -163,7 +163,7 @@ public class RoadDistanceUtils {
String text = requestGetAK(url, params);
// System.out.println(url + " : " + gson.toJson(params) + " : " + text);
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();
Distance d = new Distance();
......
......@@ -26,7 +26,7 @@ public class ScheduleEngineerOverviewResp {
/**
* 在途公里数
*/
private Integer distance;
private String distance;
/**
* 上门时间
*/
......
......@@ -128,10 +128,10 @@ public class ScheduleServiceImpl implements ScheduleService {
List<ScheduleOverviewResp.Item> children = new ArrayList<>();
Integer teamDistance = 0;
Integer minOrderSum=0;
Integer maxOrderSum=0;
Integer minDistance=0;
Integer maxDistance=0;
Integer minOrderSum = 0;
Integer maxOrderSum = 0;
Integer minDistance = 0;
Integer maxDistance = 0;
for (Map.Entry<String, List<EngineerInfoEntity>> entry : engineers.entrySet()) {
ScheduleOverviewResp.Item child = new ScheduleOverviewResp.Item();
......@@ -153,27 +153,27 @@ public class ScheduleServiceImpl implements ScheduleService {
children.add(child);
if(null==minOrderSum||null==maxOrderSum){
minOrderSum=child.getOrder().getTotal();
maxOrderSum=child.getOrder().getTotal();
}else {
if(child.getOrder().getTotal()<minOrderSum){
minOrderSum=child.getOrder().getTotal();
if (null == minOrderSum || null == maxOrderSum) {
minOrderSum = child.getOrder().getTotal();
maxOrderSum = child.getOrder().getTotal();
} else {
if (child.getOrder().getTotal() < minOrderSum) {
minOrderSum = child.getOrder().getTotal();
}
if(child.getOrder().getTotal()>maxOrderSum){
maxOrderSum=child.getOrder().getTotal();
if (child.getOrder().getTotal() > maxOrderSum) {
maxOrderSum = child.getOrder().getTotal();
}
}
if(null==minDistance||null==maxDistance){
minDistance=distanceSum;
maxDistance=distanceSum;
}else {
if(distanceSum<minDistance){
minDistance=distanceSum;
if (null == minDistance || null == maxDistance) {
minDistance = distanceSum;
maxDistance = distanceSum;
} else {
if (distanceSum < minDistance) {
minDistance = distanceSum;
}
if(distanceSum>maxDistance){
maxDistance=distanceSum;
if (distanceSum > maxDistance) {
maxDistance = distanceSum;
}
}
}
......@@ -267,7 +267,7 @@ public class ScheduleServiceImpl implements ScheduleService {
.divide(new BigDecimal(60), 2, RoundingMode.HALF_UP)
.stripTrailingZeros()
+ "时");
dynamics.setRoadTotalDistance(sumDistance + "公里");
dynamics.setRoadTotalDistance(sumDistance / 1000.0 + "公里");
if (Objects.nonNull(engineerBusinessEntity)) {
dynamics.setWorkTime(engineerBusinessEntity.getWorkOn() + "-" + engineerBusinessEntity.getWorkOff());
} else {
......@@ -289,7 +289,7 @@ public class ScheduleServiceImpl implements ScheduleService {
item.setSkill(o.getSkill());
item.setOrderStatus(o.getAppointmentStatus());
item.setOrderStatusName("");
item.setDistance(o.getArriveDistance());
item.setDistance(Objects.nonNull(o.getArriveDistance()) ? o.getArriveDistance() / 1000.0 + "" : null);
item.setTimeType("auto");
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!