|
@@ -6,6 +6,7 @@ import java.io.FileOutputStream;
|
|
|
import java.util.List;
|
|
|
import java.util.zip.ZipOutputStream;
|
|
|
|
|
|
+import cn.hmsoft.log.LogHelper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -58,7 +59,7 @@ public class EnrolGatWorksControl extends ArtControl {
|
|
|
agent_id = 100;
|
|
|
}
|
|
|
String bucketName = ArtParamHelper.getParamValue("OssBucketName", "qmhm-topic");
|
|
|
- List<StdEnrol> enrolList = null;
|
|
|
+ List<StdEnrol> enrolList;
|
|
|
if (aspect_id != null) {
|
|
|
enrolList = daoEnrol.listBySql("select * from std_enrol e where e.agent_id=? and e.aspect_id=? and e.std_id in (select std_id from std_reg where std_province >=66)",
|
|
|
agent_id, aspect_id);
|
|
@@ -67,7 +68,7 @@ public class EnrolGatWorksControl extends ArtControl {
|
|
|
agent_id);
|
|
|
}
|
|
|
OSSClient ossClient = OssUploadHelper.createClient();
|
|
|
- if (enrolList != null && enrolList.size() > 0) {
|
|
|
+ if (enrolList != null && !enrolList.isEmpty()) {
|
|
|
for (StdEnrol e : enrolList) {
|
|
|
String worksUrl = e.getWorks_file();
|
|
|
String videoUrl = e.getVideo_file();
|
|
@@ -91,7 +92,7 @@ public class EnrolGatWorksControl extends ArtControl {
|
|
|
try {
|
|
|
OssUploadHelper.ossDownload(ossClient, bucketName, worksUrl, targetPath, chekPointPath);
|
|
|
} catch (Throwable e1) {
|
|
|
- e1.printStackTrace();
|
|
|
+ LogHelper.error(e1.getMessage());
|
|
|
}
|
|
|
}
|
|
|
if (StringHelper.isNotEmpty(videoUrl)) {
|
|
@@ -113,7 +114,7 @@ public class EnrolGatWorksControl extends ArtControl {
|
|
|
try {
|
|
|
OssUploadHelper.ossDownload(ossClient, bucketName, videoUrl, targetPath, chekPointPath);
|
|
|
} catch (Throwable e1) {
|
|
|
- e1.printStackTrace();
|
|
|
+ LogHelper.error(e1.getMessage());
|
|
|
}
|
|
|
}
|
|
|
if (StringHelper.isNotEmpty(materialUrl)) {
|
|
@@ -135,7 +136,7 @@ public class EnrolGatWorksControl extends ArtControl {
|
|
|
try {
|
|
|
OssUploadHelper.ossDownload(ossClient, bucketName, worksUrl, targetPath, chekPointPath);
|
|
|
} catch (Throwable e1) {
|
|
|
- e1.printStackTrace();
|
|
|
+ LogHelper.error(e1.getMessage());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -148,12 +149,10 @@ public class EnrolGatWorksControl extends ArtControl {
|
|
|
out = new ZipOutputStream(new FileOutputStream(destFile));
|
|
|
ZipHelper.compressDirectory(new File("/data/cafa2022/uploadfile/10047"), out, "/data/cafa2022/uploadfile");
|
|
|
} catch (FileNotFoundException e1) {
|
|
|
- e1.printStackTrace();
|
|
|
+ LogHelper.error(e1.getMessage());
|
|
|
}
|
|
|
- if (ossClient != null) {
|
|
|
- ossClient.shutdown();
|
|
|
- }
|
|
|
- }
|
|
|
+ ossClient.shutdown();
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|