Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev

This commit was merged in pull request #358.
This commit is contained in:
2024-05-21 13:49:56 +08:00
committed by Gitea
4 changed files with 31 additions and 12 deletions
@@ -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();
@@ -39,7 +39,7 @@ public interface VideoService {
* @param userId
* @return
*/
AjaxResult secretaryRoleByUserId(Long userId);
AjaxResult secretaryRoleByUserId(Long userId,Long caseId);
/**
* 根据html字符串转pdf并和案件关联
@@ -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<SysRole> 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;
@@ -108,7 +108,8 @@
update case_attach
<set>
<if test="annexName != null and annexName != ''">annex_name = #{annexName},</if>
<if test="annexPath != null and annexPath != ''">annex_path = #{annexPath}</if>
<if test="annexPath != null and annexPath != ''">annex_path = #{annexPath},</if>
<if test="onlyOfficeFileId != null and onlyOfficeFileId != ''">only_office_file_id = #{onlyOfficeFileId}</if>
</set>
<where>
<if test="caseAppliId != null ">
@@ -117,6 +118,7 @@
<if test="annexType != null ">
AND annex_type = #{annexType}
</if>
</where>
</update>