|
|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
4
|
4
|
import com.alibaba.fastjson.JSONObject;
|
|
5
|
5
|
import com.google.gson.Gson;
|
|
6
|
6
|
import com.google.gson.JsonArray;
|
|
|
7
|
+import com.google.gson.JsonElement;
|
|
7
|
8
|
import com.google.gson.JsonObject;
|
|
8
|
9
|
import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
9
|
10
|
import com.ruoyi.common.constant.FileTransformation;
|
|
|
@@ -11,14 +12,8 @@ import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
|
11
|
12
|
import com.ruoyi.common.exception.EsignDemoException;
|
|
12
|
13
|
import com.ruoyi.common.utils.SealUtil;
|
|
13
|
14
|
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
|
14
|
|
-import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
|
15
|
|
-import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
|
16
|
|
-import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
|
|
17
|
|
-import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
|
|
18
|
|
-import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
|
19
|
|
-import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
|
20
|
|
-import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper;
|
|
21
|
|
-import com.ruoyi.wisdomarbitrate.mapper.SealSignRecordMapper;
|
|
|
15
|
+import com.ruoyi.wisdomarbitrate.domain.*;
|
|
|
16
|
+import com.ruoyi.wisdomarbitrate.mapper.*;
|
|
22
|
17
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
23
|
18
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
24
|
19
|
import org.springframework.stereotype.Component;
|
|
|
@@ -27,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
27
|
22
|
import java.io.File;
|
|
28
|
23
|
import java.io.IOException;
|
|
29
|
24
|
import java.time.LocalDate;
|
|
|
25
|
+import java.util.Date;
|
|
30
|
26
|
import java.util.List;
|
|
31
|
27
|
import java.util.UUID;
|
|
32
|
28
|
|
|
|
@@ -41,7 +37,11 @@ public class FixSelectFlowDetailUtils {
|
|
41
|
37
|
private CaseAttachMapper caseAttachMapper;
|
|
42
|
38
|
@Autowired
|
|
43
|
39
|
private DeptIdentifyMapper deptIdentifyMapper;
|
|
44
|
|
-
|
|
|
40
|
+ @Autowired
|
|
|
41
|
+ private SealManageMapper sealManageMapper;
|
|
|
42
|
+ /*
|
|
|
43
|
+ 定时查询签署流程详情
|
|
|
44
|
+ */
|
|
45
|
45
|
@Scheduled(cron = "0/10 * * * * ?")
|
|
46
|
46
|
@Transactional
|
|
47
|
47
|
public void fixExecuteSelectFlowDetailUtils() {
|
|
|
@@ -171,17 +171,21 @@ public class FixSelectFlowDetailUtils {
|
|
171
|
171
|
|
|
172
|
172
|
}
|
|
173
|
173
|
|
|
174
|
|
- @Scheduled(cron = "0/30 * * * * ?")
|
|
|
174
|
+ /**
|
|
|
175
|
+ * 定时查询企业认证状态
|
|
|
176
|
+ * @throws Exception
|
|
|
177
|
+ */
|
|
|
178
|
+ @Scheduled(cron = "0 0/30 * * * ?")
|
|
175
|
179
|
@Transactional
|
|
176
|
|
- public void fixExecuteSelectDeptIndentifyUtils() throws EsignDemoException {
|
|
|
180
|
+ public void fixExecuteSelectDeptIndentifyUtils() throws Exception {
|
|
177
|
181
|
Gson gson = new Gson();
|
|
178
|
182
|
DeptIdentify deptIdentify = new DeptIdentify();
|
|
179
|
183
|
deptIdentify.setIdentifyStatus(0);
|
|
180
|
|
- List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
|
|
|
184
|
+ List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
|
|
181
|
185
|
if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
|
|
182
|
186
|
for (int i = 0; i < deptIdentifysnew.size(); i++) {
|
|
183
|
|
- EsignHttpResponse identifyInfo = SignAward.getDeptIdentifyInfo(deptIdentifysnew.get(i));
|
|
184
|
|
-
|
|
|
187
|
+ DeptIdentify deptIdentify1 = deptIdentifysnew.get(i);
|
|
|
188
|
+ EsignHttpResponse identifyInfo = SignAward.getDeptIdentifyInfo(deptIdentify1);
|
|
185
|
189
|
JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class);
|
|
186
|
190
|
int code = identifyInfoJsonObject.get("code").getAsInt();
|
|
187
|
191
|
if (code == 0) {
|
|
|
@@ -189,27 +193,66 @@ public class FixSelectFlowDetailUtils {
|
|
189
|
193
|
int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt();
|
|
190
|
194
|
if (realnameStatus == 1) {
|
|
191
|
195
|
String orgId = identifyInfoData.get("orgId").getAsString();
|
|
192
|
|
- System.out.println("这是orgId" + orgId + "=======================");
|
|
193
|
|
- EsignHttpResponse identifyInfo1 = SignAward.deptIdentifySealList(orgId);
|
|
194
|
|
- //将orgId保存到数据库里
|
|
195
|
|
- DeptIdentify deptIdentifynew = deptIdentifysnew.get(i);
|
|
196
|
|
- deptIdentifynew.setOrgId(orgId);
|
|
197
|
|
- JsonObject identifyInfoJsonObject1 = gson.fromJson(identifyInfo1.getBody(), JsonObject.class);
|
|
198
|
|
- JsonObject identifyInfoData1 = identifyInfoJsonObject1.getAsJsonObject("data");
|
|
199
|
|
- JsonArray sealArray = identifyInfoData1.get("seals").getAsJsonArray();
|
|
200
|
|
- String sealNames = "";
|
|
201
|
|
- if (sealArray.size() > 0) {
|
|
202
|
|
- for (int j = 0; j < sealArray.size(); j++) {
|
|
203
|
|
- JsonObject sealObject = (JsonObject) sealArray.get(j);
|
|
204
|
|
- String sealName = sealObject.get("sealName").toString();
|
|
205
|
|
- String sealNamenew = sealName.substring(1, sealName.length() - 1);
|
|
206
|
|
- sealNames += sealNamenew + ",";
|
|
|
196
|
+ //查询企业内部印章
|
|
|
197
|
+ EsignHttpResponse response = SignAward.deptIdentifySealList(orgId);
|
|
|
198
|
+ JsonObject jsonObject = gson.fromJson(response.getBody(), JsonObject.class);
|
|
|
199
|
+ int code1 = jsonObject.get("code").getAsInt();
|
|
|
200
|
+ if (code1 == 0){
|
|
|
201
|
+ JsonObject data = jsonObject.getAsJsonObject("data");
|
|
|
202
|
+ JsonArray seals = data.get("seals").getAsJsonArray();
|
|
|
203
|
+ if (seals.size() > 0) {
|
|
|
204
|
+ for (int j = 0; j < seals.size(); j++) {
|
|
|
205
|
+ //保存印章信息到数据库
|
|
|
206
|
+ JsonObject asJsonObject = seals.get(j).getAsJsonObject();
|
|
|
207
|
+ SealManage sealManage = new SealManage();
|
|
|
208
|
+ String sealName = asJsonObject.get("sealName").toString();
|
|
|
209
|
+ String sealId = asJsonObject.get("sealId").toString();
|
|
|
210
|
+ String url = asJsonObject.get("sealImageDownloadUrl").toString();
|
|
|
211
|
+ LocalDate now = LocalDate.now();
|
|
|
212
|
+ String year = Integer.toString(now.getYear());
|
|
|
213
|
+ String month = String.format("%02d", now.getMonthValue());
|
|
|
214
|
+ String day = String.format("%02d", now.getDayOfMonth());
|
|
|
215
|
+ String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
|
216
|
+ String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
|
|
217
|
+ String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
|
218
|
+ String savePath = "/home/ruoyi/uploadPath/upload/";
|
|
|
219
|
+ // 创建日期目录
|
|
|
220
|
+ File saveFolder = new File(saveFolderPath);
|
|
|
221
|
+ if (!saveFolder.exists()) {
|
|
|
222
|
+ saveFolder.mkdirs();
|
|
|
223
|
+ }
|
|
|
224
|
+ String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
225
|
+ File resultFilePathFile = new File(resultFilePath);
|
|
|
226
|
+ if (!resultFilePathFile.exists()) {
|
|
|
227
|
+ resultFilePathFile.createNewFile();
|
|
|
228
|
+ }
|
|
|
229
|
+ boolean downLoadFile = FileTransformation.downLoadFileByUrl(url, resultFilePath);
|
|
|
230
|
+ if (downLoadFile) {
|
|
|
231
|
+ CaseAttach caseAttach = new CaseAttach();
|
|
|
232
|
+ caseAttach.setAnnexType(10); //10代表印章图片
|
|
|
233
|
+ caseAttach.setAnnexPath(savePath);
|
|
|
234
|
+ caseAttach.setAnnexName(saveName);
|
|
|
235
|
+ int i1 = caseAttachMapper.save(caseAttach);
|
|
|
236
|
+ if (i1 > 0) {
|
|
|
237
|
+ //将印章信息保存到公章管理表里
|
|
|
238
|
+ Integer annexId1 = caseAttach.getAnnexId();
|
|
|
239
|
+ sealManage.setAnnexId(annexId1);
|
|
|
240
|
+ sealManage.setSealId(sealId);
|
|
|
241
|
+ sealManage.setSealName(sealName);
|
|
|
242
|
+ sealManage.setIdentifyId(deptIdentify1.getId());
|
|
|
243
|
+ sealManage.setSealStatus(1);
|
|
|
244
|
+ sealManageMapper.insertSealManage(sealManage);
|
|
|
245
|
+ }
|
|
|
246
|
+ }
|
|
|
247
|
+ }
|
|
207
|
248
|
}
|
|
|
249
|
+
|
|
208
|
250
|
}
|
|
209
|
|
- String sealName = sealNames.substring(0, sealNames.length() - 1);
|
|
210
|
|
- deptIdentifynew.setIdentifyStatus(1);
|
|
211
|
|
- deptIdentifynew.setSealName(sealName);
|
|
212
|
|
- int row = deptIdentifyMapper.updateDeptIdentify(deptIdentifynew);
|
|
|
251
|
+ //将orgId保存到数据库里
|
|
|
252
|
+ deptIdentify1.setOrgId(orgId);
|
|
|
253
|
+ deptIdentify1.setIdentifyStatus(1);
|
|
|
254
|
+ deptIdentify1.setIsUse(0); //默认机构为未启用
|
|
|
255
|
+ int row = deptIdentifyMapper.updateDeptIdentify(deptIdentify1);
|
|
213
|
256
|
}
|
|
214
|
257
|
}
|
|
215
|
258
|
}
|
|
|
@@ -217,68 +260,77 @@ public class FixSelectFlowDetailUtils {
|
|
217
|
260
|
}
|
|
218
|
261
|
|
|
219
|
262
|
/**
|
|
220
|
|
- * 定时查询企业内部印章审核状态
|
|
221
|
|
- *
|
|
222
|
|
- * @throws EsignDemoException
|
|
|
263
|
+ * 定时查询印章审核状态
|
|
223
|
264
|
*/
|
|
224
|
|
- // @Scheduled(cron = "0/30 * * * * ?")
|
|
|
265
|
+ @Scheduled(cron = "0/30 * * * * ?")
|
|
225
|
266
|
@Transactional
|
|
226
|
267
|
public void searchForInstitutionalSeal() {
|
|
227
|
268
|
try {
|
|
228
|
|
- DeptIdentify deptIdentify = new DeptIdentify();
|
|
229
|
|
- deptIdentify.setIsUse(0);
|
|
230
|
|
- List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
|
|
231
|
|
- if (deptIdentifies != null && deptIdentifies.size() > 0) {
|
|
232
|
|
- for (DeptIdentify identify : deptIdentifies) {
|
|
|
269
|
+ SealManage sealManage = new SealManage();
|
|
|
270
|
+ sealManage.setSealStatus(0);
|
|
|
271
|
+ List<SealManage> sealManageList = sealManageMapper.selectSealList(sealManage);
|
|
|
272
|
+ if (sealManageList != null && sealManageList.size() > 0) {
|
|
|
273
|
+ for (SealManage sealManage1 : sealManageList) {
|
|
233
|
274
|
//查询企业内部印章
|
|
234
|
|
- Integer annexId = identify.getAnnexId();
|
|
235
|
|
- if (annexId == null) {
|
|
236
|
|
- //说明之前没有下载过
|
|
237
|
|
- EsignHttpResponse response = SignAward.orgOwnSealList(identify);
|
|
238
|
|
- JSONObject jsonObject = JSONObject.parseObject(response.getBody());
|
|
239
|
|
- JSONObject data = jsonObject.getJSONObject("data");
|
|
240
|
|
- JSONArray seals = data.getJSONArray("seals");
|
|
241
|
|
- for (int i = 0; i < seals.size(); i++) {
|
|
242
|
|
- JSONObject seal = seals.getJSONObject(i);
|
|
243
|
|
- int statusDescription = seal.getIntValue("statusDescription");
|
|
244
|
|
- if (statusDescription == 1) {//印章状态 1已启用,2待审核,3审核不通过,4 挂起
|
|
245
|
|
- //已启用证明审核通过,下载到数据库
|
|
246
|
|
- String sealImageDownloadUrl = seal.getString("sealImageDownloadUrl");
|
|
247
|
|
- LocalDate now = LocalDate.now();
|
|
248
|
|
- String year = Integer.toString(now.getYear());
|
|
249
|
|
- String month = String.format("%02d", now.getMonthValue());
|
|
250
|
|
- String day = String.format("%02d", now.getDayOfMonth());
|
|
251
|
|
- String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
252
|
|
- String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
|
253
|
|
- String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
254
|
|
- String savePath = "/home/ruoyi/uploadPath/upload/";
|
|
255
|
|
- // 创建日期目录
|
|
256
|
|
- File saveFolder = new File(saveFolderPath);
|
|
257
|
|
- if (!saveFolder.exists()) {
|
|
258
|
|
- saveFolder.mkdirs();
|
|
259
|
|
- }
|
|
260
|
|
- String resultFilePath = saveFolderPath + "/" + fileName;
|
|
261
|
|
- File resultFilePathFile = new File(resultFilePath);
|
|
262
|
|
- if (!resultFilePathFile.exists()) {
|
|
263
|
|
- resultFilePathFile.createNewFile();
|
|
264
|
|
- }
|
|
265
|
|
- boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath);
|
|
266
|
|
- if (downLoadFile) {
|
|
267
|
|
- CaseAttach caseAttach = new CaseAttach();
|
|
268
|
|
- caseAttach.setAnnexType(10); //10代表印章图片
|
|
269
|
|
- caseAttach.setAnnexPath(savePath);
|
|
270
|
|
- caseAttach.setAnnexName(saveName);
|
|
271
|
|
- int i1 = caseAttachMapper.save(caseAttach);
|
|
272
|
|
- if (i1 > 0) {
|
|
273
|
|
- //将附件id保存到公章管理表里
|
|
274
|
|
- Integer annexId1 = caseAttach.getAnnexId();
|
|
275
|
|
- identify.setAnnexId(annexId1);
|
|
276
|
|
- deptIdentifyMapper.updateDeptIdentify(identify);
|
|
|
275
|
+ Integer annexId = sealManage1.getAnnexId();
|
|
|
276
|
+ String sealId = sealManage1.getSealId();
|
|
|
277
|
+ DeptIdentify deptIdentify = new DeptIdentify();
|
|
|
278
|
+ deptIdentify.setId(sealManage1.getIdentifyId());
|
|
|
279
|
+ List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
|
|
|
280
|
+ if (deptIdentifies != null && deptIdentifies.size() > 0) {
|
|
|
281
|
+ DeptIdentify deptIdentify1 = deptIdentifies.get(0);
|
|
|
282
|
+ String orgId = deptIdentify1.getOrgId();
|
|
|
283
|
+ if (orgId == null) {
|
|
|
284
|
+ continue;
|
|
|
285
|
+ }
|
|
|
286
|
+ if (annexId == null) {
|
|
|
287
|
+ //说明之前没有下载过
|
|
|
288
|
+ EsignHttpResponse response = SignAward.getOrgSeal(orgId, sealId);
|
|
|
289
|
+ JSONObject jsonObject = JSONObject.parseObject(response.getBody());
|
|
|
290
|
+ int code = jsonObject.getIntValue("code");
|
|
|
291
|
+ if (code == 0) {
|
|
|
292
|
+ JSONObject data = jsonObject.getJSONObject("data");
|
|
|
293
|
+ int sealStatus = data.getIntValue("sealStatus");
|
|
|
294
|
+ if (sealStatus == 1) {//印章状态 1已启用,2待审核,3审核不通过,4 挂起
|
|
|
295
|
+ //已启用证明审核通过,下载到数据库
|
|
|
296
|
+ String sealImageDownloadUrl = data.getString("sealImageDownloadUrl ");
|
|
|
297
|
+ LocalDate now = LocalDate.now();
|
|
|
298
|
+ String year = Integer.toString(now.getYear());
|
|
|
299
|
+ String month = String.format("%02d", now.getMonthValue());
|
|
|
300
|
+ String day = String.format("%02d", now.getDayOfMonth());
|
|
|
301
|
+ String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
|
302
|
+ String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
|
|
303
|
+ String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
|
304
|
+ String savePath = "/home/ruoyi/uploadPath/upload/";
|
|
|
305
|
+ // 创建日期目录
|
|
|
306
|
+ File saveFolder = new File(saveFolderPath);
|
|
|
307
|
+ if (!saveFolder.exists()) {
|
|
|
308
|
+ saveFolder.mkdirs();
|
|
|
309
|
+ }
|
|
|
310
|
+ String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
311
|
+ File resultFilePathFile = new File(resultFilePath);
|
|
|
312
|
+ if (!resultFilePathFile.exists()) {
|
|
|
313
|
+ resultFilePathFile.createNewFile();
|
|
|
314
|
+ }
|
|
|
315
|
+ boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath);
|
|
|
316
|
+ if (downLoadFile) {
|
|
|
317
|
+ CaseAttach caseAttach = new CaseAttach();
|
|
|
318
|
+ caseAttach.setAnnexType(10); //10代表印章图片
|
|
|
319
|
+ caseAttach.setAnnexPath(savePath);
|
|
|
320
|
+ caseAttach.setAnnexName(saveName);
|
|
|
321
|
+ int i1 = caseAttachMapper.save(caseAttach);
|
|
|
322
|
+ if (i1 > 0) {
|
|
|
323
|
+ //将附件id保存到公章管理表里
|
|
|
324
|
+ Integer annexId1 = caseAttach.getAnnexId();
|
|
|
325
|
+ sealManage1.setAnnexId(annexId1);
|
|
|
326
|
+ sealManageMapper.updateSealManage(sealManage1);
|
|
|
327
|
+ }
|
|
277
|
328
|
}
|
|
278
|
329
|
}
|
|
279
|
330
|
}
|
|
280
|
331
|
}
|
|
281
|
332
|
}
|
|
|
333
|
+
|
|
282
|
334
|
}
|
|
283
|
335
|
}
|
|
284
|
336
|
} catch (EsignDemoException e) {
|
|
|
@@ -288,79 +340,6 @@ public class FixSelectFlowDetailUtils {
|
|
288
|
340
|
}
|
|
289
|
341
|
}
|
|
290
|
342
|
|
|
291
|
|
- /* public static void main(String[] args) throws Exception {
|
|
292
|
|
- Gson gson = new Gson();
|
|
293
|
|
- SealSignRecord sealSignRecord = new SealSignRecord();
|
|
294
|
|
- sealSignRecord.setCaseAppliId(1350L);
|
|
295
|
|
- sealSignRecord.setSignFlowid("24ca7172f1a242238937d952c2e7fbff");
|
|
296
|
|
- EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
|
|
297
|
|
- JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(), JsonObject.class);
|
|
298
|
|
- JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
|
|
299
|
|
- JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
|
|
300
|
|
- Integer psnsignStatus = null;
|
|
301
|
|
- Integer orgsignStatus = null;
|
|
302
|
|
-
|
|
303
|
|
- for (int j = 0; j < signersArray.size(); j++) {
|
|
304
|
|
- JsonObject signerObject = (JsonObject) signersArray.get(j);
|
|
305
|
|
-
|
|
306
|
|
- if (!(signerObject.get("psnSigner").toString()).equals("null")) {
|
|
307
|
|
- JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner");
|
|
308
|
|
- if (psnSignerData != null) {
|
|
309
|
|
- psnsignStatus = signerObject.get("signStatus").getAsInt();
|
|
310
|
|
- }
|
|
311
|
|
- }
|
|
312
|
|
- if (!(signerObject.get("orgSigner").toString()).equals("null")) {
|
|
313
|
|
- JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
|
|
314
|
|
- if (orgSignerData != null) {
|
|
315
|
|
- orgsignStatus = signerObject.get("signStatus").getAsInt();
|
|
316
|
|
- }
|
|
317
|
|
- }
|
|
318
|
|
-
|
|
319
|
|
- }
|
|
320
|
|
-
|
|
321
|
|
- if ((psnsignStatus.intValue() == 2) && (orgsignStatus.intValue() == 2)) {
|
|
322
|
|
-
|
|
323
|
|
- //下载审核完成的裁决书,
|
|
324
|
|
- String signFlowId = "24ca7172f1a242238937d952c2e7fbff";
|
|
325
|
|
- EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
|
|
326
|
|
- JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
|
|
327
|
|
- JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
|
|
328
|
|
- JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
|
|
329
|
|
- if (filesArray != null && filesArray.size() > 0) {
|
|
330
|
|
- JsonObject fileObject = (JsonObject) filesArray.get(0);
|
|
331
|
|
- String fileDownloadUrl = fileObject.get("downloadUrl").toString();
|
|
332
|
|
- System.out.println(fileDownloadUrl);
|
|
333
|
|
- String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
|
|
334
|
|
- System.out.println(filearbitraUrl);
|
|
335
|
|
- LocalDate now = LocalDate.now();
|
|
336
|
|
- String year = Integer.toString(now.getYear());
|
|
337
|
|
- String month = String.format("%02d", now.getMonthValue());
|
|
338
|
|
- String day = String.format("%02d", now.getDayOfMonth());
|
|
339
|
|
- String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
340
|
|
- String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
|
341
|
|
- String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
342
|
|
- String savePath = "/home/ruoyi/uploadPath/upload/";
|
|
343
|
|
-
|
|
344
|
|
- // 创建日期目录
|
|
345
|
|
- File saveFolder = new File(saveFolderPath);
|
|
346
|
|
- if (!saveFolder.exists()) {
|
|
347
|
|
- saveFolder.mkdirs();
|
|
348
|
|
- }
|
|
349
|
|
- String resultFilePath = saveFolderPath + "/" + fileName;
|
|
350
|
|
- File resultFilePathFile = new File(resultFilePath);
|
|
351
|
|
- if (!resultFilePathFile.exists()) {
|
|
352
|
|
- resultFilePathFile.createNewFile();
|
|
353
|
|
- }
|
|
354
|
|
-
|
|
355
|
|
- String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
|
|
356
|
|
- boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
|
357
|
|
- if (downLoadFile) {
|
|
358
|
|
- System.out.println("chenggong ===============");
|
|
359
|
|
- }
|
|
360
|
|
- }
|
|
361
|
|
- }
|
|
362
|
|
- }*/
|
|
363
|
|
-
|
|
364
|
343
|
}
|
|
365
|
344
|
|
|
366
|
345
|
|