视频,用印回调,裁决书处理

This commit is contained in:
18792927508
2024-05-10 17:48:42 +08:00
parent 50a9e7242c
commit 44129c7cd0
28 changed files with 998 additions and 671 deletions
@@ -39,7 +39,7 @@ public class CaseApplication extends BaseEntity {
/** 立案日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date registerDate;
/** 仲裁方式 */
/** 仲裁方式 ,1-开庭,2-书面*/
private Integer arbitratMethod;
/**
* 是否导入,0手动录入,1导入,默认0
@@ -211,7 +211,7 @@ public class CaseApplication extends BaseEntity {
*/
private Integer financeStatus;
/**
* 是否是被申请人,仲裁员,部门长,财务,代理人,0-否,1-是
* 是否查询全部节点
*/
private Integer isOtherRole;
/**
@@ -58,6 +58,14 @@ public class SealSignRecord extends BaseEntity {
private double positionXorg;
/** 印章位置y坐标 */
private double positionYorg;
/**
* 仲裁员签名状态,1-签名
*/
private Integer signStatusArbitor;
/**
* 用印状态,1用印
*/
private Integer sealStatus;
@@ -149,4 +149,11 @@ public interface CaseApplicationMapper {
List<CaseApplication> list(@Param("caseApplication") CaseApplication caseApplication,
@Param("caseStatusList") List<Integer> caseStatusList,
@Param("roleNames") List<String> roleNames);
/**
* 查询当前案件节点
* @param id
* @return
*/
Integer selectCaseApplicationCaseStatus(@Param("id") Long id);
}
@@ -35,4 +35,12 @@ public interface CaseAttachMapper {
void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType,@Param("isBatchUpload") int isBatchUpload);
void deleteCaseAttachByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType);
/**
* 删除存在的附件不包括该附件
* @param caseId 附件
* @param type 附件类型
* @param annexId 附件id
*/
void deleteCaseAttach(@Param("caseId")Long caseId, @Param("type")int type,@Param("annexId") Long annexId);
}
@@ -12,5 +12,7 @@ public interface CaseEvidenceMapper {
List<CaseEvidenceVO> getCaseListByRespondent(@Param(value = "identityNum" ) String identityNum
, @Param(value = "caseStatusList") List<Integer> caseStatusList
, @Param(value = "identityType" ) Integer identityType
, @Param(value = "phone" ) String phone
, @Param(value = "loginUserName" ) String loginUserName
);
}
@@ -31,4 +31,11 @@ public interface SealSignRecordMapper {
void insertSealSignRecord(SealSignRecord sealSignRecord);
List<CaseApplication> selectsignFlow(@Param("batchNumber") Integer batchNumber,@Param("caseStatus") Integer caseStatus);
/**
* 根据签署流程id查询签署记录
* @param signFlowId
* @return
*/
SealSignRecord selectSealByFlowId(@Param("signFlowId") String signFlowId);
}
@@ -57,7 +57,7 @@ public interface ICaseApplicationService {
SealSignRecord selectSealUrl(CaseApplication caseApplication) throws EsignDemoException;
AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecord);
CaseApplication selectSignSealUrl(CaseApplication caseApplication) throws EsignDemoException;
@@ -0,0 +1,15 @@
package com.ruoyi.wisdomarbitrate.service;
import com.google.gson.Gson;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import java.io.IOException;
import java.util.List;
public interface MsSignSealService {
AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException;
AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException;
}
@@ -60,6 +60,7 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
import static com.ruoyi.wisdomarbitrate.utils.CaseLogUtils.insertCaseLog;
@Service
@Slf4j
@@ -730,11 +731,13 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
@Override
@Transactional
public AjaxResult signature(CaseApplication caseApplication) {
// 查询当前案件节点
Integer currentStatus= caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId());
//更改案件状态(暂时)
caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
caseApplicationMapper.submitCaseApplication(caseApplication);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATED_SEAL, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, "");
return AjaxResult.success("签名成功,案件状态已改为待裁决书用印");
}
@@ -746,11 +749,13 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
for (Long id : ids) {
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(id);
// 查询当前案件节点
Integer currentStatus= caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId());
//更改案件状态(暂时)
caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED);
caseApplicationMapper.submitCaseApplication(caseApplication);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_ARCHIVED, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, "");
}
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
@@ -771,6 +776,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
if (caseApplication1 == null) {
return AjaxResult.error("未查询到相关案件");
}
Integer currentNode=caseApplication1.getCaseStatus();
List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1);
Boolean isExistPdf = false;
if (caseAttachList != null && caseAttachList.size() > 0) {
@@ -953,7 +959,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_FILING, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentNode, "");
return AjaxResult.success("裁决书送达成功");
}
@@ -1010,11 +1016,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
@Override
public AjaxResult stamp(CaseApplication caseApplication) {
Integer caseStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId());
//更改案件状态(暂时)
caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY);
caseApplicationMapper.submitCaseApplication(caseApplication);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATION_DELIVERY, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), caseStatus, "");
return AjaxResult.success("用印成功,案件状态已改为待裁决书送达");
}
@@ -1552,13 +1559,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
List<Long> ids = caseApplications1.stream().map(CaseApplication::getId).collect(Collectors.toList());
try {
for (Long id : ids) {
Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id);
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(id);
//更改案件状态(暂时)
caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED);
caseApplicationMapper.submitCaseApplication(caseApplication);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_ARCHIVED, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, "");
}
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
@@ -1587,6 +1595,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
if (caseApplication1 == null) {
return AjaxResult.error("未查询到相关案件");
}
Integer currentCaseNode=caseApplication1.getCaseStatus();
List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1);
if (caseAttachList != null && caseAttachList.size() > 0) {
@@ -1767,7 +1776,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
}
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication1.getId(), CaseApplicationConstants.CASE_FILING, "");
CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentCaseNode, "");
}
@@ -1902,7 +1911,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
// 保存裁决书附件
saveArbitorFile(req.getId(), saveName, savePath, caseApplicationById, arbitrateRecordSelect,null);
return AjaxResult.success("裁决书已生成");
return AjaxResult.success();
}
@Transactional
@@ -1911,10 +1920,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
if (id == null || caseStatus == null) {
return AjaxResult.error("参数校验失败");
}
Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id);
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(id);
caseApplication.setCaseStatus(caseStatus);
caseApplicationMapper.submitCaseApplication(caseApplication);
// 新增日志
insertCaseLog(id,currentStatus , "");
return AjaxResult.success();
}
@@ -1971,7 +1984,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
xwpfDocument = new XWPFDocument(fileInputStream);
log.error("xwpfDocument====" + xwpfDocument);
} catch (IOException e) {
e.printStackTrace();
throw new ServiceException("系统找不到指定的文件。");
}
if (xwpfDocument == null) {
return new ArrayList<>();
@@ -65,6 +65,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
if (caseApplication1 == null) {
return AjaxResult.success();
}
Integer currentStatus = caseApplication1.getCaseStatus();
Integer arbitratMethodOriral = caseApplication.getArbitratMethod();
String caseNum = caseApplication1.getCaseNum();
@@ -76,14 +77,14 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
//修改案件状态为待修改开庭时间
// caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, "");
} else {
caseApplication1.setArbitratMethod(2);
//修改案件状态为待书面审理
caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, "");
}
} else if (opinion == 1 ) {
@@ -92,16 +93,14 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
caseApplication1.setArbitratMethod(2);
caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, "");
} else {
//修改案件状态为待修改开庭时间
caseApplication1.setArbitratMethod(1);
caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
//修改案件状态为待修改开庭时间
// caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, "");
}
}else if (opinion == 2) {
@@ -110,16 +109,14 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
caseApplication1.setArbitratMethod(2);
caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, "");
} else {
//修改案件状态为待修改开庭时间
caseApplication1.setArbitratMethod(1);
caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
//修改案件状态为待修改开庭时间
// caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, "");
}
}
@@ -174,20 +171,21 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
List<CaseApplication> caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
if (caseApplications1 != null && caseApplications1.size() > 0) {
for(CaseApplication caseApplicationse:caseApplications1){
Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId());
String caseNum = caseApplicationse.getCaseNum();
Integer arbitratMethod = caseApplication.getArbitratMethod();
if (arbitratMethod == 1) {
caseApplicationse.setArbitratMethod(1);
caseApplicationse.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, "");
}else if (arbitratMethod == 2) {
//修改案件状态为待书面审理
caseApplicationse.setArbitratMethod(2);
caseApplicationse.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, "");
}
int i = caseApplicationMapper.submitCaseApplication(caseApplicationse);
@@ -255,13 +253,8 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
caseApplication.setId(caseId);
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
//案件日志表里添加数据
CaseLogRecord caseLogRecord = new CaseLogRecord();
caseLogRecord.setCaseAppliId(caseApplication1.getId());
caseLogRecord.setCaseNode(caseApplication1.getCaseStatus());
caseLogRecord.setCreateBy(getUsername());
caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), caseApplication1.getCaseStatus(), "");
// 生成裁决书
CaseApplication application = new CaseApplication();
@@ -297,28 +290,18 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
if (arbitrateRecord1 != null) {
int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
if (i > 0) {
//案件日志表里添加数据
CaseLogRecord caseLogRecord = new CaseLogRecord();
caseLogRecord.setCaseAppliId(caseApplication1.getId());
caseLogRecord.setCaseNode(caseApplication1.getCaseStatus());
caseLogRecord.setCreateBy(getUsername());
caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), caseApplication1.getCaseStatus(), "");
}
} else {
//提交仲裁结果
int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord);
if (i > 0) {
//案件日志表里添加数据
CaseLogRecord caseLogRecord = new CaseLogRecord();
caseLogRecord.setCaseAppliId(caseApplication1.getId());
caseLogRecord.setCaseNode(caseApplication1.getCaseStatus());
caseLogRecord.setCreateBy(getUsername());
caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), caseApplication1.getCaseStatus(), "");
}
}
// 生成裁决书
@@ -182,7 +182,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
IdentityAuthentication authentication = new IdentityAuthentication();
LoginUser loginUser = SecurityUtils.getLoginUser();
// 查询该用户的角色
// 查询登录人身份证号
// 查询登录人手机号
SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId());
String username = sysUser.getUserName();
List<SysRole> roles = sysUser.getRoles();
@@ -196,25 +196,27 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
}
}
}
if(adMinFlag!=1) {
authentication.setUserName(username);
IdentityAuthentication authentication1 = identityAuthenticationMapper.selectIdentityAuthentication(authentication);
if (authentication1 != null) {
identityNum = authentication1.getIdentityNo();
}
}
// if(adMinFlag!=1) {
// authentication.setUserName(username);
// IdentityAuthentication authentication1 = identityAuthenticationMapper.selectIdentityAuthentication(authentication);
// if (authentication1 != null) {
// identityNum = authentication1.getIdentityNo();
// }
// }
String phone=sysUser.getPhonenumber();
List<Integer> caseStatusList = Arrays.asList(caseStatus);
return getCaseEvidenceVOList(identityNum, caseStatusList, 2);
// return getCaseEvidenceVOList(identityNum, caseStatusList, 2);
return getCaseEvidenceVOListByPhone(phone, caseStatusList, 2);
}
@Override
public AjaxResult evidenceConfirmation(CaseApplication caseApplication) {
Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId());
caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_TRIAL);
int i = caseApplicationMapper.submitCaseApplication(caseApplication);
if (i > 0) {
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_TRIAL, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, "");
return AjaxResult.success("证据确认成功");
}
@@ -252,7 +254,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
if (i > 0) {
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), caseStatus, "");
return AjaxResult.success("提交成功");
}
@@ -430,18 +432,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
.userId(userId)
.userName(username)
.build();
CaseApplication caseApplicationsel = new CaseApplication();
caseApplicationsel.setId(id);
caseApplicationsel.setAnnexType(7);
List<CaseAttach> caseAttachs = caseAttachMapper.queryCaseAttachList(caseApplicationsel);
if(caseAttachs!=null&&caseAttachs.size()>0){
caseAttachMapper.deleteCaseAttachByCasedIdAndType(id,7);
int count = caseAttachMapper.save(caseAttach);
}else {
int count = caseAttachMapper.save(caseAttach);
}
caseAttachMapper.deleteCaseAttachByCasedIdAndType(id,annexType);
int count = caseAttachMapper.save(caseAttach);
return AjaxResult.success("上传成功");
} catch (IOException e) {
e.printStackTrace();
@@ -488,7 +480,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
}
private List<CaseEvidenceVO> getCaseEvidenceVOList(String identityNum, List<Integer> caseStatusList, Integer identityType) {
List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType);
List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType,null,SecurityUtils.getUsername());
// todo 返回房间号和开庭时间
if (caseListByRespondent != null && caseListByRespondent.size() > 0) {
for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) {
@@ -508,4 +500,25 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
}
return null;
}
private List<CaseEvidenceVO> getCaseEvidenceVOListByPhone(String phone, List<Integer> caseStatusList, Integer identityType) {
List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(null, caseStatusList, identityType,phone,SecurityUtils.getUsername());
// todo 返回房间号和开庭时间
if (caseListByRespondent != null && caseListByRespondent.size() > 0) {
for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) {
//根据案件id查询姓名
CaseAffiliate caseAffiliate = new CaseAffiliate();
caseAffiliate.setCaseAppliId(caseEvidenceVO.getId());
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
for (CaseAffiliate affiliate : caseAffiliates) {
if (affiliate.getIdentityType() == 1) { //申请人
caseEvidenceVO.setApplicantName(affiliate.getName());
} else {
caseEvidenceVO.setRespondentName(affiliate.getName());
}
}
}
return caseListByRespondent;
}
return null;
}
}
@@ -4,12 +4,15 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper;
import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@@ -17,10 +20,13 @@ import java.util.Optional;
public class CaseLogRecordServiceImpl implements ICaseLogRecordService {
@Autowired
private CaseLogRecordMapper caseLogRecordMapper;
@Autowired
private CaseApplicationMapper applicationMapper;
@Override
public List<CaseLogRecord> selectCaseLogRecordList(CaseLogRecord caseLogRecord) {
CaseApplication caseApplicationReq = new CaseApplication();
caseApplicationReq.setId(caseLogRecord.getCaseAppliId());
List<CaseLogRecord> records = caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord);
if(CollectionUtil.isNotEmpty(records)){
records.forEach(record->{
@@ -118,6 +118,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
for (Long id : batchCaseApplication.getIds()) {
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(id);
// 查询当前案件节点
Integer currentStatus= caseApplicationMapper.selectCaseApplicationCaseStatus(id);
if(batchCaseApplication.getAgreeOrNotCheck().equals(1)){
// 同意,更新案件状态为案件质证
caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI);
@@ -222,9 +224,9 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
casePaymentRecordMapper.update(casePaymentRecord);
// 新增日志
if(batchCaseApplication.getAgreeOrNotCheck().equals(1)) {
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, "");
}else {
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, "拒绝原因:"+batchCaseApplication.getCaseCheckReject());
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, "拒绝原因:"+batchCaseApplication.getCaseCheckReject());
}
}
}
@@ -247,6 +249,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) {
for (CaseAttach caseAttach : payDTO.getPayOrderList()) {
caseAttach.setCaseAppliId(caseId);
// 先删除该案件缴费凭证,类型为8,在新增
caseAttachMapper.deleteCaseAttach(caseId,8,caseAttach.getAnnexId());
caseAttachMapper.updateCaseAttach(caseAttach);
}
}
@@ -255,6 +259,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(caseId);
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
Integer currentStatus=caseApplication1.getCaseStatus();
caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
//修改案件状态
int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
@@ -266,7 +271,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
paymentRecord.setPaymentStatus(1);
casePaymentRecordMapper.saveRecord(paymentRecord);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus ,"");
}
}
@@ -399,6 +404,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
if (caseApplications != null && caseApplications.size() > 0) {
List<Long> caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList());
for (Long caseId : caseIds) {
Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseId);
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(caseId);
caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI);
@@ -475,7 +481,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
casePaymentRecord.setUpdateTime(new Date());
casePaymentRecordMapper.update(casePaymentRecord);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, "");
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, "");
}
@@ -0,0 +1,268 @@
package com.ruoyi.wisdomarbitrate.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.ruoyi.common.constant.FileTransformation;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.common.utils.EmailOutUtil;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.wisdomarbitrate.domain.*;
import com.ruoyi.wisdomarbitrate.mapper.*;
import com.ruoyi.wisdomarbitrate.service.MsSignSealService;
import com.ruoyi.wisdomarbitrate.utils.SignAward;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import java.io.IOException;
import java.time.LocalDate;
import java.util.*;
import static com.ruoyi.common.core.domain.AjaxResult.error;
@Slf4j
@Service
public class MsSignSealServiceImpl implements MsSignSealService {
@Autowired
private CaseApplicationMapper caseApplicationMapper;
@Autowired
private SealSignRecordMapper sealSignRecordMapper;
@Autowired
private CaseAttachMapper caseAttachMapper;
@Autowired
private DeptIdentifyMapper deptIdentifyMapper;
@Autowired
private SealManageMapper sealManageMapper;
@Autowired
private CaseLogRecordMapper caseLogRecordMapper;
/**
* 签署流程回调,即签名用印回调
*
* @param reqbodystr
* @return
* @throws EsignDemoException
* @throws IOException
*/
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException {
JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr);
Gson gson = new Gson();
if (jsonObjectCallback != null) {
log.info("签名回调======" + jsonObjectCallback);
int signResult = jsonObjectCallback.getIntValue("signResult");
String action = jsonObjectCallback.getString("action");
String signFlowId = jsonObjectCallback.getString("signFlowId");
Long operateTime = jsonObjectCallback.getLongValue("operateTime");
JSONObject operator = jsonObjectCallback.getJSONObject("operator");
JSONObject psnAccount = operator.getJSONObject("psnAccount");
String accountMobile = psnAccount.getString("accountMobile");
SealSignRecord sealSignRecordsel = sealSignRecordMapper.selectSealByFlowId(signFlowId);
if (sealSignRecordsel == null) {
return error("未找到签署流程");
}
String pensonAccount = sealSignRecordsel.getPensonAccount();
String orgnNamePsnAcc = sealSignRecordsel.getOrgnizeNamePsnAccount();
String pensonName = sealSignRecordsel.getPensonName();
String orgnNamePsnName = sealSignRecordsel.getOrgnizeNamepsnName();
Date dateOperate = new Date(operateTime);
Long caseAppliId = sealSignRecordsel.getCaseAppliId();
CaseApplication req = new CaseApplication();
req.setId(caseAppliId);
if ("SIGN_MISSON_COMPLETE".equals(action) && signResult == 2) {
if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(pensonAccount)) {
//申请人签名
sealSignRecordsel.setSignStatusArbitor(1);
sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel);
CaseLogRecord operLog = new CaseLogRecord();
operLog.setCreateNickName(pensonName);
operLog.setCaseAppliId(caseAppliId);
operLog.setCaseNode(13);
operLog.setCreateTime(dateOperate);
caseLogRecordMapper.insertCaseLogRecord(operLog);
CaseApplication application = new CaseApplication();
application.setId(caseAppliId);
// 修改状态为待用印
application.setCaseStatus(14);
caseApplicationMapper.updataCaseApplication(application);
} else if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(orgnNamePsnAcc)) {
//用印
sealSignRecordsel.setSealStatus(1);
sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel);
CaseLogRecord operLog = new CaseLogRecord();
operLog.setCreateNickName(orgnNamePsnName);
operLog.setCaseNode(14);
operLog.setCaseAppliId(caseAppliId);
operLog.setCreateTime(dateOperate);
caseLogRecordMapper.insertCaseLogRecord(operLog);
CaseApplication application = new CaseApplication();
application.setId(caseAppliId);
// 案件状态为待送达
application.setCaseStatus(15);
caseApplicationMapper.updataCaseApplication(application);
//下载审核完成的裁决书,
EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
if (filesArray != null && filesArray.size() > 0) {
JsonObject fileObject = (JsonObject) filesArray.get(0);
String fileDownloadUrl = fileObject.get("downloadUrl").toString();
///修改"签署用印记录表"的状态为完成
sealSignRecordsel.setSignFlowStatus(3);
sealSignRecordsel.setFileDownloadUrl(fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1));
sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel);
String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
application.setFilearbitraUrl(filearbitraUrl);
caseApplicationMapper.submitCaseApplication(application);
LocalDate now = LocalDate.now();
String year = Integer.toString(now.getYear());
String month = String.format("%02d", now.getMonthValue());
String day = String.format("%02d", now.getDayOfMonth());
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
String savePath = "/home/ruoyi/uploadPath/upload/";
// 创建日期目录
File saveFolder = new File(saveFolderPath);
if (!saveFolder.exists()) {
saveFolder.mkdirs();
}
String resultFilePath = saveFolderPath + "/" + fileName;
File resultFilePathFile = new File(resultFilePath);
if (!resultFilePathFile.exists()) {
resultFilePathFile.createNewFile();
}
String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
if (downLoadFile) {
CaseAttach caseAttach = new CaseAttach();
caseAttach.setCaseAppliId(caseAppliId);
caseAttach.setAnnexType(3);
caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName);
caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
}
}
}
}
} else {
return AjaxResult.error("error");
}
return AjaxResult.success("success");
}
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException {
JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr);
Gson gson = new Gson();
if (jsonObjectCallback != null) {
int auditStatus = jsonObjectCallback.getIntValue("auditStatus");
String action = jsonObjectCallback.getString("action");
String orgId = jsonObjectCallback.getString("orgId");
String sealId = jsonObjectCallback.getString("sealId");
SealManage sealManage = new SealManage();
DeptIdentify deptIdentify1 = new DeptIdentify();
deptIdentify1.setOrgId(orgId);
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1);
if (deptIdentifies != null && deptIdentifies.size() > 0) {
Long iddeptIdent = deptIdentifies.get(0).getId();
SealManage sealManageSel = new SealManage();
sealManageSel.setIdentifyId(iddeptIdent);
sealManageSel.setSealId(sealId);
List<String> sealIdList = new ArrayList<>();
List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManageSel);
if (selectSealList != null && selectSealList.size() > 0) {
sealManage = selectSealList.get(0);
}
}
if ("SEAL_AUDIT".equals(action) && auditStatus == 1) {
EsignHttpResponse response = SignAward.getOrgSeal(orgId, sealId);
JSONObject jsonObject = JSONObject.parseObject(response.getBody());
int code = jsonObject.getIntValue("code");
if (code == 0) {
JSONObject data = jsonObject.getJSONObject("data");
int sealStatus = data.getIntValue("sealStatus");
if (sealStatus == 1) {//印章状态 1已启用,2待审核,3审核不通过,4 挂起
//已启用证明审核通过,下载到数据库
String sealImageDownloadUrl = data.getString("sealImageDownloadUrl");
LocalDate now = LocalDate.now();
String year = Integer.toString(now.getYear());
String month = String.format("%02d", now.getMonthValue());
String day = String.format("%02d", now.getDayOfMonth());
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
String fileName = UUID.randomUUID().toString().replace("-", "") + ".jpg";
String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
String savePath = "/home/ruoyi/uploadPath/upload/";
// 创建日期目录
File saveFolder = new File(saveFolderPath);
if (!saveFolder.exists()) {
saveFolder.mkdirs();
}
String resultFilePath = saveFolderPath + "/" + fileName;
File resultFilePathFile = new File(resultFilePath);
if (!resultFilePathFile.exists()) {
resultFilePathFile.createNewFile();
}
boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath);
if (downLoadFile) {
CaseAttach caseAttach = new CaseAttach();
caseAttach.setAnnexType(10); //10代表印章图片
caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName);
int i1 = caseAttachMapper.save(caseAttach);
if (i1 > 0) {
//将附件id保存到公章管理表里
Long annexId1 = caseAttach.getAnnexId();
sealManage.setAnnexId(annexId1);
sealManage.setSealStatus(1);
sealManage.setIsUse(0);
sealManageMapper.updateSealManage(sealManage);
}
}
}
}
}
} else {
return AjaxResult.error("error");
}
return AjaxResult.success("success");
}
}
@@ -0,0 +1,46 @@
package com.ruoyi.wisdomarbitrate.utils;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
public class DigesdateUtils {
public static String getSignStr(String paramsStr, String accessSec ) {
Mac macDiges = null;
try {
macDiges = Mac.getInstance("HmacSHA256");
SecretKeySpec accessSecKey = new SecretKeySpec(accessSec.getBytes("UTF-8"), "HmacSHA256");
macDiges.init(accessSecKey);
macDiges.update(paramsStr.getBytes("UTF-8"));
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return null;
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return null;
} catch (InvalidKeyException e) {
e.printStackTrace();
return null;
}
return byteTrasferhex(macDiges.doFinal());
}
public static String byteTrasferhex(byte[] byteArrayData) {
StringBuilder hashBuilder = new StringBuilder();
String stmpHex;
for (int n = 0; byteArrayData != null && n < byteArrayData.length; n++) {
stmpHex = Integer.toHexString(byteArrayData[n] & 0XFF);
if (stmpHex.length() == 1)
hashBuilder.append('0');
hashBuilder.append(stmpHex);
}
return hashBuilder.toString();
}
}
@@ -43,7 +43,7 @@ public class FixSelectFlowDetailUtils {
/*
定时查询签署流程详情
*/
@Scheduled(cron = "0/10 * * * * ?")
// @Scheduled(cron = "0/10 * * * * ?")
@Transactional
public void fixExecuteSelectFlowDetailUtils() {
Gson gson = new Gson();
@@ -277,7 +277,7 @@ public class FixSelectFlowDetailUtils {
/**
* 定时查询印章审核状态
*/
@Scheduled(cron = "0/30 * * * * ?")
// @Scheduled(cron = "0/30 * * * * ?")
@Transactional
public void searchForInstitutionalSeal() {
try {
@@ -0,0 +1,96 @@
package com.ruoyi.wisdomarbitrate.utils;
import com.ruoyi.common.utils.EsignApplicaConfig;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
public class SignVerifyUtils {
private static String eSignAppSecret = EsignApplicaConfig.EsignAppSecret;
public static boolean checkSignuter() throws Exception {
HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
String orialsignature = httprequest.getHeader("X-Tsign-Open-SIGNATURE");
String timestampreq = httprequest.getHeader("X-Tsign-Open-TIMESTAMP");
String reqQuerystr =getHttpreqQuery();
//获取请求参数
String reqbodystr =getRequestBody();
String signOriaData = timestampreq + reqQuerystr + reqbodystr;
String newDisgSignuter= DigesdateUtils.getSignStr(signOriaData, eSignAppSecret);
if (StringUtils.equals(orialsignature, newDisgSignuter)) {
return true;
}else {
return false;
}
}
public static String getHttpreqQuery() {
HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
List<String> reqNames= new ArrayList();
Enumeration<String> httpreqEle =httprequest.getParameterNames();
while (httpreqEle.hasMoreElements()){
reqNames.add(httpreqEle.nextElement());
}
Collections.sort(reqNames);
String httpreqQuery = "";
for (String reqName : reqNames) {
String reqvalue = httprequest.getParameter(reqName);
httpreqQuery += reqvalue == null ? "" : reqvalue;
}
return httpreqQuery;
}
public static String getRequestBody() {
HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
String requestBody = "";
int reqContentLen = httprequest.getContentLength();
if (reqContentLen < 0) {
return null;
}
byte bufByteArray[] = new byte[reqContentLen];
try {
for (int i = 0; i < reqContentLen;) {
int lengthReadInputStream = httprequest.getInputStream().read(bufByteArray, i, reqContentLen - i);
if (lengthReadInputStream == -1) {
break;
}
i += lengthReadInputStream;
}
} catch (IOException e) {
e.printStackTrace();
}
try {
requestBody = new String(bufByteArray, "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return requestBody;
}
}