bug修复
This commit is contained in:
@@ -49,7 +49,6 @@ public class RuoYiApplication
|
||||
if(CollectionUtil.isNotEmpty(sysUsers)){
|
||||
for (SysUser sysUser : sysUsers) {
|
||||
redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
|
||||
redisCache.setCacheObject(CacheConstants.USER_EMAIL_KEY+sysUser.getEmail(),sysUser);
|
||||
}
|
||||
}
|
||||
// 初始化角色redis
|
||||
|
||||
+110
@@ -1,16 +1,28 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate.mscase;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.framework.config.ServerConfig;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.SendRoomNoMessageVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.VideoCallBackVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
|
||||
import com.ruoyi.wisdomarbitrate.service.mscase.VideoConferenceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
@@ -24,6 +36,12 @@ import javax.validation.Valid;
|
||||
public class MsVideoConferenceController extends BaseController {
|
||||
@Autowired
|
||||
private VideoConferenceService videoService;
|
||||
@Autowired
|
||||
private ServerConfig serverConfig;
|
||||
@Autowired
|
||||
private MsCaseAttachMapper msCaseAttachMapper;
|
||||
@Autowired
|
||||
private MsCaseApplicationService caseApplicationService;
|
||||
/**
|
||||
* 根据案件ID查询视频
|
||||
* @param caseId 案件id
|
||||
@@ -34,8 +52,82 @@ public class MsVideoConferenceController extends BaseController {
|
||||
|
||||
return videoService.videoList(caseId);
|
||||
}
|
||||
/**
|
||||
* 通用上传请求(单个)
|
||||
* param officeFlag: 是否上传到onlyoffice,0-否,1-是
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam("annexType") Integer annexType, @RequestParam(value = "officeFlag", required = false) Integer officeFlag,@RequestParam(value = "caseId") Long caseId) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
if(officeFlag != null && officeFlag == 1){
|
||||
// officeFlag,fileName为annexPath
|
||||
JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,caseId);
|
||||
if(jsonArray!=null && jsonArray.size() > 0) {
|
||||
MsCaseAttach caseAttach=null;
|
||||
for (Object obj : jsonArray) {
|
||||
JSONObject jsonObject = (JSONObject) obj;
|
||||
caseAttach = MsCaseAttach.builder()
|
||||
.caseAppliId(caseId)
|
||||
.annexName(jsonObject.getString("fileName"))
|
||||
.annexPath(jsonObject.getString("filePath"))
|
||||
.annexType(annexType)
|
||||
.onlyOfficeFileId(jsonObject.getString("fileId"))
|
||||
.build();
|
||||
msCaseAttachMapper.save(caseAttach);
|
||||
}
|
||||
if(caseAttach==null){
|
||||
return AjaxResult.error("上传失败");
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("annexId", caseAttach.getAnnexId());
|
||||
ajax.put("annexType", annexType);
|
||||
// ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
return ajax;
|
||||
}else {
|
||||
return AjaxResult.error("上传失败");
|
||||
}
|
||||
}else {
|
||||
|
||||
Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId);
|
||||
// 是否上传到onlyoffice
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("annexId", annexId);
|
||||
ajax.put("annexType", annexType);
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
private Long saveCaseAttach(Integer annexType, String path, String originalFilename,Long caseId) {
|
||||
MsCaseAttach caseAttach = MsCaseAttach.builder()
|
||||
.annexName(originalFilename)
|
||||
.caseAppliId(caseId)
|
||||
.annexPath(path)
|
||||
.annexType(annexType)
|
||||
.useId(SecurityUtils.getUserId())
|
||||
.useAccount(SecurityUtils.getUsername())
|
||||
.build();
|
||||
msCaseAttachMapper.save(caseAttach);
|
||||
return caseAttach.getAnnexId();
|
||||
}
|
||||
/**
|
||||
* 从腾讯云下载文件到本地
|
||||
* @param
|
||||
@@ -49,6 +141,13 @@ public class MsVideoConferenceController extends BaseController {
|
||||
}
|
||||
return success();
|
||||
}
|
||||
@Anonymous
|
||||
@PostMapping("/smsRollBack")
|
||||
public AjaxResult smsRollBack( @RequestBody String body, HttpServletRequest request) {
|
||||
logger.info("短信回调======"+body);
|
||||
videoService.smsRollBack(body,request);
|
||||
return success();
|
||||
}
|
||||
/**
|
||||
* 根据房间号绑定案件ID
|
||||
* @param
|
||||
@@ -110,6 +209,17 @@ public class MsVideoConferenceController extends BaseController {
|
||||
|
||||
return videoService.secretaryRoleByUserId(userId,caseId);
|
||||
}
|
||||
/**
|
||||
* 根据案件id查询申请人/被申请人会议上传附件按钮权限
|
||||
* @param caseId
|
||||
* @return
|
||||
*/
|
||||
@Anonymous
|
||||
@GetMapping("selectRoleMenuByCaseId")
|
||||
public AjaxResult selectRoleMenuByCaseId( @RequestParam(value = "caseId",required = true) Long caseId) {
|
||||
|
||||
return videoService.selectRoleMenuByCaseId(caseId);
|
||||
}
|
||||
/**
|
||||
* 根据html字符串转pdf并和案件关联
|
||||
* @param reservedConferenceVO
|
||||
|
||||
Reference in New Issue
Block a user