|
|
@ -13,7 +13,6 @@ import com.hnac.hzims.fdp.response.DiagnoseNextstepResp; |
|
|
|
import com.hnac.hzims.fdp.service.IFdpFaultService; |
|
|
|
import com.hnac.hzims.fdp.service.IFdpFaultService; |
|
|
|
import com.hnac.hzims.fdp.util.HttpRequestUtil; |
|
|
|
import com.hnac.hzims.fdp.util.HttpRequestUtil; |
|
|
|
import com.hnac.hzims.fdp.vo.FdpHttpResponseVo; |
|
|
|
import com.hnac.hzims.fdp.vo.FdpHttpResponseVo; |
|
|
|
import com.hnac.hzims.fdp.vo.FdpRealTimeAndHisDataVo; |
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
@ -50,13 +49,13 @@ public class ThreadTask { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//诊断
|
|
|
|
//诊断
|
|
|
|
public static void fdpTask(FdpTaskDTO taskDTO, FdpFaultEntity fdpFaultEntity, FdpRealTimeAndHisDataVo vo, String key) { |
|
|
|
public static void fdpTask(FdpTaskDTO taskDTO, FdpFaultEntity fdpFaultEntity, String key) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
Runnable runnable = new Runnable() { |
|
|
|
Runnable runnable = new Runnable() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
//异步任务
|
|
|
|
//异步任务
|
|
|
|
updateFaultState(taskDTO, fdpFaultEntity, vo, key); |
|
|
|
updateFaultState(taskDTO, fdpFaultEntity, key); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
Thread thread = new Thread(runnable); |
|
|
|
Thread thread = new Thread(runnable); |
|
|
@ -84,6 +83,24 @@ public class ThreadTask { |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//诊断
|
|
|
|
|
|
|
|
public static void fdpTaskNew(FdpTaskDTO taskDTO, FdpFaultEntity fdpFaultEntity, String key) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
Runnable runnable = new Runnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
|
|
|
|
//异步任务
|
|
|
|
|
|
|
|
updateFaultStateNew(taskDTO, fdpFaultEntity, key); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
Thread thread = new Thread(runnable); |
|
|
|
|
|
|
|
thread.start(); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
log.error(e.getMessage(), e.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// 声明对象
|
|
|
|
// 声明对象
|
|
|
|
public static ThreadTask threadTask; |
|
|
|
public static ThreadTask threadTask; |
|
|
|
|
|
|
|
|
|
|
@ -102,20 +119,18 @@ public class ThreadTask { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 修改诊断状态 |
|
|
|
* 修改诊断状态 |
|
|
|
* |
|
|
|
|
|
|
|
* @param vo |
|
|
|
|
|
|
|
* @param key |
|
|
|
* @param key |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private static void updateFaultState(FdpTaskDTO req, FdpFaultEntity fdpFaultEntity, FdpRealTimeAndHisDataVo vo, String key) { |
|
|
|
private static void updateFaultState(FdpTaskDTO req, FdpFaultEntity fdpFaultEntity, String key) { |
|
|
|
/**更新故障状态**/ |
|
|
|
/**更新故障状态**/ |
|
|
|
DiagnoseFaultAllReq faultAllReq = new DiagnoseFaultAllReq(); |
|
|
|
DiagnoseFaultAllReq faultAllReq = new DiagnoseFaultAllReq(); |
|
|
|
faultAllReq.setAutoData(vo); |
|
|
|
// faultAllReq.setAutoData(vo);
|
|
|
|
faultAllReq.setStationId(fdpFaultEntity.getStationId()); |
|
|
|
faultAllReq.setStationId(fdpFaultEntity.getStationId()); |
|
|
|
|
|
|
|
|
|
|
|
DiagnoseFaultReq diagnoseFaultReq = new DiagnoseFaultReq(); |
|
|
|
DiagnoseFaultReq diagnoseFaultReq = new DiagnoseFaultReq(); |
|
|
|
diagnoseFaultReq.setTaskId(req.getId().toString()); |
|
|
|
diagnoseFaultReq.setTaskId(req.getId().toString()); |
|
|
|
diagnoseFaultReq.setFaultId(req.getFaultId()); |
|
|
|
diagnoseFaultReq.setFaultId(req.getFaultId()); |
|
|
|
diagnoseFaultReq.setStatus(1.0); |
|
|
|
diagnoseFaultReq.setConfidence(1.0); |
|
|
|
diagnoseFaultReq.setLifeTime(1); |
|
|
|
diagnoseFaultReq.setLifeTime(1); |
|
|
|
diagnoseFaultReq.setPriority(2); |
|
|
|
diagnoseFaultReq.setPriority(2); |
|
|
|
diagnoseFaultReq.setTenantId(fdpFaultEntity.getStationId()); |
|
|
|
diagnoseFaultReq.setTenantId(fdpFaultEntity.getStationId()); |
|
|
@ -181,20 +196,18 @@ public class ThreadTask { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 修改诊断状态 |
|
|
|
* 修改诊断状态 |
|
|
|
* |
|
|
|
|
|
|
|
* @param vo |
|
|
|
|
|
|
|
* @param key |
|
|
|
* @param key |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private static void updateFaultStateNew(FdpTaskDTO req, FdpFaultEntity fdpFaultEntity, FdpRealTimeAndHisDataVo vo, String key) { |
|
|
|
private static void updateFaultStateNew(FdpTaskDTO req, FdpFaultEntity fdpFaultEntity, String key) { |
|
|
|
/**更新故障状态**/ |
|
|
|
/**更新故障状态**/ |
|
|
|
DiagnoseFaultAllReq faultAllReq = new DiagnoseFaultAllReq(); |
|
|
|
DiagnoseFaultAllReq faultAllReq = new DiagnoseFaultAllReq(); |
|
|
|
faultAllReq.setAutoData(vo); |
|
|
|
// faultAllReq.setAutoData(vo);
|
|
|
|
faultAllReq.setStationId(fdpFaultEntity.getStationId()); |
|
|
|
faultAllReq.setStationId(fdpFaultEntity.getStationId()); |
|
|
|
|
|
|
|
|
|
|
|
DiagnoseFaultReq diagnoseFaultReq = new DiagnoseFaultReq(); |
|
|
|
DiagnoseFaultReq diagnoseFaultReq = new DiagnoseFaultReq(); |
|
|
|
diagnoseFaultReq.setTaskId(req.getId().toString()); |
|
|
|
diagnoseFaultReq.setTaskId(req.getId().toString()); |
|
|
|
diagnoseFaultReq.setFaultId(req.getFaultId()); |
|
|
|
diagnoseFaultReq.setFaultId(req.getFaultId()); |
|
|
|
diagnoseFaultReq.setStatus(1.0); |
|
|
|
diagnoseFaultReq.setConfidence(1.0); |
|
|
|
diagnoseFaultReq.setLifeTime(1); |
|
|
|
diagnoseFaultReq.setLifeTime(1); |
|
|
|
diagnoseFaultReq.setPriority(2); |
|
|
|
diagnoseFaultReq.setPriority(2); |
|
|
|
diagnoseFaultReq.setTenantId(fdpFaultEntity.getStationId()); |
|
|
|
diagnoseFaultReq.setTenantId(fdpFaultEntity.getStationId()); |
|
|
|