debug
This commit is contained in:
parent
06c3157d6b
commit
f26dd92ba9
|
@ -97,4 +97,8 @@ public interface OrderValidator {
|
||||||
*/
|
*/
|
||||||
boolean isTimeout(OrderVO order);
|
boolean isTimeout(OrderVO order);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是用户
|
||||||
|
*/
|
||||||
|
boolean isUser(Long orderId, Long userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,4 +236,10 @@ public class OrderValidatorImpl implements OrderValidator{
|
||||||
public boolean isTimeout(OrderVO order) {
|
public boolean isTimeout(OrderVO order) {
|
||||||
return order != null && order.getMaxTime() != null && order.getMaxTime().isBefore(LocalDateTime.now());
|
return order != null && order.getMaxTime() != null && order.getMaxTime().isBefore(LocalDateTime.now());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isUser(Long orderId, Long userId) {
|
||||||
|
OrderVO order = orderMapper.selectOrderById(orderId);
|
||||||
|
return isUser(order, userId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ public class RefundConverterImpl implements RefundConverter{
|
||||||
refund.setReason(dto.getRefundReason());
|
refund.setReason(dto.getRefundReason());
|
||||||
refund.setUserId(dto.getUserId());
|
refund.setUserId(dto.getUserId());
|
||||||
refund.setUserName(dto.getUserName());
|
refund.setUserName(dto.getUserName());
|
||||||
|
refund.setType(dto.getType());
|
||||||
return refund;
|
return refund;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ public class AppDeviceIotController extends BaseController {
|
||||||
ServiceUtil.assertion(device == null, "当前车辆不存在,无法响铃寻车");
|
ServiceUtil.assertion(device == null, "当前车辆不存在,无法响铃寻车");
|
||||||
|
|
||||||
if (device.getAreaRequiredRingRadius() != null && device.getAreaRequiredRingRadius()) {
|
if (device.getAreaRequiredRingRadius() != null && device.getAreaRequiredRingRadius()) {
|
||||||
|
ServiceUtil.assertion(lon == null || lat == null, "请开启定位后重试");
|
||||||
BigDecimal distance = GeoUtils.calculateDistance(device.getLatitude(), device.getLongitude(), lat, lon);
|
BigDecimal distance = GeoUtils.calculateDistance(device.getLatitude(), device.getLongitude(), lat, lon);
|
||||||
ServiceUtil.assertion(MathUtils.biggerThan(distance, device.getAreaRingRadius()),
|
ServiceUtil.assertion(MathUtils.biggerThan(distance, device.getAreaRingRadius()),
|
||||||
"您当前距离车辆%s米,无法响铃寻车。请距离车辆%s米以内再试", distance, device.getAreaRingRadius());
|
"您当前距离车辆%s米,无法响铃寻车。请距离车辆%s米以内再试", distance, device.getAreaRingRadius());
|
||||||
|
|
|
@ -1,12 +1,51 @@
|
||||||
package com.ruoyi.web.app;
|
package com.ruoyi.web.app;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.ruoyi.bst.locationLog.domain.LocationLogQuery;
|
||||||
|
import com.ruoyi.bst.locationLog.domain.LocationLogVO;
|
||||||
|
import com.ruoyi.bst.locationLog.service.LocationLogService;
|
||||||
|
import com.ruoyi.bst.order.service.OrderValidator;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/app/locationLog")
|
@RequestMapping("/app/locationLog")
|
||||||
public class AppLocationLogController extends BaseController {
|
public class AppLocationLogController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private LocationLogService locationLogService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrderValidator orderValidator;
|
||||||
|
|
||||||
|
private boolean canView(Long orderId) {
|
||||||
|
return orderValidator.isUser(orderId, getUserId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据订单ID查询定位日志")
|
||||||
|
@GetMapping("/allByOrder")
|
||||||
|
public AjaxResult getAllByOrder(Long orderId) {
|
||||||
|
if (orderId == null) {
|
||||||
|
return error("订单ID不允许为空");
|
||||||
|
}
|
||||||
|
if (!canView(orderId)) {
|
||||||
|
return error("您无权查看ID为" + orderId + "的订单轨迹");
|
||||||
|
}
|
||||||
|
|
||||||
|
LocationLogQuery query = new LocationLogQuery();
|
||||||
|
query.setOrderId(orderId);
|
||||||
|
List<LocationLogVO> list = locationLogService.selectLocationLogList(query);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user