18792927508 2 лет назад
Родитель
Сommit
33d44eed4d

+ 11
- 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java Просмотреть файл

276
      * 部门长审核裁决书
276
      * 部门长审核裁决书
277
      */
277
      */
278
 //    @PreAuthorize("@ss.hasPermi('caseApplication:checkArbitrateRecord')")
278
 //    @PreAuthorize("@ss.hasPermi('caseApplication:checkArbitrateRecord')")
279
-    @Log(title = "审核裁决书", businessType = BusinessType.UPDATE)
279
+    @Log(title = "部门长审核裁决书", businessType = BusinessType.UPDATE)
280
     @PostMapping("/checkArbitrateRecord")
280
     @PostMapping("/checkArbitrateRecord")
281
     public AjaxResult checkArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) {
281
     public AjaxResult checkArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) {
282
 
282
 
283
         return caseApplicationService.checkArbitrateRecord(caseApplication);
283
         return caseApplicationService.checkArbitrateRecord(caseApplication);
284
     }
284
     }
285
+    /**
286
+     * 仲裁员审核裁决书
287
+     */
288
+//    @PreAuthorize("@ss.hasPermi('caseApplication:checkArbitrateRecord')")
289
+    @Log(title = "仲裁员审核裁决书", businessType = BusinessType.UPDATE)
290
+    @PostMapping("/arbitrator/checkArbitrateRecord")
291
+    public AjaxResult arbitratorCheckArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) {
292
+
293
+        return caseApplicationService.arbitratorCheckArbitrateRecord(caseApplication);
294
+    }
285
 
295
 
286
 
296
 
287
     /**
297
     /**

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

120
      * @return
120
      * @return
121
      */
121
      */
122
     AjaxResult updateCaseIdByAnnexId(CaseAttach caseAttach);
122
     AjaxResult updateCaseIdByAnnexId(CaseAttach caseAttach);
123
+
124
+    /**
125
+     * 仲裁员审核裁决书
126
+     * @param caseApplication
127
+     * @return
128
+     */
129
+    AjaxResult arbitratorCheckArbitrateRecord(CaseApplication caseApplication);
123
 }
130
 }

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

352
             datas.put("year", year);
352
             datas.put("year", year);
353
             String month = String.format("%02d", now.getMonthValue());
353
             String month = String.format("%02d", now.getMonthValue());
354
             String day = String.format("%02d", now.getDayOfMonth());
354
             String day = String.format("%02d", now.getDayOfMonth());
355
-            // todo 服务器路径
356
             String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx";
355
             String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx";
357
 //             String modalFilePath = "D:/新裁决书模板.docx";
356
 //             String modalFilePath = "D:/新裁决书模板.docx";
358
             // todo 服务器路径
357
             // todo 服务器路径

+ 37
- 51
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Просмотреть файл

393
         if (file.isEmpty()) {
393
         if (file.isEmpty()) {
394
             return AjaxResult.error("请选择要上传的文件");
394
             return AjaxResult.error("请选择要上传的文件");
395
         }
395
         }
396
-        // todo 服务器上要放开
396
+        // todo 服务器路径需要改
397
         String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile";
397
         String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile";
398
-//         String targetPath = "D:/zip";
398
+//         String targetPath = "D:/";
399
         File zipFile = null;
399
         File zipFile = null;
400
         InputStream ins = null;
400
         InputStream ins = null;
