|
|
@ -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) { |
|
|
|
|
|
|
|