Sfoglia il codice sorgente

Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into hjb

hejinbo 2 anni fa
parent
commit
d026e0f7ea

+ 15
- 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java Vedi File

@@ -12,6 +12,7 @@ import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
12 12
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
13 13
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
14 14
 import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
15
+import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
15 16
 import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
16 17
 import org.springframework.beans.factory.annotation.Autowired;
17 18
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -38,11 +39,23 @@ public class CaseApplicationController extends BaseController {
38 39
     @GetMapping("/list")
39 40
     public TableDataInfo list(CaseApplication caseApplication) {
40 41
         startPage();
41
-//        List<CaseApplication> list = caseApplicationService.selectCaseApplicationListNew(caseApplication);
42
-        List<CaseApplication> list = caseApplicationService.selectCaseApplicationList(caseApplication);
42
+        List<CaseApplication> list = caseApplicationService.selectCaseApplicationListByRole(caseApplication);
43
+//        List<CaseApplication> list = caseApplicationService.selectCaseApplicationList(caseApplication);
43 44
         return getDataTable(list);
44 45
     }
45 46
 
47
+    /**
48
+     * 根据角色查询待办数量
49
+     * @return
50
+     */
51
+
52
+    @GetMapping("/toDoCount")
53
+    public AjaxResult toDoCount() {
54
+        ToDoCount toDoCount = caseApplicationService.selectToDoCount();
55
+//        List<CaseApplication> list = caseApplicationService.selectCaseApplicationList(caseApplication);
56
+        return success(toDoCount);
57
+    }
58
+
46 59
     /**
47 60
      * 新增立案数据
48 61
      */

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java Vedi File

@@ -49,6 +49,14 @@ public interface SysRoleMapper
49 49
      */
50 50
     public SysRole selectRoleById(Long roleId);
51 51
 
52
+    /**
53
+     * 根据角色名称查询角色id
54
+     * @param roleName
55
+     * @return
56
+     */
57
+    public Long selectRoleIdByName(String roleName);
58
+
59
+
52 60
     /**
53 61
      * 根据用户ID查询角色
54 62
      * 

+ 24
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java Vedi File

@@ -329,6 +329,30 @@ public class CaseApplication  extends BaseEntity {
329 329
      */
330 330
     private String userId;
331 331
     private List<Long> deptIds;
332
+    /**
333
+     * 部门长状态
334
+     */
335
+    private List<Integer> deptHeadStatus;
336
+    /**
337
+     * 财务状态
338
+     */
339
+    private Integer financeStatus;
340
+
341
+    public Integer getFinanceStatus() {
342
+        return financeStatus;
343
+    }
344
+
345
+    public void setFinanceStatus(Integer financeStatus) {
346
+        this.financeStatus = financeStatus;
347
+    }
348
+
349
+    public List<Integer> getDeptHeadStatus() {
350
+        return deptHeadStatus;
351
+    }
352
+
353
+    public void setDeptHeadStatus(List<Integer> deptHeadStatus) {
354
+        this.deptHeadStatus = deptHeadStatus;
355
+    }
332 356
 
333 357
     public List<Long> getDeptIds() {
334 358
         return deptIds;

+ 32
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java Vedi File

@@ -0,0 +1,32 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @author wangqiong
7
+ * @description 待办数量
8
+ * @date 2023-10-17 09:48
9
+ */
10
+@Data
11
+public class ToDoCount {
12
+
13
+    private int caseApply; // 立案申请
14
+    private int caseApplyCheck; // 待立案审查
15
+    private int caseApplyPay; // 待缴费
16
+    private int caseApplyPayCheck; // 待缴费确认
17
+    private int caseApplyEvidence; //待案件质证
18
+    private int caseApplyGroupCheck; // 待组庭审核
19
+    private int caseApplyGroupConfirm; // 待组庭确定
20
+//    private int caseApplyGroupNotice;
21
+    private int caseApplyArbitrateWay; // 待审核仲裁方式
22
+    private int caseApplyGroupOnline; // 待开庭审理
23
+    private int caseApplyGroupOffline; // 待书面审理
24
+    private int caseApplyAward; // 待生成仲裁文书
25
+    private int caseApplyAwardCheck; // 待核验仲裁文书
26
+    private int caseApplyAwardConfirm; // 待审核仲裁文书
27
+    private int caseApplyAwardSign; // 待仲裁文书签名
28
+    private int caseApplyAwardSeal; // 待仲裁文书用印
29
+    private int caseApplyAwardSend; // 待仲裁文书送达
30
+    private int caseApplyStored; // 待案件归档
31
+    private int caseApplyArchived; // 已归档
32
+}

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java Vedi File

@@ -4,6 +4,7 @@ import com.ruoyi.wisdomarbitrate.domain.Arbitrator;
4 4
 import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
5 5
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
6 6
 import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO;
7
+import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
7 8
 import org.apache.ibatis.annotations.Param;
8 9
 
9 10
 import java.util.List;
@@ -60,4 +61,10 @@ public interface CaseApplicationMapper {
60 61
      * @return
61 62
      */
62 63
     List<CaseApplication> selectDeptHeadCaseApplicationList(@Param("caseApplication") CaseApplication caseApplication, @Param("statusList")List<Integer> caseStatusList);
64
+
65
+    ToDoCount selectAdminCaseToDoCount();
66
+
67
+    ToDoCount selectDeptHeadCaseToDoCount( @Param("statusList")List<Integer> caseStatusList);
68
+
69
+    ToDoCount selectTodoCountByRole(CaseApplication caseApplication);
63 70
 }

+ 8
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java Vedi File

@@ -6,12 +6,13 @@ import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
6 6
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
7 7
 import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
8 8
 import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
9
+import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
9 10
 
10 11
 import java.util.List;
11 12
 
12 13
 public interface ICaseApplicationService {
13 14
     List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication);
14
-    List<CaseApplication> selectCaseApplicationListNew(CaseApplication caseApplication);
15
+    List<CaseApplication> selectCaseApplicationListByRole(CaseApplication caseApplication);
15 16
 
16 17
 
17 18
     int insertcaseApplication(CaseApplication caseApplication);
@@ -53,4 +54,10 @@ public interface ICaseApplicationService {
53 54
     AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecord);
54 55
 
55 56
     CaseApplication selectSignSealUrl(CaseApplication caseApplication) throws EsignDemoException;
57
+
58
+    /**
59
+     * 查询待办数量
60
+     * @return
61
+     */
62
+    ToDoCount selectToDoCount();
56 63
 }

+ 132
- 11
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Vedi File

@@ -28,7 +28,11 @@ import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
28 28
 import com.ruoyi.common.core.domain.entity.SysUser;
29 29
 import com.ruoyi.common.exception.EsignDemoException;
30 30
 import com.ruoyi.common.exception.ServiceException;
31
+import com.ruoyi.system.domain.SysUserRole;
32
+import com.ruoyi.system.mapper.SysRoleMapper;
31 33
 import com.ruoyi.system.mapper.SysUserMapper;
34
+import com.ruoyi.system.mapper.SysUserRoleMapper;
35
+import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
32 36
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
33 37
 import com.ruoyi.common.utils.bean.BeanUtils;
34 38
 import com.ruoyi.system.mapper.SysDeptMapper;
@@ -80,6 +84,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
80 84
     @Autowired
81 85
     private SysUserMapper sysUserMapper;
82 86
     @Autowired
87
+    private SysUserRoleMapper userRoleMapper;
88
+    @Autowired
89
+    private SysRoleMapper roleMapper;
90
+    @Autowired
83 91
     private SealSignRecordMapper sealSignRecordMapper;
84 92
     @Autowired
85 93
     private CaseLogRecordMapper caseLogRecordMapper;
@@ -99,7 +107,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
99 107
      * @return
100 108
      */
101 109
 //    @Override
102
-    public List<CaseApplication> selectCaseApplicationListNew(CaseApplication caseApplication) {
110
+    public List<CaseApplication> selectCaseApplicationListByRole(CaseApplication caseApplication) {
103 111
         // 获取登录用户
104 112
         LoginUser loginUser = getLoginUser();
105 113
         SysUser user = loginUser.getUser();
@@ -125,11 +133,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
125 133
                 caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
126 134
                 caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
127 135
                 caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
128
-                return caseApplicationMapper.selectDeptHeadCaseApplicationList(caseApplication,caseStatusList);
136
+                caseApplication.setDeptHeadStatus(caseStatusList);
129 137
             }
130 138
             if(role.getRoleName().equals("仲裁员")){
131 139
                 caseApplication.setUserId(String.valueOf(userId));
132 140
             }
141
+            if(role.getRoleName().equals("财务")){
142
+                caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
143
+            }
133 144
             if(role.getRoleName().equals("法律顾问")){
134 145
                 // 查询角色有关的用户部门
135 146
                 List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
@@ -151,6 +162,64 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
151 162
 
152 163
     }
153 164
     @Override
165
+    public ToDoCount selectToDoCount() {
166
+
167
+        // 获取登录用户
168
+        LoginUser loginUser = getLoginUser();
169
+        SysUser user = loginUser.getUser();
170
+        Long userId = user.getUserId();
171
+
172
+        // 查询登录人身份证号
173
+        SysUser sysUser = sysUserMapper.selectUserById(userId);
174
+        List<SysRole> roles = sysUser.getRoles();
175
+        // 没有角色不能查看案件列表
176
+        if(CollectionUtil.isEmpty(roles)){
177
+            throw new ServiceException("该用户没有角色权限");
178
+        }
179
+        CaseApplication caseApplication = new CaseApplication();
180
+        List<Integer> caseStatusList=new ArrayList<>();
181
+        for (SysRole role : roles) {
182
+            // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
183
+            if(role.getRoleName().equals("超级管理员")
184
+            ){
185
+                return caseApplicationMapper.selectAdminCaseToDoCount();
186
+            }
187
+            if(role.getRoleName().equals("仲裁委")
188
+                    ||role.getRoleName().equals("部门长")){
189
+
190
+                caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
191
+                caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
192
+                caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
193
+                caseApplication.setDeptHeadStatus(caseStatusList);
194
+            }
195
+            if(role.getRoleName().equals("仲裁员")){
196
+                caseApplication.setUserId(String.valueOf(userId));
197
+            }
198
+            if(role.getRoleName().equals("财务")){
199
+                caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
200
+            }
201
+            if(role.getRoleName().equals("法律顾问")){
202
+                // 查询角色有关的用户部门
203
+                List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
204
+                caseApplication.setDeptIds(deptIds);
205
+            }
206
+            if(StrUtil.isEmpty(caseApplication.getNameId())&&role.getRoleName().equals("申请人")){
207
+                // 查询角色有关的用户部门
208
+                caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
209
+            }
210
+            if(role.getRoleName().equals("被申请人")){
211
+                //
212
+                caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
213
+            }
214
+        }
215
+
216
+
217
+
218
+
219
+        // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
220
+        return caseApplicationMapper.selectTodoCountByRole(caseApplication);
221
+    }
222
+    @Override
154 223
     public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
155 224
         return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
156 225
 
@@ -206,7 +275,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
206 275
 
207 276
                     }
208 277
                     // 组装申请代理人信息
209
-                    buildAgentInfo(caseAffiliate);
278
+                    String agentInfoFlag = buildAgentInfo(caseAffiliate);
279
+                    if(StrUtil.isNotEmpty(agentInfoFlag)){
280
+                        throw new ServiceException(agentInfoFlag);
281
+                    }
210 282
                 }
