瀏覽代碼

Merge branch 'wq1' of SH-Arbitrate/Mediation-Backend into dev

wangqiong123 2 年之前
父節點
當前提交
badbdf8c13

+ 15
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/miniprogress/WeChatUserController.java 查看文件

@@ -5,7 +5,9 @@ import com.ruoyi.common.annotation.Anonymous;
5 5
 import com.ruoyi.common.core.controller.BaseController;
6 6
 import com.ruoyi.common.core.domain.AjaxResult;
7 7
 import com.ruoyi.common.core.domain.entity.SysRole;
8
+import com.ruoyi.common.core.domain.entity.SysUser;
8 9
 import com.ruoyi.system.mapper.SysRoleMapper;
10
+import com.ruoyi.system.mapper.SysUserMapper;
9 11
 import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication;
10 12
 import com.ruoyi.wisdomarbitrate.domain.vo.miniprogress.WeChatUserVO;
11 13
 import com.ruoyi.wisdomarbitrate.service.miniprogress.WeChatUserService;
@@ -26,6 +28,8 @@ public class WeChatUserController extends BaseController {
26 28
     private WeChatUserService weChatUserService;
27 29
     @Autowired
28 30
     private SysRoleMapper roleMapper;
31
+    @Autowired
32
+    private SysUserMapper userMapper;
29 33
     /**
30 34
      * 小程序端获取手机验证码
31 35
      * @param userVO
@@ -67,5 +71,16 @@ public class WeChatUserController extends BaseController {
67 71
         logger.info("调用小程序注册==="+ientityAuthentication.toString());
68 72
         return weChatUserService.registerUser(ientityAuthentication);
69 73
     }
74
+    @Anonymous
75
+    @GetMapping("/verifyUserName")
76
+    public AjaxResult verifyUserName(@RequestParam("userName") String userName)
77
+    {
78
+        SysUser sysUser = userMapper.checkUserNameUnique(userName);
79
+        if(sysUser==null){
80
+            return AjaxResult.success();
81
+        }else {
82
+            return AjaxResult.error("用户名已存在!");
83
+        }
84
+    }
70 85
 
71 86
 }

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java 查看文件

@@ -99,7 +99,7 @@ public class MsCaseApplication {
99 99
     private String payType;
100 100
 
101 101
     /**
102
-     * 调解结果,1达成调解,2未达成调解,3未达成调解但不再争议,4未达成调解但同意引入仲裁
102
+     * 调解结果,1达成调解,2未达成调解,3未达成调解但不再争议,4未达成调解但同意引入仲裁,5-达成和解
103 103
      */
104 104
     @Column(name = "media_result")
105 105
     private Integer mediaResult;

+ 4
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java 查看文件

@@ -73,6 +73,10 @@ public class MsCaseApplicationVO extends MsCaseApplication {
73 73
      * 缴费拒绝原因
74 74
      */
75 75
     private String reason;
76
+    /**
77
+     * 签名按钮显示,0-显示,1-不显示
78
+     */
79
+    private Integer signButtonFlag;
76 80
 
77 81
 
78 82
 }

+ 2
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseApplicationMapper.java 查看文件

@@ -34,7 +34,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
34 34
      * @param caseStatusNames
35 35
      * @return
36 36
      */
37
-    @Select("<script> select t.* from (select c.id,c.room_id roomId,c.mediation_method mediationMethod," +
37
+    @Select("<script> select t.* from (select c.media_result mediaResult,c.id,c.room_id roomId,c.mediation_method mediationMethod," +
38 38
             "   CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName,"
39 39
             +
40 40
             "0 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
@@ -80,7 +80,7 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
80 80
             "<if test=\"req.endTime != null and req.endTime != ''\">" +
81 81
             "and c.create_time &lt;= #{req.endTime}</if>" +
82 82
             "        </where> " +
83
-            "union  select c.id id,c.room_id roomId,c.mediation_method mediationMethod,"
83
+            "union  select c.media_result mediaResult,c.id id,c.room_id roomId,c.mediation_method mediationMethod,"
84 84
             +
85 85
             "   CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName,"
86 86
             +

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAttachMapper.java 查看文件

@@ -42,4 +42,11 @@ public interface MsCaseAttachMapper {
42 42
      * @param ids
43 43
      */
44 44
     void batchDelete(@Param("ids")List<Long> ids);
45
+
46
+    /**
47
+     * 根据附件名查找数量
48
+     * @param fileName
49
+     * @return
50
+     */
51
+    int countByfileName(@Param("annexName") String fileName,@Param("caseAppliId") Long caseAppliId);
45 52
 }

+ 21
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java 查看文件

@@ -185,6 +185,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
185 185
         }
186 186
     //    Map<String, MsCaseFlow> flowMap = caseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getButtonAuthFlag, Function.identity()));
187 187
         List<String> caseStatusNames = caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList());
188
+        // 是否调解员
189
+        boolean isMediatorRole=false;
188 190
         // 如果是申请人,可以看见申请人为自己(即自然人)或者委托代理人为自己的案件(即机构)
189 191
         for (SysRole role : roles) {
190 192
             if(StrUtil.isNotEmpty(role.getRoleName())){
@@ -209,6 +211,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
209 211
                     break;
210 212
                 }
211 213
                 if(StrUtil.equals(role.getRoleName(),"调解员")) {
214
+                    isMediatorRole=true;
212 215
                     req.setMediatorId(String.valueOf(sysUser.getUserId()));
213 216
                     break;
214 217
                 }
@@ -220,7 +223,21 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
220 223
         }
221 224
         startPage();
222 225
         // 查询案件列表
223
-        return  msCaseApplicationMapper.list(req, caseStatusNames);
226
+        List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, caseStatusNames);
227
+        if (CollectionUtil.isNotEmpty(list)) {
228
+        // 判断调解员签名按钮权限,0-显示,1-不显示
229
+            for (MsCaseApplicationVO vo : list) {
230
+                if (isMediatorRole && vo.getMediaResult()!=null && vo.getMediaResult()==5) {
231
+                    // 是调解员并且是和解协议,不显示
232
+                    vo.setSignButtonFlag(1);
233
+
234
+                }else {
235
+                    vo.setSignButtonFlag(0);
236
+                }
237
+            }
238
+
239
+        }
240
+        return list;
224 241
     }
