|
@@ -127,26 +127,26 @@ public class DataService {
|
|
|
// String fileStorePath = getFileWithUrl(fpString, fileName);
|
|
|
String fileStorePath = downloadFtpFile(fpString, fileName);
|
|
|
File file = new File(fileStorePath);
|
|
|
- String key = PropKit.get("institution_id") + "/" + fileName;
|
|
|
+ String key = "attachment"+PropKit.get("institution_id") + "/" + fileName;
|
|
|
|
|
|
-// boolean exists = client.doesObjectExist(PropKit.get("oss_bucketName"), key);
|
|
|
-// if (!exists) {
|
|
|
-// PutObjectRequest request = new PutObjectRequest(PropKit.get("oss_bucketName"), key, file);
|
|
|
-// request.setCannedAcl(CannedAccessControlList.PublicRead);
|
|
|
-// client.putObject(request);
|
|
|
-// boolean bexists = client.doesObjectExist(PropKit.get("oss_bucketName"), key);
|
|
|
-// if (!bexists) {
|
|
|
-// PutObjectRequest request2 = new PutObjectRequest(PropKit.get("oss_bucketName"), key, file);
|
|
|
-// request.setCannedAcl(CannedAccessControlList.PublicRead);
|
|
|
-// client.putObject(request);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// client.shutdown();
|
|
|
-// map.put("url", "https://annex.eos.jinan-4.cmecloud.cn/" + key);
|
|
|
-// map.put("name", key);
|
|
|
-// postWithParameters(SAVE_ANNEX_URL, map);
|
|
|
-//
|
|
|
-// file.delete();
|
|
|
+ boolean exists = client.doesObjectExist(PropKit.get("oss_bucketName"), key);
|
|
|
+ if (!exists) {
|
|
|
+ PutObjectRequest request = new PutObjectRequest(PropKit.get("oss_bucketName"), key, file);
|
|
|
+ request.setCannedAcl(CannedAccessControlList.PublicRead);
|
|
|
+ client.putObject(request);
|
|
|
+ boolean bexists = client.doesObjectExist(PropKit.get("oss_bucketName"), key);
|
|
|
+ if (!bexists) {
|
|
|
+ PutObjectRequest request2 = new PutObjectRequest(PropKit.get("oss_bucketName"), key, file);
|
|
|
+ request.setCannedAcl(CannedAccessControlList.PublicRead);
|
|
|
+ client.putObject(request);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ client.shutdown();
|
|
|
+ map.put("url", "https://annex.eos.jinan-4.cmecloud.cn/" + key);
|
|
|
+ map.put("name", key);
|
|
|
+ postWithParameters(SAVE_ANNEX_URL, map);
|
|
|
+
|
|
|
+ file.delete();
|
|
|
|
|
|
}
|
|
|
|