Browse Source

优化语音广播设备功能调用返回内容

优化设备管控记录返回内容
develop
zhaoxianglong 4 months ago
parent
commit
c2f3847122
  1. 4
      zc-business/src/main/java/com/zc/business/controller/BroadcastController.java
  2. 2
      zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java
  3. 12
      zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java

4
zc-business/src/main/java/com/zc/business/controller/BroadcastController.java

@ -78,10 +78,10 @@ public class BroadcastController extends BaseController {
OkHttp okHttp = new OkHttp(UniversalEnum.ONE.getNumber());
RequestParams requestParams = new RequestParams(params);
String tokenRoadTestBroadcastPlatform = redisCache.getCacheObject(broadcast.getString("TOKENKEY"));
try {
if (tokenRoadTestBroadcastPlatform == null) {
tokenRoadTestBroadcastPlatform = getToken();
}
try {
Response response // 请求响应
= okHttp
.headers(new HashMap<>())
@ -94,7 +94,7 @@ public class BroadcastController extends BaseController {
} catch (SocketTimeoutException e) {
if (numberOfReconnections < UniversalEnum.THREE.getNumber()) {
numberOfReconnections += UniversalEnum.ONE.getNumber();
getToken();
//getToken();
return nearCamListDistance(params);
} else {
jsonResult = new JSONObject();

2
zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java

@ -653,7 +653,7 @@ public class OperationLogAspect {
operLog.setOperTime(new Date());
operLog.setDcDeviceType(deviceType);
operLog.setRemark(remark.toString());
operLog.setJsonResult(jsonResult != null ? jsonResult.toJSONString() : AjaxResult.error().toString());
operLog.setJsonResult(jsonResult != null ? jsonResult.toJSONString() : JSON.toJSON(AjaxResult.error()).toString());
dcOperLogService.save(operLog);
}
}

12
zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java

@ -388,6 +388,7 @@ public class DcDeviceServiceImpl extends ServiceImpl<DcDeviceMapper, DcDevice> i
/**
* 根据网段查询设备
*
* @param networkSegment
* @return
*/
@ -455,7 +456,7 @@ public class DcDeviceServiceImpl extends ServiceImpl<DcDeviceMapper, DcDevice> i
device.setDirection(direction);
}
List<DcDevice> list = listDevice(device);
if (startStakeMarks != null && endStakeMarks != null) {
if (startStakeMarks != null && startStakeMarks.size() != UniversalEnum.ZERO.getNumber() && endStakeMarks != null && endStakeMarks.size() != UniversalEnum.ZERO.getNumber()) {
Integer startStakeMark = Integer.parseInt(startStakeMarks.get(UniversalEnum.ZERO.getNumber()) + startStakeMarks.get(UniversalEnum.ONE.getNumber()));
Integer endStakeMark = Integer.parseInt(endStakeMarks.get(UniversalEnum.ZERO.getNumber()) + endStakeMarks.get(UniversalEnum.ONE.getNumber()));
for (DcDevice dcDevice : list) {
@ -524,13 +525,12 @@ public class DcDeviceServiceImpl extends ServiceImpl<DcDeviceMapper, DcDevice> i
}
/**
* @Description 获取事发地上游10公里内的情报板
*
* @author liuwenge
* @date 2024/4/15 14:18
* @param stakeMark 桩号
* @param direction 方向
* @return com.ruoyi.common.core.domain.AjaxResult
* @Description 获取事发地上游10公里内的情报板
* @author liuwenge
* @date 2024/4/15 14:18
*/
@Override
public AjaxResult selectNearBoard(String stakeMark, String direction) {
@ -553,6 +553,7 @@ public class DcDeviceServiceImpl extends ServiceImpl<DcDeviceMapper, DcDevice> i
public List<HashMap<String, Object>> selectDeviceNameList(DcDevice dcDevice) {
return dcDeviceMapper.selectDeviceNameList(dcDevice);
}
//设备查询-设备参数属性列表
@Override
public List<HashMap<String, Object>> selectDeviceParameterProperties(DcDevice dcDevice) {
@ -574,6 +575,7 @@ public class DcDeviceServiceImpl extends ServiceImpl<DcDeviceMapper, DcDevice> i
.get(); // 请求方法
return JSON.parseObject(response.body().string(), AjaxResult.class);
}
public List<Map<String, Object>> selectDeviceOfRoad() {
return dcDeviceMapper.selectDeviceOfRoad();
}

Loading…
Cancel
Save