|
|
@@ -272,6 +272,107 @@ public class FixSelectFlowDetailUtils {
|
|
272
|
272
|
}
|
|
273
|
273
|
}
|
|
274
|
274
|
|
|
|
275
|
+ /**
|
|
|
276
|
+ * 定时查询企业认证状态
|
|
|
277
|
+ *
|
|
|
278
|
+ * @throws Exception
|
|
|
279
|
+ */
|
|
|
280
|
+ @Scheduled(cron = "*/30 * * * * *")
|
|
|
281
|
+ @Transactional
|
|
|
282
|
+ public void fixExecuteSelectDeptIndentify() throws Exception {
|
|
|
283
|
+ Gson gson = new Gson();
|
|
|
284
|
+ DeptIdentify deptIdentify = new DeptIdentify();
|
|
|
285
|
+ deptIdentify.setIdentifyStatus(2);
|
|
|
286
|
+ List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
|
|
|
287
|
+ if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
|
|
|
288
|
+ for (int i = 0; i < deptIdentifysnew.size(); i++) {
|
|
|
289
|
+ DeptIdentify deptIdentify1 = deptIdentifysnew.get(i);
|
|
|
290
|
+ String authFlowId = deptIdentify1.getAuthFlowId();
|
|
|
291
|
+ if (authFlowId != null) {
|
|
|
292
|
+ EsignHttpResponse identifyInfo = SignAward.getDeptIdentifyInfo(deptIdentify1);
|
|
|
293
|
+ JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class);
|
|
|
294
|
+ int code = identifyInfoJsonObject.get("code").getAsInt();
|
|
|
295
|
+ if (code == 0) {
|
|
|
296
|
+ JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data");
|
|
|
297
|
+ int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt();
|
|
|
298
|
+ if (realnameStatus == 1) {
|
|
|
299
|
+ String orgId = identifyInfoData.get("orgId").getAsString();
|
|
|
300
|
+ //查询企业内部印章
|
|
|
301
|
+ EsignHttpResponse response = SignAward.deptIdentifySealList(orgId);
|
|
|
302
|
+ JsonObject jsonObject = gson.fromJson(response.getBody(), JsonObject.class);
|
|
|
303
|
+ int code1 = jsonObject.get("code").getAsInt();
|
|
|
304
|
+ if (code1 == 0) {
|
|
|
305
|
+ JsonObject data = jsonObject.getAsJsonObject("data");
|
|
|
306
|
+ JsonArray seals = data.get("seals").getAsJsonArray();
|
|
|
307
|
+ if (seals.size() > 0) {
|
|
|
308
|
+ for (int j = 0; j < seals.size(); j++) {
|
|
|
309
|
+ //保存印章信息到数据库
|
|
|
310
|
+ JsonObject asJsonObject = seals.get(j).getAsJsonObject();
|
|
|
311
|
+ SealManage sealManage = new SealManage();
|
|
|
312
|
+ String sealName = asJsonObject.get("sealName").toString();
|
|
|
313
|
+ String sealId = asJsonObject.get("sealId").toString();
|
|
|
314
|
+ String url = asJsonObject.get("sealImageDownloadUrl").toString();
|
|
|
315
|
+ LocalDate now = LocalDate.now();
|
|
|
316
|
+ String year = Integer.toString(now.getYear());
|
|
|
317
|
+ String month = String.format("%02d", now.getMonthValue());
|
|
|
318
|
+ String day = String.format("%02d", now.getDayOfMonth());
|
|
|
319
|
+ String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
|
320
|
+ String fileName = UUID.randomUUID().toString().replace("-", "") + ".jpg";
|
|
|
321
|
+ String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
|
322
|
+ String savePath = "/home/ruoyi/uploadPath/upload/";
|
|
|
323
|
+ // 创建日期目录
|
|
|
324
|
+ File saveFolder = new File(saveFolderPath);
|
|
|
325
|
+ if (!saveFolder.exists()) {
|
|
|
326
|
+ saveFolder.mkdirs();
|
|
|
327
|
+ }
|
|
|
328
|
+ String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
329
|
+ File resultFilePathFile = new File(resultFilePath);
|
|
|
330
|
+ if (!resultFilePathFile.exists()) {
|
|
|
331
|
+ resultFilePathFile.createNewFile();
|
|
|
332
|
+ }
|
|
|
333
|
+ String fileDownloadUrlnew = url.substring(1, url.length() - 1);
|
|
|
334
|
+ boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
|
|
335
|
+ if (downLoadFile) {
|
|
|
336
|
+ CaseAttach caseAttach = new CaseAttach();
|
|
|
337
|
+ caseAttach.setAnnexType(10); //10代表印章图片
|
|
|
338
|
+ caseAttach.setAnnexPath(savePath);
|
|
|
339
|
+ caseAttach.setAnnexName(saveName);
|
|
|
340
|
+ int i1 = caseAttachMapper.save(caseAttach);
|
|
|
341
|
+ if (i1 > 0) {
|
|
|
342
|
+ //将印章信息保存到公章管理表里
|
|
|
343
|
+ String sealName1 = sealName.substring(1, sealName.length() - 1);
|
|
|
344
|
+ String sealId1 = sealId.substring(1, sealId.length() - 1);
|
|
|
345
|
+ Integer annexId1 = caseAttach.getAnnexId();
|
|
|
346
|
+ sealManage.setAnnexId(annexId1);
|
|
|
347
|
+ sealManage.setSealId(sealId1);
|
|
|
348
|
+ sealManage.setSealName(sealName1);
|
|
|
349
|
+ sealManage.setIdentifyId(deptIdentify1.getId());
|
|
|
350
|
+ sealManage.setSealStatus(1);
|
|
|
351
|
+ sealManage.setIsUse(1);
|
|
|
352
|
+ sealManageMapper.insertSealManage(sealManage);
|
|
|
353
|
+ }
|
|
|
354
|
+ }
|
|
|
355
|
+ }
|
|
|
356
|
+ }
|
|
|
357
|
+
|
|
|
358
|
+ }
|
|
|
359
|
+ //将orgId保存到数据库里
|
|
|
360
|
+ deptIdentify1.setOrgId(orgId);
|
|
|
361
|
+ deptIdentify1.setIdentifyStatus(1);
|
|
|
362
|
+ deptIdentify1.setIsUse(0); //默认机构为未启用
|
|
|
363
|
+ int row = deptIdentifyMapper.updateDeptIdentify(deptIdentify1);
|
|
|
364
|
+ }
|
|
|
365
|
+ }else {
|
|
|
366
|
+ deptIdentify1.setIdentifyStatus(2);
|
|
|
367
|
+ deptIdentifyMapper.updateDeptIdentify(deptIdentify1);
|
|
|
368
|
+ }
|
|
|
369
|
+ }
|
|
|
370
|
+
|
|
|
371
|
+ }
|
|
|
372
|
+ }
|
|
|
373
|
+ }
|
|
|
374
|
+
|
|
|
375
|
+
|
|
275
|
376
|
/**
|
|
276
|
377
|
* 定时查询印章审核状态
|
|
277
|
378
|
*/
|