实现签名用印功能
This commit is contained in:
+4
@@ -2,10 +2,14 @@ package com.ruoyi.wisdomarbitrate.mapper.dept;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.dept.MsSealSignRecord;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MsSealSignRecordMapper extends Mapper<MsSealSignRecord> {
|
||||
|
||||
|
||||
@Select("SELECT s.id id ,s.case_appli_id caseAppliId ,s.file_id fileId ,s.sign_flow_id signFlowId ,s.sign_flow_status signFlowStatus from ms_seal_sign_record s join ms_case_application c on s.case_appli_id=c.id where s.sign_flow_status in (1,2) ")
|
||||
List<MsSealSignRecord> selectSealSignRecordbyStat();
|
||||
}
|
||||
+1
@@ -15,4 +15,5 @@ public interface MsSignSealService {
|
||||
|
||||
|
||||
SealSignRecord selectSealUrl(MsSignSealDTO dto) throws EsignDemoException;
|
||||
|
||||
}
|
||||
|
||||
+8
@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
||||
@@ -14,6 +15,7 @@ import com.ruoyi.common.enums.YesOrNoEnum;
|
||||
import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
||||
import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
|
||||
@@ -45,6 +47,7 @@ import tk.mybatis.mapper.entity.Example;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
@@ -325,6 +328,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
application.setCaseStatusName(nextFlow.getCaseStatusName());
|
||||
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"用印申请");
|
||||
|
||||
|
||||
}
|
||||
} else {
|
||||
// 单独
|
||||
@@ -336,6 +341,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"用印申请");
|
||||
|
||||
|
||||
}
|
||||
return AjaxResult.success("用印申请成功");
|
||||
|
||||
@@ -368,4 +374,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+114
@@ -1,28 +1,41 @@
|
||||
package com.ruoyi.wisdomarbitrate.utils;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
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.CaseApplicationConstants;
|
||||
import com.ruoyi.common.constant.FileTransformation;
|
||||
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
||||
import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
||||
import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.dept.SealManage;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.dept.MsSealSignRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.dept.DeptIdentifyMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.dept.MsSealSignRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.dept.SealManageMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseApplicationMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class FixSelectFlowDetailUtils {
|
||||
@@ -32,6 +45,14 @@ public class FixSelectFlowDetailUtils {
|
||||
private DeptIdentifyMapper deptIdentifyMapper;
|
||||
@Autowired
|
||||
private SealManageMapper sealManageMapper;
|
||||
@Autowired
|
||||
private MsSealSignRecordMapper sealSignRecordMapper;
|
||||
@Autowired
|
||||
MsCaseApplicationMapper msCaseApplicationMapper;
|
||||
@Autowired
|
||||
MsCaseFlowMapper caseFlowMapper;
|
||||
@Autowired
|
||||
private MsCaseApplicationMapper caseApplicationMapper;
|
||||
|
||||
|
||||
|
||||
@@ -220,6 +241,99 @@ public class FixSelectFlowDetailUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
定时查询签署流程详情
|
||||
*/
|
||||
// @Scheduled(cron = "0/10 * * * * ?")
|
||||
@Transactional
|
||||
public void fixExecuteSelectFlowDetailUtils() {
|
||||
Gson gson = new Gson();
|
||||
|
||||
List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat();
|
||||
|
||||
try {
|
||||
if (sealSignRecords != null && sealSignRecords.size() > 0) {
|
||||
for (int i = 0; i < sealSignRecords.size(); i++) {
|
||||
MsSealSignRecord mssealSignRecord = sealSignRecords.get(i);
|
||||
SealSignRecord sealSignRecord = new SealSignRecord();
|
||||
BeanUtil.copyProperties(mssealSignRecord, sealSignRecord);
|
||||
sealSignRecord.setSignFlowid(mssealSignRecord.getSignFlowId());
|
||||
EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
|
||||
JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(), JsonObject.class);
|
||||
JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
|
||||
JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
|
||||
List<Integer> psnsignStatusList = new ArrayList<>();
|
||||
Integer psnsignStatus = null;
|
||||
Integer orgsignStatus = null;
|
||||
for (int j = 0; j < signersArray.size(); j++) {
|
||||
JsonObject signerObject = (JsonObject) signersArray.get(j);
|
||||
|
||||
if (!(signerObject.get("psnSigner").toString()).equals("null")) {
|
||||
JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner");
|
||||
if (psnSignerData != null) {
|
||||
psnsignStatus = signerObject.get("signStatus").getAsInt();
|
||||
psnsignStatusList.add(psnsignStatus);
|
||||
}
|
||||
}
|
||||
if (!(signerObject.get("orgSigner").toString()).equals("null")) {
|
||||
JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
|
||||
if (orgSignerData != null) {
|
||||
orgsignStatus = signerObject.get("signStatus").getAsInt();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
List<Integer> psnsignStatusListnew = psnsignStatusList.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 1)) {
|
||||
//更新立案申请状态为待用印
|
||||
MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
|
||||
if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 1)) {
|
||||
// 根据流程id查找下一个流程节点
|
||||
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getId().intValue());
|
||||
MsCaseApplication application = new MsCaseApplication();
|
||||
application.setId(caseApplicationselect.getId());
|
||||
application.setCaseFlowId(nextFlow.getId());
|
||||
application.setCaseStatusName(nextFlow.getCaseStatusName());
|
||||
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
|
||||
//修改"签署用印记录表"的状态为待用印
|
||||
mssealSignRecord.setSignFlowStatus(2);
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
|
||||
}
|
||||
}
|
||||
if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 2)) {
|
||||
//更新立案申请状态为待送达
|
||||
MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
|
||||
|
||||
if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 2)) {
|
||||
//修改"签署用印记录表"的状态为签署完成
|
||||
mssealSignRecord.setSignFlowStatus(3);
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
|
||||
|
||||
// 根据流程id查找下一个流程节点
|
||||
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getId().intValue());
|
||||
MsCaseApplication application = new MsCaseApplication();
|
||||
application.setId(caseApplicationselect.getId());
|
||||
application.setCaseFlowId(nextFlow.getId());
|
||||
application.setCaseStatusName(nextFlow.getCaseStatusName());
|
||||
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (EsignDemoException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user