回调及日志修改
This commit is contained in:
@@ -4,14 +4,15 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
@@ -36,6 +37,8 @@ public class CommonController
|
||||
private ServerConfig serverConfig;
|
||||
|
||||
private static final String FILE_DELIMETER = ",";
|
||||
@Autowired
|
||||
CaseAttachMapper caseAttachMapper;
|
||||
|
||||
/**
|
||||
* 通用下载请求
|
||||
@@ -160,4 +163,22 @@ public class CommonController
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 根据案件id获取附件
|
||||
* @param caseAppliId
|
||||
* @param annexTypeList
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/fileList")
|
||||
public AjaxResult fileList(@RequestParam("caseAppliId")Long caseAppliId, @RequestParam(value = "annexTypeList",required = false) List<Integer> annexTypeList){
|
||||
if(caseAppliId==null){
|
||||
return AjaxResult.error("案件id不能为空");
|
||||
}
|
||||
CaseApplication msCaseApplicationVO = new CaseApplication();
|
||||
msCaseApplicationVO.setId(caseAppliId);
|
||||
msCaseApplicationVO.setAnnexTypeList(annexTypeList);
|
||||
List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(msCaseApplicationVO);
|
||||
return AjaxResult.success(caseAttachList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,4 +139,13 @@ public class SysMenuController extends BaseController
|
||||
}
|
||||
return toAjax(menuService.deleteMenuById(menuId));
|
||||
}
|
||||
/**
|
||||
* 根据用户查询菜单权限字符
|
||||
*/
|
||||
@GetMapping("/getMenuPermsByUser")
|
||||
public AjaxResult getMenuPermsByUser()
|
||||
{
|
||||
|
||||
return menuService.getMenuPermsByUser();
|
||||
}
|
||||
}
|
||||
+18
-3
@@ -152,7 +152,7 @@ public class CaseApplicationController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询立案信息
|
||||
* 查询立案详情
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')")
|
||||
@PostMapping("/selectCaseApplication")
|
||||
@@ -161,6 +161,18 @@ public class CaseApplicationController extends BaseController {
|
||||
CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplication(caseApplication);
|
||||
return success(caseApplicationselect);
|
||||
}
|
||||
/**
|
||||
* 视频会议中查询立案详情
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')")
|
||||
@GetMapping("/selectById")
|
||||
public AjaxResult selectById(@RequestParam(required = false) Long id ,@RequestParam(required = false) String caseNum) {
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(id);
|
||||
caseApplication.setCaseNum(caseNum);
|
||||
CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplication(caseApplication);
|
||||
return success(caseApplicationselect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询已签署裁决书URL
|
||||
@@ -460,9 +472,12 @@ public class CaseApplicationController extends BaseController {
|
||||
* @param arbitrateRecord
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/creatTrialRecordnew")
|
||||
@PostMapping("/confirmMeetingResult")
|
||||
// @PreAuthorize("@ss.hasPermi('caseManagement:list:creatTrialRecord')")
|
||||
public AjaxResult creatTrialRecordnew(@Validated @RequestBody ArbitrateRecord arbitrateRecord){
|
||||
public AjaxResult creatTrialRecordnew( @RequestBody ArbitrateRecord arbitrateRecord){
|
||||
if(arbitrateRecord.getCaseAppliId()==null || arbitrateRecord.getAppliIsAbsen()==null || arbitrateRecord.getIsAbsence()==null){
|
||||
return error("参数校验失败");
|
||||
}
|
||||
return caseApplicationService.creatTrialRecordnew(arbitrateRecord);
|
||||
}
|
||||
|
||||
|
||||
+130
-1
@@ -2,13 +2,23 @@ package com.ruoyi.web.controller.wisdomarbitrate;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
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.CaseAttach;
|
||||
import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||
import com.ruoyi.wisdomarbitrate.service.VideoService;
|
||||
import com.ruoyi.wisdomarbitrate.service.WeChatUserService;
|
||||
import com.tencentcloudapi.common.Credential;
|
||||
@@ -25,6 +35,9 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.google.common.io.Files.getFileExtension;
|
||||
|
||||
/**
|
||||
* @author wangqiong
|
||||
@@ -36,7 +49,12 @@ import java.io.IOException;
|
||||
public class VideoController extends BaseController {
|
||||
@Autowired
|
||||
private VideoService videoService;
|
||||
|
||||
@Autowired
|
||||
private ServerConfig serverConfig;
|
||||
@Autowired
|
||||
private CaseAttachMapper caseAttachMapper;
|
||||
@Autowired
|
||||
private ICaseApplicationService caseApplicationService;
|
||||
/**
|
||||
* 从腾讯云下载文件到本地
|
||||
* @param
|
||||
@@ -144,6 +162,117 @@ public class VideoController extends BaseController {
|
||||
|
||||
return videoService.attachListByCaseId(caseAppliId,annexType);
|
||||
}
|
||||
/**
|
||||
* 根据案件id查询申请人/被申请人会议上传附件按钮权限
|
||||
* @param caseId
|
||||
* @return
|
||||
*/
|
||||
@Anonymous
|
||||
@GetMapping("selectRoleMenuByCaseId")
|
||||
public AjaxResult selectRoleMenuByCaseId( @RequestParam(value = "caseId",required = true) Long caseId) {
|
||||
|
||||
return videoService.selectRoleMenuByCaseId(caseId);
|
||||
}
|
||||
/**
|
||||
* 通用上传请求(单个)
|
||||
* param officeFlag: 是否上传到onlyoffice,0-否,1-是
|
||||
* param isMediaBook: 是否上仲裁书,1-是,其余为否
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam(value = "isMediaBook",required = false) Integer isMediaBook, @RequestParam("annexType") Integer annexType, @RequestParam(value = "officeFlag", required = false) Integer officeFlag,@RequestParam(value = "caseId",required = false) Long caseId) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String suffix = getFileExtension(fileName);
|
||||
if(StrUtil.isNotEmpty(suffix)&& suffix.contains("doc")){
|
||||
// 上传到onlyoffice
|
||||
officeFlag=1;
|
||||
}
|
||||
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) {
|
||||
// 先删除之前的裁决书附件
|
||||
if(Objects.equals(annexType,3) && caseId!=null) {
|
||||
caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType);
|
||||
}
|
||||
CaseAttach caseAttach=null;
|
||||
for (Object obj : jsonArray) {
|
||||
JSONObject jsonObject = (JSONObject) obj;
|
||||
caseAttach = CaseAttach.builder()
|
||||
.caseAppliId(caseId)
|
||||
.annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"")
|
||||
.annexType(annexType)
|
||||
.onlyOfficeFileId(jsonObject.getString("fileId"))
|
||||
.build();
|
||||
if(jsonObject.get("filePath")!=null){
|
||||
String officePath = jsonObject.getString("filePath");
|
||||
String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/");
|
||||
caseAttach.setAnnexPath(replace);
|
||||
|
||||
}
|
||||
caseAttachMapper.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 {
|
||||
// 如果是调解书并且是pdf,则删除之前的在新增
|
||||
// if(isMediaBook != null && isMediaBook == 1 ){
|
||||
// if(StrUtil.isNotEmpty(suffix)&&!suffix.equals("pdf")){
|
||||
// return AjaxResult.error("请上传pdf格式文件");
|
||||
// }
|
||||
// annexType=AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode();
|
||||
// // 先删除之前的附件
|
||||
// if(caseId!=null) {
|
||||
// msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType);
|
||||
// }
|
||||
// }
|
||||
Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId);
|
||||
|
||||
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) {
|
||||
CaseAttach caseAttach = CaseAttach.builder()
|
||||
.annexName(originalFilename)
|
||||
.caseAppliId(caseId)
|
||||
.annexPath(path)
|
||||
.annexType(annexType)
|
||||
.userId(SecurityUtils.getUserId())
|
||||
.userName(SecurityUtils.getUsername())
|
||||
.build();
|
||||
|
||||
caseAttachMapper.save(caseAttach);
|
||||
return caseAttach.getAnnexId();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user