机构管理.公章管理优化

This commit is contained in:
hejinbo
2023-11-15 18:27:09 +08:00
parent 044cffeb7f
commit 8b0eae8dca
13 changed files with 495 additions and 554 deletions
@@ -2,182 +2,39 @@ package com.ruoyi.wisdomarbitrate.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
import lombok.Data;
import java.util.Date;
@Data
public class DeptIdentify extends BaseEntity {
private static final long serialVersionUID = 1L;
/** ID */
private Long id;
/** 部门ID */
private Long deptId;
/** 用户ID */
private Long userId;
/** 机构名称 */
private String identifyName;
/** 认证状态 */
private Integer identifyStatus;
/** 认证时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date identifyDate;
/** 是否启用 */
private Integer isUse;
/** 用户名称 */
private String nickName;
/** 手机号码 */
private String phonenumber;
/** 部门名称 */
private String deptName;
/** 印章名称 */
private String sealName;
/** 经办人姓名 */
private String operName;
/** 经办人手机号 */
private String operPhone;
/** 机构账号ID */
private String orgId;
/** 认证授权流程ID */
private String authFlowId;
public String getSealId() {
return sealId;
}
public void setSealId(String sealId) {
this.sealId = sealId;
}
/** 印章id */
private String sealId;
/**
* 附件id
*/
private Integer annexId;
/**
* 印章状态 0禁用,1启用
*/
private Integer sealStatus;
public Integer getAnnexId() {
return annexId;
}
public void setAnnexId(Integer annexId) {
this.annexId = annexId;
}
public String getAuthFlowId() {
return authFlowId;
}
public void setAuthFlowId(String authFlowId) {
this.authFlowId = authFlowId;
}
public String getOrgId() {
return orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public String getSealName() {
return sealName;
}
public void setSealName(String sealName) {
this.sealName = sealName;
}
/** 部门认证链接 */
private String identifyUrl;
public String getIdentifyUrl() {
return identifyUrl;
}
/** 机构类型(1 仲裁机构) */
private Integer identifyType;
public void setIdentifyUrl(String identifyUrl) {
this.identifyUrl = identifyUrl;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getPhonenumber() {
return phonenumber;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Integer getIdentifyStatus() {
return identifyStatus;
}
public void setIdentifyStatus(Integer identifyStatus) {
this.identifyStatus = identifyStatus;
}
public Date getIdentifyDate() {
return identifyDate;
}
public void setIdentifyDate(Date identifyDate) {
this.identifyDate = identifyDate;
}
public Integer getIsUse() {
return isUse;
}
public void setIsUse(Integer isUse) {
this.isUse = isUse;
}
public Integer getSealStatus() {
return sealStatus;
}
public void setSealStatus(Integer sealStatus) {
this.sealStatus = sealStatus;
}
}
@@ -0,0 +1,38 @@
package com.ruoyi.wisdomarbitrate.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
@Data
public class SealManage extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long id;
/**
* 机构关联id
*/
private Long identifyId;
/**
* 印章名称
*/
private String sealName;
/**
* 印章id
*/
private String sealId;
/**
* 附件id
*/
private Integer annexId;
/**
* 印章状态(0禁用,1启用)
*/
private Integer sealStatus;
}
@@ -21,7 +21,7 @@ public class SealListVO {
*/
private String annexPath;
/**
* 附件类型,立案申请书(1)、申请人证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)、被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)'
* 附件类型
*/
private Integer annexType;
}
@@ -1,23 +1,20 @@
package com.ruoyi.wisdomarbitrate.mapper;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface DeptIdentifyMapper {
/*
查询仲裁机构信息
*/
List<DeptIdentify> selectDeptIdentify(DeptIdentify deptIdentify);
List<DeptIdentify> selectDeptIdentifyBydeptid(DeptIdentify deptIdentify);
int insertDeptIdentify(DeptIdentify deptIdentify);
List<DeptIdentify> selectDeptIdentifylist(DeptIdentify deptIdentify);
int updateDeptIdentify(DeptIdentify deptIdentify);
List<DeptIdentify> selectDeptIdentifylistother(DeptIdentify deptIdentify);
}
@@ -0,0 +1,16 @@
package com.ruoyi.wisdomarbitrate.mapper;
import com.ruoyi.wisdomarbitrate.domain.SealManage;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SealManageMapper {
List<SealManage> selectSealList(SealManage sealManage);
int insertSealManage(SealManage sealManage);
int updateSealManage(SealManage sealManage1);
}
@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
import com.ruoyi.wisdomarbitrate.domain.SealManage;
import com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
import org.springframework.web.multipart.MultipartFile;
@@ -18,14 +19,16 @@ public interface IDeptIdentifyService {
AjaxResult enableDept(DeptIdentify deptIdentify);
AjaxResult sealUpload(Long id, String sealName , MultipartFile file);
AjaxResult sealUpload(Long id,MultipartFile file);
AjaxResult receiveNotify(String body);
List<SealListVO> getSealList(DeptIdentify deptIdentify);
AjaxResult updateSealLockStatus(DeptIdentify deptIdentify);
AjaxResult updateSealLockStatus(SealManage sealManage);
AjaxResult insertDeptIdentify(DeptIdentify deptIdentify);
}
@@ -115,6 +115,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
private ReservedConferenceMapper reservedConferenceMapper;
@Autowired
private SysDeptMapper deptMapper;
@Autowired
private SealManageMapper sealManageMapper;
// 手机号正则
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}$");
@@ -177,7 +179,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
deptIds.add(sysUser.getDeptId());
caseApplication.setDeptIds(deptIds);
}
if ( role.getRoleName().equals("申请人")) {
if (role.getRoleName().equals("申请人")) {
// 查询角色有关的用户部门
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
}
@@ -238,7 +240,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
deptIds.add(sysUser.getDeptId());
caseApplication.setDeptIds(deptIds);
}
if ( role.getRoleName().equals("申请人")) {
if (role.getRoleName().equals("申请人")) {
// 查询角色有关的用户部门
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
}
@@ -1686,7 +1688,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
if (jsonObject1.getIntValue("errCode") == 0) {
//查看文件上传状态
Thread.sleep(5000);
Thread.sleep(3000);
EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
JSONObject data = jsonObject2.getJSONObject("data");
@@ -1716,12 +1718,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
DeptIdentify deptIdentify = new DeptIdentify();
deptIdentify.setIsUse(1);
DeptIdentify deptIdentifyselect = new DeptIdentify();
List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
deptIdentifyselect = deptIdentifysnew.get(0);
sealSignRecord.setOrgnizeName(deptIdentifyselect.getDeptName());
sealSignRecord.setOrgnizeNamePsnAccount(deptIdentifyselect.getPhonenumber());
sealSignRecord.setOrgnizeNamepsnName(deptIdentifyselect.getNickName());
sealSignRecord.setOrgnizeName(deptIdentifyselect.getIdentifyName());
sealSignRecord.setOrgnizeNamePsnAccount(deptIdentifyselect.getOperName());
sealSignRecord.setOrgnizeNamepsnName(deptIdentifyselect.getOperPhone());
} else {
return AjaxResult.error("没有用印时的机构名称及经办人信息");
}
@@ -1781,19 +1783,45 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
sealIds.add(sealId);
}
}*/
EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord);
JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
if (jsonObject3.getIntValue("code") == 0) {
//获取签署流程ID
JSONObject data1 = jsonObject3.getJSONObject("data");
String signFlowId = data1.getString("signFlowId");
//保存案件id,文件id,文件名称.流程id到签署用印记录表里
sealSignRecord.setCaseAppliId(caseApplication.getId());
sealSignRecord.setSignFlowid(signFlowId);
sealSignRecord.setSignFlowStatus(1);//待签名
sealSignRecordMapper.insertSealSignRecord(sealSignRecord);
} else {
throw new ServiceException("发起签署流程失败,请检查参数是否有误");
String orgnizeName = sealSignRecord.getOrgnizeName(); //机构名称
String orgnizeNamepsnName = sealSignRecord.getOrgnizeNamepsnName(); //机构经办人姓名
String orgnizeNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount(); //机构经办人联系方式
//查询机构信息
DeptIdentify deptIdentify1 = new DeptIdentify();
deptIdentify1.setIdentifyName(orgnizeName);
deptIdentify1.setOperName(orgnizeNamepsnName);
deptIdentify1.setOperPhone(orgnizeNamePsnAccount);
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1);
if (deptIdentifies != null && deptIdentifies.size() > 0) {
Long id = deptIdentifies.get(0).getId();
SealManage sealManage = new SealManage();
sealManage.setIdentifyId(id);
List<String> sealIdList = new ArrayList<>();
List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManage);
if (selectSealList != null && selectSealList.size() > 0) {
for (SealManage manage : selectSealList) {
Integer sealStatus = manage.getSealStatus();
if (sealStatus == 1){
sealIdList.add(manage.getSealId());
}
}
EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord,sealIdList);
JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
if (jsonObject3.getIntValue("code") == 0) {
//获取签署流程ID
JSONObject data1 = jsonObject3.getJSONObject("data");
String signFlowId = data1.getString("signFlowId");
//保存案件id,文件id,文件名称.流程id到签署用印记录表里
sealSignRecord.setCaseAppliId(caseApplication.getId());
sealSignRecord.setSignFlowid(signFlowId);
sealSignRecord.setSignFlowStatus(1);//待签名
sealSignRecordMapper.insertSealSignRecord(sealSignRecord);
} else {
throw new ServiceException("发起签署流程失败,请检查参数是否有误");
}
}
}
}
}
@@ -2580,7 +2608,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
// 新增预约会议表
ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), roomId,
reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime(),1);
reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime(), 1);
reservedConferenceMapper.insert(conference);
return AjaxResult.success("预约会议成功");
@@ -2608,20 +2636,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
String roomId = generateRoomId();
// 新增预约会议表
ReservedConference conference = new ReservedConference(caseId, roomId,
null, null,0);
null, null, 0);
reservedConferenceMapper.insert(conference);
return roomId;
}
/**
* 获取房间号
*
* @return
*/
public String generateRoomId() {
// 查询最大房间号
Integer maxRoomId = caseApplicationMapper.selectMaxRoomId();
if (null == maxRoomId || maxRoomId >999999) {
if (null == maxRoomId || maxRoomId > 999999) {
return "000001";
} else {
return String.format("%06d", maxRoomId);
@@ -2662,13 +2691,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
/**
* 删除房间号
*
* @param roomId
* @return
*/
@Override
public AjaxResult deleteRoom(String roomId) {
return AjaxResult.success( reservedConferenceMapper.deleteByRoomId(roomId));
return AjaxResult.success(reservedConferenceMapper.deleteByRoomId(roomId));
}
}
@@ -12,9 +12,11 @@ import com.ruoyi.common.utils.SealUtil;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
import com.ruoyi.wisdomarbitrate.domain.SealManage;
import com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper;
import com.ruoyi.wisdomarbitrate.mapper.SealManageMapper;
import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
import com.ruoyi.wisdomarbitrate.utils.SignAward;
import org.springframework.beans.factory.annotation.Autowired;
@@ -37,33 +39,20 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
private DeptIdentifyMapper deptIdentifyMapper;
@Autowired
private CaseAttachMapper caseAttachMapper;
@Autowired
private SealManageMapper sealManageMapper;
@Override
@Transactional
public List<DeptIdentify> selectDeptIdentify(DeptIdentify deptIdentify) {
List<DeptIdentify> deptIdentifys = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
if (deptIdentifys != null && deptIdentifys.size() > 0) {
for (int i = 0; i < deptIdentifys.size(); i++) {
DeptIdentify deptIdentifyselect = deptIdentifys.get(i);
List<DeptIdentify> deptIdentifylist = deptIdentifyMapper.selectDeptIdentifyBydeptid(deptIdentifyselect);
if (deptIdentifylist != null && deptIdentifylist.size() > 0) {
continue;
} else {
deptIdentifyselect.setIdentifyStatus(0);
deptIdentifyMapper.insertDeptIdentify(deptIdentifyselect);
}
}
}
List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
return deptIdentifysnew;
return deptIdentifyMapper.selectDeptIdentify(deptIdentify);
}
@Override
@Transactional
public DeptIdentify selectDeptIndefiUrl(DeptIdentify deptIdentify) throws EsignDemoException {
List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
DeptIdentify deptIdentifynew = new DeptIdentify();
if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
Gson gson = new Gson();
@@ -71,7 +60,7 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
EsignHttpResponse identifyUrl = SignAward.deptIdentifyUrl(deptIdentifyselect);
JsonObject signUrlJsonObject = gson.fromJson(identifyUrl.getBody(), JsonObject.class);
int code = signUrlJsonObject.get("code").getAsInt();
if (code == 0){
if (code == 0) {
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
String url = signUrlData.get("authUrl").getAsString();
//获取本次认证授权流程ID
@@ -88,34 +77,36 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
@Override
@Transactional
public AjaxResult enableDept(DeptIdentify deptIdentify) {
List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
//参数校验
if (deptIdentify.getId() == null) {
return AjaxResult.error("请检查参数");
}
List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
DeptIdentify deptIdentifyselect = deptIdentifysnew.get(0);
Integer identifyStatus = deptIdentifyselect.getIdentifyStatus();
if (identifyStatus.intValue() == 0) {
return AjaxResult.error("这个认证数据未进行认证,不能启用");
} else if (identifyStatus.intValue() == 1) {
deptIdentifyselect.setIsUse(1);
deptIdentifyMapper.updateDeptIdentify(deptIdentifyselect);
DeptIdentify deptIdentifySel = new DeptIdentify();
deptIdentifySel.setId(deptIdentify.getId());
deptIdentifySel.setIdentifyStatus(1);
List<DeptIdentify> deptIdentifysother = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentifySel);
if (deptIdentifysother != null && deptIdentifysother.size() > 0) {
for (int i = 0; i < deptIdentifysother.size(); i++) {
DeptIdentify deptIdentifyother = deptIdentifysother.get(i);
deptIdentifyother.setIsUse(0);
deptIdentifyMapper.updateDeptIdentify(deptIdentifyother);
Integer isUse = deptIdentifyselect.getIsUse();
if (isUse == 0) { //机构为未启用状态
Integer identifyStatus = deptIdentifyselect.getIdentifyStatus();
if (identifyStatus == 0) {
return AjaxResult.error("这个认证数据未进行认证,不能启用");
} else {
deptIdentifyselect.setIsUse(1);
int i = deptIdentifyMapper.updateDeptIdentify(deptIdentifyselect);
if (i > 0) {
return AjaxResult.success("启用成功");
}
}
} else { //机构为已启用状态
deptIdentifyselect.setIsUse(0);
int i = deptIdentifyMapper.updateDeptIdentify(deptIdentifyselect);
if (i > 0) {
return AjaxResult.success();
}
}
return AjaxResult.success();
return AjaxResult.error();
}
@Override
public AjaxResult sealUpload(Long id, String sealName , MultipartFile file) {
public AjaxResult sealUpload(Long id, MultipartFile file) {
try {
if (file.isEmpty()) {
return AjaxResult.error("请选择要上传的文件");
@@ -125,11 +116,14 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
String fileName = FileUploadUtils.upload(filePath, file);
DeptIdentify deptIdentify = new DeptIdentify();
deptIdentify.setId(id);
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifyBydeptid(deptIdentify);
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
if (deptIdentifies != null && deptIdentifies.size() > 0) {
for (DeptIdentify identify : deptIdentifies) {
//先判断企业用户是否授予资源管理权限
String authFlowId = identify.getAuthFlowId();
if (authFlowId == null) {
return AjaxResult.error("改机构尚未认证,不能上传自定义公章");
}
EsignHttpResponse response1 = SealUtil.queryAuthProcess(authFlowId);
JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
int authorizedStatus = jsonObject1.getJSONObject("data").getIntValue("authorizedStatus");
@@ -137,32 +131,27 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
String prefix = "/profile";
int startIndex = fileName.indexOf(prefix);
startIndex += prefix.length();
//String annexPath = "home/ruoyi/uploadPath" + fileName.substring(startIndex);
String annexPath = "home/ruoyi/uploadPath" + fileName.substring(startIndex);
//创建机构图片印章
String annexPath = "D:\\develop\\2.jpg";
identify.setSealName(sealName);
EsignHttpResponse response = SignAward.createOrgByImage(identify, annexPath);
// String annexPath = "D:\\develop\\2.jpg";
String sealName = "自定义" + UUID.randomUUID() + ""; //自定义印章印章名称不能重复,所以用UUID确保唯一性
EsignHttpResponse response = SignAward.createOrgByImage(identify,sealName,annexPath);
JSONObject jsonObject = JSONObject.parseObject(response.getBody());
int code = jsonObject.getIntValue("code");
if (code == 0) { //业务码,0表示成功,非0表示异常。
String sealId = jsonObject.getJSONObject("data").getString("sealId");
//保存到表里
DeptIdentify deptIdentify1 = new DeptIdentify();
deptIdentify1.setDeptId(identify.getDeptId());
deptIdentify1.setUserId(identify.getUserId());
deptIdentify1.setIdentifyStatus(identify.getIdentifyStatus());
deptIdentify1.setIdentifyDate(identify.getIdentifyDate());
deptIdentify1.setIsUse(identify.getIsUse());
deptIdentify1.setSealName(sealName);
deptIdentify1.setOrgId(identify.getOrgId());
deptIdentify1.setAuthFlowId(identify.getAuthFlowId());
deptIdentify1.setSealId(sealId);
int i = deptIdentifyMapper.insertDeptIdentify(deptIdentify1);
SealManage sealManage = new SealManage();
sealManage.setIdentifyId(identify.getId());
sealManage.setSealName(sealName);
sealManage.setSealId(sealId);
sealManage.setSealStatus(0); //默认为禁用
int i = sealManageMapper.insertSealManage(sealManage);
if (i > 0) {
return AjaxResult.success("上传成功");
}
}
return AjaxResult.error("公章上传失败,请检查印章名称是否重复");
return AjaxResult.error("公章上传失败,请检查参数");
}
return AjaxResult.error("企业用户未授予资源管理权限");
}
@@ -233,14 +222,14 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
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);
SealManage sealManage = new SealManage();
sealManage.setSealId(sealId);
List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManage);
if (selectSealList != null && selectSealList.size() > 0) {
SealManage sealManage1 = selectSealList.get(0);
sealManage1.setAnnexId(annexId1);
sealManage1.setSealStatus(1); //启用
sealManageMapper.updateSealManage(sealManage1);
}
}
}
@@ -258,33 +247,62 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
@Override
public List<SealListVO> getSealList(DeptIdentify deptIdentify) {
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentify);
if (deptIdentify.getId() == null) {
return null;
}
SealManage sealManage = new SealManage();
sealManage.setIdentifyId(deptIdentify.getId());
List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManage);
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);
if (selectSealList != null && selectSealList.size() > 0) {
for (SealManage sealManage1 : selectSealList) {
Integer annexId = sealManage1.getAnnexId();
if (annexId != null) { //附件id有值,证明是审核通过了的
SealListVO sealListVO = new SealListVO();
sealListVO.setSealId(sealManage1.getSealId());
sealListVO.setSealName(sealManage1.getSealName());
sealListVO.setSealStatus(sealManage1.getSealStatus());
//根据附件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);
public AjaxResult updateSealLockStatus(SealManage sealManage) {
sealManageMapper.updateSealManage(sealManage);
return AjaxResult.success();
}
@Override
public AjaxResult insertDeptIdentify(DeptIdentify deptIdentify) {
//参数校验
String identifyName = deptIdentify.getIdentifyName();
String operName = deptIdentify.getOperName();
String operPhone = deptIdentify.getOperPhone();
if (identifyName == null || operName == null || operPhone == null) {
AjaxResult.error("请检查参数是否完整");
}
Integer identifyType = deptIdentify.getIdentifyType();
if (identifyType == null) {
deptIdentify.setIdentifyType(1); // 设置机构默认为仲裁机构
}
deptIdentify.setIdentifyStatus(0); //设置认证状态默认为未认证
deptIdentify.setIsUse(0); //设置认证状态默认为未认证
int i = deptIdentifyMapper.insertDeptIdentify(deptIdentify);//设置机构默认为未启用
if (i > 0) {
return AjaxResult.success("新增成功");
}
return AjaxResult.error();
}
}
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.ruoyi.common.constant.CaseApplicationConstants;
import com.ruoyi.common.constant.FileTransformation;
@@ -11,14 +12,8 @@ import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.common.utils.SealUtil;
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper;
import com.ruoyi.wisdomarbitrate.mapper.SealSignRecordMapper;
import com.ruoyi.wisdomarbitrate.domain.*;
import com.ruoyi.wisdomarbitrate.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -27,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import java.io.IOException;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@@ -41,7 +37,11 @@ public class FixSelectFlowDetailUtils {
private CaseAttachMapper caseAttachMapper;
@Autowired
private DeptIdentifyMapper deptIdentifyMapper;
@Autowired
private SealManageMapper sealManageMapper;
/*
定时查询签署流程详情
*/
@Scheduled(cron = "0/10 * * * * ?")
@Transactional
public void fixExecuteSelectFlowDetailUtils() {
@@ -171,17 +171,21 @@ public class FixSelectFlowDetailUtils {
}
@Scheduled(cron = "0/30 * * * * ?")
/**
* 定时查询企业认证状态
* @throws Exception
*/
@Scheduled(cron = "0 0/30 * * * ?")
@Transactional
public void fixExecuteSelectDeptIndentifyUtils() throws EsignDemoException {
public void fixExecuteSelectDeptIndentifyUtils() throws Exception {
Gson gson = new Gson();
DeptIdentify deptIdentify = new DeptIdentify();
deptIdentify.setIdentifyStatus(0);
List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
for (int i = 0; i < deptIdentifysnew.size(); i++) {
EsignHttpResponse identifyInfo = SignAward.getDeptIdentifyInfo(deptIdentifysnew.get(i));
DeptIdentify deptIdentify1 = deptIdentifysnew.get(i);
EsignHttpResponse identifyInfo = SignAward.getDeptIdentifyInfo(deptIdentify1);
JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class);
int code = identifyInfoJsonObject.get("code").getAsInt();
if (code == 0) {
@@ -189,27 +193,66 @@ public class FixSelectFlowDetailUtils {
int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt();
if (realnameStatus == 1) {
String orgId = identifyInfoData.get("orgId").getAsString();
System.out.println("这是orgId" + orgId + "=======================");
EsignHttpResponse identifyInfo1 = SignAward.deptIdentifySealList(orgId);
//将orgId保存到数据库里
DeptIdentify deptIdentifynew = deptIdentifysnew.get(i);
deptIdentifynew.setOrgId(orgId);
JsonObject identifyInfoJsonObject1 = gson.fromJson(identifyInfo1.getBody(), JsonObject.class);
JsonObject identifyInfoData1 = identifyInfoJsonObject1.getAsJsonObject("data");
JsonArray sealArray = identifyInfoData1.get("seals").getAsJsonArray();
String sealNames = "";
if (sealArray.size() > 0) {
for (int j = 0; j < sealArray.size(); j++) {
JsonObject sealObject = (JsonObject) sealArray.get(j);
String sealName = sealObject.get("sealName").toString();
String sealNamenew = sealName.substring(1, sealName.length() - 1);
sealNames += sealNamenew + ",";
//查询企业内部印章
EsignHttpResponse response = SignAward.deptIdentifySealList(orgId);
JsonObject jsonObject = gson.fromJson(response.getBody(), JsonObject.class);
int code1 = jsonObject.get("code").getAsInt();
if (code1 == 0){
JsonObject data = jsonObject.getAsJsonObject("data");
JsonArray seals = data.get("seals").getAsJsonArray();
if (seals.size() > 0) {
for (int j = 0; j < seals.size(); j++) {
//保存印章信息到数据库
JsonObject asJsonObject = seals.get(j).getAsJsonObject();
SealManage sealManage = new SealManage();
String sealName = asJsonObject.get("sealName").toString();
String sealId = asJsonObject.get("sealId").toString();
String url = asJsonObject.get("sealImageDownloadUrl").toString();
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(url, 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) {
//将印章信息保存到公章管理表里
Integer annexId1 = caseAttach.getAnnexId();
sealManage.setAnnexId(annexId1);
sealManage.setSealId(sealId);
sealManage.setSealName(sealName);
sealManage.setIdentifyId(deptIdentify1.getId());
sealManage.setSealStatus(1);
sealManageMapper.insertSealManage(sealManage);
}
}
}
}
}
String sealName = sealNames.substring(0, sealNames.length() - 1);
deptIdentifynew.setIdentifyStatus(1);
deptIdentifynew.setSealName(sealName);
int row = deptIdentifyMapper.updateDeptIdentify(deptIdentifynew);
//将orgId保存到数据库里
deptIdentify1.setOrgId(orgId);
deptIdentify1.setIdentifyStatus(1);
deptIdentify1.setIsUse(0); //默认机构为未启用
int row = deptIdentifyMapper.updateDeptIdentify(deptIdentify1);
}
}
}
@@ -217,68 +260,77 @@ public class FixSelectFlowDetailUtils {
}
/**
* 定时查询企业内部印章审核状态
*
* @throws EsignDemoException
* 定时查询印章审核状态
*/
// @Scheduled(cron = "0/30 * * * * ?")
@Scheduled(cron = "0/30 * * * * ?")
@Transactional
public void searchForInstitutionalSeal() {
try {
DeptIdentify deptIdentify = new DeptIdentify();
deptIdentify.setIsUse(0);
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
if (deptIdentifies != null && deptIdentifies.size() > 0) {
for (DeptIdentify identify : deptIdentifies) {
SealManage sealManage = new SealManage();
sealManage.setSealStatus(0);
List<SealManage> sealManageList = sealManageMapper.selectSealList(sealManage);
if (sealManageList != null && sealManageList.size() > 0) {
for (SealManage sealManage1 : sealManageList) {
//查询企业内部印章
Integer annexId = identify.getAnnexId();
if (annexId == null) {
//说明之前没有下载过
EsignHttpResponse response = SignAward.orgOwnSealList(identify);
JSONObject jsonObject = JSONObject.parseObject(response.getBody());
JSONObject data = jsonObject.getJSONObject("data");
JSONArray seals = data.getJSONArray("seals");
for (int i = 0; i < seals.size(); i++) {
JSONObject seal = seals.getJSONObject(i);
int statusDescription = seal.getIntValue("statusDescription");
if (statusDescription == 1) {//印章状态 1已启用,2待审核,3审核不通过,4 挂起
//已启用证明审核通过,下载到数据库
String sealImageDownloadUrl = seal.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();
identify.setAnnexId(annexId1);
deptIdentifyMapper.updateDeptIdentify(identify);
Integer annexId = sealManage1.getAnnexId();
String sealId = sealManage1.getSealId();
DeptIdentify deptIdentify = new DeptIdentify();
deptIdentify.setId(sealManage1.getIdentifyId());
List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
if (deptIdentifies != null && deptIdentifies.size() > 0) {
DeptIdentify deptIdentify1 = deptIdentifies.get(0);
String orgId = deptIdentify1.getOrgId();
if (orgId == null) {
continue;
}
if (annexId == null) {
//说明之前没有下载过
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("-", "") + ".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();
sealManage1.setAnnexId(annexId1);
sealManageMapper.updateSealManage(sealManage1);
}
}
}
}
}
}
}
}
} catch (EsignDemoException e) {
@@ -288,79 +340,6 @@ public class FixSelectFlowDetailUtils {
}
}
/* public static void main(String[] args) throws Exception {
Gson gson = new Gson();
SealSignRecord sealSignRecord = new SealSignRecord();
sealSignRecord.setCaseAppliId(1350L);
sealSignRecord.setSignFlowid("24ca7172f1a242238937d952c2e7fbff");
EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(), JsonObject.class);
JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
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();
}
}
if (!(signerObject.get("orgSigner").toString()).equals("null")) {
JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
if (orgSignerData != null) {
orgsignStatus = signerObject.get("signStatus").getAsInt();
}
}
}
if ((psnsignStatus.intValue() == 2) && (orgsignStatus.intValue() == 2)) {
//下载审核完成的裁决书,
String signFlowId = "24ca7172f1a242238937d952c2e7fbff";
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();
System.out.println(fileDownloadUrl);
String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
System.out.println(filearbitraUrl);
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) {
System.out.println("chenggong ===============");
}
}
}
}*/
}
@@ -18,6 +18,7 @@ import java.io.File;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
public class SignAward {
@@ -119,10 +120,7 @@ public class SignAward {
// System.out.println(signFlowDetailJsonObject);
DeptIdentify deptIdentify = new DeptIdentify();
deptIdentify.setOrgId("db279dd50d844e6fa64770d9a6edc7dd");
EsignHttpResponse orgByImage = createOrgByImage(deptIdentify, "D:\\develop\\2.jpg");
System.out.println("这是结果===============" + orgByImage);
}
@@ -150,7 +148,7 @@ public class SignAward {
* @return
* @throws EsignDemoException
*/
public static EsignHttpResponse createByFile(SealSignRecord sealSignRecord) throws EsignDemoException {
public static EsignHttpResponse createByFile(SealSignRecord sealSignRecord ,List<String> sealIdList) throws EsignDemoException {
String apiaddr = "/v3/sign-flow/create-by-file";
String fileId = sealSignRecord.getFileid();
@@ -248,10 +246,10 @@ public class SignAward {
" \"autoSign\": false,\n" +
" \"freeMode\": false,\n" +
" \"availableSealIds\": [\n" +
/* " \"availableSealIds\": [\n" +
" \"" + availableSealId + "\"\n" +
" ],\n" +
" ],\n" +*/
" \"availableSealIds\": " + new Gson().toJson(sealIdList) + "\n" +
" \"signFieldPosition\": {\n" +
" \"positionPage\": \"" + positionPageorg + "\",\n" +
@@ -343,16 +341,16 @@ public class SignAward {
*/
public static EsignHttpResponse deptIdentifyUrl(DeptIdentify deptIdentify) throws EsignDemoException {
String apiaddr = "/v3/org-auth-url";
String nickName = deptIdentify.getNickName();
String phonenumber = deptIdentify.getPhonenumber();
String deptName = deptIdentify.getDeptName();
String psnName = deptIdentify.getOperName();
String phonenumber = deptIdentify.getOperPhone();
String orgName = deptIdentify.getIdentifyName();
String jsonParm = "{\n" +
" \"orgAuthConfig\": {\n" +
" \"orgName\": \"" + deptName + " \",\n" +
" \"orgName\": \"" + orgName + " \",\n" +
" \"transactorInfo\": {\n" +
" \"psnAccount\": \"" + phonenumber + "\",\n" +
" \"psnInfo\": {\n" +
" \"psnName\": \"" + nickName + "\",\n" +
" \"psnName\": \"" + psnName + "\",\n" +
" \"psnMobile\": \"" + phonenumber + "\"\n" +
" }\n" +
" }\n" +
@@ -381,7 +379,7 @@ public class SignAward {
* 查询企业认证状态
*/
public static EsignHttpResponse getDeptIdentifyInfo(DeptIdentify deptIdentify) throws EsignDemoException {
String apiaddr = "/v3/organizations/identity-info?orgName=" + deptIdentify.getDeptName();
String apiaddr = "/v3/organizations/identity-info?orgName=" + deptIdentify.getIdentifyName();
String jsonParm = "{}";
//请求方法
@@ -392,8 +390,9 @@ public class SignAward {
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
}
/**
* 查询企业认证印章信息
* 查询企业内部印章
*/
public static EsignHttpResponse deptIdentifySealList(String orgId) throws EsignDemoException {
int pageNum = 1;
@@ -437,7 +436,7 @@ public class SignAward {
*
* @return
*/
public static EsignHttpResponse createOrgByImage(DeptIdentify deptIdentify, String filePath) throws EsignDemoException {
public static EsignHttpResponse createOrgByImage(DeptIdentify deptIdentify,String sealName, String filePath) throws EsignDemoException {
String apiaddr = "/v3/seals/org-seals/create-by-image";
String orgId = deptIdentify.getOrgId();
//上传印章图片
@@ -452,7 +451,7 @@ public class SignAward {
if (errCode == 0) { //业务码,0表示成功,非0表示异常。
//获取步骤一里面的fileKey
String sealImageFileKey = jsonObject1.getJSONObject("data").getString("fileKey");
String sealName = deptIdentify.getSealName();
//请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null
String jsonParm = "{\n" +
" \"orgId\": \"" + orgId + "\",\n" +
@@ -473,26 +472,8 @@ public class SignAward {
return null;
}
/**
* 查询企业内部印章
*/
public static EsignHttpResponse orgOwnSealList(DeptIdentify deptIdentify) throws EsignDemoException {
String orgId = deptIdentify.getOrgId();
int pageNum = 1;
int pageSize = 20;
String apiaddr = "/v3/seals/org-own-seal-list?orgId=" + orgId + "&pageNum=" + pageNum + "&pageSize=" + pageSize;
//请求参数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);
}
/**
* 查询指定印章详情(机构)