实现机构认证功能
This commit is contained in:
+1
-1
@@ -252,7 +252,7 @@ public class CaseApplicationController extends BaseController {
|
|||||||
@PostMapping("/checkArbitrateRecord")
|
@PostMapping("/checkArbitrateRecord")
|
||||||
public AjaxResult checkArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) {
|
public AjaxResult checkArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
|
||||||
return toAjax(caseApplicationService.checkArbitrateRecord(caseApplication));
|
return caseApplicationService.checkArbitrateRecord(caseApplication);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+56
@@ -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<DeptIdentify> 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -31,6 +31,9 @@ public class SysDept extends BaseEntity
|
|||||||
/** 部门名称 */
|
/** 部门名称 */
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
|
/** 部门类型 */
|
||||||
|
private Integer deptType;
|
||||||
|
|
||||||
/** 显示顺序 */
|
/** 显示顺序 */
|
||||||
private Integer orderNum;
|
private Integer orderNum;
|
||||||
|
|
||||||
@@ -51,7 +54,15 @@ public class SysDept extends BaseEntity
|
|||||||
|
|
||||||
/** 父部门名称 */
|
/** 父部门名称 */
|
||||||
private String parentName;
|
private String parentName;
|
||||||
|
|
||||||
|
public Integer getDeptType() {
|
||||||
|
return deptType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeptType(Integer deptType) {
|
||||||
|
this.deptType = deptType;
|
||||||
|
}
|
||||||
|
|
||||||
/** 子部门 */
|
/** 子部门 */
|
||||||
private List<SysDept> children = new ArrayList<SysDept>();
|
private List<SysDept> children = new ArrayList<SysDept>();
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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<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);
|
||||||
|
}
|
||||||
+1
-1
@@ -38,7 +38,7 @@ public interface ICaseApplicationService {
|
|||||||
|
|
||||||
int verificationArbitrateRecord(CaseApplication caseApplication);
|
int verificationArbitrateRecord(CaseApplication caseApplication);
|
||||||
|
|
||||||
int checkArbitrateRecord(CaseApplication caseApplication);
|
AjaxResult checkArbitrateRecord(CaseApplication caseApplication);
|
||||||
|
|
||||||
int submitCaseApplicationCheck(List<Long> ids, Integer agreeOrNotCheck);
|
int submitCaseApplicationCheck(List<Long> ids, Integer agreeOrNotCheck);
|
||||||
|
|
||||||
|
|||||||
+18
@@ -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<DeptIdentify> selectDeptIdentify(DeptIdentify deptIdentify);
|
||||||
|
|
||||||
|
|
||||||
|
DeptIdentify selectDeptIndefiUrl(DeptIdentify deptIdentify) throws EsignDemoException;
|
||||||
|
|
||||||
|
AjaxResult enableDept(DeptIdentify deptIdentify);
|
||||||
|
}
|
||||||
+19
-6
@@ -89,6 +89,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
private CaseEvidenceDirectoryMapper caseEvidenceDirectoryMapper;
|
private CaseEvidenceDirectoryMapper caseEvidenceDirectoryMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SmsRecordMapper smsRecordMapper;
|
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}$");
|
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
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int checkArbitrateRecord(CaseApplication caseApplication) {
|
public AjaxResult checkArbitrateRecord(CaseApplication caseApplication) {
|
||||||
int rows = 0;
|
int rows = 0;
|
||||||
ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
|
ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
|
||||||
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
|
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
|
||||||
@@ -1587,14 +1589,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
if (arbitratorId!=null){
|
if (arbitratorId!=null){
|
||||||
SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId));
|
SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId));
|
||||||
if (sysUser == null){
|
if (sysUser == null){
|
||||||
return rows;
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
sealSignRecord.setPensonAccount(sysUser.getPhonenumber());
|
sealSignRecord.setPensonAccount(sysUser.getPhonenumber());
|
||||||
sealSignRecord.setPensonName(sysUser.getNickName());
|
sealSignRecord.setPensonName(sysUser.getNickName());
|
||||||
}
|
}
|
||||||
sealSignRecord.setOrgnizeName("西安云美电子科技有限公司");
|
|
||||||
sealSignRecord.setOrgnizeNamePsnAccount("17691338406");
|
DeptIdentify deptIdentify = new DeptIdentify();
|
||||||
sealSignRecord.setOrgnizeNamepsnName("韩超勃");
|
deptIdentify.setIsUse(1);
|
||||||
|
DeptIdentify deptIdentifyselect = new DeptIdentify();
|
||||||
|
List<DeptIdentify> 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);
|
JSONArray jsonArray = JSONArray.parseArray(keywordPositions);
|
||||||
for (int i = 0; i < jsonArray.size(); i++) {
|
for (int i = 0; i < jsonArray.size(); i++) {
|
||||||
@@ -1671,7 +1684,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rows;
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+97
@@ -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<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;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public DeptIdentify selectDeptIndefiUrl(DeptIdentify deptIdentify) throws EsignDemoException {
|
||||||
|
List<DeptIdentify> 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<DeptIdentify> 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<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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+46
@@ -10,9 +10,11 @@ import com.ruoyi.common.exception.EsignDemoException;
|
|||||||
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
|
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
|
||||||
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
||||||
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
||||||
|
import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper;
|
||||||
import com.ruoyi.wisdomarbitrate.mapper.SealSignRecordMapper;
|
import com.ruoyi.wisdomarbitrate.mapper.SealSignRecordMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
@@ -32,6 +34,8 @@ public class FixSelectFlowDetailUtils {
|
|||||||
private SealSignRecordMapper sealSignRecordMapper;
|
private SealSignRecordMapper sealSignRecordMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CaseAttachMapper caseAttachMapper;
|
private CaseAttachMapper caseAttachMapper;
|
||||||
|
@Autowired
|
||||||
|
private DeptIdentifyMapper deptIdentifyMapper;
|
||||||
|
|
||||||
@Scheduled(cron = "0/3 * * * * ?")
|
@Scheduled(cron = "0/3 * * * * ?")
|
||||||
@Transactional
|
@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<DeptIdentify> 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.ruoyi.common.exception.EsignDemoException;
|
|||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.EsignApplicaConfig;
|
import com.ruoyi.common.utils.EsignApplicaConfig;
|
||||||
import com.ruoyi.common.utils.EsignHttpHelper;
|
import com.ruoyi.common.utils.EsignHttpHelper;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
|
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -19,8 +20,6 @@ public class SignAward {
|
|||||||
private static String eSignHost= EsignApplicaConfig.EsignHost;
|
private static String eSignHost= EsignApplicaConfig.EsignHost;
|
||||||
private static String eSignAppId= EsignApplicaConfig.EsignAppId;
|
private static String eSignAppId= EsignApplicaConfig.EsignAppId;
|
||||||
private static String eSignAppSecret= EsignApplicaConfig.EsignAppSecret;
|
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("签署长链接:" +shortusesealUrl);
|
||||||
// System.out.println("签署短链接:"+sealUrl);
|
// 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);
|
// EsignHttpResponse signFlowDetail = signFlowDetail(sealSignRecord);
|
||||||
// JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
|
// JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
|
||||||
@@ -91,12 +119,7 @@ public class SignAward {
|
|||||||
|
|
||||||
// System.out.println(signFlowDetailJsonObject);
|
// 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 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<String, String> 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<String, String> 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<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true);
|
||||||
|
//发起接口请求
|
||||||
|
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取文件签名印章位置
|
* 获取文件签名印章位置
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||||
<if test="deptName != null and deptName != ''">dept_name,</if>
|
<if test="deptName != null and deptName != ''">dept_name,</if>
|
||||||
|
<if test="deptType != null">dept_type,</if>
|
||||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||||
<if test="orderNum != null">order_num,</if>
|
<if test="orderNum != null">order_num,</if>
|
||||||
<if test="leader != null and leader != ''">leader,</if>
|
<if test="leader != null and leader != ''">leader,</if>
|
||||||
@@ -108,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||||
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
||||||
|
<if test="deptType != null">#{deptType},</if>
|
||||||
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
||||||
<if test="orderNum != null">#{orderNum},</if>
|
<if test="orderNum != null">#{orderNum},</if>
|
||||||
<if test="leader != null and leader != ''">#{leader},</if>
|
<if test="leader != null and leader != ''">#{leader},</if>
|
||||||
@@ -124,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<set>
|
<set>
|
||||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||||
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
||||||
|
<if test="deptType != null">dept_type = #{deptType},</if>
|
||||||
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
||||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||||
<if test="leader != null">leader = #{leader},</if>
|
<if test="leader != null">leader = #{leader},</if>
|
||||||
|
|||||||
@@ -0,0 +1,100 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper">
|
||||||
|
<resultMap type="DeptIdentify" id="DeptIdentifyResult">
|
||||||
|
<id property="id" column="id" />
|
||||||
|
<result property="deptId" column="dept_id" />
|
||||||
|
<result property="userId" column="user_id" />
|
||||||
|
<result property="identifyStatus" column="identify_status" />
|
||||||
|
<result property="identifyDate" column="identify_date" />
|
||||||
|
<result property="isUse" column="is_use" />
|
||||||
|
<result property="nickName" column="nick_name" />
|
||||||
|
<result property="phonenumber" column="phonenumber" />
|
||||||
|
<result property="deptName" column="dept_name" />
|
||||||
|
<result property="sealName" column="seal_name" />
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectDeptIdentify" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
|
||||||
|
SELECT ud.user_id , ud.nick_name ,ud.phonenumber ,ud.dept_id ,d.dept_name
|
||||||
|
FROM (SELECT u.user_id , u.nick_name ,u.phonenumber ,u.dept_id
|
||||||
|
FROM sys_user_post up left join sys_user u on u.user_id = up.user_id
|
||||||
|
left join sys_post sp on up.post_id = sp.post_id
|
||||||
|
where sp.post_code = 'jbr') ud left join sys_dept d on ud.dept_id = d.dept_id
|
||||||
|
WHERE d.dept_type = 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDeptIdentifyBydeptid" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
|
||||||
|
SELECT d.id ,d.dept_id ,d.user_id
|
||||||
|
from dept_identify d
|
||||||
|
<where>
|
||||||
|
<if test="deptId != null">
|
||||||
|
AND d.dept_id = #{deptId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertDeptIdentify" parameterType="DeptIdentify" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into dept_identify(
|
||||||
|
<if test="deptId != null">dept_id,</if>
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="identifyStatus != null">identify_status</if>
|
||||||
|
)values(
|
||||||
|
<if test="deptId != null">#{deptId},</if>
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="identifyStatus != null">#{identifyStatus}</if>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="selectDeptIdentifylist" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
|
||||||
|
SELECT d.id ,d.dept_id ,d.user_id, d.identify_status ,d.identify_date ,d.is_use , d.seal_name, sd.dept_name ,
|
||||||
|
u.nick_name ,u.phonenumber
|
||||||
|
from dept_identify d left join sys_dept sd on d.dept_id = sd.dept_id
|
||||||
|
left join sys_user u on u.user_id = d.user_id
|
||||||
|
<where>
|
||||||
|
<if test="identifyStatus != null">
|
||||||
|
AND d.identify_status = #{identifyStatus}
|
||||||
|
</if>
|
||||||
|
<if test="isUse != null">
|
||||||
|
AND d.is_use = #{isUse}
|
||||||
|
</if>
|
||||||
|
<if test="id != null">
|
||||||
|
AND d.id = #{id}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDeptIdentifylistother" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
|
||||||
|
SELECT d.id ,d.dept_id ,d.user_id,d.identify_status ,d.is_use
|
||||||
|
from dept_identify d
|
||||||
|
<where>
|
||||||
|
<if test="identifyStatus != null">
|
||||||
|
AND d.identify_status = #{identifyStatus}
|
||||||
|
</if>
|
||||||
|
<if test="id != null">
|
||||||
|
AND d.id != #{id}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateDeptIdentify" parameterType="DeptIdentify">
|
||||||
|
update dept_identify
|
||||||
|
<set>
|
||||||
|
<if test="identifyDate != null">identify_date = #{identifyDate},</if>
|
||||||
|
<if test="isUse != null">is_use = #{isUse},</if>
|
||||||
|
<if test="identifyStatus != null ">identify_status = #{identifyStatus},</if>
|
||||||
|
<if test="sealName != null and sealName != ''">seal_name = #{sealName},</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user