bug修复 #358

Merged
wangqiong123 merged 1 commits from wq into dev 2024-05-21 05:49:56 +00:00
4 changed files with 31 additions and 12 deletions
@@ -132,9 +132,9 @@ public class VideoController extends BaseController {
*/ */
@Anonymous @Anonymous
@GetMapping("secretaryRoleByUserId") @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并和案件关联 * 根据html字符串转pdf并和案件关联
@@ -235,16 +235,16 @@ public class VideoController extends BaseController {
} }
}else { }else {
// 如果是调解书并且是pdf,则删除之前的在新增 // 如果是调解书并且是pdf,则删除之前的在新增
// if(isMediaBook != null && isMediaBook == 1 ){ if(annexType!=null && annexType.equals(3) ){
// if(StrUtil.isNotEmpty(suffix)&&!suffix.equals("pdf")){ // if(StrUtil.isNotEmpty(suffix)&&!suffix.equals("pdf")){
// return AjaxResult.error("请上传pdf格式文件"); // return AjaxResult.error("请上传pdf格式文件");
// } // }
// annexType=AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode(); // annexType=AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode();
// // 先删除之前的附件 // 先删除之前的附件
// if(caseId!=null) { if(caseId!=null) {
// msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType); caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType);
// } }
// } }
Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId); Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId);
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
@@ -39,7 +39,7 @@ public interface VideoService {
* @param userId * @param userId
* @return * @return
*/ */
AjaxResult secretaryRoleByUserId(Long userId); AjaxResult secretaryRoleByUserId(Long userId,Long caseId);
/** /**
* 根据html字符串转pdf并和案件关联 * 根据html字符串转pdf并和案件关联
@@ -321,11 +321,28 @@ public class VideoServiceImpl implements VideoService {
} }
@Override @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); List<SysRole> roles = roleMapper.selectRolePermissionByUserId(userId);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
boolean isSecretaryRole=false; 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) { for (SysRole role : roles) {
if("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName())){ if("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName())){
isSecretaryRole=true; isSecretaryRole=true;
@@ -108,7 +108,8 @@
update case_attach update case_attach
<set> <set>
<if test="annexName != null and annexName != ''">annex_name = #{annexName},</if> <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> </set>
<where> <where>
<if test="caseAppliId != null "> <if test="caseAppliId != null ">
@@ -117,6 +118,7 @@
<if test="annexType != null "> <if test="annexType != null ">
AND annex_type = #{annexType} AND annex_type = #{annexType}
</if> </if>
</where> </where>
</update> </update>