401
         try {
401
         try {
412
         String zipName = file.getOriginalFilename();
412
         String zipName = file.getOriginalFilename();
413
         String subzipName = zipName.substring(0, zipName.indexOf(".zip"));
413
         String subzipName = zipName.substring(0, zipName.indexOf(".zip"));
414
 //        String zipPath = "F:\\testZip\\uploadPath\\upload\\upload1\\unzipFile\\"+subzipName;
414
 //        String zipPath = "F:\\testZip\\uploadPath\\upload\\upload1\\unzipFile\\"+subzipName;
415
-        // todo 服务器上要放开
416
         String zipPath = "/home/ruoyi/uploadPath/upload/unzipFile/" + subzipName;
415
         String zipPath = "/home/ruoyi/uploadPath/upload/unzipFile/" + subzipName;
417
 //        String zipPath = "D:/" + subzipName;
416
 //        String zipPath = "D:/" + subzipName;
418
 
417
 
506
                     String year = Integer.toString(now.getYear());
505
                     String year = Integer.toString(now.getYear());
507
                     String month = String.format("%02d", now.getMonthValue());
506
                     String month = String.format("%02d", now.getMonthValue());
508
                     String day = String.format("%02d", now.getDayOfMonth());
507
                     String day = String.format("%02d", now.getDayOfMonth());
508
+                    //  // todo 服务器路径需要改
509
                     String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
509
                     String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
510
-//                    String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day;
510
+//                    String saveFolderPath = "D:/" + year + "/" + month + "/" + day;
511
                     String fileName = UUID.randomUUID().toString().replace("-", "") + "_" + substrfile;
511
                     String fileName = UUID.randomUUID().toString().replace("-", "") + "_" + substrfile;
512
                     String resultFilePath = saveFolderPath + "/" + fileName;
512
                     String resultFilePath = saveFolderPath + "/" + fileName;
513
                     try {
513
                     try {
1931
     }
1931
     }
1932
 
1932
 
1933
     /**
1933
     /**
1934
-     * 仲裁员,部门长审核裁决书
1934
+     * 部门长审核裁决书
1935
      * @param caseApplication
1935
      * @param caseApplication
1936
      * @return
1936
      * @return
1937
      */
1937
      */
1938
     @Override
1938
     @Override
1939
     @Transactional
1939
     @Transactional
1940
     public AjaxResult checkArbitrateRecord(CaseApplication caseApplication) {
1940
     public AjaxResult checkArbitrateRecord(CaseApplication caseApplication) {
1941
-        // 查询当前登录人角色
1942
-        LoginUser loginUser = getLoginUser();
1943
-        // 查询登录人角色
1944
-        SysUser user = sysUserMapper.selectUserById(loginUser.getUser().getUserId());
1945
-        List<SysRole> roles = user.getRoles();  if (CollectionUtil.isEmpty(roles)) {
1946
-            throw new ServiceException("该用户没有角色权限");
1947
-        }
1948
-        String roleName="";
1949
-        for (SysRole role : roles) {
1950
-            if (StrUtil.isEmpty(role.getRoleName())) {
1951
-                continue;
1952
-            }
1953
-            roleName=role.getRoleName();
1954
-        }
1955
-        // 如果是仲裁员,同意后状态改为待部门长审核仲裁文书(CHECK_ARBITRATION = 12),拒绝改为待秘书核验仲裁文书(VERPRIF_ARBITRATION = 11)
1956
-        // 如果是部门长,同意后状态改为待仲裁文书签名(SIGN_ARBITRATION = 13),拒绝改为待仲裁员审核仲裁文书(HEAD_CHECK_ARBITRATION = 18)
1957
-
1958
         int rows = 0;
1941
         int rows = 0;
1959
         ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
1942
         ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
1960
         arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
1943
         arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
1970
                             String annexPath = caseAttach.getAnnexPath();
1953
                             String annexPath = caseAttach.getAnnexPath();
1971
                             String path = "/home/ruoyi" + annexPath;
1954
                             String path = "/home/ruoyi" + annexPath;
1972
                             // System.out.println("这是查询到的裁决书路径" + path);
1955
                             // System.out.println("这是查询到的裁决书路径" + path);
1973
-                           // String path = "D:\\home\\新裁决书模板.docx";
1956
+                            // String path = "D:\\home\\新裁决书模板.docx";
1974
                             //获取文件上传地址
1957
                             //获取文件上传地址
1975
                             EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
1958
                             EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
1976
                             String body = response.getBody();
1959
                             String body = response.getBody();
2139
             } catch (InterruptedException e) {
2122
             } catch (InterruptedException e) {
2140
                 e.printStackTrace();
2123
                 e.printStackTrace();
2141
             }
2124
             }
2142
-            // 如果是仲裁员,同意后状态改为待部门长审核仲裁文书(CHECK_ARBITRATION = 12)
2143
-            if(roleName.contains("仲裁员")){
2144
-                caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION);
2145
-            }else  if(roleName.contains("仲裁委")||roleName.contains("部门长")){
2146
-                // 如果是部门长,同意后状态改为待仲裁文书签名(SIGN_ARBITRATION = 13),
2147
-                caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION);
2148
-            }
2149
-
2150
-
2151
-
2125
+            caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION);
2152
             // 新增日志
2126
             // 新增日志
2153
-            insertCaseLog(caseApplication.getId(), caseApplication.getCaseStatus(), "");
2127
+            insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_ARBITRATION, "");
2154
 
2128
 
2155
             rows = caseApplicationMapper.submitCaseApplication(caseApplication);
2129
             rows = caseApplicationMapper.submitCaseApplication(caseApplication);
2156
         } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核
2130
         } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核
2157
-            // 如果是仲裁员,拒绝改为待秘书核验仲裁文书(VERPRIF_ARBITRATION = 11)
2158
-            if(roleName.contains("仲裁员")){
2159
-                caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
2160
-            }else  if(roleName.contains("仲裁委")||roleName.contains("部门长")){
2161
-                // 如果是部门长,拒绝改为待仲裁员审核仲裁文书(HEAD_CHECK_ARBITRATION = 18)
2162
-                caseApplication.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION);
2163
-            }
2131
+            caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
2164
             // 新增日志
