1. 提供车辆轨迹进度条接口
This commit is contained in:
parent
f354d03219
commit
9e40431027
|
@ -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);
|
||||
|
|
|
@ -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<EtLocationLog> trajectoryDetails = asDeviceService.trajectoryDetails(sn,startTime,endTime);
|
||||
ajax.put(AjaxResult.DATA_TAG,trajectoryDetails);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单号查询车辆轨迹
|
||||
*/
|
||||
|
|
|
@ -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<AsDevice>
|
|||
*/
|
||||
String trajectory(String sn,String startTime,String endTime);
|
||||
|
||||
/**
|
||||
* 根据时间查询车辆轨迹
|
||||
*/
|
||||
List<EtLocationLog> trajectoryDetails(String sn, String startTime, String endTime);
|
||||
|
||||
/**
|
||||
* 根据订单号查询车辆轨迹
|
||||
*/
|
||||
|
|
|
@ -2672,6 +2672,17 @@ public class AsDeviceServiceImpl extends ServiceImpl<AsDeviceMapper, AsDevice> i
|
|||
return trajectoryStr.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据时间查询车辆轨迹
|
||||
*/
|
||||
@Override
|
||||
public List<EtLocationLog> trajectoryDetails(String sn, String startTime,String endTime) {
|
||||
AsDevice device = asDeviceMapper.selectAsDeviceBySn(sn);
|
||||
List<EtLocationLog> etLocationLogs = etLocationLogMapper.selectEtLocationLogListByCreateTime(device.getMac(), startTime, endTime);
|
||||
return etLocationLogs;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据时间查询车辆轨迹
|
||||
*/
|
||||
|
|
|
@ -52,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="typeList != null">
|
||||
AND c.type IN
|
||||
<foreach item="item" index="index" collection="typeList" open="(" separator="," close=")">
|
||||
#{type}
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
|
|
|
@ -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
|
||||
</sql>
|
||||
|
||||
<sql id="selectEtLocationLogVoNoMsg">
|
||||
select location_id, mac, longitude, latitude, create_time, at, status, lock_status from et_location_log
|
||||
</sql>
|
||||
|
||||
<select id="selectEtLocationLogList" parameterType="EtLocationLog" resultMap="EtLocationLogResult">
|
||||
<include refid="selectEtLocationLogVo"/>
|
||||
<where>
|
||||
|
@ -33,8 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectEtLocationLogListByCreateTime" parameterType="EtLocationLog" resultMap="EtLocationLogResult">
|
||||
<include refid="selectEtLocationLogVo"/>
|
||||
<where>
|
||||
<include refid="selectEtLocationLogVoNoMsg"/>
|
||||
where longitude != '0E-8' and latitude != '0E-8'
|
||||
<if test="mac != null and mac != ''"> and mac = #{mac}</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND date_format(`AT`,'%Y%m%d%H%i%s') >= date_format(#{startTime},'%Y%m%d%H%i%s')
|
||||
|
@ -42,7 +46,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="endTime != null and endTime != ''">
|
||||
AND date_format(`AT`,'%Y%m%d%H%i%s') <= date_format(#{endTime},'%Y%m%d%H%i%s')
|
||||
</if>
|
||||
</where>
|
||||
order by `AT`
|
||||
</select>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user