11.10 开发

This commit is contained in:
hejinbo
2023-11-10 18:08:30 +08:00
parent 7cfc39190a
commit 4cf4fa6f5c
14 changed files with 311 additions and 48 deletions
@@ -1,5 +1,6 @@
package com.ruoyi.web.controller.wisdomarbitrate; package com.ruoyi.web.controller.wisdomarbitrate;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
@@ -9,6 +10,8 @@ import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.DeptIdentify; import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
import com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService; import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@@ -19,7 +22,7 @@ import java.util.List;
@RestController @RestController
@RequestMapping("/deptIdentify") @RequestMapping("/deptIdentify")
public class DeptIdentifyController extends BaseController { public class DeptIdentifyController extends BaseController {
@Autowired @Autowired
private IDeptIdentifyService deptIdentifyService; private IDeptIdentifyService deptIdentifyService;
@@ -52,17 +55,49 @@ public class DeptIdentifyController extends BaseController {
/** /**
* 上传自定义公章 * 上传自定义公章
*
* @param deptIdentify * @param deptIdentify
* @param file * @param file
* @return * @return
*/ */
@PostMapping("sealUpload") @PostMapping("/sealUpload")
public AjaxResult sealUpload(@Validated @RequestBody DeptIdentify deptIdentify public AjaxResult sealUpload(@Validated @RequestBody DeptIdentify deptIdentify
,@RequestParam("file") MultipartFile file){ , @RequestParam("file") MultipartFile file) {
return deptIdentifyService.sealUpload(deptIdentify,file); return deptIdentifyService.sealUpload(deptIdentify, file);
} }
/**
* 接收E签宝回调通知
* @param body
* @return
*/
@GetMapping("/notify")
public AjaxResult receiveNotify(String body) {
return deptIdentifyService.receiveNotify(body);
}
/**
* 签章图片列表查询
* @param deptIdentify
* @return
*/
@GetMapping("/sealList")
public TableDataInfo getSealList(DeptIdentify deptIdentify){
startPage();
List<SealListVO> list = deptIdentifyService.getSealList(deptIdentify);
return getDataTable(list);
}
/**
* 印章启用或者禁用
* @param deptIdentify
* @return
*/
@PostMapping("/updateSealLockStatus")
public AjaxResult updateSealLockStatus(@Validated @RequestBody DeptIdentify deptIdentify){
if(deptIdentify.getSealId()==null ||deptIdentify.getSealStatus()==null){
return error("参数校验失败");
}
return deptIdentifyService.updateSealLockStatus(deptIdentify);
}
} }
@@ -82,7 +82,7 @@ public class SaaSAPIFileUtils {
//生成签名鉴权方式的的header //生成签名鉴权方式的的header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true); Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true);
//发起接口请求 //发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true); return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,false);
} }
@@ -42,9 +42,6 @@ public class CaseAttach {
* 用户账户 * 用户账户
*/ */
private String userName; private String userName;
/**
* 印章状态(0未启用,1已启用)
*/
private Integer sealStatus;
} }
@@ -53,6 +53,10 @@ public class DeptIdentify extends BaseEntity {
* 附件id * 附件id
*/ */
private Integer annexId; private Integer annexId;
/**
* 印章状态 0禁用,1启用
*/
private Integer sealStatus;
public Integer getAnnexId() { public Integer getAnnexId() {
return annexId; return annexId;
@@ -168,4 +172,12 @@ public class DeptIdentify extends BaseEntity {
public void setIsUse(Integer isUse) { public void setIsUse(Integer isUse) {
this.isUse = isUse; this.isUse = isUse;
} }
public Integer getSealStatus() {
return sealStatus;
}
public void setSealStatus(Integer sealStatus) {
this.sealStatus = sealStatus;
}
} }
@@ -0,0 +1,27 @@
package com.ruoyi.wisdomarbitrate.domain.vo;
import lombok.Data;
@Data
public class SealListVO {
/** 印章id */
private String sealId;
/** 印章名称 */
private String sealName;
/**
* 印章状态 0禁用,1启用
*/
private Integer sealStatus;
/**
* 附件id
*/
private Integer annexId;
/**
* 附件路径
*/
private String annexPath;
/**
* 附件类型,立案申请书(1)、申请人证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)、被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)'
*/
private Integer annexType;
}
@@ -23,4 +23,6 @@ public interface CaseAttachMapper {
int deleteByFileIds(@Param("ids") List<Integer> fileIds); int deleteByFileIds(@Param("ids") List<Integer> fileIds);
List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach); List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
CaseAttach queryAnnexById(Integer annexId);
} }
@@ -19,4 +19,5 @@ public interface DeptIdentifyMapper {
int updateDeptIdentify(DeptIdentify deptIdentify); int updateDeptIdentify(DeptIdentify deptIdentify);
List<DeptIdentify> selectDeptIdentifylistother(DeptIdentify deptIdentify); List<DeptIdentify> selectDeptIdentifylistother(DeptIdentify deptIdentify);
} }
@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.wisdomarbitrate.domain.DeptIdentify; import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
import com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.util.List; import java.util.List;
@@ -20,4 +21,11 @@ public interface IDeptIdentifyService {
AjaxResult sealUpload(DeptIdentify deptIdentify, MultipartFile file); AjaxResult sealUpload(DeptIdentify deptIdentify, MultipartFile file);
AjaxResult receiveNotify(String body);
List<SealListVO> getSealList(DeptIdentify deptIdentify);
AjaxResult updateSealLockStatus(DeptIdentify deptIdentify);
} }
@@ -106,6 +106,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
private DeptIdentifyMapper deptIdentifyMapper; private DeptIdentifyMapper deptIdentifyMapper;
@Autowired @Autowired
private ReservedConferenceMapper reservedConferenceMapper; private ReservedConferenceMapper reservedConferenceMapper;
@Autowired
private SysDeptMapper deptMapper;
// 手机号正则 // 手机号正则
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}$"); 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}$");
@@ -1746,7 +1748,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
} }
} }
} }
EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord); DeptIdentify deptIdentify1 = new DeptIdentify();
deptIdentify1.setSealStatus(1); // 印章状态为启用
//根据机构名称查询部门id
SysDept sysDept = new SysDept();
sysDept.setDeptName(sealSignRecord.getOrgnizeName());
List<SysDept> sysDepts = deptMapper.selectDeptList(sysDept);
if (sysDepts != null && sysDepts.size() > 0) {
Long deptId = sysDepts.get(0).getDeptId();
deptIdentify1.setDeptId(deptId);
}
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentify1);
List<String> sealIds = new ArrayList<>();
if (deptIdentifies != null && deptIdentifies.size() > 0) {
for (DeptIdentify identify : deptIdentifies) {
String sealId = identify.getSealId();
sealIds.add(sealId);
}
}
EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord,sealIds);
JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody()); JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
if (jsonObject3.getIntValue("code") == 0) { if (jsonObject3.getIntValue("code") == 0) {
//获取签署流程ID //获取签署流程ID
@@ -1881,7 +1901,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
request.setTemplateId("1952136"); request.setTemplateId("1952136");
for (CaseAffiliate caseAffiliate : caseAffiliates) { for (CaseAffiliate caseAffiliate : caseAffiliates) {
request.setPhone(caseAffiliate.getContactTelphone()); request.setPhone(caseAffiliate.getContactTelphone());
request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()+caseAffiliate.getUserId()}); request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo() + caseAffiliate.getUserId()});
// 1952136 普通短信 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请在浏览器打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。 // 1952136 普通短信 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请在浏览器打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。
Boolean aBoolean = SmsUtils.sendSms(request); Boolean aBoolean = SmsUtils.sendSms(request);
//保存短信发送记录 //保存短信发送记录
@@ -1890,7 +1910,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum()); smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
smsSendRecord.setPhone(request.getPhone()); smsSendRecord.setPhone(request.getPhone());
smsSendRecord.setSendTime(new Date()); smsSendRecord.setSendTime(new Date());
String content = "尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplicationselect.getCaseNum() + "仲裁案件,开庭审理房间号为" + messageVO.getRoomNo()+caseAffiliate.getUserId() + ",请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。"; String content = "尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplicationselect.getCaseNum() + "仲裁案件,开庭审理房间号为" + messageVO.getRoomNo() + caseAffiliate.getUserId() + ",请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。";
smsSendRecord.setSendContent(content); smsSendRecord.setSendContent(content);
String userName; String userName;
@@ -1909,6 +1929,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
} }
return returnResult; return returnResult;
} }
@Override @Override
public SealSignRecord selectSignUrl(CaseApplication caseApplication) throws EsignDemoException { public SealSignRecord selectSignUrl(CaseApplication caseApplication) throws EsignDemoException {
SealSignRecord sealSignRecord = new SealSignRecord(); SealSignRecord sealSignRecord = new SealSignRecord();
@@ -2452,10 +2473,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
/** /**
* 获取userSign,默认过期时间10小时 * 获取userSign,默认过期时间10小时
*
* @param userId * @param userId
* @return * @return
*/ */
public String generateUserSign(String userId){ public String generateUserSign(String userId) {
TLSSigAPIv2 tlsSigAPIv2 = new TLSSigAPIv2(sdkAppId, secretKey); TLSSigAPIv2 tlsSigAPIv2 = new TLSSigAPIv2(sdkAppId, secretKey);
return tlsSigAPIv2.genUserSig(userId, 60 * 60 * 10); return tlsSigAPIv2.genUserSig(userId, 60 * 60 * 10);
} }
@@ -2463,6 +2485,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
/** /**
* 预约会议 * 预约会议
*
* @param reservedConferenceVO * @param reservedConferenceVO
* @return * @return
* @throws Exception * @throws Exception
@@ -2480,7 +2503,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
Integer scheduleEndTime = reservedConferenceVO.getScheduleEndTime(); Integer scheduleEndTime = reservedConferenceVO.getScheduleEndTime();
Random rand = new Random(); Random rand = new Random();
int random = rand.nextInt(214748365); int random = rand.nextInt(214748365);
String url="https://roomkit.trtc.tencent-cloud.com/room_api/v1/roomctl/create?usersig=" + userSign + "&identifier=" + administrator + "&sdkappid=" + sdkAppId + "&random=" +random + "&contenttype=json"; String url = "https://roomkit.trtc.tencent-cloud.com/room_api/v1/roomctl/create?usersig=" + userSign + "&identifier=" + administrator + "&sdkappid=" + sdkAppId + "&random=" + random + "&contenttype=json";
HttpPost post = new HttpPost(url); HttpPost post = new HttpPost(url);
String result = ""; String result = "";
//添加参数 //添加参数
@@ -2489,7 +2512,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
bodyParams.put("ownerId", reservedConferenceVO.getOwnerId()); bodyParams.put("ownerId", reservedConferenceVO.getOwnerId());
bodyParams.put("roomId", reservedConferenceVO.getRoomId()); bodyParams.put("roomId", reservedConferenceVO.getRoomId());
bodyParams.put("scheduleStartTime", scheduleStartTime); bodyParams.put("scheduleStartTime", scheduleStartTime);
bodyParams.put("scheduleEndTime",scheduleEndTime); bodyParams.put("scheduleEndTime", scheduleEndTime);
roomParams.put("roomType", 1); roomParams.put("roomType", 1);
bodyParams.put("roomInfo", roomParams); bodyParams.put("roomInfo", roomParams);
StringEntity postingString = new StringEntity(bodyParams.toString()); StringEntity postingString = new StringEntity(bodyParams.toString());
@@ -2536,6 +2559,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
/** /**
* 销毁房间回调 * 销毁房间回调
*
* @param body * @param body
* @param request * @param request
*/ */
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.FileTransformation;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.EsignDemoException;
@@ -11,6 +12,7 @@ import com.ruoyi.common.utils.SealUtil;
import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
import com.ruoyi.wisdomarbitrate.domain.DeptIdentify; import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
import com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper; import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper;
import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService; import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
@@ -20,9 +22,13 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID;
@Service @Service
public class DeptIdentifyServiceImpl implements IDeptIdentifyService { public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
@@ -123,7 +129,7 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
EsignHttpResponse response1 = SealUtil.queryAuthProcess(authFlowId); EsignHttpResponse response1 = SealUtil.queryAuthProcess(authFlowId);
JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody()); JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
int authorizedStatus = jsonObject1.getJSONObject("data").getIntValue("authorizedStatus"); int authorizedStatus = jsonObject1.getJSONObject("data").getIntValue("authorizedStatus");
if (authorizedStatus == 1){//授权流程状态 0流程过期失效 1已授权 2授权中 3审批未通过 if (authorizedStatus == 1) {//授权流程状态 0流程过期失效 1已授权 2授权中 3审批未通过
String prefix = "/profile"; String prefix = "/profile";
int startIndex = fileName.indexOf(prefix); int startIndex = fileName.indexOf(prefix);
startIndex += prefix.length(); startIndex += prefix.length();
@@ -138,7 +144,7 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
identify.setIsUse(0); //设置印章使用状态为未启用 identify.setIsUse(0); //设置印章使用状态为未启用
//保存到表里 //保存到表里
int i = deptIdentifyMapper.updateDeptIdentify(identify); int i = deptIdentifyMapper.updateDeptIdentify(identify);
if (i>0){ if (i > 0) {
return AjaxResult.success("上传成功"); return AjaxResult.success("上传成功");
} }
} }
@@ -151,8 +157,119 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
} catch (EsignDemoException e) { } catch (EsignDemoException e) {
e.printStackTrace(); e.printStackTrace();
} }
return AjaxResult.error(); return AjaxResult.error();
} }
@Override
public AjaxResult receiveNotify(String body) {
/* 请求Body数据格式如下:
{
"action":"SEAL_AUDIT",
"auditStatus":1,
"psnId":"c7e00294**41e7",
"rejectReason":"",
"sealBizType":"COMMON",
"sealId":"af80ba0f-xx-xx-xx-a2da292d7f7f",
"sealName":"赵四的图片印章",
"statusDescription":"通过"
}*/
//解析body数据
try {
JSONObject jsonObject = JSONObject.parseObject(body);
String action = jsonObject.getString("action");
if (action.equals("SEAL_AUDIT")) { //SEAL_AUDIT表示图片印章审核结果通知
String auditStatus = jsonObject.getString("auditStatus");
if (auditStatus.equals("1")) { //图片印章审核结果 1通过 ,0驳回
//审核通过,拿到印章id和机构账号ID
String orgId = jsonObject.getString("orgId");
String sealId = jsonObject.getString("sealId");
//查询指定印章详情(机构)
EsignHttpResponse response = SignAward.getOrgSeal(orgId, sealId);
JSONObject jsonObject1 = JSONObject.parseObject(response.getBody());
if (jsonObject1.getIntValue("code") == 0) { //业务码,0表示成功,非0表示异常。
int sealStatus = jsonObject1.getJSONObject("data").getIntValue("sealStatus");
if (sealStatus == 1) { //印章状态 1已启用,2待审核,3审核不通过,4 挂起
String sealImageDownloadUrl = jsonObject1.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("-", "") + ".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();
}
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保存到公章管理表里
Integer annexId1 = caseAttach.getAnnexId();
DeptIdentify identify = new DeptIdentify();
identify.setSealId(sealId);
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(identify);
if (deptIdentifies != null && deptIdentifies.size() > 0) {
DeptIdentify identify1 = deptIdentifies.get(0);
identify1.setAnnexId(annexId1);
identify1.setSealStatus(1); //启用
deptIdentifyMapper.updateDeptIdentify(identify1);
}
}
}
}
}
}
}
} catch (EsignDemoException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return new AjaxResult(200, "success");
}
@Override
public List<SealListVO> getSealList(DeptIdentify deptIdentify) {
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentify);
List<SealListVO> sealListVOS = new ArrayList<>();
if (deptIdentifies != null && deptIdentifies.size() > 0) {
for (DeptIdentify identify : deptIdentifies) {
SealListVO sealListVO = new SealListVO();
sealListVO.setSealId(identify.getSealId());
sealListVO.setSealName(identify.getSealName());
sealListVO.setSealStatus(identify.getSealStatus());
Integer annexId = identify.getAnnexId();
//根据附件id查询路径
CaseAttach caseAttach = caseAttachMapper.queryAnnexById(annexId);
String annexName = caseAttach.getAnnexName();
String prefix = "/profile";
int startIndex = annexName.indexOf(prefix);
startIndex += prefix.length();
String annexPath = "/uploadPath" + annexName.substring(startIndex);
sealListVO.setAnnexPath(annexPath);
sealListVO.setAnnexType(caseAttach.getAnnexType());
sealListVOS.add(sealListVO);
}
}
return sealListVOS;
}
@Override
public AjaxResult updateSealLockStatus(DeptIdentify deptIdentify) {
deptIdentifyMapper.updateDeptIdentify(deptIdentify);
return AjaxResult.success();
}
} }
@@ -216,7 +216,7 @@ public class FixSelectFlowDetailUtils {
* *
* @throws EsignDemoException * @throws EsignDemoException
*/ */
@Scheduled(cron = "0/30 * * * * ?") // @Scheduled(cron = "0/30 * * * * ?")
@Transactional @Transactional
public void searchForInstitutionalSeal() { public void searchForInstitutionalSeal() {
try { try {
@@ -263,7 +263,6 @@ public class FixSelectFlowDetailUtils {
caseAttach.setAnnexType(10); //10代表印章图片 caseAttach.setAnnexType(10); //10代表印章图片
caseAttach.setAnnexPath(savePath); caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName); caseAttach.setAnnexName(saveName);
caseAttach.setSealStatus(1); //1代表印章启用
int i1 = caseAttachMapper.save(caseAttach); int i1 = caseAttachMapper.save(caseAttach);
if (i1>0){ if (i1>0){
//将附件id保存到公章管理表里 //将附件id保存到公章管理表里
@@ -16,6 +16,7 @@ import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
import java.io.File; import java.io.File;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Map; import java.util.Map;
public class SignAward { public class SignAward {
@@ -134,9 +135,9 @@ public class SignAward {
//请求方法 //请求方法
EsignRequestType requestType = EsignRequestType.GET; EsignRequestType requestType = EsignRequestType.GET;
//生成签名鉴权方式的的header //生成签名鉴权方式的的header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true); Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
//发起接口请求 //发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true); return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
} }
@@ -146,7 +147,7 @@ public class SignAward {
* @return * @return
* @throws EsignDemoException * @throws EsignDemoException
*/ */
public static EsignHttpResponse createByFile(SealSignRecord sealSignRecord) throws EsignDemoException { public static EsignHttpResponse createByFile(SealSignRecord sealSignRecord, List<String> sealIds) throws EsignDemoException {
String apiaddr = "/v3/sign-flow/create-by-file"; String apiaddr = "/v3/sign-flow/create-by-file";
String fileId = sealSignRecord.getFileid(); String fileId = sealSignRecord.getFileid();
@@ -167,7 +168,6 @@ public class SignAward {
double positionXorg = sealSignRecord.getPositionXorg(); double positionXorg = sealSignRecord.getPositionXorg();
double positionYorg = sealSignRecord.getPositionYorg(); double positionYorg = sealSignRecord.getPositionYorg();
String availableSealId = "209af82b-5f87-4e0a-b0d8-cc4923b6e652";
String jsonParm = "{\n" + String jsonParm = "{\n" +
" \"docs\": [\n" + " \"docs\": [\n" +
@@ -245,7 +245,7 @@ public class SignAward {
" \"freeMode\": false,\n" + " \"freeMode\": false,\n" +
" \"availableSealIds\": [\n" + " \"availableSealIds\": [\n" +
" \"" + availableSealId + "\"\n" + " \"" + sealIds + "\"\n" +
" ],\n" + " ],\n" +
@@ -268,9 +268,9 @@ public class SignAward {
//请求方法 //请求方法
EsignRequestType requestType = EsignRequestType.POST; EsignRequestType requestType = EsignRequestType.POST;
//生成请求签名鉴权方式的Header //生成请求签名鉴权方式的Header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true); Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
//发起接口请求 //发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true); return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
} }
/** /**
@@ -296,9 +296,9 @@ public class SignAward {
//请求方法 //请求方法
EsignRequestType requestType = EsignRequestType.POST; EsignRequestType requestType = EsignRequestType.POST;
//生成请求签名鉴权方式的Header //生成请求签名鉴权方式的Header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true); Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
//发起接口请求 //发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true); return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
} }
/** /**
@@ -327,9 +327,9 @@ public class SignAward {
//请求方法 //请求方法
EsignRequestType requestType = EsignRequestType.POST; EsignRequestType requestType = EsignRequestType.POST;
//生成请求签名鉴权方式的Header //生成请求签名鉴权方式的Header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true); Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
//发起接口请求 //发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true); return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
} }
/** /**
@@ -368,9 +368,9 @@ public class SignAward {
//请求方法 //请求方法
EsignRequestType requestType = EsignRequestType.POST; EsignRequestType requestType = EsignRequestType.POST;
//生成请求签名鉴权方式的Header //生成请求签名鉴权方式的Header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true); Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
//发起接口请求 //发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true); return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
} }
/** /**
@@ -383,9 +383,9 @@ public class SignAward {
//请求方法 //请求方法
EsignRequestType requestType = EsignRequestType.GET; EsignRequestType requestType = EsignRequestType.GET;
//生成签名鉴权方式的的header //生成签名鉴权方式的的header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true); Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
//发起接口请求 //发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true); return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
} }
/** /**
@@ -399,9 +399,9 @@ public class SignAward {
//请求方法 //请求方法
EsignRequestType requestType = EsignRequestType.GET; EsignRequestType requestType = EsignRequestType.GET;
//生成签名鉴权方式的的header //生成签名鉴权方式的的header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true); Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
//发起接口请求 //发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true); return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
} }
@@ -423,9 +423,9 @@ public class SignAward {
//请求方法 //请求方法
EsignRequestType requestType = EsignRequestType.POST; EsignRequestType requestType = EsignRequestType.POST;
//生成请求签名鉴权方式的Header //生成请求签名鉴权方式的Header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true); Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
//发起接口请求 //发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true); return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
} }
/** /**
@@ -470,9 +470,9 @@ public class SignAward {
//请求方法 //请求方法
EsignRequestType requestType = EsignRequestType.POST; EsignRequestType requestType = EsignRequestType.POST;
//生成签名鉴权方式的的header //生成签名鉴权方式的的header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true); Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
//发起接口请求 //发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true); return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
} }
} }
} }
@@ -495,8 +495,24 @@ public class SignAward {
//请求方法 //请求方法
EsignRequestType requestType= EsignRequestType.GET; EsignRequestType requestType= EsignRequestType.GET;
//生成签名鉴权方式的的header //生成签名鉴权方式的的header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true); Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,false);
//发起接口请求 //发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true); return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,false);
}
/**
* 查询指定印章详情(机构)
*/
public static EsignHttpResponse getOrgSeal(String orgId,String sealId) throws EsignDemoException {
String apiaddr="/v3/seals/org-seal-info?orgId="+orgId+"&sealId="+sealId;
//请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null
String jsonParm=null;
//请求方法
EsignRequestType requestType= EsignRequestType.GET;
//生成签名鉴权方式的的header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,false);
//发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,false);
} }
} }
@@ -63,6 +63,15 @@
</if> </if>
</where> </where>
</select> </select>
<select id="queryAnnexById" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach">
select annex_id,annex_name,annex_path,annex_type,note,use_id,use_account
from case_attach
<where>
<if test="annexId != null ">
AND annex_id = #{annexId}
</if>
</where>
</select>
<update id="updateCaseAttach" parameterType="CaseAttach"> <update id="updateCaseAttach" parameterType="CaseAttach">
update case_attach update case_attach
@@ -17,6 +17,7 @@
<result property="orgId" column="org_id" /> <result property="orgId" column="org_id" />
<result property="authFlowId" column="auth_flow_id" /> <result property="authFlowId" column="auth_flow_id" />
<result property="sealId" column="seal_id" /> <result property="sealId" column="seal_id" />
<result property="sealStatus" column="seal_status" />
</resultMap> </resultMap>
@@ -74,18 +75,25 @@
</select> </select>
<select id="selectDeptIdentifylistother" parameterType="DeptIdentify" resultMap="DeptIdentifyResult"> <select id="selectDeptIdentifylistother" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
SELECT d.id ,d.dept_id ,d.user_id,d.identify_status ,d.is_use SELECT d.id ,d.dept_id ,d.user_id,d.identify_status ,d.is_use ,d.sealName ,d.sealId ,d.annexId
from dept_identify d from dept_identify d
<where> <where>
<if test="identifyStatus != null"> <if test="identifyStatus != null">
AND d.identify_status = #{identifyStatus} AND d.identify_status = #{identifyStatus}
</if> </if>
<if test="id != null"> <if test="id != null">
AND d.id != #{id} AND d.id = #{id}
</if>
<if test="sealStatus != null">
AND d.seal_status = #{sealStatus}
</if>
<if test="deptId != null">
AND d.dept_id = #{deptId}
</if> </if>
</where> </where>
</select> </select>
<update id="updateDeptIdentify" parameterType="DeptIdentify"> <update id="updateDeptIdentify" parameterType="DeptIdentify">
update dept_identify update dept_identify
<set> <set>
@@ -94,8 +102,16 @@
<if test="identifyStatus != null ">identify_status = #{identifyStatus},</if> <if test="identifyStatus != null ">identify_status = #{identifyStatus},</if>
<if test="sealName != null and sealName != ''">seal_name = #{sealName},</if> <if test="sealName != null and sealName != ''">seal_name = #{sealName},</if>
<if test="sealId != null and sealId != ''">seal_id = #{sealId},</if> <if test="sealId != null and sealId != ''">seal_id = #{sealId},</if>
<if test="sealStatus != null ">seal_status = #{sealStatus},</if>
</set> </set>
where id = #{id} <where>
<if test="id != null">
AND d.id = #{id}
</if>
<if test="sealId != null">
AND seal_id = #{sealId}
</if>
</where>
</update> </update>