2132
             // 新增日志
2165
-            insertCaseLog(caseApplication.getId(), caseApplication.getCaseStatus(), "");
2133
+            insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
2166
 
2134
 
2167
             rows = caseApplicationMapper.submitCaseApplication(caseApplication);
2135
             rows = caseApplicationMapper.submitCaseApplication(caseApplication);
2168
         }
2136
         }
2170
         return success();
2138
         return success();
2171
     }
2139
     }
2172
 
2140
 
2141
+    /**
2142
+     * 仲裁员审核裁决书
2143
+     * @param caseApplication
2144
+     * @return
2145
+     */
2146
+    @Override
2147
+    public AjaxResult arbitratorCheckArbitrateRecord(CaseApplication caseApplication) {
2148
+        // 同意后状态改为待部门长审核仲裁文书(CHECK_ARBITRATION = 12),拒绝改为待秘书核验仲裁文书(VERPRIF_ARBITRATION = 11)
2149
+
2150
+        return null;
2151
+    }
2152
+
2173
     @Override
2153
     @Override
2174
     @Transactional
2154
     @Transactional
2175
     public int submitCaseApplicationCheck(List<Long> ids, Integer agreeOrNotCheck) {
2155
     public int submitCaseApplicationCheck(List<Long> ids, Integer agreeOrNotCheck) {
2974
             return AjaxResult.error("请选择要上传的文件");
2954
             return AjaxResult.error("请选择要上传的文件");
2975
         }
2955
         }
2976
         UUID uuid = UUID.randomUUID();
2956
         UUID uuid = UUID.randomUUID();
2977
-        // todo 服务器上要放开
2957
+        // todo 服务器路径需要改
2978
         String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile/"+uuid+ "/";
2958
         String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile/"+uuid+ "/";
2979
 //        String targetPath = "D:/zip";
2959
 //        String targetPath = "D:/zip";
2980
         File zipFile = null;
2960
         File zipFile = null;