211 283
             }
212 284
 
@@ -294,7 +366,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
294 366
                         caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
295 367
 
296 368
                     }
297
-                    buildAgentInfo(caseAffiliate);
369
+                    String agentInfoFlag = buildAgentInfo(caseAffiliate);
370
+                    if(StrUtil.isNotEmpty(agentInfoFlag)){
371
+                        throw new ServiceException(agentInfoFlag);
372
+                    }
298 373
 
299 374
                 }
300 375
 
@@ -318,12 +393,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
318 393
      * 组装申请代理人信息
319 394
      * @param caseAffiliate
320 395
      */
321
-    private void buildAgentInfo(CaseAffiliate caseAffiliate) {
322
-        if(StrUtil.isNotEmpty(caseAffiliate.getNameAgent())){
396
+    private String buildAgentInfo(CaseAffiliate caseAffiliate) {
397
+        if (caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getNameAgent())) {
398
+            // 查询申请人角色id
399
+            Long roleId = roleMapper.selectRoleIdByName("申请人");
323 400
             // 组装申请机构代理人信息,用户表新增并且和部门关联
324 401
             // 根据代理人身份证去用户表查询,有修改,么有新增
325 402
             SysUser agentUser = sysUserMapper.selectUserByIdCard(caseAffiliate.getIdentityNumAgent());
326
-            if(agentUser==null){
403
+            if (agentUser == null) {
327 404
                 agentUser = new SysUser();
328 405
                 agentUser.setIdCard(caseAffiliate.getIdentityNumAgent());
329 406
                 agentUser.setNickName(caseAffiliate.getNameAgent());
@@ -332,18 +409,46 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
332 409
                 agentUser.setPassword(SecurityUtils.encryptPassword(Constants.DEFAULT_PASSWORD));
333 410
                 agentUser.setDeptId(Long.valueOf(caseAffiliate.getApplicationOrganId()));
334 411
                 int insertUserRow = sysUserMapper.insertUser(agentUser);
335
-                if(insertUserRow>0) {
412
+                // 新增角色为申请人
413
+                ArrayList<SysUserRole> sysUserRoles = new ArrayList<>();
414
+                SysUserRole sysUserRole = new SysUserRole();
415
+                sysUserRole.setUserId(agentUser.getUserId());
416
+                sysUserRole.setRoleId(roleId);
417
+                sysUserRoles.add(sysUserRole);
418
+                if(CollectionUtil.isNotEmpty(sysUserRoles)) {
419
+                    userRoleMapper.batchUserRole(sysUserRoles);
420
+                }
421
+                if (insertUserRow > 0) {
336 422
                     caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
337 423
                     // 发送短信 todo
338 424
                 }
339
-            }else {
425
+            } else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())) {
426
+               return "申请机构与申请代理人不匹配";
427
+            } else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())){
340 428
                 // 同步用户表和案件关联人表的手机号和名称
341 429
                 caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
342 430
                 caseAffiliate.setNameAgent(agentUser.getNickName());
343 431
                 caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
432
+                // 新增角色为申请人
433
+                if(agentUser.getRoleIds()!=null) {
434
+                    List<Long> longList = Arrays.asList(agentUser.getRoleIds());
435
+                    if(!longList.contains(roleId)) {
436
+                        ArrayList<SysUserRole> sysUserRoles = new ArrayList<>();
437
+                        SysUserRole sysUserRole = new SysUserRole();
438
+                        sysUserRole.setUserId(agentUser.getUserId());
439
+                        sysUserRole.setRoleId(roleId);
440
+                        sysUserRoles.add(sysUserRole);
441
+                        if (CollectionUtil.isNotEmpty(sysUserRoles)) {
442
+                            userRoleMapper.batchUserRole(sysUserRoles);
443
+                        }
444
+                    }
445
+                }
446
+
344 447
             }
345 448
 
449
+
346 450
         }
