Commit 4942f11f by 吕明尚

修改门店距离显示

parent eda4d4f8
...@@ -27,6 +27,7 @@ import share.system.mapper.SStoreMapper; ...@@ -27,6 +27,7 @@ import share.system.mapper.SStoreMapper;
import share.system.request.SStoreRequest; import share.system.request.SStoreRequest;
import share.system.service.*; import share.system.service.*;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -323,7 +324,8 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme ...@@ -323,7 +324,8 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
double distance = geo.calcDistance(nowPoint, geo.makePoint(Double.parseDouble(o.getLongitude()), Double.parseDouble(o.getLatitude()))) * DistanceUtils.DEG_TO_KM; double distance = geo.calcDistance(nowPoint, geo.makePoint(Double.parseDouble(o.getLongitude()), Double.parseDouble(o.getLatitude()))) * DistanceUtils.DEG_TO_KM;
SStoreVo vo = new SStoreVo(); SStoreVo vo = new SStoreVo();
BeanUtils.copyProperties(o, vo); BeanUtils.copyProperties(o, vo);
vo.setDistance(distance); //截取2位小数
vo.setDistance(new BigDecimal(distance).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
// 计算当天预定最后预定时间 // 计算当天预定最后预定时间
SOrder order = orderMap.get(vo.getId()); SOrder order = orderMap.get(vo.getId());
if (order != null) { if (order != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment