|
@@ -100,7 +100,7 @@ public class D00008Service extends D00008BaseModel implements ExecProcessFlow {
|
|
|
LogService.addLog(accident,"Fire.init配置生成——————————————————成功");
|
|
|
TemplateGenerator2.createFireEsccapeControl(aid,jid);
|
|
|
LogService.addLog(accident,"FireEscape.control配置生成——————————————————成功");
|
|
|
- exeFire(aid,jid);
|
|
|
+ exeFire2(aid,jid);
|
|
|
|
|
|
}
|
|
|
if(accident.getStype().equals("Water")){
|
|
@@ -373,7 +373,6 @@ public class D00008Service extends D00008BaseModel implements ExecProcessFlow {
|
|
|
//异步执行
|
|
|
@SneakyThrows
|
|
|
public void exeWater2(Integer aid,Integer jid){
|
|
|
-
|
|
|
try {
|
|
|
LogService.addLog(aid,jid,"Water","求解——————————————————开始");
|
|
|
DockerExe.stopDocker(aid,"Water");
|
|
@@ -466,7 +465,54 @@ public class D00008Service extends D00008BaseModel implements ExecProcessFlow {
|
|
|
});
|
|
|
|
|
|
}
|
|
|
+ //异步执行
|
|
|
+ @SneakyThrows
|
|
|
+ public void exeFire2(Integer aid,Integer jid) throws Exception {
|
|
|
+ try {
|
|
|
+ LogService.addLog(aid,jid,"Fire","求解——————————————————开始");
|
|
|
+ DockerExe.stopDocker(aid,"Fire");
|
|
|
+ DockerExe.fireExec(aid, jid, "Fire");
|
|
|
+ }catch (Exception e) {
|
|
|
+ LogService.addLog(aid,jid,"Fire","求解——————————————————失败");
|
|
|
+ JobError(jid);
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ CompletableFuture<Void> cf = CompletableFuture.supplyAsync(()-> {
|
|
|
+ try {
|
|
|
+ DockerExe.getDockerLogs(aid,"Fire",new ResultCallback.Adapter<Frame>() {
|
|
|
+ @Override
|
|
|
+ public void onNext(Frame frame) {
|
|
|
+ LogService.addLog(aid,jid,"Fire",new String(frame.getPayload()));
|
|
|
+ System.out.print(new String(frame.getPayload()));
|
|
|
+ super.onNext(frame);
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public void onError(Throwable throwable) {
|
|
|
+ System.err.println("日志获取失败");
|
|
|
+ throwable.printStackTrace();
|
|
|
+ super.onError(throwable);
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public void onComplete() {
|
|
|
+ System.out.println("日志获取完成");
|
|
|
+ super.onComplete();
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
+ //监测点数据保存
|
|
|
+ saveMonitorValue(aid,jid);
|
|
|
+ //路径保存
|
|
|
+ saveWayValue(aid,jid);
|
|
|
+ LogService.addLog(aid,jid,"Fire","求解——————————————————成功");
|
|
|
+ JobSucces(jid);
|
|
|
+ } catch (Exception e) {
|
|
|
+ LogService.addLog(aid,jid,"Fire","求解——————————————————失败");
|
|
|
+ JobError(jid);
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ });
|
|
|
+ }
|
|
|
//异步执行
|
|
|
@SneakyThrows
|
|
|
public void exeFire(Integer aid,Integer jid) throws Exception{
|