hejinbo hace 2 años
padre
commit
74305b5728

+ 27
- 24
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java Ver fichero

102
         }
102
         }
103
         List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
103
         List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
104
         DeptIdentify deptIdentifyselect = deptIdentifysnew.get(0);
104
         DeptIdentify deptIdentifyselect = deptIdentifysnew.get(0);
105
-        Integer isUse = deptIdentifyselect.getIsUse();
106
-        if (isUse == 0) { //机构为未启用状态
107
-            Integer identifyStatus = deptIdentifyselect.getIdentifyStatus();
108
-            if (identifyStatus == 0) {
109
-                return AjaxResult.error("这个认证数据未进行认证,不能启用");
110
-            } else {
111
-                deptIdentifyselect.setIsUse(1);
112
-                int i = deptIdentifyMapper.updateDeptIdentify(deptIdentifyselect);
113
-                if (i > 0) {
114
-                    return AjaxResult.success("启用成功");
105
+        Integer identifyStatus = deptIdentifyselect.getIdentifyStatus();
106
+        if (identifyStatus != 1) {
107
+            return AjaxResult.error("这个认证数据未进行认证,不能启用");
108
+        }
109
+        deptIdentifyselect.setIsUse(1);
110
+        int i = deptIdentifyMapper.updateDeptIdentify(deptIdentifyselect);
111
+        if (i > 0) {
112
+            //把其他认证数据置为未使用
113
+             DeptIdentify deptIdentify2 = new DeptIdentify();
114
+            deptIdentify2.setIsUse(1);
115
+            List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify2);
116
+            for (DeptIdentify deptIdentify3 : deptIdentifies) {
117
+                if (deptIdentify3.equals(deptIdentifyselect)) {
118
+                    continue;
115
                 }
119
                 }
120
+                deptIdentify3.setIsUse(0);
121
+                deptIdentifyMapper.updateDeptIdentify(deptIdentify3);
116
             }
122
             }
117
-        } else { //机构为已启用状态
118
-            deptIdentifyselect.setIsUse(0);
119
-            int i = deptIdentifyMapper.updateDeptIdentify(deptIdentifyselect);
120
-            if (i > 0) {
121
-                return AjaxResult.success();
122
-            }
123
+            return AjaxResult.success("启用成功");
123
         }
124
         }
125
+
126
+
124
         return AjaxResult.error();
127
         return AjaxResult.error();
125
     }
128
     }
126
 
129
 
412
             templateManage.setTemOrigPath(annexPath);
415
             templateManage.setTemOrigPath(annexPath);
413
             String format = getFileExtension(fileName);
416
             String format = getFileExtension(fileName);
414
             templateManage.setTemFormat(format);
417
             templateManage.setTemFormat(format);
415
-            String subFileName = fileName.substring(fileName.lastIndexOf("/")+1);
418
+            String subFileName = fileName.substring(fileName.lastIndexOf("/") + 1);
416
             templateManage.setFileName(subFileName);
419
             templateManage.setFileName(subFileName);
417
             templateManage.setCreateBy(getUsername());
420
             templateManage.setCreateBy(getUsername());
418
             int i = templateManageMapper.insertTemplateManage(templateManage);
421
             int i = templateManageMapper.insertTemplateManage(templateManage);
441
                 startIndex += prefix.length();
444
                 startIndex += prefix.length();
442
                 String annexPath = "uploadPath" + fileName.substring(startIndex);
445
                 String annexPath = "uploadPath" + fileName.substring(startIndex);
443
                 templateManage.setTemOrigPath(annexPath);
446
                 templateManage.setTemOrigPath(annexPath);
444
-                String subFileName = fileName.substring(fileName.lastIndexOf("/")+1);
447
+                String subFileName = fileName.substring(fileName.lastIndexOf("/") + 1);
445
                 templateManage.setFileName(subFileName);
448
                 templateManage.setFileName(subFileName);
446
                 String format = getFileExtension(fileName);
449
                 String format = getFileExtension(fileName);
447
                 templateManage.setTemFormat(format);
450
                 templateManage.setTemFormat(format);
491
     }
494
     }
492
 
495
 
493
     @Override
496
     @Override
