diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index cd363e3..a10b1d6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -252,7 +252,7 @@ public class CaseApplicationController extends BaseController { @PostMapping("/checkArbitrateRecord") public AjaxResult checkArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) { - return toAjax(caseApplicationService.checkArbitrateRecord(caseApplication)); + return caseApplicationService.checkArbitrateRecord(caseApplication); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java new file mode 100644 index 0000000..3366e0a --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java @@ -0,0 +1,56 @@ +package com.ruoyi.web.controller.wisdomarbitrate; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.DeptIdentify; +import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; +import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/deptIdentify") +public class DeptIdentifyController extends BaseController { + @Autowired + private IDeptIdentifyService deptIdentifyService; + + /** + * 查询部门认证数据 + */ + @GetMapping("/list") + public TableDataInfo list(DeptIdentify deptIdentify) { + startPage(); + List list = deptIdentifyService.selectDeptIdentify(deptIdentify); + return getDataTable(list); + } + + /** + * 查询机构认证链接 + */ + @PostMapping("/selectDeptIndefiUrl") + public AjaxResult selectDeptIndefiUrl(@Validated @RequestBody DeptIdentify deptIdentify) throws EsignDemoException { + DeptIdentify deptIdentifyselect = deptIdentifyService.selectDeptIndefiUrl(deptIdentify); + return success(deptIdentifyselect); + } + + /** + * 启用 + */ + @PostMapping("/enableDept") + public AjaxResult enableDept(@Validated @RequestBody DeptIdentify deptIdentify) { + return deptIdentifyService.enableDept(deptIdentify); + } + + + + + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java index fb18c5c..f98291a 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java @@ -31,6 +31,9 @@ public class SysDept extends BaseEntity /** 部门名称 */ private String deptName; + /** 部门类型 */ + private Integer deptType; + /** 显示顺序 */ private Integer orderNum; @@ -51,7 +54,15 @@ public class SysDept extends BaseEntity /** 父部门名称 */ private String parentName; - + + public Integer getDeptType() { + return deptType; + } + + public void setDeptType(Integer deptType) { + this.deptType = deptType; + } + /** 子部门 */ private List children = new ArrayList(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java new file mode 100644 index 0000000..a45a78e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java @@ -0,0 +1,126 @@ +package com.ruoyi.wisdomarbitrate.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.core.domain.BaseEntity; + +import java.util.Date; + +public class DeptIdentify extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** ID */ + private Long id; + /** 部门ID */ + private Long deptId; + /** 用户ID */ + private Long userId; + + /** 认证状态 */ + 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; + + public String getSealName() { + return sealName; + } + + public void setSealName(String sealName) { + this.sealName = sealName; + } + + /** 部门认证链接 */ + private String identifyUrl; + + public String getIdentifyUrl() { + return identifyUrl; + } + + 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; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/DeptIdentifyMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/DeptIdentifyMapper.java new file mode 100644 index 0000000..5261ede --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/DeptIdentifyMapper.java @@ -0,0 +1,22 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.DeptIdentify; + +import java.util.List; + +public interface DeptIdentifyMapper { + + + List selectDeptIdentify(DeptIdentify deptIdentify); + + List selectDeptIdentifyBydeptid(DeptIdentify deptIdentify); + + int insertDeptIdentify(DeptIdentify deptIdentify); + + List selectDeptIdentifylist(DeptIdentify deptIdentify); + + int updateDeptIdentify(DeptIdentify deptIdentify); + + List selectDeptIdentifylistother(DeptIdentify deptIdentify); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index 6291b64..25cf01a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -38,7 +38,7 @@ public interface ICaseApplicationService { int verificationArbitrateRecord(CaseApplication caseApplication); - int checkArbitrateRecord(CaseApplication caseApplication); + AjaxResult checkArbitrateRecord(CaseApplication caseApplication); int submitCaseApplicationCheck(List ids, Integer agreeOrNotCheck); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IDeptIdentifyService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IDeptIdentifyService.java new file mode 100644 index 0000000..e6d3753 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IDeptIdentifyService.java @@ -0,0 +1,18 @@ +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 java.util.List; + +public interface IDeptIdentifyService { + + + List selectDeptIdentify(DeptIdentify deptIdentify); + + + DeptIdentify selectDeptIndefiUrl(DeptIdentify deptIdentify) throws EsignDemoException; + + AjaxResult enableDept(DeptIdentify deptIdentify); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index c9862c8..43535ee 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -89,6 +89,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private CaseEvidenceDirectoryMapper caseEvidenceDirectoryMapper; @Autowired private SmsRecordMapper smsRecordMapper; + @Autowired + private DeptIdentifyMapper deptIdentifyMapper; // 手机号正则 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}$"); @@ -1537,7 +1539,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional - public int checkArbitrateRecord(CaseApplication caseApplication) { + public AjaxResult checkArbitrateRecord(CaseApplication caseApplication) { int rows = 0; ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); @@ -1587,14 +1589,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (arbitratorId!=null){ SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId)); if (sysUser == null){ - return rows; + return AjaxResult.error(); } sealSignRecord.setPensonAccount(sysUser.getPhonenumber()); sealSignRecord.setPensonName(sysUser.getNickName()); } - sealSignRecord.setOrgnizeName("西安云美电子科技有限公司"); - sealSignRecord.setOrgnizeNamePsnAccount("17691338406"); - sealSignRecord.setOrgnizeNamepsnName("韩超勃"); + + DeptIdentify deptIdentify = new DeptIdentify(); + deptIdentify.setIsUse(1); + DeptIdentify deptIdentifyselect = new DeptIdentify(); + List deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify); + if(deptIdentifysnew!=null&&deptIdentifysnew.size()>0){ + deptIdentifyselect = deptIdentifysnew.get(0); + sealSignRecord.setOrgnizeName(deptIdentifyselect.getDeptName()); + sealSignRecord.setOrgnizeNamePsnAccount(deptIdentifyselect.getPhonenumber()); + sealSignRecord.setOrgnizeNamepsnName(deptIdentifyselect.getNickName()); + }else { + return AjaxResult.error("没有用印时的机构名称及经办人信息"); + } + //解析文件签名印章位置 JSONArray jsonArray = JSONArray.parseArray(keywordPositions); for (int i = 0; i < jsonArray.size(); i++) { @@ -1671,7 +1684,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows = caseApplicationMapper.submitCaseApplication(caseApplication); } - return rows; + return AjaxResult.success(); } @Override diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java new file mode 100644 index 0000000..a00f982 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java @@ -0,0 +1,97 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.EsignHttpResponse; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.wisdomarbitrate.domain.DeptIdentify; +import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper; +import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService; +import com.ruoyi.wisdomarbitrate.utils.SignAward; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +@Service +public class DeptIdentifyServiceImpl implements IDeptIdentifyService { + + @Autowired + private DeptIdentifyMapper deptIdentifyMapper; + + + @Override + @Transactional + public List selectDeptIdentify(DeptIdentify deptIdentify) { + List deptIdentifys = deptIdentifyMapper.selectDeptIdentify(deptIdentify); + if(deptIdentifys!=null&&deptIdentifys.size()>0){ + for (int i = 0; i < deptIdentifys.size(); i++) { + DeptIdentify deptIdentifyselect = deptIdentifys.get(i); + List deptIdentifylist = deptIdentifyMapper.selectDeptIdentifyBydeptid(deptIdentifyselect); + if(deptIdentifylist!=null&&deptIdentifylist.size()>0){ + continue; + }else { + deptIdentifyselect.setIdentifyStatus(0); + deptIdentifyMapper.insertDeptIdentify(deptIdentifyselect); + } + } + } + + List deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify); + return deptIdentifysnew; + } + + @Override + @Transactional + public DeptIdentify selectDeptIndefiUrl(DeptIdentify deptIdentify) throws EsignDemoException { + List deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify); + DeptIdentify deptIdentifynew = new DeptIdentify(); + if(deptIdentifysnew!=null&&deptIdentifysnew.size()>0){ + Gson gson = new Gson(); + DeptIdentify deptIdentifyselect = deptIdentifysnew.get(0); + EsignHttpResponse identifyUrl = SignAward.deptIdentifyUrl(deptIdentifyselect); + JsonObject signUrlJsonObject = gson.fromJson(identifyUrl.getBody(), JsonObject.class); + JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); + String url = signUrlData.get("authUrl").getAsString(); + deptIdentifynew.setIdentifyUrl(url); + } + + deptIdentify.setIdentifyDate(new Date()); + int row = deptIdentifyMapper.updateDeptIdentify(deptIdentify); + return deptIdentifynew; + } + + @Override + @Transactional + public AjaxResult enableDept(DeptIdentify deptIdentify) { + List deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(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 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); + } + } + + } + return AjaxResult.success(); + + } + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java index 0d7bc68..6e6abc5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java @@ -10,9 +10,11 @@ import com.ruoyi.common.exception.EsignDemoException; 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 org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; @@ -32,6 +34,8 @@ public class FixSelectFlowDetailUtils { private SealSignRecordMapper sealSignRecordMapper; @Autowired private CaseAttachMapper caseAttachMapper; + @Autowired + private DeptIdentifyMapper deptIdentifyMapper; @Scheduled(cron = "0/3 * * * * ?") @Transactional @@ -121,6 +125,48 @@ public class FixSelectFlowDetailUtils { } + @Scheduled(cron = "0/10 * * * * ?") + @Transactional + public void fixExecuteSelectDeptIndentifyUtils() throws EsignDemoException { + Gson gson = new Gson(); + DeptIdentify deptIdentify = new DeptIdentify(); + deptIdentify.setIdentifyStatus(0); + List deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify); + if(deptIdentifysnew!=null&&deptIdentifysnew.size()>0){ + for (int i = 0; i < deptIdentifysnew.size(); i++) { + EsignHttpResponse identifyInfo = SignAward.getDeptIdentifyInfo(deptIdentifysnew.get(i)); + JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class); + JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data"); + int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt(); + String orgId = identifyInfoData.get("orgId").getAsString(); + if(realnameStatus==1){ + EsignHttpResponse identifyInfo1 = SignAward.deptIdentifySealList(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 +","; + } + } + String sealName = sealNames.substring(0,sealNames.length()-1); + DeptIdentify deptIdentifynew = deptIdentifysnew.get(i); + deptIdentifynew.setIdentifyStatus(1); + deptIdentifynew.setSealName(sealName); + int row = deptIdentifyMapper.updateDeptIdentify(deptIdentifynew); + } + + } + + } + + } + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java index c260992..3c1418c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java @@ -9,6 +9,7 @@ import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.EsignApplicaConfig; import com.ruoyi.common.utils.EsignHttpHelper; +import com.ruoyi.wisdomarbitrate.domain.DeptIdentify; import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import java.util.Date; @@ -19,8 +20,6 @@ public class SignAward { private static String eSignHost= EsignApplicaConfig.EsignHost; private static String eSignAppId= EsignApplicaConfig.EsignAppId; private static String eSignAppSecret= EsignApplicaConfig.EsignAppSecret; -// public static String fileId = "95d0c307d91e4985bdb8874f6f84daa5"; - public static String fileId = "a0c2ad21065f48ff8b872412c39d5d3a"; @@ -63,6 +62,35 @@ public class SignAward { // System.out.println("签署长链接:" +shortusesealUrl); // System.out.println("签署短链接:"+sealUrl); + //查询机构认证信息 +// DeptIdentify deptIdentify = new DeptIdentify(); +// deptIdentify.setDeptName("西安云美电子科技有限公司"); +// EsignHttpResponse identifyInfo = getDeptIdentifyInfo(deptIdentify); +// JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class); +// JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data"); +// int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt(); +// String orgId = identifyInfoData.get("orgId").getAsString(); +// System.out.println("机构认证状态:" +realnameStatus); +// System.out.println("机构id:" +orgId); + +// EsignHttpResponse identifyInfo = deptIdentifySealList(orgId); +// JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class); +// JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data"); +// JsonArray sealArray = identifyInfoData.get("seals").getAsJsonArray(); +// String sealNames = ""; +// if(sealArray.size()>0){ +// for (int i = 0; i < sealArray.size(); i++) { +// JsonObject sealObject = (JsonObject)sealArray.get(i); +// String sealName = sealObject.get("sealName").toString(); +// String sealNamenew = sealName.substring(1,sealName.length()-1); +// sealNames += sealNamenew +","; +// } +// } +// System.out.println("机构印章名称:" +sealNames.substring(0,sealNames.length()-1)); + + + + //查询签署流程详情 // EsignHttpResponse signFlowDetail = signFlowDetail(sealSignRecord); // JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); @@ -91,12 +119,7 @@ public class SignAward { // System.out.println(signFlowDetailJsonObject); - String annexName = "/profile/upload/2023/10/26/1f6fe04f5f984e8ab5bbaf70dd47100a.docx"; - String prefix = "/profile/upload/"; - int startIndex = prefix.length(); - String annexPath = "/home/ruoyi/uploadPath/upload/"; - String annexPathnew = annexPath + annexName.substring(startIndex); - System.out.println(annexPathnew); + } @@ -317,6 +340,69 @@ public class SignAward { return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true); } + /** + * 获取机构认证链接 + * @return + * @throws EsignDemoException + */ + 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 jsonParm = "{\n" + + " \"orgAuthConfig\": {\n" + + " \"orgName\": \"" + deptName + "\",\n" + + " \"transactorInfo\": {\n" + + " \"psnAccount\": \"" + phonenumber + "\",\n" + + " \"psnInfo\": {\n" + + " \"psnName\": \"" + nickName + "\",\n" + + " \"psnMobile\": \"" + phonenumber + "\"\n" + + " }\n" + + + " }\n" + + " }\n" + + "}"; + //请求方法 + EsignRequestType requestType = EsignRequestType.POST; + //生成请求签名鉴权方式的Header + Map header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, true); + //发起接口请求 + return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true); + } + + /** + * 查询企业认证状态 + */ + public static EsignHttpResponse getDeptIdentifyInfo(DeptIdentify deptIdentify) throws EsignDemoException { + String apiaddr="/v3/organizations/identity-info?orgName="+deptIdentify.getDeptName(); + + String jsonParm="{}"; + //请求方法 + EsignRequestType requestType= EsignRequestType.GET; + //生成签名鉴权方式的的header + Map header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true); + //发起接口请求 + return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true); + } + /** + * 查询企业认证印章信息 + */ + public static EsignHttpResponse deptIdentifySealList(String orgId) throws EsignDemoException { + int pageNum=1; + int pageSize=10; + String apiaddr="/v3/seals/org-own-seal-list?orgId="+orgId+"&pageNum="+pageNum+"&pageSize="+pageSize; + String jsonParm=null; + //请求方法 + EsignRequestType requestType= EsignRequestType.GET; + //生成签名鉴权方式的的header + Map header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true); + //发起接口请求 + return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true); + } + + + /** * 获取文件签名印章位置 * @return diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 2fafdc1..48a45b7 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -96,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" dept_id, parent_id, dept_name, + dept_type, ancestors, order_num, leader, @@ -108,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{deptId}, #{parentId}, #{deptName}, + #{deptType}, #{ancestors}, #{orderNum}, #{leader}, @@ -124,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" parent_id = #{parentId}, dept_name = #{deptName}, + dept_type = #{deptType}, ancestors = #{ancestors}, order_num = #{orderNum}, leader = #{leader}, diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml new file mode 100644 index 0000000..a4404e2 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + insert into dept_identify( + dept_id, + user_id, + identify_status + )values( + #{deptId}, + #{userId}, + #{identifyStatus} + ) + + + + + + + + update dept_identify + + identify_date = #{identifyDate}, + is_use = #{isUse}, + identify_status = #{identifyStatus}, + seal_name = #{sealName}, + + where id = #{id} + + + + + + + + + \ No newline at end of file