修改获取实时状态类型

This commit is contained in:
2025-08-30 13:53:41 +08:00
parent d8686e3cbd
commit dfb5d8ac65
10 changed files with 31 additions and 11 deletions

View File

@ -14,7 +14,7 @@ public class AppRealTimeStatusDto {
private String deviceImei;
/**
* 设备类型
* 获取实时状态类型FunctionAccessBatchStatusRule 批量 FunctionAccessStatusRule 单个
*/
private String typeName;

View File

@ -1,6 +1,5 @@
package com.fuyuanshen.web.controller.device;
import com.alibaba.fastjson2.JSONObject;
import com.fuyuanshen.app.domain.dto.APPReNameDTO;
import com.fuyuanshen.app.domain.dto.AppRealTimeStatusDto;
import com.fuyuanshen.app.domain.vo.APPDeviceTypeVo;
@ -142,7 +141,7 @@ public class DeviceControlCenterController extends BaseController {
}
/**
* 历史轨迹导出
* 历史轨迹播放
*/
@GetMapping("/getLocationHistoryDetail")
public R<List<LocationHistoryDetailVo>> getLocationHistoryDetail(Long id) {

View File

@ -1,6 +1,7 @@
package com.fuyuanshen.web.service.device;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@ -310,8 +311,8 @@ public class DeviceBizService {
public Map<String, Object> getRealTimeStatus(AppRealTimeStatusDto statusDto) {
try {
String commandType = statusDto.getTypeName()+"_" + statusDto.getFunctionMode();
DeviceStatusRule rule = realTimeStatusEngine.getDeviceStatusRule(commandType);
// String commandType = statusDto.getTypeName()+"_" + statusDto.getFunctionMode();"FunctionAccessBatchStatusRule"
DeviceStatusRule rule = realTimeStatusEngine.getDeviceStatusRule(statusDto.getTypeName());
if(rule == null){
throw new ServiceException("未匹配到处理命令");
}
@ -382,11 +383,14 @@ public class DeviceBizService {
detailVo.setDeviceName(device.getDeviceName());
detailVo.setStartLocation(entry.getValue().get(0).getString("address"));
detailVo.setEndLocation(entry.getValue().get(entry.getValue().size()-1).getString("address"));
detailVo.setDetailList(entry.getValue());
String jsonString = JSONArray.toJSONString(entry.getValue());
List<Object> strings = JSONArray.parseArray(jsonString);
detailVo.setDetailList(strings);
result.add(detailVo);
}
return result;
}
}

View File

@ -22,7 +22,7 @@ import static com.fuyuanshen.common.core.constant.GlobalConstants.FUNCTION_ACCES
public class FunctionAccessBatchStatusRule implements DeviceStatusRule {
@Override
public String getCommandType() {
return DeviceTypeConstants.TYPE_BJQ6170+"_2";
return "FunctionAccessBatchStatusRule";
}
@Override

View File

@ -21,7 +21,7 @@ import static com.fuyuanshen.common.core.constant.GlobalConstants.FUNCTION_ACCES
public class FunctionAccessStatusRule implements DeviceStatusRule {
@Override
public String getCommandType() {
return DeviceTypeConstants.TYPE_BJQ6170+"_1";
return "FunctionAccessStatusRule";
}
@Override