494
-    public  List<SysUser> selectPostUserByDeptId(DeptIdentify deptIdentify) {
497
+    public List<SysUser> selectPostUserByDeptId(DeptIdentify deptIdentify) {
495
         List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
498
         List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
496
-        if (deptIdentifies!= null && deptIdentifies.size() > 0) {
499
+        if (deptIdentifies != null && deptIdentifies.size() > 0) {
497
             deptIdentify = deptIdentifies.get(0);
500
             deptIdentify = deptIdentifies.get(0);
498
-            if (deptIdentify.getDeptId()!= null) {
501
+            if (deptIdentify.getDeptId() != null) {
499
                 //默认查询经办人的
502
                 //默认查询经办人的
500
                 Long roleId = 106L;
503
                 Long roleId = 106L;
501
-                List<SysUser> sysUserList = sysUserMapper.selectRoleUserByDeptId(deptIdentify.getDeptId(),roleId);
504
+                List<SysUser> sysUserList = sysUserMapper.selectRoleUserByDeptId(deptIdentify.getDeptId(), roleId);
502
                 return sysUserList;
505
                 return sysUserList;
503
             }
506
             }
504
 
507
 
508
 
511
 
509
     @Override
512
     @Override
510
     public AjaxResult bindHandler(DeptIdentify deptIdentify) {
513
     public AjaxResult bindHandler(DeptIdentify deptIdentify) {
511
-        if (deptIdentify.getId()== null||deptIdentify.getUserId()==null) {
514
+        if (deptIdentify.getId() == null || deptIdentify.getUserId() == null) {
512
             return AjaxResult.error("请检查参数是否完整");
515
             return AjaxResult.error("请检查参数是否完整");
513
         }
516
         }
514
         //根据userid查询用户信息
517
         //根据userid查询用户信息
515
         SysUser sysUser = sysUserMapper.selectUserById(deptIdentify.getUserId());
518
         SysUser sysUser = sysUserMapper.selectUserById(deptIdentify.getUserId());
516
-        if (sysUser!= null) {
519
+        if (sysUser != null) {
517
             deptIdentify.setOperName(sysUser.getNickName());
520
             deptIdentify.setOperName(sysUser.getNickName());
518
             deptIdentify.setOperPhone(sysUser.getPhonenumber());
521
             deptIdentify.setOperPhone(sysUser.getPhonenumber());
519
             deptIdentify.setOperUserName(sysUser.getUserName());
522
             deptIdentify.setOperUserName(sysUser.getUserName());

+ 101
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java Ver fichero

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
      */

+ 5
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java Ver fichero

32
 
32
 
33
         SealSignRecord sealSignRecord = new SealSignRecord();
33
         SealSignRecord sealSignRecord = new SealSignRecord();
34
 
34
 
35
+
35
         /* 发起签署*/
36
         /* 发起签署*/
36
 //        EsignHttpResponse createByFile = createByFile(sealSignRecord);
37
 //        EsignHttpResponse createByFile = createByFile(sealSignRecord);
37
 //        JsonObject createByFileJsonObject = gson.fromJson(createByFile.getBody(), JsonObject.class);
38
 //        JsonObject createByFileJsonObject = gson.fromJson(createByFile.getBody(), JsonObject.class);
119
 //        }
120
 //        }
120
 
121
 
121
 //        System.out.println(signFlowDetailJsonObject);
122
 //        System.out.println(signFlowDetailJsonObject);
122
-
123
+        DeptIdentify deptIdentify = new DeptIdentify();
124
+        deptIdentify.setAuthFlowId("OF-2b4e8f043408003c");
125
+        EsignHttpResponse deptIdentifyInfo = getDeptIdentifyInfo(deptIdentify);
126
+        System.out.println(deptIdentifyInfo);
123
 
127
 
124
     }
128
     }
125
 
129
 

+ 1
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Ver fichero

1465
         where id = #{id}
1465
         where id = #{id}
1466
     </update>
1466
     </update>
1467
     <update id="updatePayType">
1467
     <update id="updatePayType">
1468
-        update case_application set pay_type=#{payDTO.payType} where id in
1468
+        update case_application set pay_type=#{payType} where id in
1469
         <foreach item="caseId" collection="caseIds" open="(" separator="," close=")">
1469
         <foreach item="caseId" collection="caseIds" open="(" separator="," close=")">
1470
             #{caseId}
1470
             #{caseId}
1471
         </foreach>
1471
         </foreach>

+ 2
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml Ver fichero

114
             <if test="legalPerName != null and legalPerName != ''">legal_per_name = #{legalPerName},</if>
114
             <if test="legalPerName != null and legalPerName != ''">legal_per_name = #{legalPerName},</if>
115
             <if test="legalPerPhone != null and legalPerPhone != ''">legal_per_phone = #{legalPerPhone},</if>
115
             <if test="legalPerPhone != null and legalPerPhone != ''">legal_per_phone = #{legalPerPhone},</if>
116
             <if test="identifyEmail != null and identifyEmail != ''">identify_email = #{identifyEmail},</if>
116
             <if test="identifyEmail != null and identifyEmail != ''">identify_email = #{identifyEmail},</if>
117
+            <if test="userId != null ">user_id = #{userId},</if>
117
             <if test="authFlowId != null  and authFlowId != '' ">auth_flow_id = #{authFlowId}</if>
118
             <if test="authFlowId != null  and authFlowId != '' ">auth_flow_id = #{authFlowId}</if>
119
+
118
         </set>
120
         </set>
119
         <where>
121
         <where>
120
             <if test="id != null">
122
             <if test="id != null">