jiapeng 6 years ago
parent
commit
50705070fc

+ 1 - 0
src/main/java/com/ekexiu/project/storage/diacrisis/AiDiacrisisTask.java

58
		String nextStateCode = "ERR0599";
58
		String nextStateCode = "ERR0599";
59

59

60
		File file = new File(aiTaskService.getDstPath(), taskId);
60
		File file = new File(aiTaskService.getDstPath(), taskId);
61
		file = new File(file,"data_trans");
61
		if (file.exists() && file.isDirectory()) {
62
		if (file.exists() && file.isDirectory()) {
62
			try {
63
			try {
63
				URL u = new URL(urlPrefix + file.getAbsolutePath());
64
				URL u = new URL(urlPrefix + file.getAbsolutePath());

+ 3 - 1
src/main/java/com/ekexiu/project/storage/diacrisis/AiTaskService.java

232
   @Post
232
   @Post
233
	public String insert(@JdbcConn(true) Connection con, @LoginUser SessionUser user, final int taskType,String[] file) throws IOException, SQLException {
233
	public String insert(@JdbcConn(true) Connection con, @LoginUser SessionUser user, final int taskType,String[] file) throws IOException, SQLException {
234
	   File path;
234
	   File path;
235
	   String taskId;
235
	   do{
236
	   do{
236
		path = new File(this.dstPath,  StringUtil.buildUUID());
237
		path = new File(this.dstPath,  StringUtil.buildUUID());
237
	   }while(path.exists());
238
	   }while(path.exists());
238
	 	if(!path.mkdir()){
239
	 	if(!path.mkdir()){
239
	 		throw new RuntimeException("mkdir["+path.getAbsolutePath()+"] error");	
240
	 		throw new RuntimeException("mkdir["+path.getAbsolutePath()+"] error");	
240
	 	}
241
	 	}
242
	 	taskId = path.getName();
241
	 	path = new File(path,"data");
243
	 	path = new File(path,"data");
242
	 	if(!path.mkdir()){
244
	 	if(!path.mkdir()){
243
	 		throw new RuntimeException("mkdir["+path.getAbsolutePath()+"] error");	
245
	 		throw new RuntimeException("mkdir["+path.getAbsolutePath()+"] error");	
263
		   }
265
		   }
264
	   }
266
	   }
265
	   
267
	   
266
		final String id = path.getName();
268
		final String id = taskId;
267
		AiTask task = new AiTask();
269
		AiTask task = new AiTask();
268
		task.setDataNum(id.substring(24));
270
		task.setDataNum(id.substring(24));
269
		task.setTaskType(taskType);
271
		task.setTaskType(taskType);