2024-05-23 17:24:41 +08:00
|
|
|
package com.ruoyi.system.service;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
2024-07-13 14:12:47 +08:00
|
|
|
import com.ruoyi.common.utils.onenet.DataPointRes;
|
2024-06-04 10:36:58 +08:00
|
|
|
import com.ruoyi.common.utils.onenet.ResponseVo;
|
2024-05-23 17:24:41 +08:00
|
|
|
import com.ruoyi.system.domain.AsDevice;
|
2024-09-06 10:37:19 +08:00
|
|
|
import com.ruoyi.system.domain.EtLocationLog;
|
2024-05-28 16:55:38 +08:00
|
|
|
import com.ruoyi.system.domain.EtOperatingArea;
|
2024-05-23 17:24:41 +08:00
|
|
|
import com.ruoyi.system.domain.response.OrderResponse;
|
2024-09-27 15:23:10 +08:00
|
|
|
import com.ruoyi.system.domain.vo.AsDeviceVO;
|
2024-05-23 17:24:41 +08:00
|
|
|
import com.ruoyi.system.domain.vo.DeviceNumVo;
|
|
|
|
import com.ruoyi.system.domain.vo.EtOrderVo;
|
2024-06-25 09:25:38 +08:00
|
|
|
import com.ruoyi.system.domain.vo.IsInParkingAreaVo;
|
2024-05-23 17:24:41 +08:00
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 设备Service接口
|
|
|
|
*
|
|
|
|
* @author 邱贞招
|
|
|
|
* @date 2024-04-05
|
|
|
|
*/
|
|
|
|
public interface IAsDeviceService extends IService<AsDevice>
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* 查询设备
|
|
|
|
*
|
|
|
|
* @param deviceId 设备主键
|
|
|
|
* @return 设备
|
|
|
|
*/
|
|
|
|
public AsDevice selectAsDeviceByDeviceId(Long deviceId);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询设备
|
|
|
|
*
|
|
|
|
* @param mac 设备主键
|
|
|
|
* @return 设备
|
|
|
|
*/
|
2024-09-27 15:23:10 +08:00
|
|
|
public AsDeviceVO selectAsDeviceByMac(String mac);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据SN查询设备信息
|
|
|
|
*
|
|
|
|
* @param sn 设备主键
|
|
|
|
* @return 设备
|
|
|
|
*/
|
|
|
|
public AsDevice selectAsDeviceBySn(String sn);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询设备列表
|
|
|
|
*
|
|
|
|
* @param asDevice 设备
|
|
|
|
* @return 设备集合
|
|
|
|
*/
|
|
|
|
public List<AsDevice> selectAsDeviceList(AsDevice asDevice);
|
|
|
|
|
2024-06-01 15:41:42 +08:00
|
|
|
/**
|
|
|
|
* 查询设备列表
|
|
|
|
*
|
|
|
|
* @param asDevice 设备
|
|
|
|
* @return 设备集合
|
|
|
|
*/
|
|
|
|
public List<AsDevice> selectAsDeviceListWithIsolate(AsDevice asDevice);
|
|
|
|
|
2024-05-23 17:24:41 +08:00
|
|
|
/**
|
|
|
|
* 新增设备
|
|
|
|
*
|
|
|
|
* @param asDevice 设备
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
public int insertAsDevice(AsDevice asDevice);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 修改设备
|
|
|
|
*
|
|
|
|
* @param asDevice 设备
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
public int updateAsDevice(AsDevice asDevice);
|
|
|
|
|
2024-07-08 14:18:58 +08:00
|
|
|
/**
|
|
|
|
* 修改设备
|
|
|
|
*
|
|
|
|
* @param asDevice 设备
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
public int updateAsDevice2(AsDevice asDevice);
|
|
|
|
|
2024-05-23 17:24:41 +08:00
|
|
|
/**
|
|
|
|
* 根据SN修改设备
|
|
|
|
*
|
|
|
|
* @param asDevice 设备
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
public int updateAsDeviceBySn(AsDevice asDevice);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 批量删除设备
|
|
|
|
*
|
|
|
|
* @param deviceIds 需要删除的设备主键集合
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
public int deleteAsDeviceByDeviceIds(Long[] deviceIds);
|
|
|
|
|
2024-06-26 14:57:34 +08:00
|
|
|
/**
|
|
|
|
* 一键上线
|
|
|
|
*
|
|
|
|
* @param deviceIds 需要一键上线的设备主键集合
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
public int oneClickOnline(Long[] deviceIds);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 一键下线
|
|
|
|
*
|
|
|
|
* @param deviceIds 需要一键下线的设备主键集合
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
public int oneClickOffline(Long[] deviceIds);
|
|
|
|
|
2024-07-17 09:34:09 +08:00
|
|
|
/**
|
|
|
|
* 一键出仓
|
|
|
|
*
|
|
|
|
* @param deviceIds 需要一键出仓的设备主键集合
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
int oneClickListing(Long[] deviceIds);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 一键入仓
|
|
|
|
*
|
|
|
|
* @param deviceIds 需要一键入仓的设备主键集合
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
int oneClickWarehousing(Long[] deviceIds);
|
|
|
|
|
2024-07-23 21:43:37 +08:00
|
|
|
/**
|
|
|
|
* 更新设备
|
|
|
|
*
|
|
|
|
* @param deviceIds 需要更新设备的设备主键集合
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
int refreshDevice(Long[] deviceIds);
|
|
|
|
|
2024-08-26 16:26:06 +08:00
|
|
|
/**
|
|
|
|
* 更新设备
|
|
|
|
*
|
2024-08-26 17:36:53 +08:00
|
|
|
* @param sn 需要更新设备的设备主键集合
|
2024-08-26 16:26:06 +08:00
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
int refreshDeviceBySn(String sn);
|
|
|
|
|
2024-05-23 17:24:41 +08:00
|
|
|
/**
|
|
|
|
* 删除设备信息
|
|
|
|
*
|
|
|
|
* @param deviceId 设备主键
|
|
|
|
* @return 结果
|
|
|
|
*/
|
|
|
|
public int deleteAsDeviceByDeviceId(Long deviceId);
|
|
|
|
|
|
|
|
/**
|
2024-08-08 23:06:11 +08:00
|
|
|
* 根据经纬度查询附近500米的所有车辆
|
2024-05-23 17:24:41 +08:00
|
|
|
*
|
|
|
|
* @param longitude 经度
|
|
|
|
* @param latitude 纬度
|
|
|
|
* @return 结果
|
|
|
|
*/
|
2024-08-09 22:18:23 +08:00
|
|
|
List<AsDevice> vehicleLocalization(String longitude, String latitude,String deptId);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 所有车辆定位
|
|
|
|
*/
|
2025-01-03 13:52:04 +08:00
|
|
|
List<AsDevice> allVehicleInfo(String powerStart, String powerEnd, String status,String sort,String areaId,String onlineStatus,String typeSort);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询车辆数量
|
|
|
|
*/
|
2024-06-25 09:25:38 +08:00
|
|
|
DeviceNumVo allVehicleNum(String powerStart, String powerEnd,String areaId);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 扫码/编号开锁骑行
|
|
|
|
*/
|
|
|
|
OrderResponse snSwitch(EtOrderVo orderVo);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 发送命令
|
|
|
|
*/
|
2024-07-17 09:34:09 +08:00
|
|
|
public void sendCommand(String mac, String token,String command,String type,String orderNo,String userName);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
2024-06-04 10:36:58 +08:00
|
|
|
/**
|
2024-08-03 14:16:07 +08:00
|
|
|
* 发送命令
|
|
|
|
*/
|
|
|
|
public void sendCommand(String mac, String token,String command,String type,String orderNo,String userName,String msg);
|
|
|
|
|
|
|
|
/**
|
2024-06-04 10:36:58 +08:00
|
|
|
* 发送命令(带响应)
|
|
|
|
*/
|
2024-07-15 10:02:56 +08:00
|
|
|
public ResponseVo sendCommandWithResp(String mac, String token, String command, String type,String orderNo);
|
2024-06-04 10:36:58 +08:00
|
|
|
|
2024-09-09 15:49:35 +08:00
|
|
|
/**
|
|
|
|
* 发送命令(带响应)
|
|
|
|
*/
|
|
|
|
public ResponseVo sendCommandWithResp(String mac, String token, String command, String type,String orderNo,String lon,String lat);
|
|
|
|
|
2024-07-13 14:12:47 +08:00
|
|
|
/**
|
|
|
|
* 查询数据点
|
|
|
|
*/
|
|
|
|
public DataPointRes historyDatapoints(String mac, String token);
|
|
|
|
|
2024-05-23 17:24:41 +08:00
|
|
|
/**
|
|
|
|
* 响铃寻车
|
|
|
|
*/
|
2024-06-19 21:54:45 +08:00
|
|
|
Boolean ring(String sn);
|
|
|
|
|
2024-07-19 20:00:16 +08:00
|
|
|
/**
|
|
|
|
* 开坐垫锁
|
|
|
|
*/
|
|
|
|
Boolean seatCushionLock(String sn);
|
|
|
|
|
2024-07-09 14:18:54 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 重启设备
|
|
|
|
*/
|
|
|
|
Boolean rebootByMac(String mac);
|
|
|
|
/**
|
|
|
|
* 重启设备
|
|
|
|
*/
|
|
|
|
Boolean reboot(String sn);
|
|
|
|
|
2024-06-19 21:54:45 +08:00
|
|
|
/**
|
|
|
|
* 响铃寻车
|
|
|
|
*/
|
|
|
|
Boolean ringByMac(String mac);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
2024-11-05 13:54:18 +08:00
|
|
|
/**
|
|
|
|
* 电压校准
|
|
|
|
*/
|
|
|
|
Boolean check(String sn);
|
|
|
|
|
2024-07-19 20:00:16 +08:00
|
|
|
/**
|
|
|
|
* 坐垫锁用mac
|
|
|
|
*/
|
|
|
|
Boolean seatCushionLockByMac(String mac);
|
|
|
|
|
2024-05-23 17:24:41 +08:00
|
|
|
/**
|
|
|
|
* 临时锁车
|
|
|
|
*/
|
2024-06-25 09:25:38 +08:00
|
|
|
Boolean lock(String mac,String orderNo,String isBluetooth,String lon,String lat);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
2024-06-03 21:13:59 +08:00
|
|
|
/**
|
|
|
|
* 管理员锁车
|
|
|
|
*/
|
2024-07-17 09:34:09 +08:00
|
|
|
Boolean adminLock(String sn,String userName);
|
2024-06-19 21:54:45 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 管理员锁车
|
|
|
|
*/
|
2024-07-17 09:34:09 +08:00
|
|
|
Boolean adminLockByMac(String mac,String userName);
|
2024-06-03 21:13:59 +08:00
|
|
|
|
2024-05-23 17:24:41 +08:00
|
|
|
/**
|
|
|
|
* 临时解锁
|
|
|
|
*/
|
2024-06-25 09:25:38 +08:00
|
|
|
Boolean unlock(String sn, String orderNo,String isBluetooth,String lon,String lat);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 车辆预约
|
|
|
|
*/
|
|
|
|
OrderResponse deviceAppointment(EtOrderVo appointmentVo);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 取消预约
|
|
|
|
*/
|
|
|
|
OrderResponse cancelAppointment(EtOrderVo appointmentVo, AsDevice asDevice);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 还车
|
|
|
|
*/
|
2024-07-03 21:18:16 +08:00
|
|
|
Boolean returnVehicle(String orderNo,String returnType,String isBluetooth,String lon,String lat,String voltage,String isInParkingArea);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 管理员开锁
|
|
|
|
*/
|
2024-07-17 09:34:09 +08:00
|
|
|
Boolean unlocking(String sn,String userName);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
2024-06-19 21:54:45 +08:00
|
|
|
/**
|
|
|
|
* 管理员开锁
|
|
|
|
*/
|
2024-07-17 09:34:09 +08:00
|
|
|
Boolean unlockingByMac(String mac,String userName);
|
2024-06-19 21:54:45 +08:00
|
|
|
|
2024-05-23 17:24:41 +08:00
|
|
|
/**
|
|
|
|
* 车辆上线
|
|
|
|
*/
|
|
|
|
Boolean online(String sn);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 车辆下线
|
|
|
|
*/
|
2024-07-09 14:18:54 +08:00
|
|
|
Boolean offline(String sn,String status);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据条件模糊查询车辆信息
|
|
|
|
* type:1-sn,2-mac,3-车牌号
|
|
|
|
*/
|
2024-06-25 09:25:38 +08:00
|
|
|
List<AsDevice> deviceSearch(String key,String type,String areaId);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 运营中车辆
|
|
|
|
*/
|
2024-06-25 09:25:38 +08:00
|
|
|
String getInOperationDevice(String timeStart, String timeEnd,String areaId);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 有订单车辆
|
|
|
|
*/
|
2024-06-25 09:25:38 +08:00
|
|
|
String getInOrderDevice(String timeStart, String timeEnd,String areaId);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 无订单车辆
|
|
|
|
*/
|
2024-06-25 09:25:38 +08:00
|
|
|
String getNoOrderDevice(String timeStart, String timeEnd,String areaId);
|
2024-05-23 17:24:41 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据车辆型号查询车辆数量
|
|
|
|
*/
|
|
|
|
Integer selectCountByModelId(Long modelId);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据运营区查询车辆数量
|
|
|
|
*/
|
|
|
|
Integer selectCountByAreaId(Long areaId);
|
2024-05-28 16:55:38 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 判断是否在运营区
|
|
|
|
*/
|
|
|
|
public Boolean isAreaZone(String sn, EtOperatingArea area);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 判断是否在禁行区内
|
|
|
|
*/
|
|
|
|
public boolean isNoRidingArea(String sn,Long areaId);
|
2024-05-28 17:33:11 +08:00
|
|
|
|
2024-07-03 21:18:16 +08:00
|
|
|
/**
|
|
|
|
* 判断是否在禁行区内
|
|
|
|
*/
|
|
|
|
public boolean isNoRidingAreaWithTolerance(String sn,Long areaId,int tolerance);
|
|
|
|
|
2024-05-28 17:33:11 +08:00
|
|
|
/**
|
|
|
|
* 低电量不得骑行判断
|
|
|
|
*/
|
|
|
|
boolean isLowBattery(String sn);
|
2024-05-28 21:35:40 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 判断是否在运营时间内
|
|
|
|
*/
|
|
|
|
Boolean isOperatingTime(String sn);
|
2024-05-29 15:12:52 +08:00
|
|
|
|
2024-05-30 10:34:10 +08:00
|
|
|
/**
|
|
|
|
* 根据运营区id获取所有车辆
|
|
|
|
*/
|
|
|
|
List<AsDevice> allVehicleByArea(Long areaId);
|
|
|
|
|
2024-05-31 09:38:47 +08:00
|
|
|
|
|
|
|
int updateLocation(AsDevice device);
|
|
|
|
|
2024-06-04 10:36:58 +08:00
|
|
|
/**
|
|
|
|
* 判断是否在线
|
|
|
|
*/
|
|
|
|
boolean isOnline(String sn);
|
|
|
|
|
2024-06-13 15:03:23 +08:00
|
|
|
/**
|
|
|
|
* 判断是否重复
|
|
|
|
*/
|
|
|
|
boolean checkSNUnique(AsDevice asDevice);
|
|
|
|
|
2024-06-13 16:29:23 +08:00
|
|
|
/**
|
|
|
|
* 判断是否重复
|
|
|
|
*/
|
|
|
|
boolean checkMACUnique(AsDevice asDevice);
|
|
|
|
|
2024-06-17 10:12:59 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* sn和mac号绑定
|
|
|
|
*/
|
|
|
|
int bandSn(AsDevice asDevice);
|
|
|
|
|
2024-09-09 15:49:35 +08:00
|
|
|
/**
|
|
|
|
* 根据mac修改sn
|
|
|
|
*/
|
|
|
|
int updateSn(AsDevice asDevice);
|
|
|
|
|
2024-06-25 09:25:38 +08:00
|
|
|
/**
|
|
|
|
* 根据mac号判断是否有绑定过
|
|
|
|
*/
|
|
|
|
boolean isBandByMac(String mac);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 判断是否在停车区内
|
|
|
|
*/
|
2024-07-03 21:18:16 +08:00
|
|
|
IsInParkingAreaVo isInParkingArea(String longitude, String latitude,String areaId,String sn);
|
2024-06-25 09:25:38 +08:00
|
|
|
|
2024-07-13 14:12:47 +08:00
|
|
|
/**
|
|
|
|
* 查询版本并更新
|
|
|
|
*/
|
|
|
|
boolean updateVersion(String sn);
|
|
|
|
|
2024-08-26 16:26:06 +08:00
|
|
|
/**
|
|
|
|
* 更新最新的位置信息
|
|
|
|
*/
|
|
|
|
boolean updateLatestLocation(String sn);
|
|
|
|
|
2024-08-31 16:08:15 +08:00
|
|
|
/**
|
|
|
|
* 获取最新的位置信息
|
|
|
|
*/
|
|
|
|
double[] getLatestLocation(String mac);
|
|
|
|
|
2024-08-21 17:22:14 +08:00
|
|
|
/**
|
|
|
|
* 根据时间查询车辆轨迹
|
|
|
|
*/
|
|
|
|
String trajectory(String sn,String startTime,String endTime);
|
|
|
|
|
2024-09-06 10:37:19 +08:00
|
|
|
/**
|
|
|
|
* 根据时间查询车辆轨迹
|
|
|
|
*/
|
|
|
|
List<EtLocationLog> trajectoryDetails(String sn, String startTime, String endTime);
|
|
|
|
|
2024-08-26 16:26:06 +08:00
|
|
|
/**
|
|
|
|
* 根据订单号查询车辆轨迹
|
|
|
|
*/
|
|
|
|
String trajectoryByOrderNo(String orderNo);
|
|
|
|
|
2024-05-29 15:12:52 +08:00
|
|
|
// /**
|
|
|
|
// * 是否靠近运营区边界
|
|
|
|
// */
|
|
|
|
// boolean isCloseToTheBoundary(String sn, EtOperatingArea area);
|
2024-05-23 17:24:41 +08:00
|
|
|
}
|