Explorar el Código

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

wangqiong123 hace 2 años
padre
commit
34524284d4

+ 8
- 8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java Ver fichero

@@ -132,9 +132,9 @@ public class VideoController extends BaseController {
132 132
      */
133 133
     @Anonymous
134 134
     @GetMapping("secretaryRoleByUserId")
135
-    public AjaxResult secretaryRoleByUserId(   @RequestParam(value = "userId",required = true) Long userId) {
135
+    public AjaxResult secretaryRoleByUserId(   @RequestParam(value = "userId",required = true) Long userId,@RequestParam(value = "caseId",required = true) Long caseId) {
136 136
 
137
-        return  videoService.secretaryRoleByUserId(userId);
137
+        return  videoService.secretaryRoleByUserId(userId,caseId);
138 138
     }
139 139
     /**
140 140
      * 根据html字符串转pdf并和案件关联
@@ -235,16 +235,16 @@ public class VideoController extends BaseController {
235 235
                 }
236 236
             }else {
237 237
                 // 如果是调解书并且是pdf,则删除之前的在新增
238
-//                if(isMediaBook != null && isMediaBook == 1 ){
238
+                if(annexType!=null && annexType.equals(3) ){
239 239
 //                    if(StrUtil.isNotEmpty(suffix)&&!suffix.equals("pdf")){
240 240
 //                        return AjaxResult.error("请上传pdf格式文件");
241 241
 //                    }
242 242
 //                    annexType=AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode();
243
-//                    // 先删除之前的附件
244
-//                    if(caseId!=null) {
245
-//                        msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType);
246
-//                    }
247
-//                }
243
+                    // 先删除之前的附件
244
+                    if(caseId!=null) {
245
+                        caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType);
246
+                    }
247
+                }
248 248
                 Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId);
249 249
 
250 250
                 AjaxResult ajax = AjaxResult.success();

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java Ver fichero

@@ -39,7 +39,7 @@ public interface VideoService {
39 39
      * @param userId
40 40
      * @return
41 41
      */
42
-    AjaxResult secretaryRoleByUserId(Long userId);
42
+    AjaxResult secretaryRoleByUserId(Long userId,Long caseId);
43 43
 
44 44
     /**
45 45
      * 根据html字符串转pdf并和案件关联

+ 19
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java Ver fichero

@@ -321,11 +321,28 @@ public class VideoServiceImpl implements VideoService {
321 321
     }
322 322
 
323 323
     @Override
324
-    public AjaxResult secretaryRoleByUserId(Long userId) {
324
+    public AjaxResult secretaryRoleByUserId(Long userId,Long caseId) {
325
+        CaseApplication application = new CaseApplication();
326
+        application.setId(caseId);
327
+        // 根据案件id查询案件
328
+        CaseApplication caseApplication = caseApplicationMapper.selectCaseApplication(application);
329
+        if(caseApplication==null){
330
+            return AjaxResult.error("案件不存在");
331
+        }
325 332
         List<SysRole> roles = roleMapper.selectRolePermissionByUserId(userId);
326 333
         JSONObject jsonObject = new JSONObject();
327 334
         boolean isSecretaryRole=false;
328
-        if(CollectionUtil.isNotEmpty(roles)){
335
+        if(caseApplication.getArbitratorId()!=null&& Objects.equals(userId, caseApplication.getArbitratorId())){
336
+            // 是调解员
337
+            if(CollectionUtil.isNotEmpty(roles)){
338
+                for (SysRole role : roles) {
339
+                    if("仲裁员".equals(role.getRoleName())){
340
+                        isSecretaryRole=true;
341
+                        break;
342
+                    }
343
+                }
344
+            }
345
+        }else if(CollectionUtil.isNotEmpty(roles)){
329 346
             for (SysRole role : roles) {
330 347
                 if("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName())){
331 348
                     isSecretaryRole=true;

+ 3
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml Ver fichero

@@ -108,7 +108,8 @@
108 108
         update case_attach
109 109
         <set>
110 110
             <if test="annexName != null and annexName != ''">annex_name = #{annexName},</if>
111
-            <if test="annexPath != null and annexPath != ''">annex_path = #{annexPath}</if>
111
+            <if test="annexPath != null and annexPath != ''">annex_path = #{annexPath},</if>
112
+            <if test="onlyOfficeFileId != null and onlyOfficeFileId != ''">only_office_file_id = #{onlyOfficeFileId}</if>
112 113
         </set>
113 114
         <where>
114 115
             <if test="caseAppliId != null ">
@@ -117,6 +118,7 @@
117 118
             <if test="annexType != null ">
118 119
                 AND annex_type  = #{annexType}
119 120
             </if>
121
+
120 122
         </where>
121 123
     </update>
122 124