#128 印章审核回调

Слито
qtz слито 2 коммит(ов) из qtz1 в dev 2 лет назад

+ 16
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java Просмотреть файл

@@ -77,6 +77,22 @@ public class MsSignSealController  extends BaseController {
77 77
 
78 78
     }
79 79
 
80
+    /**
81
+     * 印章审核回调
82
+     */
83
+    @Anonymous
84
+    @PostMapping("/sealCheckCallback")
85
+    public AjaxResult sealCheckCallback() throws Exception {
86
+        boolean checkResult= SignVerifyUtils.checkSignuter();
87
+        if(checkResult){
88
+            String reqbodystr =SignVerifyUtils.getRequestBody();
89
+            return msSignSealService.sealCheckCallback(reqbodystr);
90
+        }else {
91
+            return AjaxResult.error("error");
92
+        }
93
+
94
+    }
95
+
80 96
     /**
81 97
      * 查询案件进度
82 98
      */

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/dept/DeptIdentifyMapper.java Просмотреть файл

@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.mapper.dept;
3 3
 import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
4 4
 import org.apache.ibatis.annotations.Mapper;
5 5
 import org.apache.ibatis.annotations.Param;
6
+import tk.mybatis.mapper.entity.Example;
6 7
 
7 8
 import java.util.List;
8 9
 
@@ -24,4 +25,5 @@ public interface DeptIdentifyMapper {
24 25
      * @return
25 26
      */
26 27
     String selectById(@Param("id") Long identifyId);
28
+
27 29
 }

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java Просмотреть файл

@@ -37,4 +37,6 @@ public interface MsSignSealService {
37 37
     AjaxResult msCaseSignUrlResAPP(MsSignSealDTO dto) throws EsignDemoException;
38 38
 
39 39
     AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException;
40
+
41
+    AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException;
40 42
 }

+ 80
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Просмотреть файл

@@ -1056,8 +1056,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1056 1056
             MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(caseApplicationselect.getCaseFlowId());
1057 1057
             Integer caseNode = currentFlow.getNodeId();
1058 1058
             String caseStatusName = currentFlow.getCaseStatusName();
1059
-
1060
-
1061 1059
             if("SIGN_MISSON_COMPLETE".equals(action) && signResult==2){
1062 1060
                 if(mediaResult.intValue()==1){
1063 1061
                     //调解
@@ -1344,6 +1342,86 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1344 1342
         return AjaxResult.success("success");
1345 1343
     }
1346 1344
 
1345
+    @Override
1346
+    @Transactional(rollbackFor = Exception.class)
1347
+    public AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException {
1348
+        JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr);
1349
+        Gson gson = new Gson();
1350
+        if (jsonObjectCallback != null) {
1351
+            int auditStatus = jsonObjectCallback.getIntValue("auditStatus");
1352
+            String action = jsonObjectCallback.getString("action");
1353
+            String orgId = jsonObjectCallback.getString("orgId");
1354
+            String sealId = jsonObjectCallback.getString("sealId");
1355
+
1356
+            SealManage sealManage = new SealManage();
1357
+            DeptIdentify deptIdentify1 = new DeptIdentify();
1358
+            deptIdentify1.setOrgId(orgId);
1359
+            List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1);
1360
+            if (deptIdentifies != null && deptIdentifies.size() > 0) {
1361
+                Long iddeptIdent = deptIdentifies.get(0).getId();
1362
+                SealManage sealManageSel = new SealManage();
1363
+                sealManageSel.setIdentifyId(iddeptIdent);
1364
+                sealManageSel.setSealId(sealId);
1365
+                List<String> sealIdList = new ArrayList<>();
1366
+                List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManageSel);
1367
+                if (selectSealList != null && selectSealList.size() > 0) {
1368
+                    sealManage = selectSealList.get(0);
1369
+                }
1370
+            }
1371
+
1372
+            if("SEAL_AUDIT".equals(action) && auditStatus==1){
1373
+                EsignHttpResponse response = SignAward.getOrgSeal(orgId, sealId);
1374
+                JSONObject jsonObject = JSONObject.parseObject(response.getBody());
1375
+                int code = jsonObject.getIntValue("code");
1376
+                if (code == 0) {
1377
+                    JSONObject data = jsonObject.getJSONObject("data");
1378
+                    int sealStatus = data.getIntValue("sealStatus");
1379
+                    if (sealStatus == 1) {//印章状态 1已启用,2待审核,3审核不通过,4 挂起
1380
+                        //已启用证明审核通过,下载到数据库
1381
+                        String sealImageDownloadUrl = data.getString("sealImageDownloadUrl");
1382
+                        LocalDate now = LocalDate.now();
1383
+                        String year = Integer.toString(now.getYear());
1384
+                        String month = String.format("%02d", now.getMonthValue());
1385
+                        String day = String.format("%02d", now.getDayOfMonth());
1386
+                        String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
1387
+                        String fileName = UUID.randomUUID().toString().replace("-", "") + ".jpg";
1388
+                        String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1389
+                        String savePath = "/home/ruoyi/uploadPath/upload/";
1390
+                        // 创建日期目录
1391
+                        File saveFolder = new File(saveFolderPath);
1392
+                        if (!saveFolder.exists()) {
1393
+                            saveFolder.mkdirs();
1394
+                        }
1395
+                        String resultFilePath = saveFolderPath + "/" + fileName;
1396
+                        File resultFilePathFile = new File(resultFilePath);
1397
+                        if (!resultFilePathFile.exists()) {
1398
+                            resultFilePathFile.createNewFile();
1399
+                        }
1400
+                        boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath);
1401
+                        if (downLoadFile) {
1402
+                            MsCaseAttach caseAttach = new MsCaseAttach();
1403
+                            caseAttach.setAnnexType(AnnexTypeEnum.SEAL_PICTURE.getCode());  //10代表印章图片
1404
+                            caseAttach.setAnnexPath(savePath);
1405
+                            caseAttach.setAnnexName(saveName);
1406
+                            int i1 = caseAttachMapper.save(caseAttach);
1407
+                            if (i1 > 0) {
1408
+                                //将附件id保存到公章管理表里
1409
+                                Long annexId1 = caseAttach.getAnnexId();
1410
+                                sealManage.setAnnexId(annexId1);
1411
+                                sealManage.setSealStatus(1);
1412
+                                sealManage.setIsUse(0);
1413
+                                sealManageMapper.updateSealManage(sealManage);
1414
+                            }
1415
+                        }
1416
+                    }
1417
+                }
1418
+            }
1419
+        }else{
1420
+            return AjaxResult.error("error");
1421
+        }
1422
+        return AjaxResult.success("success");
1423
+    }
1424
+
1347 1425
     /**
1348 1426
      * 通过邮件发送裁决书文件
1349 1427
      *

+ 3
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/dept/SealManageMapper.xml Просмотреть файл

@@ -23,6 +23,9 @@
23 23
             <if test="sealStatus != null">
24 24
                 AND seal_status = #{sealStatus}
25 25
             </if>
26
+            <if test="sealId != null  and sealId != ''">
27
+                AND seal_id = #{sealId}
28
+            </if>
26 29
         </where>
27 30
     </select>
28 31