This commit is contained in:
hejinbo
2023-10-12 11:42:12 +08:00
parent e8785fd5b2
commit 9c6303addb
3 changed files with 80 additions and 29 deletions
@@ -118,20 +118,6 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
datas.put("rulingFollows", arbitrateRecord1.getRulingFollows());
}
datas.put("legalProvisions", "仲裁法");
if (arbitratorName == null) {
datas.put("arbitratorName1", null);
datas.put("arbitratorName2", null);
} else if (arbitratorName.contains(",")) {
String[] nameArray = arbitratorName.split(",");
String firstName = nameArray[0];
String secondName = nameArray[1];
datas.put("arbitratorName1", firstName);
datas.put("arbitratorName2", secondName);
} else {
String secondName = "";
datas.put("arbitratorName1", arbitratorName);
datas.put("arbitratorName2", secondName);
}
LocalDate now = LocalDate.now();
String year = Integer.toString(now.getYear());
String month = String.format("%02d", now.getMonthValue());
@@ -4,10 +4,14 @@ package com.ruoyi.wisdomarbitrate.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.constant.CaseApplicationConstants;
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SmsUtils;
@@ -21,6 +25,8 @@ import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -47,6 +53,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
private CaseAttachMapper caseAttachMapper;
@Autowired
private SysDeptMapper sysDeptMapper;
@Autowired
private ICaseApplicationService caseApplicationService;
// 手机号正则
private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
@@ -690,10 +699,48 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck();
if(agreeOrNotCheck.intValue()==1){//同意审核
try {
//获取当前案件的裁决书
CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication);
List<CaseAttach> caseAttachList = caseApplication2.getCaseAttachList();
if (caseAttachList != null && caseAttachList.size() > 0) {
for (CaseAttach caseAttach : caseAttachList) {
if (caseAttach.getAnnexType() == 3) {
String annexPath = caseAttach.getAnnexPath();
String path = "/home/ruoyi/" + annexPath;
//获取文件上传地址
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
String body = response.getBody();
if (body != null){
JSONObject jsonObject = JSONObject.parseObject(body);
String fileId = jsonObject.getJSONObject("data").getString("fileId");
String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl");
//上传文件流
EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path);
JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
if (jsonObject1.getIntValue("errCode")==0){
//查看文件上传状态
Thread.sleep(5000);
EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
int fileStatus = jsonObject2.getJSONObject("data").getIntValue("fileStatus");
if (fileStatus == 2 || fileStatus == 5){
//上传成功,发起签署流程
//保存案件id,文件id,文件名称.流程id到签署用印记录表里
}
}
}
}
}
}
} catch (EsignDemoException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.SIGN_ARBITRATION,"");
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
}else if(agreeOrNotCheck.intValue()==2){//拒绝审核
caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);