|
|
@@ -21,6 +21,8 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|
21
|
21
|
import org.springframework.stereotype.Component;
|
|
22
|
22
|
import org.springframework.transaction.annotation.Transactional;
|
|
23
|
23
|
|
|
|
24
|
+import java.io.File;
|
|
|
25
|
+import java.io.IOException;
|
|
24
|
26
|
import java.time.LocalDate;
|
|
25
|
27
|
import java.util.List;
|
|
26
|
28
|
import java.util.UUID;
|
|
|
@@ -38,6 +40,7 @@ public class FixSelectFlowDetailUtils {
|
|
38
|
40
|
private DeptIdentifyMapper deptIdentifyMapper;
|
|
39
|
41
|
|
|
40
|
42
|
@Scheduled(cron = "0/10 * * * * ?")
|
|
|
43
|
+// @Scheduled(cron = "0/30 * * * * ?")
|
|
41
|
44
|
@Transactional
|
|
42
|
45
|
public void fixExecuteSelectFlowDetailUtils(){
|
|
43
|
46
|
Gson gson = new Gson();
|
|
|
@@ -118,18 +121,29 @@ public class FixSelectFlowDetailUtils {
|
|
118
|
121
|
caseApplication.setFilearbitraUrl(filearbitraUrl);
|
|
119
|
122
|
caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
120
|
123
|
|
|
121
|
|
- /* LocalDate now = LocalDate.now();
|
|
|
124
|
+ LocalDate now = LocalDate.now();
|
|
122
|
125
|
String year = Integer.toString(now.getYear());
|
|
123
|
126
|
String month = String.format("%02d", now.getMonthValue());
|
|
124
|
127
|
String day = String.format("%02d", now.getDayOfMonth());
|
|
125
|
128
|
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
126
|
129
|
String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
|
127
|
130
|
String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
128
|
|
- String savePath = "/home/ruoyi/uploadPath/upload";
|
|
|
131
|
+ String savePath = "/home/ruoyi/uploadPath/upload/";
|
|
|
132
|
+
|
|
|
133
|
+ // 创建日期目录
|
|
|
134
|
+ File saveFolder = new File(saveFolderPath);
|
|
|
135
|
+ if (!saveFolder.exists()) {
|
|
|
136
|
+ saveFolder.mkdirs();
|
|
|
137
|
+ }
|
|
129
|
138
|
String resultFilePath = saveFolderPath + "/" + fileName;
|
|
130
|
|
- String fileDownloadUrlnew = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1);
|
|
131
|
|
- boolean b = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
|
132
|
|
- if(b) {
|
|
|
139
|
+ File resultFilePathFile = new File(resultFilePath);
|
|
|
140
|
+ if (!resultFilePathFile.exists()) {
|
|
|
141
|
+ resultFilePathFile.createNewFile();
|
|
|
142
|
+ }
|
|
|
143
|
+
|
|
|
144
|
+ String fileDownloadUrlnew = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1);
|
|
|
145
|
+ boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
|
|
146
|
+ if(downLoadFile) {
|
|
133
|
147
|
Long caseAppliId = sealSignRecord.getCaseAppliId();
|
|
134
|
148
|
CaseAttach caseAttach = new CaseAttach();
|
|
135
|
149
|
caseAttach.setCaseAppliId(caseAppliId);
|
|
|
@@ -137,7 +151,7 @@ public class FixSelectFlowDetailUtils {
|
|
137
|
151
|
caseAttach.setAnnexPath(savePath);
|
|
138
|
152
|
caseAttach.setAnnexName(saveName);
|
|
139
|
153
|
caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
|
140
|
|
- }*/
|
|
|
154
|
+ }
|
|
141
|
155
|
|
|
142
|
156
|
}
|
|
143
|
157
|
}
|
|
|
@@ -149,6 +163,8 @@ public class FixSelectFlowDetailUtils {
|
|
149
|
163
|
}
|
|
150
|
164
|
} catch (EsignDemoException e) {
|
|
151
|
165
|
e.printStackTrace();
|
|
|
166
|
+ }catch (IOException e) {
|
|
|
167
|
+ e.printStackTrace();
|
|
152
|
168
|
}
|
|
153
|
169
|
|
|
154
|
170
|
}
|