diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java index c02c52a..25b30c8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java @@ -132,9 +132,9 @@ public class VideoController extends BaseController { */ @Anonymous @GetMapping("secretaryRoleByUserId") - public AjaxResult secretaryRoleByUserId( @RequestParam(value = "userId",required = true) Long userId) { + public AjaxResult secretaryRoleByUserId( @RequestParam(value = "userId",required = true) Long userId,@RequestParam(value = "caseId",required = true) Long caseId) { - return videoService.secretaryRoleByUserId(userId); + return videoService.secretaryRoleByUserId(userId,caseId); } /** * 根据html字符串转pdf并和案件关联 @@ -235,16 +235,16 @@ public class VideoController extends BaseController { } }else { // 如果是调解书并且是pdf,则删除之前的在新增 -// if(isMediaBook != null && isMediaBook == 1 ){ + if(annexType!=null && annexType.equals(3) ){ // if(StrUtil.isNotEmpty(suffix)&&!suffix.equals("pdf")){ // return AjaxResult.error("请上传pdf格式文件"); // } // annexType=AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode(); -// // 先删除之前的附件 -// if(caseId!=null) { -// msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType); -// } -// } + // 先删除之前的附件 + if(caseId!=null) { + caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType); + } + } Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId); AjaxResult ajax = AjaxResult.success(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java index 1f287a1..b0033fe 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java @@ -39,7 +39,7 @@ public interface VideoService { * @param userId * @return */ - AjaxResult secretaryRoleByUserId(Long userId); + AjaxResult secretaryRoleByUserId(Long userId,Long caseId); /** * 根据html字符串转pdf并和案件关联 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java index 6f73494..352b0a8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java @@ -321,11 +321,28 @@ public class VideoServiceImpl implements VideoService { } @Override - public AjaxResult secretaryRoleByUserId(Long userId) { + public AjaxResult secretaryRoleByUserId(Long userId,Long caseId) { + CaseApplication application = new CaseApplication(); + application.setId(caseId); + // 根据案件id查询案件 + CaseApplication caseApplication = caseApplicationMapper.selectCaseApplication(application); + if(caseApplication==null){ + return AjaxResult.error("案件不存在"); + } List roles = roleMapper.selectRolePermissionByUserId(userId); JSONObject jsonObject = new JSONObject(); boolean isSecretaryRole=false; - if(CollectionUtil.isNotEmpty(roles)){ + if(caseApplication.getArbitratorId()!=null&& Objects.equals(userId, caseApplication.getArbitratorId())){ + // 是调解员 + if(CollectionUtil.isNotEmpty(roles)){ + for (SysRole role : roles) { + if("仲裁员".equals(role.getRoleName())){ + isSecretaryRole=true; + break; + } + } + } + }else if(CollectionUtil.isNotEmpty(roles)){ for (SysRole role : roles) { if("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName())){ isSecretaryRole=true; diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index dcc7cc4..058b16c 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -108,7 +108,8 @@ update case_attach annex_name = #{annexName}, - annex_path = #{annexPath} + annex_path = #{annexPath}, + only_office_file_id = #{onlyOfficeFileId} @@ -117,6 +118,7 @@ AND annex_type = #{annexType} +