Browse Source

设备管控-增加设备列表为空的时候,返回提示信息

修改设备控制记录存储到公众服务统计记录
develop
Mr.Wang 5 months ago
parent
commit
bb48b50886
  1. 2
      zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java
  2. 21
      zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

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

@ -269,7 +269,7 @@ public class OperationLogAspect {
dcPublishManage.setPublishChannels(7);
}
dcPublishManage.setContentDetails(String.valueOf(pointArgs));
dcPublishManage.setContentDetails(JSON.toJSONString(pointArgs));
dcPublishManageService.insertDcPublishManage(dcPublishManage);
}
}

21
zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

@ -767,6 +767,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
try {
// 根据不通设备类型,执行不通的功能操作
invokedFunction(
dcExecuteAction.getDeviceType(),
id,
dcEventAnDcEmergencyPlans.getOperationType(),
dcDevices,
@ -820,11 +821,29 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
/**
* 根据不通设备类型执行不通的功能操作
*/
public void invokedFunction(String eventId,
public void invokedFunction(int deviceType,
String eventId,
Integer operationType,
List<DcDevice> dcDevices,
JSONObject otherConfig,
JSONArray resultArray) {
// 获取设备类型名称
String deviceTypeName = Arrays.stream(DeviceTypeEnum.values())
.filter(deviceTypeEnum -> deviceTypeEnum.getCode() == deviceType)
.findFirst()
.map(DeviceTypeEnum::getInfo)
.orElse("类型异常");
if (dcDevices.size() == 0) {
JSONObject result = new JSONObject();
JSONObject errorResult = new JSONObject();
errorResult.put("code",500);
errorResult.put("msg","操作失败");
result.put("deviceName", deviceTypeName);
result.put("content", "未找到相关设备");
result.put("result", errorResult);
resultArray.add(result);
}
for (DcDevice device : dcDevices) {

Loading…
Cancel
Save