2982
         try {
2962
         try {
2983
             ins = file.getInputStream();
2963
             ins = file.getInputStream();
2984
             //上传的压缩包保存的路径
2964
             //上传的压缩包保存的路径
2985
-            // todo 服务器上要放开
2965
+            // todo 服务器路径需要改
2986
             String savePath = "/home/ruoyi/uploadPath/upload/zipFile/";
2966
             String savePath = "/home/ruoyi/uploadPath/upload/zipFile/";
2987
 //           String savePath = "D:/zip/";
2967
 //           String savePath = "D:/zip/";
2988
             String saveName = uuid + "_" + file.getOriginalFilename();
2968
             String saveName = uuid + "_" + file.getOriginalFilename();
3001
                     // oc识别pdf并组装数据
2981
                     // oc识别pdf并组装数据
3002
                     // 抓取申请书
2982
                     // 抓取申请书
3003
                     if(!OCRAndBuildInfo(andConvertPDF, "仲裁申请书", map)){
2983
                     if(!OCRAndBuildInfo(andConvertPDF, "仲裁申请书", map)){
3004
-                        return AjaxResult.error("文件转base64编码有误,请检查");
2984
+                        return AjaxResult.error("未找到该路径:"+andConvertPDF);
3005
                     }
2985
                     }
3006
                     // 抓取调节协议书
2986
                     // 抓取调节协议书
3007
                 if(!OCRAndBuildInfo(andConvertPDF, "调解协议", map)){
2987
                 if(!OCRAndBuildInfo(andConvertPDF, "调解协议", map)){
3008
-                    return AjaxResult.error("文件转base64编码有误,请检查");
2988
+                    return AjaxResult.error("未找到该路径:"+andConvertPDF);
3009
                 }
2989
                 }
3010
                 // 抓取合同
2990
                 // 抓取合同
3011
-                if(!OCRAndBuildInfo(andConvertPDF, "合同", map)){
3012
-                    return AjaxResult.error("文件转base64编码有误,请检查");
2991
+                if(!OCRAndBuildInfo(andConvertPDF, "贷款合同", map)){
2992
+                    return AjaxResult.error("未找到该路径:"+andConvertPDF);
3013
                 }
2993
                 }
3014
                 if(!OCRAndBuildInfo(andConvertPDF, "授权委托书", map)){
2994
                 if(!OCRAndBuildInfo(andConvertPDF, "授权委托书", map)){
3015
-                    return AjaxResult.error("文件转base64编码有误,请检查");
2995
+                    return AjaxResult.error("未找到该路径:"+andConvertPDF);
3016
                 }
2996
                 }
3017
 
2997
 
3018
                 if (map.size()>0){
2998
                 if (map.size()>0){
3206
 
3186
 
3207
     private boolean OCRAndBuildInfo( Map<String, String> andConvertPDF, String mapKey, Map<String, List<String>> map) {
3187
     private boolean OCRAndBuildInfo( Map<String, String> andConvertPDF, String mapKey, Map<String, List<String>> map) {
3208
         String pdfUrl = andConvertPDF.get(mapKey);
3188
         String pdfUrl = andConvertPDF.get(mapKey);
3189
+
3209
         if(StrUtil.isEmpty(pdfUrl)){
3190
         if(StrUtil.isEmpty(pdfUrl)){
3210
-            return false;
3191
+            throw new ServiceException("pdfUrl:"+pdfUrl+"===mapKey:"+mapKey);
3192
+          //  return false;
3211
         }
3193
         }
3212
         //获取文件的页数
3194
         //获取文件的页数
3213
         int fileNumPage = getFileNumPage(pdfUrl);
3195
         int fileNumPage = getFileNumPage(pdfUrl);
3214
         //文件转成base64
3196
         //文件转成base64
3215
         String base64 = OCRUtils.pdfConvertBase64(pdfUrl);
3197
         String base64 = OCRUtils.pdfConvertBase64(pdfUrl);
3216
         if (base64 == null){
3198
         if (base64 == null){
3217
-            return false;
3199
+            throw new ServiceException("文件转成base64 pdfUrl:"+pdfUrl+"===mapKey:"+mapKey);
3200
+          //  return false;
3218
         }
3201
         }
3219
         StringBuilder stringBuilder = new StringBuilder(); // 创建一个StringBuilder对象
3202
         StringBuilder stringBuilder = new StringBuilder(); // 创建一个StringBuilder对象
3220
         for (int i = 0; i < fileNumPage; i++) {
3203
         for (int i = 0; i < fileNumPage; i++) {
3304
         return success();
3287
         return success();
3305
     }
3288
     }
3306
 
3289
 
3290
+
3307
     public static Map<String,String> findAndConvertPDF(File directory) {
3291
     public static Map<String,String> findAndConvertPDF(File directory) {
3308
        Map<String,String> pdfPathMap= new HashMap<>();
3292
        Map<String,String> pdfPathMap= new HashMap<>();
3309
         if (directory.isFile()) {
3293
         if (directory.isFile()) {
3452
     private static String convertToPDF(File file) {
3436
     private static String convertToPDF(File file) {
3453
         String wordFilePath = file.getAbsolutePath();
3437
         String wordFilePath = file.getAbsolutePath();
3454
         //String pdfSaveDirectory = "D:\\home\\unzip\\wordToPDF\\";
3438
         //String pdfSaveDirectory = "D:\\home\\unzip\\wordToPDF\\";
3439
+        // todo 服务器路径需要改
3455
         String pdfSaveDirectory = "/home/ruoyi/uploadPath/upload/wordToPDF/";
3440
         String pdfSaveDirectory = "/home/ruoyi/uploadPath/upload/wordToPDF/";
3441
+//        String pdfSaveDirectory = "D:/";
3456
         File directory = new File(pdfSaveDirectory);
3442
         File directory = new File(pdfSaveDirectory);
3457
         if (!directory.exists()) {
3443
         if (!directory.exists()) {
3458
             directory.mkdirs();
3444
             directory.mkdirs();

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java Просмотреть файл

65
             if(type.contains("申请书")){
65
             if(type.contains("申请书")){
66
                 req.setItemNames(applicantName);
66
                 req.setItemNames(applicantName);
67
             }else if(type.contains("调解协议")){
67
             }else if(type.contains("调解协议")){
68
-             //   req.setItemNames(accordName);
68
+                req.setItemNames(accordName);
69
             }else if(type.contains("合同")){
69
             }else if(type.contains("合同")){
70
                 req.setItemNames(contractName);
70
                 req.setItemNames(contractName);
71
             }else if(type.contains("授权委托书")){
71
             }else if(type.contains("授权委托书")){

+ 2
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml Просмотреть файл

20
     </insert>
20
     </insert>
21
     <insert id="batchSave" useGeneratedKeys="true" keyProperty="annexId">
21
     <insert id="batchSave" useGeneratedKeys="true" keyProperty="annexId">
22
         INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload)
22
         INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload)
23
+        VALUES
23
         <foreach item="item" index="index" collection="list" separator=",">
24
         <foreach item="item" index="index" collection="list" separator=",">
24
 
25
 
25
-        VALUES
26
+
26
          (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.userId},#{item.userName},#{item.sealStatus},#{item.isBatchUpload})
27
          (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.userId},#{item.userName},#{item.sealStatus},#{item.isBatchUpload})
27
         </foreach>
28
         </foreach>
28
     </insert>
29
     </insert>