预约会议
This commit is contained in:
@@ -55,7 +55,10 @@ public class SysLoginController {
|
||||
IdentityAuthentication identityAuthentication=new IdentityAuthentication();
|
||||
identityAuthentication.setUserName(loginBody.getUsername());
|
||||
String status = identityAuthenticationService.checkIsAuthentication(identityAuthentication);
|
||||
|
||||
ajax.put("certificationStatus", status);
|
||||
ajax.put("userId", SecurityUtils.getUserId());
|
||||
ajax.put("userName", SecurityUtils.getUsername());
|
||||
return ajax;
|
||||
}
|
||||
|
||||
|
||||
+25
@@ -12,6 +12,7 @@ import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.WxAppletNotifyUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.*;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||
@@ -349,5 +350,29 @@ public class CaseApplicationController extends BaseController {
|
||||
List<SmsSendRecord> list = caseApplicationService.getSmsSendRecord(smsSendRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 获取userSign
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Anonymous
|
||||
@GetMapping("/generateUserSign")
|
||||
public AjaxResult generateUserSign(@RequestParam(required = true) String userId){
|
||||
if(StrUtil.isEmpty(userId)){
|
||||
error("参数校验失败");
|
||||
}
|
||||
return AjaxResult.success(caseApplicationService.generateUserSign(userId));
|
||||
}
|
||||
/**
|
||||
* 预约会议
|
||||
* @param reservedConferenceVO
|
||||
* @return
|
||||
*/
|
||||
@Anonymous
|
||||
@PostMapping("/reservedConference")
|
||||
public AjaxResult reservedConference(@Validated @RequestBody ReservedConferenceVO reservedConferenceVO) throws Exception {
|
||||
|
||||
return caseApplicationService.reservedConference(reservedConferenceVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -173,3 +173,9 @@ identityAuthentication:
|
||||
credentialSecretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7
|
||||
merchantId: 0NSJ2309281116194321
|
||||
privateKeyHexDecodeinfo: 4c3b311bf7b98969994e85928e069574a1e95777f24d1c510679cc3c2f460faf
|
||||
# 腾讯云即时通信相关配置
|
||||
imConfig:
|
||||
# sdkAppId
|
||||
sdkAppId: 1600011167
|
||||
# 密钥
|
||||
secretKey: 17d136d9327576a247f991bdfed3a6d14cebc7d540a52245086829c3a1421a86
|
||||
@@ -27,6 +27,11 @@
|
||||
<artifactId>pay</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.tencentyun</groupId>
|
||||
<artifactId>tls-sig-api-v2</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author wangqiong
|
||||
* @description 预约会议
|
||||
* @date 2023-11-08 11:05
|
||||
*/
|
||||
@Data
|
||||
public class ReservedConferenceVO {
|
||||
/**
|
||||
* 房主id
|
||||
*/
|
||||
@NotEmpty(message = "房主id不能为空")
|
||||
private String ownerId;
|
||||
/**
|
||||
* 房间号id
|
||||
*/
|
||||
@NotEmpty(message = "房主id不能为空")
|
||||
private String roomId;
|
||||
/**
|
||||
* 会议开始时间
|
||||
*/
|
||||
@NotNull(message = "会议开始时间不能为空")
|
||||
private Integer scheduleStartTime;
|
||||
/**
|
||||
* 会议结束时间
|
||||
*/
|
||||
@NotNull(message = "会议结束时间不能为空")
|
||||
private Integer scheduleEndTime;
|
||||
@NotNull(message = "案件id不能为空")
|
||||
private Long caseId;
|
||||
}
|
||||
+16
@@ -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.*;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -78,4 +79,19 @@ public interface ICaseApplicationService {
|
||||
* @return
|
||||
*/
|
||||
List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord);
|
||||
|
||||
/**
|
||||
* 获取userSign
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
String generateUserSign(String userId);
|
||||
|
||||
/**
|
||||
* 预约会议
|
||||
* @param reservedConferenceVO
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
AjaxResult reservedConference(ReservedConferenceVO reservedConferenceVO) throws Exception;
|
||||
}
|
||||
|
||||
+82
-72
@@ -3,8 +3,6 @@ package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
@@ -12,10 +10,8 @@ import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.*;
|
||||
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
@@ -26,6 +22,7 @@ import com.ruoyi.system.domain.SysUserRole;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
|
||||
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
||||
import com.ruoyi.system.mapper.SysDeptMapper;
|
||||
@@ -35,12 +32,19 @@ import com.ruoyi.wisdomarbitrate.mapper.*;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||
import com.ruoyi.wisdomarbitrate.utils.SignAward;
|
||||
import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils;
|
||||
import com.tencentyun.TLSSigAPIv2;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
@@ -51,6 +55,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -61,6 +66,12 @@ import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
||||
|
||||
@Service
|
||||
public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
// 腾讯云即时通信sdkAppId
|
||||
@Value("${imConfig.sdkAppId}")
|
||||
private long sdkAppId;
|
||||
// 腾讯云即时通信密钥
|
||||
@Value("${imConfig.secretKey}")
|
||||
private String secretKey;
|
||||
@Autowired
|
||||
private CaseApplicationMapper caseApplicationMapper;
|
||||
|
||||
@@ -2436,74 +2447,73 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
|
||||
|
||||
// @Transactional
|
||||
// public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException {
|
||||
//
|
||||
// Gson gson = new Gson();
|
||||
//
|
||||
// SealSignRecord sealSignRecordselect = new SealSignRecord();
|
||||
// sealSignRecordselect.setSignFlowStatus(1);
|
||||
//
|
||||
// List<SealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecordselect);
|
||||
// if(sealSignRecords!=null&&sealSignRecords.size()>0){
|
||||
// for (int i = 0; i < sealSignRecords.size(); i++) {
|
||||
// SealSignRecord sealSignRecord = sealSignRecords.get(i);
|
||||
// EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
|
||||
// JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class);
|
||||
// JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
|
||||
// JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
|
||||
// for (int j = 0; j < signersArray.size(); j++) {
|
||||
// JsonObject signerObject = (JsonObject)signersArray.get(j);
|
||||
// Integer psnsignStatus ;
|
||||
// Integer orgsignStatus ;
|
||||
// if(!(signerObject.get("psnSigner").toString()).equals("null")){
|
||||
// JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner");
|
||||
// if(psnSignerData!=null){
|
||||
// psnsignStatus = signerObject.get("signStatus").getAsInt();
|
||||
// sealSignRecord.setPsnsignStatus(psnsignStatus);
|
||||
//
|
||||
// if(psnsignStatus.intValue()==2){
|
||||
// //更新立案申请状态为待用印
|
||||
// CaseApplication caseApplication = new CaseApplication();
|
||||
// caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
|
||||
// caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
//
|
||||
// //修改"签署用印记录表"的状态为待用印
|
||||
// sealSignRecord.setSignFlowStatus(2);
|
||||
// sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if(!(signerObject.get("orgSigner").toString()).equals("null")){
|
||||
// JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
|
||||
// if(orgSignerData!=null){
|
||||
// orgsignStatus = signerObject.get("signStatus").getAsInt();
|
||||
// sealSignRecord.setOrgsignStatus(orgsignStatus);
|
||||
// //更新立案申请状态为待送达
|
||||
// CaseApplication caseApplication = new CaseApplication();
|
||||
// caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY);
|
||||
// caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
//
|
||||
// //修改"签署用印记录表"的状态为签署完成
|
||||
// sealSignRecord.setSignFlowStatus(3);
|
||||
// sealSignRecordMapper.updataSealSignRecord(sealSignRecord);
|
||||
//
|
||||
// //下载审核完成的裁决书,
|
||||
//// SaaSAPIFileUtils.fileDownloadUrl();
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
/**
|
||||
* 获取userSign,默认过期时间10小时
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public String generateUserSign(String userId){
|
||||
TLSSigAPIv2 tlsSigAPIv2 = new TLSSigAPIv2(sdkAppId, secretKey);
|
||||
return tlsSigAPIv2.genUserSig(userId, 60 * 60 * 10);
|
||||
}
|
||||
|
||||
|
||||
// }
|
||||
/**
|
||||
* 预约会议
|
||||
* @param reservedConferenceVO
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public AjaxResult reservedConference(ReservedConferenceVO reservedConferenceVO) throws Exception {
|
||||
// 生成administrator的userSig
|
||||
String administrator = "administrator";
|
||||
String userSign = generateUserSign(administrator);
|
||||
if (StrUtil.isEmpty(userSign)) {
|
||||
return AjaxResult.error("生成userSign失败");
|
||||
}
|
||||
int random = ThreadLocalRandom.current().nextInt(0, 214748364);
|
||||
String url="https://roomkit.trtc.tencent-cloud.com/room_api/v1/roomctl/create?usersig=" + userSign + "&identifier=" + administrator + "&sdkappid=" + sdkAppId + "&random=" +random + "&contenttype=json";
|
||||
HttpPost post = new HttpPost(url);
|
||||
String result = "";
|
||||
|
||||
|
||||
//添加参数
|
||||
JSONObject bodyParams = new JSONObject();
|
||||
bodyParams.put("ownerId", reservedConferenceVO.getOwnerId());
|
||||
bodyParams.put("roomId", reservedConferenceVO.getRoomId());
|
||||
bodyParams.put("scheduleStartTime", reservedConferenceVO.getScheduleStartTime());
|
||||
bodyParams.put("scheduleEndTime", reservedConferenceVO.getScheduleEndTime());
|
||||
StringEntity postingString = new StringEntity(bodyParams.toString());
|
||||
post.setEntity(postingString);
|
||||
CloseableHttpClient client = HttpClients.createDefault();
|
||||
//启动执行请求,并获得返回值
|
||||
CloseableHttpResponse response = client.execute(post);
|
||||
//得到返回的entity对象
|
||||
HttpEntity entity = response.getEntity();
|
||||
//把实体对象转换为string
|
||||
result = EntityUtils.toString(entity, "UTF-8");
|
||||
if (StrUtil.isNotEmpty(result)) {
|
||||
JSONObject resJson = JSONObject.parseObject(result);
|
||||
if ((int) resJson.get("errorCode") == 0 ) {
|
||||
// 绑定房间号和案件id
|
||||
caseApplicationMapper.bindCaseId(reservedConferenceVO.getCaseId(),reservedConferenceVO.getRoomId());
|
||||
return AjaxResult.success("预约会议成功");
|
||||
} else if((int) resJson.get("errorCode") == 42003){
|
||||
return AjaxResult.error("请求频繁");
|
||||
}else if((int) resJson.get("errorCode") == 84005){
|
||||
return AjaxResult.error("房间号已被占用");
|
||||
}else {
|
||||
return AjaxResult.error("预约会议失败");
|
||||
}
|
||||
|
||||
}else {
|
||||
return AjaxResult.error("预约会议失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
-18
@@ -1,34 +1,23 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.SmsUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.http.HttpUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.IdentityAuthenticationMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.WeChatUserMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.WeChatUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -40,13 +29,6 @@ import java.util.concurrent.TimeUnit;
|
||||
@Service
|
||||
@Slf4j
|
||||
public class WeChatUserServiceImpl implements WeChatUserService {
|
||||
String appid="wx91cb8459dca561b4";//自行获取
|
||||
//小程序secret
|
||||
String secret="190aaa3bda96a65d25318fbb0e133fc6";//自己去公众号后台获取
|
||||
// 获取openId
|
||||
String openIdUrl = "https://api.weixin.qq.com/sns/jscode2session";
|
||||
@Autowired
|
||||
private WeChatUserMapper weChatUserMapper;
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
@Autowired
|
||||
|
||||
Reference in New Issue
Block a user