|
|
@@ -37,120 +37,127 @@ public class FixSelectFlowDetailUtils {
|
|
37
|
37
|
@Autowired
|
|
38
|
38
|
private DeptIdentifyMapper deptIdentifyMapper;
|
|
39
|
39
|
|
|
40
|
|
- @Scheduled(cron = "0/3 * * * * ?")
|
|
|
40
|
+ @Scheduled(cron = "0/10 * * * * ?")
|
|
41
|
41
|
@Transactional
|
|
42
|
|
- public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException {
|
|
|
42
|
+ public void fixExecuteSelectFlowDetailUtils(){
|
|
43
|
43
|
Gson gson = new Gson();
|
|
44
|
44
|
|
|
45
|
45
|
SealSignRecord sealSignRecordselect = new SealSignRecord();
|
|
46
|
46
|
// sealSignRecordselect.setSignFlowStatus(1);
|
|
47
|
47
|
List<SealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat(sealSignRecordselect);
|
|
48
|
|
- if(sealSignRecords!=null&&sealSignRecords.size()>0){
|
|
49
|
|
- for (int i = 0; i < sealSignRecords.size(); i++) {
|
|
50
|
|
- SealSignRecord sealSignRecord = sealSignRecords.get(i);
|
|
51
|
|
- EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
|
|
52
|
|
- JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
|
|
53
|
|
- JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
|
|
54
|
|
- JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
|
|
55
|
|
- Integer psnsignStatus = null;
|
|
56
|
|
- Integer orgsignStatus = null;
|
|
57
|
|
- for (int j = 0; j < signersArray.size(); j++) {
|
|
58
|
|
- JsonObject signerObject = (JsonObject)signersArray.get(j);
|
|
59
|
|
-
|
|
60
|
|
- if(!(signerObject.get("psnSigner").toString()).equals("null")){
|
|
61
|
|
- JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner");
|
|
62
|
|
- if(psnSignerData!=null){
|
|
63
|
|
- psnsignStatus = signerObject.get("signStatus").getAsInt();
|
|
|
48
|
+
|
|
|
49
|
+ try {
|
|
|
50
|
+ if(sealSignRecords!=null&&sealSignRecords.size()>0){
|
|
|
51
|
+ for (int i = 0; i < sealSignRecords.size(); i++) {
|
|
|
52
|
+ SealSignRecord sealSignRecord = sealSignRecords.get(i);
|
|
|
53
|
+ EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
|
|
|
54
|
+ JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
|
|
|
55
|
+ JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
|
|
|
56
|
+ JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
|
|
|
57
|
+ Integer psnsignStatus = null;
|
|
|
58
|
+ Integer orgsignStatus = null;
|
|
|
59
|
+ for (int j = 0; j < signersArray.size(); j++) {
|
|
|
60
|
+ JsonObject signerObject = (JsonObject)signersArray.get(j);
|
|
|
61
|
+
|
|
|
62
|
+ if(!(signerObject.get("psnSigner").toString()).equals("null")){
|
|
|
63
|
+ JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner");
|
|
|
64
|
+ if(psnSignerData!=null){
|
|
|
65
|
+ psnsignStatus = signerObject.get("signStatus").getAsInt();
|
|
|
66
|
+ }
|
|
64
|
67
|
}
|
|
65
|
|
- }
|
|
66
|
|
- if(!(signerObject.get("orgSigner").toString()).equals("null")){
|
|
67
|
|
- JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
|
|
68
|
|
- if(orgSignerData!=null){
|
|
69
|
|
- orgsignStatus = signerObject.get("signStatus").getAsInt();
|
|
|
68
|
+ if(!(signerObject.get("orgSigner").toString()).equals("null")){
|
|
|
69
|
+ JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
|
|
|
70
|
+ if(orgSignerData!=null){
|
|
|
71
|
+ orgsignStatus = signerObject.get("signStatus").getAsInt();
|
|
|
72
|
+ }
|
|
70
|
73
|
}
|
|
71
|
|
- }
|
|
72
|
74
|
|
|
73
|
|
- }
|
|
74
|
|
- if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==1)){
|
|
75
|
|
- //更新立案申请状态为待用印
|
|
76
|
|
- CaseApplication caseApplication = new CaseApplication();
|
|
77
|
|
- caseApplication.setId(sealSignRecord.getCaseAppliId());
|
|
78
|
|
-
|
|
79
|
|
- CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
80
|
|
- if(caseApplicationselect!=null){
|
|
81
|
|
- if((caseApplicationselect.getCaseStatus()!=null)&&(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.SIGN_ARBITRATION)){
|
|
82
|
|
- caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
|
|
83
|
|
- caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
84
|
|
-
|
|
85
|
|
- //修改"签署用印记录表"的状态为待用印
|
|
86
|
|
- sealSignRecord.setSignFlowStatus(2);
|
|
87
|
|
- sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
|
|
88
|
|
- }
|
|
89
|
75
|
}
|
|
90
|
|
-
|
|
91
|
|
- }
|
|
92
|
|
- if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==2)){
|
|
93
|
|
- //更新立案申请状态为待送达
|
|
94
|
|
- CaseApplication caseApplication = new CaseApplication();
|
|
95
|
|
- caseApplication.setId(sealSignRecord.getCaseAppliId());
|
|
96
|
|
-
|
|
97
|
|
- CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
98
|
|
- if(caseApplicationselect!=null){
|
|
99
|
|
- if((caseApplicationselect.getCaseStatus()!=null)&&(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.ARBITRATED_SEAL)){
|
|
100
|
|
- caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY);
|
|
101
|
|
- //下载审核完成的裁决书,
|
|
102
|
|
- String signFlowId = sealSignRecord.getSignFlowid();
|
|
103
|
|
- EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
|
|
104
|
|
- JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(),JsonObject.class);
|
|
105
|
|
- JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
|
|
106
|
|
- JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
|
|
107
|
|
- if(filesArray!=null&&filesArray.size()>0){
|
|
108
|
|
- JsonObject fileObject = (JsonObject)filesArray.get(0);
|
|
109
|
|
- String fileDownloadUrl = fileObject.get("downloadUrl").toString();
|
|
110
|
|
- //修改"签署用印记录表"的状态为签署完成
|
|
111
|
|
- sealSignRecord.setSignFlowStatus(3);
|
|
112
|
|
- sealSignRecord.setFileDownloadUrl(fileDownloadUrl.substring(1,fileDownloadUrl.length()-1));
|
|
113
|
|
- sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
|
|
114
|
|
-
|
|
115
|
|
- String filearbitraUrl = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1);
|
|
116
|
|
- caseApplication.setFilearbitraUrl(filearbitraUrl);
|
|
|
76
|
+ if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==1)){
|
|
|
77
|
+ //更新立案申请状态为待用印
|
|
|
78
|
+ CaseApplication caseApplication = new CaseApplication();
|
|
|
79
|
+ caseApplication.setId(sealSignRecord.getCaseAppliId());
|
|
|
80
|
+
|
|
|
81
|
+ CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
|
82
|
+ if(caseApplicationselect!=null){
|
|
|
83
|
+ if((caseApplicationselect.getCaseStatus()!=null)&&(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.SIGN_ARBITRATION)){
|
|
|
84
|
+ caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
|
|
117
|
85
|
caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
118
|
86
|
|
|
119
|
|
- LocalDate now = LocalDate.now();
|
|
120
|
|
- String year = Integer.toString(now.getYear());
|
|
121
|
|
- String month = String.format("%02d", now.getMonthValue());
|
|
122
|
|
- String day = String.format("%02d", now.getDayOfMonth());
|
|
123
|
|
- String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
124
|
|
- String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
|
125
|
|
- String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
126
|
|
- String savePath = "/home/ruoyi/uploadPath/upload";
|
|
127
|
|
- String resultFilePath = saveFolderPath + "/" + fileName;
|
|
128
|
|
- String fileDownloadUrlnew = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1);
|
|
129
|
|
- FileTransformation.downLoadFileByUrl(fileDownloadUrlnew,resultFilePath);
|
|
130
|
|
-
|
|
131
|
|
- Long caseAppliId = sealSignRecord.getCaseAppliId();
|
|
132
|
|
- CaseAttach caseAttach = new CaseAttach();
|
|
133
|
|
- caseAttach.setCaseAppliId(caseAppliId);
|
|
134
|
|
- caseAttach.setAnnexType(3);
|
|
135
|
|
- caseAttach.setAnnexPath(savePath);
|
|
136
|
|
- caseAttach.setAnnexName(saveName);
|
|
137
|
|
- caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
|
138
|
|
-
|
|
|
87
|
+ //修改"签署用印记录表"的状态为待用印
|
|
|
88
|
+ sealSignRecord.setSignFlowStatus(2);
|
|
|
89
|
+ sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
|
|
139
|
90
|
}
|
|
140
|
91
|
}
|
|
|
92
|
+
|
|
141
|
93
|
}
|
|
|
94
|
+ if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==2)){
|
|
|
95
|
+ //更新立案申请状态为待送达
|
|
|
96
|
+ CaseApplication caseApplication = new CaseApplication();
|
|
|
97
|
+ caseApplication.setId(sealSignRecord.getCaseAppliId());
|
|
|
98
|
+
|
|
|
99
|
+ CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
|
100
|
+ if(caseApplicationselect!=null){
|
|
|
101
|
+ if((caseApplicationselect.getCaseStatus()!=null)&&(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.ARBITRATED_SEAL)){
|
|
|
102
|
+ caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY);
|
|
|
103
|
+ //下载审核完成的裁决书,
|
|
|
104
|
+ String signFlowId = sealSignRecord.getSignFlowid();
|
|
|
105
|
+ EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
|
|
|
106
|
+ JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(),JsonObject.class);
|
|
|
107
|
+ JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
|
|
|
108
|
+ JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
|
|
|
109
|
+ if(filesArray!=null&&filesArray.size()>0){
|
|
|
110
|
+ JsonObject fileObject = (JsonObject)filesArray.get(0);
|
|
|
111
|
+ String fileDownloadUrl = fileObject.get("downloadUrl").toString();
|
|
|
112
|
+ //修改"签署用印记录表"的状态为签署完成
|
|
|
113
|
+ sealSignRecord.setSignFlowStatus(3);
|
|
|
114
|
+ sealSignRecord.setFileDownloadUrl(fileDownloadUrl.substring(1,fileDownloadUrl.length()-1));
|
|
|
115
|
+ sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
|
|
|
116
|
+
|
|
|
117
|
+ String filearbitraUrl = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1);
|
|
|
118
|
+ caseApplication.setFilearbitraUrl(filearbitraUrl);
|
|
|
119
|
+ caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
|
120
|
+
|
|
|
121
|
+ LocalDate now = LocalDate.now();
|
|
|
122
|
+ String year = Integer.toString(now.getYear());
|
|
|
123
|
+ String month = String.format("%02d", now.getMonthValue());
|
|
|
124
|
+ String day = String.format("%02d", now.getDayOfMonth());
|
|
|
125
|
+ String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
|
126
|
+ String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
|
|
127
|
+ String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
|
128
|
+ String savePath = "/home/ruoyi/uploadPath/upload";
|
|
|
129
|
+ String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
130
|
+ String fileDownloadUrlnew = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1);
|
|
|
131
|
+ boolean b = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
|
|
132
|
+ if(b) {
|
|
|
133
|
+ Long caseAppliId = sealSignRecord.getCaseAppliId();
|
|
|
134
|
+ CaseAttach caseAttach = new CaseAttach();
|
|
|
135
|
+ caseAttach.setCaseAppliId(caseAppliId);
|
|
|
136
|
+ caseAttach.setAnnexType(3);
|
|
|
137
|
+ caseAttach.setAnnexPath(savePath);
|
|
|
138
|
+ caseAttach.setAnnexName(saveName);
|
|
|
139
|
+ caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
|
|
140
|
+ }
|
|
|
141
|
+
|
|
|
142
|
+ }
|
|
|
143
|
+ }
|
|
|
144
|
+ }
|
|
142
|
145
|
|
|
|
146
|
+ }
|
|
143
|
147
|
}
|
|
|
148
|
+
|
|
144
|
149
|
}
|
|
145
|
150
|
|
|
146
|
|
- }
|
|
147
|
151
|
|
|
148
|
152
|
|
|
|
153
|
+ } catch (EsignDemoException e) {
|
|
|
154
|
+ e.printStackTrace();
|
|
|
155
|
+ }
|
|
149
|
156
|
|
|
150
|
157
|
}
|
|
151
|
158
|
|
|
152
|
159
|
|
|
153
|
|
- @Scheduled(cron = "0/10 * * * * ?")
|
|
|
160
|
+ @Scheduled(cron = "0/30 * * * * ?")
|
|
154
|
161
|
@Transactional
|
|
155
|
162
|
public void fixExecuteSelectDeptIndentifyUtils() throws EsignDemoException {
|
|
156
|
163
|
Gson gson = new Gson();
|