实现机构认证功能

This commit is contained in:
qitz
2023-10-30 20:06:38 +08:00
parent 9e16fc1b1a
commit 0cda870fbd
13 changed files with 595 additions and 17 deletions
@@ -38,7 +38,7 @@ public interface ICaseApplicationService {
int verificationArbitrateRecord(CaseApplication caseApplication);
int checkArbitrateRecord(CaseApplication caseApplication);
AjaxResult checkArbitrateRecord(CaseApplication caseApplication);
int submitCaseApplicationCheck(List<Long> ids, Integer agreeOrNotCheck);
@@ -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);
}
@@ -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<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);
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
@@ -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();
}
}