225 242
 
226 243
     @Override
@@ -2027,6 +2044,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2027 2044
                                                 if(caseFlow != null){
2028 2045
                                                     application.setCaseFlowId(caseFlow.getId());
2029 2046
                                                     application.setCaseStatusName(caseFlow.getCaseStatusName());
2047
+                                                    // 新增日志
2048
+                                                    CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
2049
+
2030 2050
                                                 }
2031 2051
 
2032 2052
                                                 application.setMediaResult(mediaResult);

+ 17
- 12
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java 查看文件

@@ -53,8 +53,7 @@ import java.util.Map;
53 53
 import java.util.stream.Collectors;
54 54
 
55 55
 import static com.ruoyi.common.core.domain.AjaxResult.success;
56
-import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile;
57
-import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName;
56
+import static com.ruoyi.common.utils.file.FileUploadUtils.*;
58 57
 
59 58
 /**
60 59
  * @author wangqiong
@@ -454,23 +453,29 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
454 453
             String fileName = fileUrl.substring(fileUrl.lastIndexOf("/"));
455 454
             fileName = fileName.replace("/", "");
456 455
             fileName=fileId+fileName;
457
-                String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), fileName).getAbsolutePath();
456
+            String annexName=System.currentTimeMillis()+fileName;
457
+            String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), annexName).getAbsolutePath();
458 458
                 staticAndMksDir = Paths.get(absPath).toFile().toString();
459 459
             long downloadFile = HttpUtil.downloadFile(fileUrl, staticAndMksDir);
460 460
             if(downloadFile>0) {
461
+
461 462
                 Example example = new Example(MsCaseApplication.class);
462 463
                 example.createCriteria().andEqualTo("roomId", roomId);
463 464
                 MsCaseApplication caseApplication = caseApplicationMapper.selectOneByExample(example);
464 465
                 if(caseApplication != null) {
465
-                    String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName);
466
-                    // 存入数据库
467
-                    MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(caseApplication.getId())
468
-                            .annexName(fileName)
469
-                            .annexPath(annexName)
470
-                            .annexType(AnnexTypeEnum.MEETING_VIDEO.getCode())
471
-                            .build();
472
-                    caseAttachMapper.save(caseAttach);
473
-                    return annexName;
466
+                    // 根据文件名称查询附件,如果该视频已存在则不存入数据库
467
+                    int count= caseAttachMapper.countByfileName(fileName,caseApplication.getId());
468
+                    if(count<1) {
469
+                         annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), annexName);
470
+                        // 存入数据库
471
+                        MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(caseApplication.getId())
472
+                                .annexName(fileName)
473
+                                .annexPath(annexName)
474
+                                .annexType(AnnexTypeEnum.MEETING_VIDEO.getCode())
475
+                                .build();
476
+                        caseAttachMapper.save(caseAttach);
477
+                        return annexName;
478
+                    }
474 479
                 }
475 480
             }
476 481
         }

+ 3
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml 查看文件

@@ -104,6 +104,9 @@
104 104
             </if>
105 105
         </where>
106 106
     </select>
107
+    <select id="countByfileName" resultType="java.lang.Integer">
108
+        select count(1) from ms_case_attach where case_appli_id=#{caseAppliId} and annex_name=#{annexName}
109
+    </select>
107 110
 
108 111
     <update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach">
109 112
         update ms_case_attach