451
+        return null;
347 452
     }
348 453
 
349 454
     @Override
@@ -471,7 +576,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
471 576
 //                }else {
472 577
 //                    caseApplicationListinsert.add(caseApplication);
473 578
 //                }
474
-                    caseApplicationListinsert.add(caseApplication);
579
+                    if(StrUtil.isEmpty(caseApplication.getErrorMsg())) {
580
+                        caseApplicationListinsert.add(caseApplication);
581
+                    }else {
582
+                        // 拼接错误信息
583
+                        failureMsg.append("<br/>").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString());
584
+
585
+                    }
475 586
                 }else {
476 587
                     // 拼接错误信息
477 588
                     failureMsg.append("<br/>").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString());
@@ -519,7 +630,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
519 630
                             if(caseAffiliates!=null&&caseAffiliates.size()>0){
520 631
                                 for (CaseAffiliate caseAffiliate : caseAffiliates){
521 632
                                     caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
522
-                                    buildAgentInfo(caseAffiliate);
523 633
 
524 634
                                 }
525 635
                                 caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
@@ -1272,6 +1382,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1272 1382
         return caseApplication;
1273 1383
     }
1274 1384
 
1385
+
1386
+
1275 1387
     @Override
1276 1388
     @Transactional
1277 1389
     public int pendTralSure(CaseApplication caseApplication) {
@@ -1384,6 +1496,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1384 1496
         if(StrUtil.isNotEmpty(caseApplication.getName())){
1385 1497
             setApplicantOrganization(caseAffiliate, caseApplication, deptMap);
1386 1498
         }
1499
+        String s = buildAgentInfo(caseAffiliate);
1500
+        if(StrUtil.isNotEmpty(s)){
1501
+            StringBuilder errorMsg = caseApplication.getErrorMsg();
1502
+            if(StrUtil.isEmpty(errorMsg)){
1503
+             errorMsg=new StringBuilder();
1504
+            }
1505
+            errorMsg.append(s);
1506
+            caseApplication.setErrorMsg(errorMsg);
1507
+        }
1387 1508
         caseAffiliatesnew.add(caseAffiliate);
1388 1509
 
1389 1510
         // 组装被申请人信息

+ 9
- 6
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/WeChatUserServiceImpl.java Vedi File

@@ -74,14 +74,14 @@ public class WeChatUserServiceImpl implements WeChatUserService {
74 74
         return "短信发送失败";
75 75
     }
76 76
     /**
77
-     * 设置字典缓存
77
+     * 设置验证码缓存
78 78
      *
79 79
      * @param key 参数键
80
-     * @param code 字典数据列表
80
+     * @param code 验证码
81 81
      */
82 82
     public static void setCodeCache(String key, String code)
83 83
     {
84
-        SpringUtils.getBean(RedisCache.class).setCacheObject(getVerifyCodeCacheKey(key), code, 5,TimeUnit.MILLISECONDS);
84
+        SpringUtils.getBean(RedisCache.class).setCacheObject(getVerifyCodeCacheKey(key), code, 5,TimeUnit.MINUTES);
85 85
     }
86 86
 
87 87
 
@@ -107,9 +107,12 @@ public class WeChatUserServiceImpl implements WeChatUserService {
107 107
     @Transactional
108 108
     @Override
109 109
     public AjaxResult registerUser(IdentityAuthentication ientityAuthentication) {
110
+        String codeCache = getCodeCache(ientityAuthentication.getPhone());
110 111
         // 校验短信验证码
111
-        if(StrUtil.isEmpty(getCodeCache(ientityAuthentication.getPhone()))){
112
-            return AjaxResult.success("验证码校验失败");
112
+        if(StrUtil.isEmpty(codeCache)){
113
+            return AjaxResult.warn("验证码校验失败");
114
+        }else if(!codeCache.equals(ientityAuthentication.getVerifyCode())){
115
+            return AjaxResult.warn("验证码校验失败");
113 116
         }
114 117
         SysUser sysUserName=sysUserMapper.selectUserByUserName(ientityAuthentication.getUserName());
115 118
         if(sysUserName!=null){
@@ -140,7 +143,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
140 143
             sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
141 144
             int row = sysUserMapper.insertUser(sysUser);
142 145
             if(row<1) {
143
-                return AjaxResult.error("注册失败");
146
+                return AjaxResult.warn("注册失败");
144 147
             }
145 148
         }
146 149
 

+ 5
- 2
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml Vedi File

@@ -92,8 +92,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
92 92
 		<include refid="selectRoleVo"/>
93 93
 		 where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
94 94
 	</select>
95
-	
96
- 	<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
95
+    <select id="selectRoleIdByName" resultType="java.lang.Long" >
96
+		select role_id from sys_role where role_name=#{roleName}
97
+	</select>
98
+
99
+	<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
97 100
  		insert into sys_role(
98 101
  			<if test="roleId != null and roleId != 0">role_id,</if>
99 102
  			<if test="roleName != null and roleName != ''">role_name,</if>

+ 225
- 6
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Vedi File

@@ -39,7 +39,13 @@
39 39
 
40 40
     <select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
41 41
         select t1.* from(
42
-        select t.* from(
42
+        select DISTINCT(t.id),t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
43
+             t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims ,
44
+        t.loan_start_date ,t.loan_end_date ,t.claim_princi_owed ,t.claim_interest_owed ,t.claim_liquid_damag,t.fee_payable ,
45
+        t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
46
+        t.update_by ,t.update_time , t.arbitrator_name,t.name,t.application_organ_id,t.applicantName,
47
+        t.arbitrator_id,t.identity_num , t.identity_type,t.filearbitra_url
48
+        from(
43 49
         select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
44 50
         CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
45 51
         ELSE '无审理方式'
@@ -99,20 +105,129 @@
99 105
                 </foreach> )
100 106
             </if>
101 107
 
108
+                <!--申请人-->
109
+                <if test="nameId != null and nameId != ''">
110
+                    or ( t.application_organ_id = #{nameId} AND t.identity_type=1
111
+                    and t.case_status in (0,2))
112
+
113
+                </if>
114
+        <!--部门长-->
115
+            <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
116
+            or (t.identity_type=1 and t.case_status in
117
+            <foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">#{caseStatus}
118
+            </foreach>)
119
+            </if>
120
+            <!--财务-->
121
+            <if test="financeStatus != null and financeStatus != ''">
122
+                or(t.identity_type=1 and t.case_status =#{financeStatus})
123
+
124
+            </if>
102 125
         </where>
103 126
         ) t1
127
+<!--        <where>-->
128
+<!--            &lt;!&ndash;申请人&ndash;&gt;-->
129
+<!--            <if test="nameId != null and nameId != ''">-->
130
+<!--                and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1-->
131
+<!--                    and t1.case_status in (0,2)-->
132
+<!--                )-->
133
+<!--            </if>-->
134
+<!--        </where>-->
135
+        order by t1.create_time desc,t1.case_num desc
136
+    </select>
137
+    <select id="selectTodoCountByRole" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
138
+        select sum( case when t1.case_status=0 then 1 else 0 end) caseApply,
139
+        sum( case when t1.case_status=1 then 1 else 0 end) caseApplyCheck,
140
+        sum( case when t1.case_status=2 then 1 else 0 end) caseApplyPay,
141
+        sum( case when t1.case_status=3 then 1 else 0 end) caseApplyPayCheck,
142
+        sum( case when t1.case_status=4 then 1 else 0 end) caseApplyEvidence,
143
+        sum( case when t1.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
144
+        sum( case when t1.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
145
+        sum( case when t1.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
146
+        sum( case when t1.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
147
+        sum( case when t1.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
148
+        sum( case when t1.case_status=10 then 1 else 0 end) caseApplyAward,
149
+        sum( case when t1.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
150
+        sum( case when t1.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
151
+        sum( case when t1.case_status=13 then 1 else 0 end) caseApplyAwardSign,
152
+        sum( case when t1.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
153
+        sum( case when t1.case_status=15 then 1 else 0 end) caseApplyAwardSend,
154
+        sum( case when t1.case_status=16 then 1 else 0 end) caseApplyStored,
155
+        sum( case when t1.case_status=17 then 1 else 0 end) caseApplyArchived
156
+        from(
157
+        select  DISTINCT(t.id),t.case_status,t.application_organ_id, t.arbitrator_id,t.identity_num , t.identity_type from(
158
+        select c.id ,
159
+         c.case_status,ca.application_organ_id,
160
+        c.arbitrator_id,ca.identity_num , ca.identity_type
161
+        from case_application c
162
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id
104 163
         <where>
164
+            <if test="caseStatus != null">
165
+                AND c.case_status = #{caseStatus}
166
+            </if>
167
+            <if test="caseNum != null and caseNum != ''">
168
+                AND c.case_num = #{caseNum}
169
+            </if>
170
+            <if test="caseStatusList != null and caseStatusList.size() > 0">
171
+                and c.case_status in
172
+                <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
173
+                    #{caseStatus}
174
+                </foreach>
175
+            </if>
176
+        </where>
177
+        ) t
178
+        <where>
179
+
180
+            <!--被申请人-->
181
+            <if test="idCard != null and idCard != ''">
182
+                or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
183
+            </if>
184
+            <!--仲裁员-->
185
+            <if test="userId != null and userId != ''">
186
+                or ( t.identity_type=1 and
187
+                t.case_status in (7,8,9,12,13,14)
188
+                and
189
+                instr (t.arbitrator_id,#{userId})>0)
190
+            </if>
191
+            <!--法律顾问-->
192
+            <if test="deptIds != null and deptIds.size() > 0">
193
+                or (t.identity_type=1 and t.case_status in (1,5,11,15,16)
194
+                and t.application_organ_id in
195
+                <foreach item="item" collection="deptIds" open="(" separator="," close=")">
196
+                    #{item}
197
+                </foreach> )
198
+            </if>
105 199
             <!--申请人-->
106 200
             <if test="nameId != null and nameId != ''">
107
-                and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1
108
-                    and t1.case_status in (0,2)
109
-                )
201
+                or ( t.application_organ_id = #{nameId} AND t.identity_type=1
202
+                and t.case_status in (0,2))
203
+
204
+            </if>
205
+            <!--部门长-->
206
+            <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
207
+                or (t.identity_type=1 and t.case_status in
208
+                <foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">
209
+                    #{caseStatus}
210
+                </foreach>)
211
+            </if>
212
+            <!--财务-->
213
+            <if test="financeStatus != null and financeStatus != ''">
214
+                or( t.identity_type=1 and t.case_status =#{financeStatus})
215
+
110 216
             </if>
111 217
         </where>
112
-        order by t1.create_time desc,t1.case_num desc
218
+        ) t1
219
+        <!--      <where>
220
+                   &lt;!&ndash;申请人&ndash;&gt;-->
221
+<!--            <if test="nameId != null and nameId != ''">-->
222
+<!--                and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1-->
223
+<!--                and t1.case_status in (0,2)-->
224
+<!--                )-->
225
+<!--            </if>
226
+        </where> -->
113 227
     </select>
228
+
114 229
     <select id="selectAdminCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
115
-        select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
230
+        select DISTINCT(c.id) id,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
116 231
         CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
117 232
         ELSE '无审理方式'
118 233
         END arbitratMethodName,
@@ -150,6 +265,53 @@
150 265
         </where>
151 266
         order by c.create_time desc,c.case_num desc
152 267
     </select>
268
+    <select id="selectAdminCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
269
+        SELECT
270
+            sum( case when c.case_status=0 then 1 else 0 end) caseApply,
271
+            sum( case when c.case_status=1 then 1 else 0 end) caseApplyCheck,
272
+            sum( case when c.case_status=2 then 1 else 0 end) caseApplyPay,
273
+            sum( case when c.case_status=3 then 1 else 0 end) caseApplyPayCheck,
274
+            sum( case when c.case_status=4 then 1 else 0 end) caseApplyEvidence,
275
+            sum( case when c.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
276
+            sum( case when c.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
277
+            sum( case when c.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
278
+            sum( case when c.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
279
+            sum( case when c.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
280
+            sum( case when c.case_status=10 then 1 else 0 end) caseApplyAward,
281
+            sum( case when c.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
282
+            sum( case when c.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
283
+            sum( case when c.case_status=13 then 1 else 0 end) caseApplyAwardSign,
284
+            sum( case when c.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
285
+            sum( case when c.case_status=15 then 1 else 0 end) caseApplyAwardSend,
286
+            sum( case when c.case_status=16 then 1 else 0 end) caseApplyStored,
287
+            sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived
288
+        FROM
289
+            case_application c
290
+                 JOIN case_affiliate ca ON ca.case_appli_id = c.id
291
+                AND ca.identity_type = 1
292
+        WHERE
293
+                c.case_status IN (
294
+                                  0,
295
+                                  1,
296
+                                  2,
297
+                                  3,
298
+                                  4,
299
+                                  5,
300
+                                  6,
301
+                                  7,
302
+                                  8,
303
+                                  9,
304
+                                  10,
305
+                                  11,
306
+                                  12,
307
+                                  13,
308
+                                  14,
309
+                                  15,
310
+                                  16,
311
+                                  17
312
+                )
313
+
314
+    </select>
153 315
     <select id="selectDeptHeadCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
154 316
         select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
155 317
         CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
@@ -193,6 +355,63 @@
193 355
         </where>
194 356
         order by c.create_time desc,c.case_num desc
195 357
     </select>
358
+    <select id="selectDeptHeadCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
359
+        select  sum( case when c.case_status=0 then 1 else 0 end) caseApply,
360
+        sum( case when c.case_status=1 then 1 else 0 end) caseApplyCheck,
361
+        sum( case when c.case_status=2 then 1 else 0 end) caseApplyPay,
362
+        sum( case when c.case_status=3 then 1 else 0 end) caseApplyPayCheck,
363
+        sum( case when c.case_status=4 then 1 else 0 end) caseApplyEvidence,
364
+        sum( case when c.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
365
+        sum( case when c.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
366
+        sum( case when c.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
367
+        sum( case when c.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
368
+        sum( case when c.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
369
+        sum( case when c.case_status=10 then 1 else 0 end) caseApplyAward,
370
+        sum( case when c.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
371
+        sum( case when c.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
372
+        sum( case when c.case_status=13 then 1 else 0 end) caseApplyAwardSign,
373
+        sum( case when c.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
374
+        sum( case when c.case_status=15 then 1 else 0 end) caseApplyAwardSend,
375
+        sum( case when c.case_status=16 then 1 else 0 end) caseApplyStored,
376
+        sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived
377
+        from case_application c
378
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
379
+        <where>
380
+            <!--部门长-->
381
+            <if test="statusList != null and statusList.size() > 0">
382
+            or c.case_status in
383
+            <foreach item="caseStatus" collection="statusList" open="(" separator="," close=")">
384
+                #{caseStatus}
385
+            </foreach>
386
+                <!--被申请人-->
387
+                <if test="idCard != null and idCard != ''">
388
+                    or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
389
+                </if>
390
+                <!--仲裁员-->
391
+                <if test="userId != null and userId != ''">
392
+                    or ( t.identity_type=1 and
393
+                    t.case_status in (7,8,9,12,13,14)
394
+                    and
395
+                    instr (t.arbitrator_id,#{userId})>0)
396
+                </if>
397
+                <!--法律顾问-->
398
+                <if test="deptIds != null and deptIds.size() > 0">
399
+                    or (t.identity_type=1 and t.case_status in (1,5,11,15,16)
400
+                    and t.application_organ_id in
401
+                    <foreach item="item" collection="deptIds" open="(" separator="," close=")">
402
+                        #{item}
403
+                    </foreach> )
404
+                </if>
405
+                <!--申请人-->
406
+                <if test="nameId != null and nameId != ''">
407
+                    or( ( t.application_organ_id = #{nameId} AND t.identity_type=1
408
+                    and t.case_status in (0,2))
409
+                    )
410
+                </if>
411
+            </if>
412
+        </where>
413
+
414
+    </select>
196 415
 
197 416
 
198 417
     <select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">