刘韬 2 éve
szülő
commit
e377ca4305
1 módosított fájl, 78 hozzáadás és 0 törlés
  1. 78 0
      DataFusion/src/com/zskk/control/ViewController.java

+ 78 - 0
DataFusion/src/com/zskk/control/ViewController.java

@@ -64,6 +64,84 @@ public class ViewController extends Controller {
 		}
 	}
 	
+	public void test() {
+		// TODO Auto-generated method stub
+//		List<Record> count = Db.use("local").find("select * from study where status =4");
+//		//同时下载的队列
+//		Integer flag = count.size();
+//		if (flag >= 5) {
+//			return;
+//		}
+		//延迟10分钟获取影像,并且查找状态为待CMOVE和错误状态的检查
+		List<Record> studyidfinds = Db.use("local").find("select * from study where status =1 and createAt<? order by createAt asc limit 1",parseStringToDate());
+		if (studyidfinds == null) {
+			return;
+		}
+		for (Record studyidfind : studyidfinds) {
+//			flag++;
+//			if (flag <= 5) {
+				//状态4:下载中
+				studyidfind.set("status", 4);
+				studyidfind.set("updateAt", parseStringToDateTime());
+				Db.use("local").update("study", studyidfind);
+				
+//				ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
+//				tService.execute(() -> {
+					String execCmd = ExecUtil.execCmd("/zskk_system/other/cmove.sh " + studyidfind.getStr("studyuid"));
+					if (execCmd.contains("Connection refused")) {
+						//状态2:错误
+						studyidfind.set("status", 2);
+						studyidfind.set("updateAt", parseStringToDateTime());
+						Db.use("local").update("study", studyidfind);
+					}else {
+						//状态2:完成
+						studyidfind.set("status", 3);
+						studyidfind.set("updateAt", parseStringToDateTime());
+						Db.use("local").update("study", studyidfind);
+					}
+					
+//				});	
+//				}
+			
+			
+		}
+		
+		//延迟10分钟获取影像,并且查找状态为待CMOVE和错误状态的检查
+				List<Record> studyidfindsde = Db.use("local").find("select * from study where status =1 or status =2 and createAt<? order by createAt desc limit 1",parseStringToDate());
+				if (studyidfindsde == null) {
+					return;
+				}
+				for (Record studyidfind : studyidfindsde) {
+//					flag++;
+//					if (flag <= 5) {
+						//状态4:下载中
+						studyidfind.set("status", 4);
+						studyidfind.set("updateAt", parseStringToDateTime());
+						Db.use("local").update("study", studyidfind);
+						
+//						ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
+//						tService.execute(() -> {
+							String execCmd = ExecUtil.execCmd("/zskk_system/other/cmove.sh " + studyidfind.getStr("studyuid"));
+							if (execCmd.contains("Connection refused")) {
+								//状态2:错误
+								studyidfind.set("status", 2);
+								studyidfind.set("updateAt", parseStringToDateTime());
+								Db.use("local").update("study", studyidfind);
+							}else {
+								//状态2:完成
+								studyidfind.set("status", 3);
+								studyidfind.set("updateAt", parseStringToDateTime());
+								Db.use("local").update("study", studyidfind);
+							}
+							
+//						});	
+//						}
+					
+					
+				}
+				renderJson(studyidfindsde);
+	}
+	
 	public void sdcfind() {
 		String execCmd = ExecUtil.execCmd("/zskk_system/other/cfind.sh " + this.getPara("time") + " STUDYUID_" + "temppp" + ".xml");
 		if (execCmd.contains("Connection refused")) {