仲裁员审核裁决书

This commit is contained in:
18792927508
2023-12-05 15:19:36 +08:00
parent 8615b98be2
commit 33d44eed4d
6 changed files with 58 additions and 55 deletions
@@ -120,4 +120,11 @@ public interface ICaseApplicationService {
* @return
*/
AjaxResult updateCaseIdByAnnexId(CaseAttach caseAttach);
/**
* 仲裁员审核裁决书
* @param caseApplication
* @return
*/
AjaxResult arbitratorCheckArbitrateRecord(CaseApplication caseApplication);
}
@@ -352,7 +352,6 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
datas.put("year", year);
String month = String.format("%02d", now.getMonthValue());
String day = String.format("%02d", now.getDayOfMonth());
// todo 服务器路径
String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx";
// String modalFilePath = "D:/新裁决书模板.docx";
// todo 服务器路径
@@ -393,9 +393,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
if (file.isEmpty()) {
return AjaxResult.error("请选择要上传的文件");
}
// todo 服务器上要放开
// todo 服务器路径需要改
String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile";
// String targetPath = "D:/zip";
// String targetPath = "D:/";
File zipFile = null;
InputStream ins = null;
try {
@@ -412,7 +412,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
String zipName = file.getOriginalFilename();
String subzipName = zipName.substring(0, zipName.indexOf(".zip"));
// String zipPath = "F:\\testZip\\uploadPath\\upload\\upload1\\unzipFile\\"+subzipName;
// todo 服务器上要放开
String zipPath = "/home/ruoyi/uploadPath/upload/unzipFile/" + subzipName;
// String zipPath = "D:/" + subzipName;
@@ -506,8 +505,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
String year = Integer.toString(now.getYear());
String month = String.format("%02d", now.getMonthValue());
String day = String.format("%02d", now.getDayOfMonth());
// // todo 服务器路径需要改
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
// String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day;
// String saveFolderPath = "D:/" + year + "/" + month + "/" + day;
String fileName = UUID.randomUUID().toString().replace("-", "") + "_" + substrfile;
String resultFilePath = saveFolderPath + "/" + fileName;
try {
@@ -1931,30 +1931,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
}
/**
* 仲裁员,部门长审核裁决书
* 部门长审核裁决书
* @param caseApplication
* @return
*/
@Override
@Transactional
public AjaxResult checkArbitrateRecord(CaseApplication caseApplication) {
// 查询当前登录人角色
LoginUser loginUser = getLoginUser();
// 查询登录人角色
SysUser user = sysUserMapper.selectUserById(loginUser.getUser().getUserId());
List<SysRole> roles = user.getRoles(); if (CollectionUtil.isEmpty(roles)) {
throw new ServiceException("该用户没有角色权限");
}
String roleName="";
for (SysRole role : roles) {
if (StrUtil.isEmpty(role.getRoleName())) {
continue;
}
roleName=role.getRoleName();
}
// 如果是仲裁员,同意后状态改为待部门长审核仲裁文书(CHECK_ARBITRATION = 12),拒绝改为待秘书核验仲裁文书(VERPRIF_ARBITRATION = 11)
// 如果是部门长,同意后状态改为待仲裁文书签名(SIGN_ARBITRATION = 13),拒绝改为待仲裁员审核仲裁文书(HEAD_CHECK_ARBITRATION = 18)
int rows = 0;
ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
@@ -1970,7 +1953,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
String annexPath = caseAttach.getAnnexPath();
String path = "/home/ruoyi" + annexPath;
// System.out.println("这是查询到的裁决书路径" + path);
// String path = "D:\\home\\新裁决书模板.docx";
// String path = "D:\\home\\新裁决书模板.docx";
//获取文件上传地址
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
String body = response.getBody();
@@ -2139,30 +2122,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
} catch (InterruptedException e) {
e.printStackTrace();
}
// 如果是仲裁员,同意后状态改为待部门长审核仲裁文书(CHECK_ARBITRATION = 12)
if(roleName.contains("仲裁员")){
caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION);
}else if(roleName.contains("仲裁委")||roleName.contains("部门长")){
// 如果是部门长,同意后状态改为待仲裁文书签名(SIGN_ARBITRATION = 13),
caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION);
}
caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION);
// 新增日志
insertCaseLog(caseApplication.getId(), caseApplication.getCaseStatus(), "");
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_ARBITRATION, "");
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
} else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核
// 如果是仲裁员,拒绝改为待秘书核验仲裁文书(VERPRIF_ARBITRATION = 11)
if(roleName.contains("仲裁员")){
caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
}else if(roleName.contains("仲裁委")||roleName.contains("部门长")){
// 如果是部门长,拒绝改为待仲裁员审核仲裁文书(HEAD_CHECK_ARBITRATION = 18)
caseApplication.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION);
}
caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
// 新增日志
insertCaseLog(caseApplication.getId(), caseApplication.getCaseStatus(), "");
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
}
@@ -2170,6 +2138,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
return success();
}
/**
* 仲裁员审核裁决书
* @param caseApplication
* @return
*/
@Override
public AjaxResult arbitratorCheckArbitrateRecord(CaseApplication caseApplication) {
// 同意后状态改为待部门长审核仲裁文书(CHECK_ARBITRATION = 12),拒绝改为待秘书核验仲裁文书(VERPRIF_ARBITRATION = 11)
return null;
}
@Override
@Transactional
public int submitCaseApplicationCheck(List<Long> ids, Integer agreeOrNotCheck) {
@@ -2974,7 +2954,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
return AjaxResult.error("请选择要上传的文件");
}
UUID uuid = UUID.randomUUID();
// todo 服务器上要放开
// todo 服务器路径需要改
String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile/"+uuid+ "/";
// String targetPath = "D:/zip";
File zipFile = null;
@@ -2982,7 +2962,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
try {
ins = file.getInputStream();
//上传的压缩包保存的路径
// todo 服务器上要放开
// todo 服务器路径需要改
String savePath = "/home/ruoyi/uploadPath/upload/zipFile/";
// String savePath = "D:/zip/";
String saveName = uuid + "_" + file.getOriginalFilename();
@@ -3001,18 +2981,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
// oc识别pdf并组装数据
// 抓取申请书
if(!OCRAndBuildInfo(andConvertPDF, "仲裁申请书", map)){
return AjaxResult.error("文件转base64编码有误,请检查");
return AjaxResult.error("未找到该路径:"+andConvertPDF);
}
// 抓取调节协议书
if(!OCRAndBuildInfo(andConvertPDF, "调解协议", map)){
return AjaxResult.error("文件转base64编码有误,请检查");
return AjaxResult.error("未找到该路径:"+andConvertPDF);
}
// 抓取合同
if(!OCRAndBuildInfo(andConvertPDF, "合同", map)){
return AjaxResult.error("文件转base64编码有误,请检查");
if(!OCRAndBuildInfo(andConvertPDF, "贷款合同", map)){
return AjaxResult.error("未找到该路径:"+andConvertPDF);
}
if(!OCRAndBuildInfo(andConvertPDF, "授权委托书", map)){
return AjaxResult.error("文件转base64编码有误,请检查");
return AjaxResult.error("未找到该路径:"+andConvertPDF);
}
if (map.size()>0){
@@ -3206,15 +3186,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
private boolean OCRAndBuildInfo( Map<String, String> andConvertPDF, String mapKey, Map<String, List<String>> map) {
String pdfUrl = andConvertPDF.get(mapKey);
if(StrUtil.isEmpty(pdfUrl)){
return false;
throw new ServiceException("pdfUrl:"+pdfUrl+"===mapKey:"+mapKey);
// return false;
}
//获取文件的页数
int fileNumPage = getFileNumPage(pdfUrl);
//文件转成base64
String base64 = OCRUtils.pdfConvertBase64(pdfUrl);
if (base64 == null){
return false;
throw new ServiceException("文件转成base64 pdfUrl:"+pdfUrl+"===mapKey:"+mapKey);
// return false;
}
StringBuilder stringBuilder = new StringBuilder(); // 创建一个StringBuilder对象
for (int i = 0; i < fileNumPage; i++) {
@@ -3304,6 +3287,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
return success();
}
public static Map<String,String> findAndConvertPDF(File directory) {
Map<String,String> pdfPathMap= new HashMap<>();
if (directory.isFile()) {
@@ -3452,7 +3436,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
private static String convertToPDF(File file) {
String wordFilePath = file.getAbsolutePath();
//String pdfSaveDirectory = "D:\\home\\unzip\\wordToPDF\\";
// todo 服务器路径需要改
String pdfSaveDirectory = "/home/ruoyi/uploadPath/upload/wordToPDF/";
// String pdfSaveDirectory = "D:/";
File directory = new File(pdfSaveDirectory);
if (!directory.exists()) {
directory.mkdirs();
@@ -65,7 +65,7 @@ public class OCRUtils {
if(type.contains("申请书")){
req.setItemNames(applicantName);
}else if(type.contains("调解协议")){
// req.setItemNames(accordName);
req.setItemNames(accordName);
}else if(type.contains("合同")){
req.setItemNames(contractName);
}else if(type.contains("授权委托书")){
@@ -20,9 +20,10 @@
</insert>
<insert id="batchSave" useGeneratedKeys="true" keyProperty="annexId">
INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload)
VALUES
<foreach item="item" index="index" collection="list" separator=",">
VALUES
(#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.userId},#{item.userName},#{item.sealStatus},#{item.isBatchUpload})
</foreach>
</insert>