|
|
@@ -39,10 +39,11 @@ public class FixSelectFlowDetailUtils {
|
|
39
|
39
|
private DeptIdentifyMapper deptIdentifyMapper;
|
|
40
|
40
|
@Autowired
|
|
41
|
41
|
private SealManageMapper sealManageMapper;
|
|
|
42
|
+
|
|
42
|
43
|
/*
|
|
43
|
44
|
定时查询签署流程详情
|
|
44
|
45
|
*/
|
|
45
|
|
- @Scheduled(cron = "0/10 * * * * ?")
|
|
|
46
|
+ //@Scheduled(cron = "0/10 * * * * ?")
|
|
46
|
47
|
@Transactional
|
|
47
|
48
|
public void fixExecuteSelectFlowDetailUtils() {
|
|
48
|
49
|
Gson gson = new Gson();
|
|
|
@@ -173,9 +174,10 @@ public class FixSelectFlowDetailUtils {
|
|
173
|
174
|
|
|
174
|
175
|
/**
|
|
175
|
176
|
* 定时查询企业认证状态
|
|
|
177
|
+ *
|
|
176
|
178
|
* @throws Exception
|
|
177
|
179
|
*/
|
|
178
|
|
- @Scheduled(cron = "0 0/30 * * * ?")
|
|
|
180
|
+ //@Scheduled(cron = "*/30 * * * * *")
|
|
179
|
181
|
@Transactional
|
|
180
|
182
|
public void fixExecuteSelectDeptIndentifyUtils() throws Exception {
|
|
181
|
183
|
Gson gson = new Gson();
|
|
|
@@ -185,76 +187,84 @@ public class FixSelectFlowDetailUtils {
|
|
185
|
187
|
if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
|
|
186
|
188
|
for (int i = 0; i < deptIdentifysnew.size(); i++) {
|
|
187
|
189
|
DeptIdentify deptIdentify1 = deptIdentifysnew.get(i);
|
|
188
|
|
- EsignHttpResponse identifyInfo = SignAward.getDeptIdentifyInfo(deptIdentify1);
|
|
189
|
|
- JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class);
|
|
190
|
|
- int code = identifyInfoJsonObject.get("code").getAsInt();
|
|
191
|
|
- if (code == 0) {
|
|
192
|
|
- JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data");
|
|
193
|
|
- int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt();
|
|
194
|
|
- if (realnameStatus == 1) {
|
|
195
|
|
- String orgId = identifyInfoData.get("orgId").getAsString();
|
|
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);
|
|
|
190
|
+ String authFlowId = deptIdentify1.getAuthFlowId();
|
|
|
191
|
+ if (authFlowId != null) {
|
|
|
192
|
+ EsignHttpResponse identifyInfo = SignAward.getDeptIdentifyInfo(deptIdentify1);
|
|
|
193
|
+ JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class);
|
|
|
194
|
+ int code = identifyInfoJsonObject.get("code").getAsInt();
|
|
|
195
|
+ if (code == 0) {
|
|
|
196
|
+ JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data");
|
|
|
197
|
+ int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt();
|
|
|
198
|
+ if (realnameStatus == 1) {
|
|
|
199
|
+ String orgId = identifyInfoData.get("orgId").getAsString();
|
|
|
200
|
+ //查询企业内部印章
|
|
|
201
|
+ EsignHttpResponse response = SignAward.deptIdentifySealList(orgId);
|
|
|
202
|
+ JsonObject jsonObject = gson.fromJson(response.getBody(), JsonObject.class);
|
|
|
203
|
+ int code1 = jsonObject.get("code").getAsInt();
|
|
|
204
|
+ if (code1 == 0) {
|
|
|
205
|
+ JsonObject data = jsonObject.getAsJsonObject("data");
|
|
|
206
|
+ JsonArray seals = data.get("seals").getAsJsonArray();
|
|
|
207
|
+ if (seals.size() > 0) {
|
|
|
208
|
+ for (int j = 0; j < seals.size(); j++) {
|
|
|
209
|
+ //保存印章信息到数据库
|
|
|
210
|
+ JsonObject asJsonObject = seals.get(j).getAsJsonObject();
|
|
|
211
|
+ SealManage sealManage = new SealManage();
|
|
|
212
|
+ String sealName = asJsonObject.get("sealName").toString();
|
|
|
213
|
+ String sealId = asJsonObject.get("sealId").toString();
|
|
|
214
|
+ String url = asJsonObject.get("sealImageDownloadUrl").toString();
|
|
|
215
|
+ LocalDate now = LocalDate.now();
|
|
|
216
|
+ String year = Integer.toString(now.getYear());
|
|
|
217
|
+ String month = String.format("%02d", now.getMonthValue());
|
|
|
218
|
+ String day = String.format("%02d", now.getDayOfMonth());
|
|
|
219
|
+ String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
|
220
|
+ String fileName = UUID.randomUUID().toString().replace("-", "") + ".jpg";
|
|
|
221
|
+ String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
|
222
|
+ String savePath = "/home/ruoyi/uploadPath/upload/";
|
|
|
223
|
+ // 创建日期目录
|
|
|
224
|
+ File saveFolder = new File(saveFolderPath);
|
|
|
225
|
+ if (!saveFolder.exists()) {
|
|
|
226
|
+ saveFolder.mkdirs();
|
|
|
227
|
+ }
|
|
|
228
|
+ String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
229
|
+ File resultFilePathFile = new File(resultFilePath);
|
|
|
230
|
+ if (!resultFilePathFile.exists()) {
|
|
|
231
|
+ resultFilePathFile.createNewFile();
|
|
|
232
|
+ }
|
|
|
233
|
+ String fileDownloadUrlnew = url.substring(1, url.length() - 1);
|
|
|
234
|
+ boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
|
|
235
|
+ if (downLoadFile) {
|
|
|
236
|
+ CaseAttach caseAttach = new CaseAttach();
|
|
|
237
|
+ caseAttach.setAnnexType(10); //10代表印章图片
|
|
|
238
|
+ caseAttach.setAnnexPath(savePath);
|
|
|
239
|
+ caseAttach.setAnnexName(saveName);
|
|
|
240
|
+ int i1 = caseAttachMapper.save(caseAttach);
|
|
|
241
|
+ if (i1 > 0) {
|
|
|
242
|
+ //将印章信息保存到公章管理表里
|
|
|
243
|
+ String sealName1 = sealName.substring(1, sealName.length() - 1);
|
|
|
244
|
+ String sealId1 = sealId.substring(1, sealId.length() - 1);
|
|
|
245
|
+ Integer annexId1 = caseAttach.getAnnexId();
|
|
|
246
|
+ sealManage.setAnnexId(annexId1);
|
|
|
247
|
+ sealManage.setSealId(sealId1);
|
|
|
248
|
+ sealManage.setSealName(sealName1);
|
|
|
249
|
+ sealManage.setIdentifyId(deptIdentify1.getId());
|
|
|
250
|
+ sealManage.setSealStatus(1);
|
|
|
251
|
+ sealManage.setIsUse(1);
|
|
|
252
|
+ sealManageMapper.insertSealManage(sealManage);
|
|
|
253
|
+ }
|
|
245
|
254
|
}
|
|
246
|
255
|
}
|
|
247
|
256
|
}
|
|
248
|
|
- }
|
|
249
|
257
|
|
|
|
258
|
+ }
|
|
|
259
|
+ //将orgId保存到数据库里
|
|
|
260
|
+ deptIdentify1.setOrgId(orgId);
|
|
|
261
|
+ deptIdentify1.setIdentifyStatus(1);
|
|
|
262
|
+ deptIdentify1.setIsUse(0); //默认机构为未启用
|
|
|
263
|
+ int row = deptIdentifyMapper.updateDeptIdentify(deptIdentify1);
|
|
250
|
264
|
}
|
|
251
|
|
- //将orgId保存到数据库里
|
|
252
|
|
- deptIdentify1.setOrgId(orgId);
|
|
253
|
|
- deptIdentify1.setIdentifyStatus(1);
|
|
254
|
|
- deptIdentify1.setIsUse(0); //默认机构为未启用
|
|
255
|
|
- int row = deptIdentifyMapper.updateDeptIdentify(deptIdentify1);
|
|
256
|
265
|
}
|
|
257
|
266
|
}
|
|
|
267
|
+
|
|
258
|
268
|
}
|
|
259
|
269
|
}
|
|
260
|
270
|
}
|
|
|
@@ -293,7 +303,7 @@ public class FixSelectFlowDetailUtils {
|
|
293
|
303
|
int sealStatus = data.getIntValue("sealStatus");
|
|
294
|
304
|
if (sealStatus == 1) {//印章状态 1已启用,2待审核,3审核不通过,4 挂起
|
|
295
|
305
|
//已启用证明审核通过,下载到数据库
|
|
296
|
|
- String sealImageDownloadUrl = data.getString("sealImageDownloadUrl ");
|
|
|
306
|
+ String sealImageDownloadUrl = data.getString("sealImageDownloadUrl");
|
|
297
|
307
|
LocalDate now = LocalDate.now();
|
|
298
|
308
|
String year = Integer.toString(now.getYear());
|
|
299
|
309
|
String month = String.format("%02d", now.getMonthValue());
|
|
|
@@ -323,6 +333,8 @@ public class FixSelectFlowDetailUtils {
|
|
323
|
333
|
//将附件id保存到公章管理表里
|
|
324
|
334
|
Integer annexId1 = caseAttach.getAnnexId();
|
|
325
|
335
|
sealManage1.setAnnexId(annexId1);
|
|
|
336
|
+ sealManage1.setSealStatus(1);
|
|
|
337
|
+ sealManage1.setIsUse(1); //默认使用状态都是未启用
|
|
326
|
338
|
sealManageMapper.updateSealManage(sealManage1);
|
|
327
|
339
|
}
|
|
328
|
340
|
}
|