|
|
@@ -393,9 +393,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
393
|
393
|
if (file.isEmpty()) {
|
|
394
|
394
|
return AjaxResult.error("请选择要上传的文件");
|
|
395
|
395
|
}
|
|
396
|
|
- // todo 服务器上要放开
|
|
|
396
|
+ // todo 服务器路径需要改
|
|
397
|
397
|
String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile";
|
|
398
|
|
-// String targetPath = "D:/zip";
|
|
|
398
|
+// String targetPath = "D:/";
|
|
399
|
399
|
File zipFile = null;
|
|
400
|
400
|
InputStream ins = null;
|
|
401
|
401
|
try {
|
|
|
@@ -412,7 +412,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
412
|
412
|
String zipName = file.getOriginalFilename();
|
|
413
|
413
|
String subzipName = zipName.substring(0, zipName.indexOf(".zip"));
|
|
414
|
414
|
// String zipPath = "F:\\testZip\\uploadPath\\upload\\upload1\\unzipFile\\"+subzipName;
|
|
415
|
|
- // todo 服务器上要放开
|
|
416
|
415
|
String zipPath = "/home/ruoyi/uploadPath/upload/unzipFile/" + subzipName;
|
|
417
|
416
|
// String zipPath = "D:/" + subzipName;
|
|
418
|
417
|
|
|
|
@@ -506,8 +505,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
506
|
505
|
String year = Integer.toString(now.getYear());
|
|
507
|
506
|
String month = String.format("%02d", now.getMonthValue());
|
|
508
|
507
|
String day = String.format("%02d", now.getDayOfMonth());
|
|
|
508
|
+ // // todo 服务器路径需要改
|
|
509
|
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
|
511
|
String fileName = UUID.randomUUID().toString().replace("-", "") + "_" + substrfile;
|
|
512
|
512
|
String resultFilePath = saveFolderPath + "/" + fileName;
|
|
513
|
513
|
try {
|
|
|
@@ -1931,30 +1931,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1931
|
1931
|
}
|
|
1932
|
1932
|
|
|
1933
|
1933
|
/**
|
|
1934
|
|
- * 仲裁员,部门长审核裁决书
|
|
|
1934
|
+ * 部门长审核裁决书
|
|
1935
|
1935
|
* @param caseApplication
|
|
1936
|
1936
|
* @return
|
|
1937
|
1937
|
*/
|
|
1938
|
1938
|
@Override
|
|
1939
|
1939
|
@Transactional
|
|
1940
|
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
|
1941
|
int rows = 0;
|
|
1959
|
1942
|
ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
|
|
1960
|
1943
|
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
|
|
|
@@ -1970,7 +1953,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1970
|
1953
|
String annexPath = caseAttach.getAnnexPath();
|
|
1971
|
1954
|
String path = "/home/ruoyi" + annexPath;
|
|
1972
|
1955
|
// System.out.println("这是查询到的裁决书路径" + path);
|
|
1973
|
|
- // String path = "D:\\home\\新裁决书模板.docx";
|
|
|
1956
|
+ // String path = "D:\\home\\新裁决书模板.docx";
|
|
1974
|
1957
|
//获取文件上传地址
|
|
1975
|
1958
|
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
|
1976
|
1959
|
String body = response.getBody();
|
|
|
@@ -2139,30 +2122,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2139
|
2122
|
} catch (InterruptedException e) {
|
|
2140
|
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
|
2129
|
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
2156
|
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
|
2135
|
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
2168
|
2136
|
}
|
|
|
@@ -2170,6 +2138,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2170
|
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
|
2153
|
@Override
|
|
2174
|
2154
|
@Transactional
|
|
2175
|
2155
|
public int submitCaseApplicationCheck(List<Long> ids, Integer agreeOrNotCheck) {
|
|
|
@@ -2974,7 +2954,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2974
|
2954
|
return AjaxResult.error("请选择要上传的文件");
|
|
2975
|
2955
|
}
|
|
2976
|
2956
|
UUID uuid = UUID.randomUUID();
|
|
2977
|
|
- // todo 服务器上要放开
|
|
|
2957
|
+ // todo 服务器路径需要改
|
|
2978
|
2958
|
String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile/"+uuid+ "/";
|
|
2979
|
2959
|
// String targetPath = "D:/zip";
|
|
2980
|
2960
|
File zipFile = null;
|
|
|
@@ -2982,7 +2962,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2982
|
2962
|
try {
|
|
2983
|
2963
|
ins = file.getInputStream();
|
|
2984
|
2964
|
//上传的压缩包保存的路径
|
|
2985
|
|
- // todo 服务器上要放开
|
|
|
2965
|
+ // todo 服务器路径需要改
|
|
2986
|
2966
|
String savePath = "/home/ruoyi/uploadPath/upload/zipFile/";
|
|
2987
|
2967
|
// String savePath = "D:/zip/";
|
|
2988
|
2968
|
String saveName = uuid + "_" + file.getOriginalFilename();
|
|
|
@@ -3001,18 +2981,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
3001
|
2981
|
// oc识别pdf并组装数据
|
|
3002
|
2982
|
// 抓取申请书
|
|
3003
|
2983
|
if(!OCRAndBuildInfo(andConvertPDF, "仲裁申请书", map)){
|
|
3004
|
|
- return AjaxResult.error("文件转base64编码有误,请检查");
|
|
|
2984
|
+ return AjaxResult.error("未找到该路径:"+andConvertPDF);
|
|
3005
|
2985
|
}
|
|
3006
|
2986
|
// 抓取调节协议书
|
|
3007
|
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
|
2994
|
if(!OCRAndBuildInfo(andConvertPDF, "授权委托书", map)){
|
|
3015
|
|
- return AjaxResult.error("文件转base64编码有误,请检查");
|
|
|
2995
|
+ return AjaxResult.error("未找到该路径:"+andConvertPDF);
|
|
3016
|
2996
|
}
|
|
3017
|
2997
|
|
|
3018
|
2998
|
if (map.size()>0){
|
|
|
@@ -3206,15 +3186,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
3206
|
3186
|
|
|
3207
|
3187
|
private boolean OCRAndBuildInfo( Map<String, String> andConvertPDF, String mapKey, Map<String, List<String>> map) {
|
|
3208
|
3188
|
String pdfUrl = andConvertPDF.get(mapKey);
|
|
|
3189
|
+
|
|
3209
|
3190
|
if(StrUtil.isEmpty(pdfUrl)){
|
|
3210
|
|
- return false;
|
|
|
3191
|
+ throw new ServiceException("pdfUrl:"+pdfUrl+"===mapKey:"+mapKey);
|
|
|
3192
|
+ // return false;
|
|
3211
|
3193
|
}
|
|
3212
|
3194
|
//获取文件的页数
|
|
3213
|
3195
|
int fileNumPage = getFileNumPage(pdfUrl);
|
|
3214
|
3196
|
//文件转成base64
|
|
3215
|
3197
|
String base64 = OCRUtils.pdfConvertBase64(pdfUrl);
|
|
3216
|
3198
|
if (base64 == null){
|
|
3217
|
|
- return false;
|
|
|
3199
|
+ throw new ServiceException("文件转成base64 pdfUrl:"+pdfUrl+"===mapKey:"+mapKey);
|
|
|
3200
|
+ // return false;
|
|
3218
|
3201
|
}
|
|
3219
|
3202
|
StringBuilder stringBuilder = new StringBuilder(); // 创建一个StringBuilder对象
|
|
3220
|
3203
|
for (int i = 0; i < fileNumPage; i++) {
|
|
|
@@ -3304,6 +3287,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
3304
|
3287
|
return success();
|
|
3305
|
3288
|
}
|
|
3306
|
3289
|
|
|
|
3290
|
+
|
|
3307
|
3291
|
public static Map<String,String> findAndConvertPDF(File directory) {
|
|
3308
|
3292
|
Map<String,String> pdfPathMap= new HashMap<>();
|
|
3309
|
3293
|
if (directory.isFile()) {
|
|
|
@@ -3452,7 +3436,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
3452
|
3436
|
private static String convertToPDF(File file) {
|
|
3453
|
3437
|
String wordFilePath = file.getAbsolutePath();
|
|
3454
|
3438
|
//String pdfSaveDirectory = "D:\\home\\unzip\\wordToPDF\\";
|
|
|
3439
|
+ // todo 服务器路径需要改
|
|
3455
|
3440
|
String pdfSaveDirectory = "/home/ruoyi/uploadPath/upload/wordToPDF/";
|
|
|
3441
|
+// String pdfSaveDirectory = "D:/";
|
|
3456
|
3442
|
File directory = new File(pdfSaveDirectory);
|
|
3457
|
3443
|
if (!directory.exists()) {
|
|
3458
|
3444
|
directory.mkdirs();
|