Преглед на файлове

Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev

qtz преди 2 години
родител
ревизия
9132518de4

+ 9
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java Целия файл

@@ -99,6 +99,15 @@ public class CaseApplicationController extends BaseController {
99 99
         return success(caseApplicationselect);
100 100
     }
101 101
 
102
+    /**
103
+     * 查询已签署裁决书URL
104
+     */
105
+    @PostMapping("/selectSignSealUrl")
106
+    public AjaxResult selectSignSealUrl(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException {
107
+        CaseApplication caseApplicationselect = caseApplicationService.selectSignSealUrl(caseApplication);
108
+        return success(caseApplicationselect);
109
+    }
110
+
102 111
     /**
103 112
      * 查询签名链接
104 113
      */

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java Целия файл

@@ -50,4 +50,6 @@ public interface ICaseApplicationService {
50 50
     SealSignRecord selectSealUrl(CaseApplication caseApplication) throws EsignDemoException;
51 51
 
52 52
     AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecord);
53
+
54
+    CaseApplication selectSignSealUrl(CaseApplication caseApplication) throws EsignDemoException;
53 55
 }

+ 4
- 4
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Целия файл

@@ -126,10 +126,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
126 126
             datas.put("year", year);
127 127
             datas.put("months", month);
128 128
             datas.put("day", day);
129
-//            String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx";
130
-            String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
131
-//            String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
132
-            String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
129
+            String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx";
130
+//            String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
131
+            String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
132
+//            String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
133 133
             String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
134 134
             String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
135 135
             String resultFilePath = saveFolderPath + "/" + fileName;

+ 46
- 16
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Целия файл

@@ -1116,24 +1116,31 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1116 1116
 //            String savePath = saveFolderPath;
1117 1117
 //            saveName = fileName;
1118 1118
 
1119
-            //将庭审笔录保存到附件表里
1120
-            CaseAttach caseAttach = CaseAttach.builder()
1121
-                    .caseAppliId(id)
1122
-                    .annexName(saveName)
1123
-                    .annexPath(savePath) 
1124
-                    .annexType(7)
1125
-                    .build();
1126
-            int i = caseAttachMapper.save(caseAttach);
1127
-            if (i > 0) {
1128
-                if (arbitrateRecord1 != null) {
1129
-                    Integer annexId = caseAttach.getAnnexId();
1130
-                    //将附件id保存到仲裁记录表里面
1131
-                    arbitrateRecord1.setAnnexId(annexId);
1132
-                    arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1);
1133
-                }
1119
+            caseApplication.setAnnexType(7);
1120
+            List<CaseAttach> caseAttachs = caseAttachMapper.queryCaseAttachList(caseApplication);
1121
+            if(caseAttachs!=null&&caseAttachs.size()>0){
1122
+                CaseAttach caseAttach = CaseAttach.builder()
1123
+                        .caseAppliId(id)
1124
+                        .annexName(saveName)
1125
+                        .annexPath(savePath)
1126
+                        .annexType(7)
1127
+                        .build();
1128
+                int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
1129
+
1130
+            }else {
1131
+                //将庭审笔录保存到附件表里
1132
+                CaseAttach caseAttach = CaseAttach.builder()
1133
+                        .caseAppliId(id)
1134
+                        .annexName(saveName)
1135
+                        .annexPath(savePath)
1136
+                        .annexType(7)
1137
+                        .build();
1138
+                int i = caseAttachMapper.save(caseAttach);
1139
+
1134 1140
             }
1141
+
1135 1142
             //获取案件详细信息
1136
-            CaseApplication caseApplicationSelct = caseApplicationMapper.selectCaseApplication(caseApplication);
1143
+            CaseApplication caseApplicationSelct = selectCaseApplication(caseApplication);
1137 1144
             return AjaxResult.success(caseApplicationSelct);
1138 1145
         } catch (IOException e) {
1139 1146
             e.printStackTrace();
@@ -1142,6 +1149,29 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1142 1149
 
1143 1150
     }
1144 1151
 
1152
+    @Override
1153
+    public CaseApplication selectSignSealUrl(CaseApplication caseApplication) throws EsignDemoException {
1154
+        Gson gson = new Gson();
1155
+        SealSignRecord sealSignRecord = new SealSignRecord();
1156
+        sealSignRecord.setCaseAppliId(caseApplication.getId());
1157
+        List<SealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord);
1158
+        if(sealSignRecords!=null&&sealSignRecords.size()>0){
1159
+            String signFlowid = sealSignRecords.get(0).getSignFlowid();
1160
+            EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowid);
1161
+            JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(),JsonObject.class);
1162
+            JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
1163
+            JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
1164
+            if(filesArray!=null&&filesArray.size()>0){
1165
+                JsonObject fileObject = (JsonObject)filesArray.get(0);
1166
+                String fileDownloadUrl = fileObject.get("downloadUrl").toString();
1167
+                String filearbitraUrl  = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1);
1168
+                caseApplication.setFilearbitraUrl(filearbitraUrl);
1169
+            }
1170
+        }
1171
+
1172
+        return caseApplication;
1173
+    }
1174
+
1145 1175
     @Override
1146 1176
     @Transactional
1147 1177
     public int pendTralSure(CaseApplication caseApplication) {

+ 3
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java Целия файл

@@ -17,6 +17,7 @@ import com.ruoyi.wisdomarbitrate.mapper.SealSignRecordMapper;
17 17
 import org.springframework.beans.factory.annotation.Autowired;
18 18
 import org.springframework.scheduling.annotation.Scheduled;
19 19
 import org.springframework.stereotype.Component;
20
+import org.springframework.transaction.annotation.Transactional;
20 21
 
21 22
 import java.time.LocalDate;
22 23
 import java.util.List;
@@ -32,7 +33,8 @@ public class FixSelectFlowDetailUtils {
32 33
     @Autowired
33 34
     private CaseAttachMapper caseAttachMapper;
34 35
 
35
-//    @Scheduled(cron = "0/3 * * * * ?")
36
+    @Scheduled(cron = "0/3 * * * * ?")
37
+    @Transactional
36 38
     public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException {
37 39
         Gson gson = new Gson();
38 40