From 9e404310279a6d2868d047aca82fc9227565515e Mon Sep 17 00:00:00 2001 From: 18650502300 <18650502300@163.com> Date: Fri, 6 Sep 2024 10:37:19 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E6=8F=90=E4=BE=9B=E8=BD=A6=E8=BE=86?= =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E8=BF=9B=E5=BA=A6=E6=9D=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/app/AppVerifyController.java | 2 +- .../controller/system/AsDeviceController.java | 20 +++++++++++++++++-- .../system/service/IAsDeviceService.java | 6 ++++++ .../service/impl/AsDeviceServiceImpl.java | 11 ++++++++++ .../mapper/system/EtCouponClaimLogMapper.xml | 2 +- .../mapper/system/EtLocationLogMapper.xml | 9 ++++++--- 6 files changed, 43 insertions(+), 7 deletions(-) diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java index 3db1dc2..13802e1 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java @@ -1355,7 +1355,7 @@ public class AppVerifyController extends BaseController @GetMapping("/couponBuyRecord") public AjaxResult couponBuyRecord(Long userId, String[] typeList) { - logger.info("【优惠券购买记录】:【userId="+userId+"】"); + logger.info("【优惠券购买记录】:【userId="+userId+"】,【typeList="+ Arrays.toString(typeList)+"】"); EtCouponUserLog etCouponUserLog = new EtCouponUserLog(); etCouponUserLog.setUserId(userId); etCouponUserLog.setGainMethod(ServiceConstants.COUPON_GAIN_METHOD_BUY); diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/AsDeviceController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/AsDeviceController.java index e31be56..5e783ef 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/AsDeviceController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/AsDeviceController.java @@ -5,12 +5,11 @@ import com.ruoyi.common.annotation.Log; import com.ruoyi.common.constant.ServiceConstants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.AsUser; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.domain.AsDevice; +import com.ruoyi.system.domain.EtLocationLog; import com.ruoyi.system.service.IAsDeviceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; @@ -296,6 +295,23 @@ public class AsDeviceController extends BaseController return ajax; } + /** + * 根据时间查询车辆轨迹 /trajectory 给方法取个名,本来是查询轨迹的,现在增加一个带详情的轨迹,给新接口取个名 + */ + @PostMapping("/trajectoryDetails") + public AjaxResult trajectoryDetails(String sn,String startTime,String endTime) + { + AjaxResult ajax = AjaxResult.success(); + if(StrUtil.isBlank(sn)){ + logger.info("没有sn号参数:【sn={}】",sn); + return error("请传sn号参数"+"【sn="+sn+"】"); + } + logger.info("【根据时间查询车辆轨迹】:{}",sn,startTime,endTime); + List trajectoryDetails = asDeviceService.trajectoryDetails(sn,startTime,endTime); + ajax.put(AjaxResult.DATA_TAG,trajectoryDetails); + return ajax; + } + /** * 根据订单号查询车辆轨迹 */ diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/IAsDeviceService.java b/electripper-system/src/main/java/com/ruoyi/system/service/IAsDeviceService.java index 35e3c90..c4c8d76 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/IAsDeviceService.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/IAsDeviceService.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.common.utils.onenet.DataPointRes; import com.ruoyi.common.utils.onenet.ResponseVo; import com.ruoyi.system.domain.AsDevice; +import com.ruoyi.system.domain.EtLocationLog; import com.ruoyi.system.domain.EtOperatingArea; import com.ruoyi.system.domain.response.OrderResponse; import com.ruoyi.system.domain.vo.DeviceNumVo; @@ -400,6 +401,11 @@ public interface IAsDeviceService extends IService */ String trajectory(String sn,String startTime,String endTime); + /** + * 根据时间查询车辆轨迹 + */ + List trajectoryDetails(String sn, String startTime, String endTime); + /** * 根据订单号查询车辆轨迹 */ diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java index 1c997de..823e836 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java @@ -2672,6 +2672,17 @@ public class AsDeviceServiceImpl extends ServiceImpl i return trajectoryStr.toString(); } + /** + * 根据时间查询车辆轨迹 + */ + @Override + public List trajectoryDetails(String sn, String startTime,String endTime) { + AsDevice device = asDeviceMapper.selectAsDeviceBySn(sn); + List etLocationLogs = etLocationLogMapper.selectEtLocationLogListByCreateTime(device.getMac(), startTime, endTime); + return etLocationLogs; + } + + /** * 根据时间查询车辆轨迹 */ diff --git a/electripper-system/src/main/resources/mapper/system/EtCouponClaimLogMapper.xml b/electripper-system/src/main/resources/mapper/system/EtCouponClaimLogMapper.xml index 58f4592..51a553a 100644 --- a/electripper-system/src/main/resources/mapper/system/EtCouponClaimLogMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/EtCouponClaimLogMapper.xml @@ -52,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND c.type IN - #{type} + #{item} diff --git a/electripper-system/src/main/resources/mapper/system/EtLocationLogMapper.xml b/electripper-system/src/main/resources/mapper/system/EtLocationLogMapper.xml index 6450e06..6400477 100644 --- a/electripper-system/src/main/resources/mapper/system/EtLocationLogMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/EtLocationLogMapper.xml @@ -20,6 +20,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select location_id, mac, onenet_msg, longitude, latitude, create_time, at, status, lock_status from et_location_log + + select location_id, mac, longitude, latitude, create_time, at, status, lock_status from et_location_log + +