qitz 2 лет назад
Родитель
Сommit
5612aa2f84
25 измененных файлов: 1087 добавлений и 88 удалений
  1. 15
    1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java
  2. 3
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java
  3. 61
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/WeChatUserController.java
  4. 1
    0
      ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java
  5. 1
    0
      ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
  6. 8
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java
  7. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
  8. 10
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java
  9. 24
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java
  10. 20
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java
  11. 32
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java
  12. 63
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/WeChatUserVO.java
  13. 15
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java
  14. 1
    2
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java
  15. 21
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/WeChatUserMapper.java
  16. 8
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java
  17. 18
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/WeChatUserService.java
  18. 215
    37
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java
  19. 15
    8
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java
  20. 157
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/WeChatUserServiceImpl.java
  21. 5
    2
      ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
  22. 7
    1
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
  23. 305
    35
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml
  24. 14
    0
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml
  25. 61
    0
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/WeChatUserMapper.xml

+ 15
- 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java Просмотреть файл

@@ -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,10 +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.selectCaseApplicationList(caseApplication);
42
+        List<CaseApplication> list = caseApplicationService.selectCaseApplicationListByRole(caseApplication);
43
+//        List<CaseApplication> list = caseApplicationService.selectCaseApplicationList(caseApplication);
42 44
         return getDataTable(list);
43 45
     }
44 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
+
45 59
     /**
46 60
      * 新增立案数据
47 61
      */

+ 3
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java Просмотреть файл

@@ -1,6 +1,7 @@
1 1
 package com.ruoyi.web.controller.wisdomarbitrate;
2 2
 
3 3
 import com.alibaba.fastjson.JSONObject;
4
+import com.ruoyi.common.annotation.Anonymous;
4 5
 import com.ruoyi.common.core.controller.BaseController;
5 6
 import com.ruoyi.common.core.domain.AjaxResult;
6 7
 import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
@@ -21,6 +22,7 @@ public class IdentityAuthenticationController extends BaseController {
21 22
     /**
22 23
      * 获取EIDtoken
23 24
      */
25
+    @Anonymous
24 26
     @PostMapping("/selectIdentityAuthenticaEIDtoken")
25 27
     public AjaxResult selectIdentityAuthenticaEIDtoken() {
26 28
         JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthenticaEIDtoken();
@@ -30,6 +32,7 @@ public class IdentityAuthenticationController extends BaseController {
30 32
     /**
31 33
      * 小程序人脸核身后查询身份认证结果
32 34
      */
35
+    @Anonymous
33 36
     @PostMapping("/selectIdentityAuthenticaRespon")
34 37
     public AjaxResult selectIdentityAuthenticaRespon(@Validated @RequestBody IdentityAuthentication ientityAuthentication) {
35 38
         AjaxResult checkResult = identityAuthenticationService.selectIdentityAuthenticaRespon(ientityAuthentication);

+ 61
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/WeChatUserController.java Просмотреть файл

@@ -0,0 +1,61 @@
1
+package com.ruoyi.web.controller.wisdomarbitrate;
2
+
3
+import cn.hutool.core.util.StrUtil;
4
+import com.ruoyi.common.annotation.Anonymous;
5
+import com.ruoyi.common.core.controller.BaseController;
6
+import com.ruoyi.common.core.domain.AjaxResult;
7
+import com.ruoyi.common.exception.ServiceException;
8
+import com.ruoyi.common.utils.http.HttpUtils;
9
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
10
+import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
11
+import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO;
12
+import com.ruoyi.wisdomarbitrate.service.WeChatUserService;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.validation.annotation.Validated;
15
+import org.springframework.web.bind.annotation.*;
16
+
17
+/**
18
+ * @author wangqiong
19
+ * @description 微信小程序用户注册登录
20
+ * @date 2023-10-16 11:25
21
+ */
22
+@RestController
23
+@RequestMapping("/weChatUser")
24
+public class WeChatUserController extends BaseController {
25
+    @Autowired
26
+    private WeChatUserService weChatUserService;
27
+
28
+    /**
29
+     * 小程序端获取手机验证码
30
+     * @param userVO
31
+     * @return
32
+     */
33
+    @Anonymous
34
+    @GetMapping("/sendCode")
35
+    public AjaxResult sendCode(  WeChatUserVO userVO)
36
+    {
37
+        if(StrUtil.isEmpty(userVO.getPhone())){
38
+            return warn("手机号不能为空");
39
+        }
40
+        return success(weChatUserService.sendCode(userVO));
41
+    }
42
+    /**
43
+     * 小程序注册
44
+     */
45
+    @Anonymous
46
+    @PostMapping("/registerUser")
47
+    public AjaxResult registerUser( @RequestBody IdentityAuthentication ientityAuthentication) {
48
+        if(ientityAuthentication.getId()==null
49
+                || StrUtil.isEmpty(ientityAuthentication.getName())
50
+                || StrUtil.isEmpty(ientityAuthentication.getIdentityNo())
51
+                || StrUtil.isEmpty(ientityAuthentication.getPhone())
52
+                || StrUtil.isEmpty(ientityAuthentication.getUserName())
53
+                || StrUtil.isEmpty(ientityAuthentication.getEmail())
54
+                || StrUtil.isEmpty(ientityAuthentication.getVerifyCode())
55
+        ){
56
+            return warn("参数校验失败");
57
+        }
58
+        return weChatUserService.registerUser(ientityAuthentication);
59
+    }
60
+
61
+}

+ 1
- 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java Просмотреть файл

@@ -41,4 +41,5 @@ public class CacheConstants
41 41
      * 登录账户密码错误次数 redis key
42 42
      */
43 43
     public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
44
+    public static final String  WE_CHAT_SMS_VERIFY_CODE_KEY="we_chat_sms_verify_code:";
44 45
 }

+ 1
- 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java Просмотреть файл

@@ -128,6 +128,7 @@ public class Constants
128 128
      * LDAPS 远程方法调用
129 129
      */
130 130
     public static final String LOOKUP_LDAPS = "ldaps:";
131
+    public static final String DEFAULT_PASSWORD = "123456";
131 132
 
132 133
     /**
133 134
      * 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全)

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java Просмотреть файл

@@ -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
      * 

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java Просмотреть файл

@@ -134,4 +134,11 @@ public interface SysUserMapper
134 134
     public SysUser checkEmailUnique(String email);
135 135
 
136 136
     List<SysUser> selectUserListByIds(@Param("idList") List<Long> idList);
137
+
138
+    /**
139
+     * 根据身份证号查询用户信息
140
+     * @param identityNo
141
+     * @return
142
+     */
143
+    SysUser selectUserByIdCard(@Param("idCard")String identityNo);
137 144
 }

+ 10
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java Просмотреть файл

@@ -104,6 +104,16 @@ public class CaseAffiliate   extends BaseEntity {
104 104
 
105 105
     /** 送达电子邮件 */
106 106
     private String sendEmail;
107
+    private String applicantAgentUserId;
108
+
109
+    public String getApplicantAgentUserId() {
110
+        return applicantAgentUserId;
111
+    }
112
+
113
+    public void setApplicantAgentUserId(String applicantAgentUserId) {
114
+        this.applicantAgentUserId = applicantAgentUserId;
115
+    }
116
+
107 117
     /** 快递单号 */
108 118
     private String trackNum;
109 119
 

+ 24
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java Просмотреть файл

@@ -340,6 +340,30 @@ public class CaseApplication  extends BaseEntity {
340 340
      */
341 341
     private String userId;
342 342
     private List<Long> deptIds;
343
+    /**
344
+     * 部门长状态
345
+     */
346
+    private List<Integer> deptHeadStatus;
347
+    /**
348
+     * 财务状态
349
+     */
350
+    private Integer financeStatus;
351
+
352
+    public Integer getFinanceStatus() {
353
+        return financeStatus;
354
+    }
355
+
356
+    public void setFinanceStatus(Integer financeStatus) {
357
+        this.financeStatus = financeStatus;
358
+    }
359
+
360
+    public List<Integer> getDeptHeadStatus() {
361
+        return deptHeadStatus;
362
+    }
363
+
364
+    public void setDeptHeadStatus(List<Integer> deptHeadStatus) {
365
+        this.deptHeadStatus = deptHeadStatus;
366
+    }
343 367
 
344 368
     public List<Long> getDeptIds() {
345 369
         return deptIds;

+ 20
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java Просмотреть файл

@@ -3,9 +3,10 @@ package com.ruoyi.wisdomarbitrate.domain;
3 3
 import com.fasterxml.jackson.annotation.JsonFormat;
4 4
 import com.ruoyi.common.annotation.Excel;
5 5
 import com.ruoyi.common.core.domain.BaseEntity;
6
+import lombok.Data;
6 7
 
7 8
 import java.util.Date;
8
-
9
+@Data
9 10
 public class IdentityAuthentication   extends BaseEntity {
10 11
     private static final long serialVersionUID = 1L;
11 12
 
@@ -15,6 +16,20 @@ public class IdentityAuthentication   extends BaseEntity {
15 16
     private String name;
16 17
     /** 身份证号 */
17 18
     private String identityNo;
19
+    /**
20
+     * 短信验证码
21
+     */
22
+    private String VerifyCode;
23
+    private String passWord;
24
+    private String phone;
25
+    /**
26
+     * 邮箱
27
+     */
28
+    private String email;
29
+    /**
30
+     * 身份证地址
31
+     */
32
+    private String idAddress;
18 33
     /** 认证时间 */
19 34
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
20 35
     private Date certificationTime;
@@ -44,6 +59,10 @@ public class IdentityAuthentication   extends BaseEntity {
44 59
     private Long userId;
45 60
     /** 用户账号 */
46 61
     private String userName;
62
+    /**
63
+     * 用户昵称
64
+     */
65
+    private String nickName;
47 66
 
48 67
     /** EID商户id */
49 68
     private String merchantId;

+ 32
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java Просмотреть файл

@@ -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
+}

+ 63
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/WeChatUserVO.java Просмотреть файл

@@ -0,0 +1,63 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo;
2
+
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+import com.ruoyi.wisdomarbitrate.domain.Arbitrator;
5
+import lombok.Data;
6
+
7
+import javax.validation.constraints.NotEmpty;
8
+import javax.validation.constraints.NotNull;
9
+import java.util.Date;
10
+import java.util.List;
11
+
12
+/**
13
+ * 微信小程序用户注册登录
14
+ */
15
+@Data
16
+public class WeChatUserVO {
17
+    /**
18
+     * id
19
+     */
20
+    private Long id;
21
+    /**
22
+     * 微信用户唯一标识
23
+     */
24
+    private String openId;
25
+    /**
26
+     * 微信授权的code,用户登录凭证
27
+     */
28
+    private String wxCode;
29
+
30
+    /**
31
+     * 姓名
32
+     */
33
+    @NotEmpty(message = "姓名不能为空")
34
+    private String name;
35
+    /** 身份证号 */
36
+    @NotEmpty(message = "身份证号不能为空")
37
+    private String identityNo;
38
+    /** 认证时间 */
39
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
40
+    private Date certificationTime;
41
+    /** 认证状态 */
42
+    private Integer certificationStatus;
43
+    private String password;
44
+    /**
45
+     * 电话
46
+     */
47
+    @NotEmpty(message = "电话不能为空")
48
+    private String phone;
49
+    /**
50
+     * 验证码
51
+     */
52
+    private String verifyCode;
53
+    /**
54
+     * 邮箱
55
+     */
56
+    @NotEmpty(message = "邮箱不能为空")
57
+    private String email;
58
+    /**
59
+     * 创建人
60
+     */
61
+    private String createBy;
62
+    private String updateBy;
63
+}

+ 15
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java Просмотреть файл

@@ -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;
@@ -43,7 +44,7 @@ public interface CaseApplicationMapper {
43 44
 
44 45
     /**
45 46
      * 查询仲裁员根据案件id
46
-     * @param arbitrator
47
+     * @param id
47 48
      * @return
48 49
      */
49 50
     String selectArbitratorList(@Param("id") String id);
@@ -53,4 +54,17 @@ public interface CaseApplicationMapper {
53 54
      * @param payDTO
54 55
      */
55 56
     void updatePayType(CaseConfirmPayDTO payDTO);
57
+
58
+    /**
59
+     * 查询部门长案件
60
+     * @param caseApplication
61
+     * @return
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);
56 70
 }

+ 1
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java Просмотреть файл

@@ -8,6 +8,5 @@ public interface IdentityAuthenticationMapper {
8 8
     IdentityAuthentication  selectIdentityAuthentication(IdentityAuthentication identityAuthentication);
9 9
 
10 10
 
11
-
12
-
11
+    void updateIdentityAuthentication(IdentityAuthentication ientityAuthentication);
13 12
 }

+ 21
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/WeChatUserMapper.java Просмотреть файл

@@ -0,0 +1,21 @@
1
+package com.ruoyi.wisdomarbitrate.mapper;
2
+
3
+import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO;
4
+import org.apache.ibatis.annotations.Param;
5
+import org.springframework.stereotype.Repository;
6
+
7
+import java.util.List;
8
+
9
+/**
10
+ * @author wangqiong
11
+ * @description 微信小程序用户注册登录
12
+ * @date 2023-10-16 11:45
13
+ */
14
+@Repository
15
+public interface WeChatUserMapper {
16
+    int insertUser(WeChatUserVO userVO);
17
+    int updateUser(WeChatUserVO userVO);
18
+    List<WeChatUserVO> selectIdentityAuthentication(WeChatUserVO userVO);
19
+
20
+    WeChatUserVO selectUserByOppenId(@Param("oppenId") String openId);
21
+}

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java Просмотреть файл

@@ -6,11 +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);
15
+    List<CaseApplication> selectCaseApplicationListByRole(CaseApplication caseApplication);
14 16
 
15 17
 
16 18
     int insertcaseApplication(CaseApplication caseApplication);
@@ -52,4 +54,10 @@ public interface ICaseApplicationService {
52 54
     AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecord);
53 55
 
54 56
     CaseApplication selectSignSealUrl(CaseApplication caseApplication) throws EsignDemoException;
57
+
58
+    /**
59
+     * 查询待办数量
60
+     * @return
61
+     */
62
+    ToDoCount selectToDoCount();
55 63
 }

+ 18
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/WeChatUserService.java Просмотреть файл

@@ -0,0 +1,18 @@
1
+package com.ruoyi.wisdomarbitrate.service;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.ruoyi.common.core.domain.AjaxResult;
5
+import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
6
+import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO;
7
+
8
+/**
9
+ * 微信小程序用户注册登录
10
+ */
11
+public interface WeChatUserService {
12
+
13
+
14
+    String sendCode(WeChatUserVO userVO);
15
+
16
+
17
+    AjaxResult registerUser(IdentityAuthentication ientityAuthentication);
18
+}

+ 215
- 37
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Просмотреть файл

@@ -13,6 +13,7 @@ import com.google.gson.JsonArray;
13 13
 import com.google.gson.JsonObject;
14 14
 import com.ruoyi.common.annotation.DataScope;
15 15
 import com.ruoyi.common.constant.CaseApplicationConstants;
16
+import com.ruoyi.common.constant.Constants;
16 17
 import com.ruoyi.common.core.domain.AjaxResult;
17 18
 import com.ruoyi.common.core.domain.entity.*;
18 19
 
@@ -27,7 +28,11 @@ import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
27 28
 import com.ruoyi.common.core.domain.entity.SysUser;
28 29
 import com.ruoyi.common.exception.EsignDemoException;
29 30
 import com.ruoyi.common.exception.ServiceException;
31
+import com.ruoyi.system.domain.SysUserRole;
32
+import com.ruoyi.system.mapper.SysRoleMapper;
30 33
 import com.ruoyi.system.mapper.SysUserMapper;
34
+import com.ruoyi.system.mapper.SysUserRoleMapper;
35
+import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
31 36
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
32 37
 import com.ruoyi.common.utils.bean.BeanUtils;
33 38
 import com.ruoyi.system.mapper.SysDeptMapper;
@@ -79,6 +84,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
79 84
     @Autowired
80 85
     private SysUserMapper sysUserMapper;
81 86
     @Autowired
87
+    private SysUserRoleMapper userRoleMapper;
88
+    @Autowired
89
+    private SysRoleMapper roleMapper;
90
+    @Autowired
82 91
     private SealSignRecordMapper sealSignRecordMapper;
83 92
     @Autowired
84 93
     private CaseLogRecordMapper caseLogRecordMapper;
@@ -98,41 +107,118 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
98 107
      * @return
99 108
      */
100 109
 //    @Override
101
-//    public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
102
-//        // 获取登录用户
103
-//        LoginUser loginUser = getLoginUser();
104
-//        SysUser user = loginUser.getUser();
105
-//        Long userId = user.getUserId();
106
-//        Long deptId = user.getDeptId();
107
-//        List<SysRole> roles = user.getRoles();
108
-//        // 查询登录人身份证号
109
-//        SysUser sysUser = sysUserMapper.selectUserById(userId);
110
-//        caseApplication.setIdCard(sysUser.getIdCard());
111
-//        caseApplication.setUserId(String.valueOf(userId));
112
-//        startPage();
113
-//        for (SysRole role : roles) {
114
-//            // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
115
-//            if(role.getRoleName().equals("超级管理员")
116
-//            ||role.getRoleName().equals("仲裁委")
117
-//            ||role.getRoleName().equals("部门长")){
118
-//                return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
119
-//            }
120
-//            if(role.getRoleName().equals("法律顾问")){
121
-//                // 查询角色有关的用户部门
122
-//                List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
123
-//                caseApplication.setDeptIds(deptIds);
124
-//            }
125
-//            if(StrUtil.isEmpty(caseApplication.getNameId())&&role.getRoleName().equals("申请人")){
126
-//                // 查询角色有关的用户部门
127
-//                caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
128
-//            }
129
-//        }
130
-//
131
-//
132
-//        // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
133
-//        return caseApplicationMapper.selectCaseApplicationList(caseApplication);
134
-//
135
-//    }
110
+    public List<CaseApplication> selectCaseApplicationListByRole(CaseApplication caseApplication) {
111
+        // 获取登录用户
112
+        LoginUser loginUser = getLoginUser();
113
+        SysUser user = loginUser.getUser();
114
+        Long userId = user.getUserId();
115
+
116
+        // 查询登录人身份证号
117
+        SysUser sysUser = sysUserMapper.selectUserById(userId);
118
+        List<SysRole> roles = sysUser.getRoles();
119
+        // 没有角色不能查看案件列表
120
+        if(CollectionUtil.isEmpty(roles)){
121
+            throw new ServiceException("该用户没有角色权限");
122
+        }
123
+        startPage();
124
+        for (SysRole role : roles) {
125
+            // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
126
+            if(role.getRoleName().equals("超级管理员")
127
+            ){
128
+                return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
129
+            }
130
+            if(role.getRoleName().equals("仲裁委")
131
+                    ||role.getRoleName().equals("部门长")){
132
+                List<Integer> caseStatusList=new ArrayList<>();
133
+                caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
134
+                caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
135
+                caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
136
+                caseApplication.setDeptHeadStatus(caseStatusList);
137
+            }
138
+            if(role.getRoleName().equals("仲裁员")){
139
+                caseApplication.setUserId(String.valueOf(userId));
140
+            }
141
+            if(role.getRoleName().equals("财务")){
142
+                caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
143
+            }
144
+            if(role.getRoleName().equals("法律顾问")){
145
+                // 查询角色有关的用户部门
146
+                List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
147
+                caseApplication.setDeptIds(deptIds);
148
+            }
149
+            if(StrUtil.isEmpty(caseApplication.getNameId())&&role.getRoleName().equals("申请人")){
150
+                // 查询角色有关的用户部门
151
+                caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
152
+            }
153
+            if(role.getRoleName().equals("被申请人")){
154
+                //
155
+                caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
156
+            }
157
+        }
158
+
159
+
160
+        // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
161
+        return caseApplicationMapper.selectCaseApplicationList(caseApplication);
162
+
163
+    }
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
+    }
136 222
     @Override
137 223
     public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
138 224
         return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
@@ -188,6 +274,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
188 274
                         caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
189 275
 
190 276
                     }
277
+                    // 组装申请代理人信息
278
+                    String agentInfoFlag = buildAgentInfo(caseAffiliate);
279
+                    if(StrUtil.isNotEmpty(agentInfoFlag)){
280
+                        throw new ServiceException(agentInfoFlag);
281
+                    }
191 282
                 }
192 283
             }
193 284
 
@@ -275,8 +366,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
275 366
                         caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
276 367
 
277 368
                     }
369
+                    String agentInfoFlag = buildAgentInfo(caseAffiliate);
370
+                    if(StrUtil.isNotEmpty(agentInfoFlag)){
371
+                        throw new ServiceException(agentInfoFlag);
372
+                    }
373
+
278 374
                 }
279
-                caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
375
+
376
+                    caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
280 377
             }
281 378
 
282 379
         }
@@ -292,6 +389,68 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
292 389
         return rows;
293 390
     }
294 391
 
392
+    /**
393
+     * 组装申请代理人信息
394
+     * @param caseAffiliate
395
+     */
396
+    private String buildAgentInfo(CaseAffiliate caseAffiliate) {
397
+        if (caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getNameAgent())) {
398
+            // 查询申请人角色id
399
+            Long roleId = roleMapper.selectRoleIdByName("申请人");
400
+            // 组装申请机构代理人信息,用户表新增并且和部门关联
401
+            // 根据代理人身份证去用户表查询,有修改,么有新增
402
+            SysUser agentUser = sysUserMapper.selectUserByIdCard(caseAffiliate.getIdentityNumAgent());
403
+            if (agentUser == null) {
404
+                agentUser = new SysUser();
405
+                agentUser.setIdCard(caseAffiliate.getIdentityNumAgent());
406
+                agentUser.setNickName(caseAffiliate.getNameAgent());
407
+                agentUser.setUserName(caseAffiliate.getIdentityNumAgent());
408
+                agentUser.setPhonenumber(caseAffiliate.getContactTelphoneAgent());
409
+                agentUser.setPassword(SecurityUtils.encryptPassword(Constants.DEFAULT_PASSWORD));
410
+                agentUser.setDeptId(Long.valueOf(caseAffiliate.getApplicationOrganId()));
411
+                int insertUserRow = sysUserMapper.insertUser(agentUser);
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) {
422
+                    caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
423
+                    // 发送短信 todo
424
+                }
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())){
428
+                // 同步用户表和案件关联人表的手机号和名称
429
+                caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
430
+                caseAffiliate.setNameAgent(agentUser.getNickName());
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
+
447
+            }
448
+
449
+
450
+        }
451
+        return null;
452
+    }
453
+
295 454
     @Override
296 455
     @Transactional
297 456
     public int submitCaseApplication(CaseApplication caseApplication) {
@@ -417,7 +576,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
417 576
 //                }else {
418 577
 //                    caseApplicationListinsert.add(caseApplication);
419 578
 //                }
420
-                    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
+                    }
421 586
                 }else {
422 587
                     // 拼接错误信息
423 588
                     failureMsg.append("<br/>").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString());
@@ -465,9 +630,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
465 630
                             if(caseAffiliates!=null&&caseAffiliates.size()>0){
466 631
                                 for (CaseAffiliate caseAffiliate : caseAffiliates){
467 632
                                     caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
633
+
468 634
                                 }
469 635
                                 caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
470 636
                             }
637
+
471 638
                             successNum++;
472 639
                             successMsg.append("<br/>" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功");
473 640
                         }
@@ -1225,6 +1392,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1225 1392
         return caseApplication;
1226 1393
     }
1227 1394
 
1395
+
1396
+
1228 1397
     @Override
1229 1398
     @Transactional
1230 1399
     public int pendTralSure(CaseApplication caseApplication) {
@@ -1338,6 +1507,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1338 1507
         if(StrUtil.isNotEmpty(caseApplication.getName())){
1339 1508
             setApplicantOrganization(caseAffiliate, caseApplication, deptMap);
1340 1509
         }
1510
+        String s = buildAgentInfo(caseAffiliate);
1511
+        if(StrUtil.isNotEmpty(s)){
1512
+            StringBuilder errorMsg = caseApplication.getErrorMsg();
1513
+            if(StrUtil.isEmpty(errorMsg)){
1514
+             errorMsg=new StringBuilder();
1515
+            }
1516
+            errorMsg.append(s);
1517
+            caseApplication.setErrorMsg(errorMsg);
1518
+        }
1341 1519
         caseAffiliatesnew.add(caseAffiliate);
1342 1520
 
1343 1521
         // 组装被申请人信息

+ 15
- 8
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java Просмотреть файл

@@ -8,8 +8,10 @@ import cn.hutool.crypto.symmetric.SymmetricCrypto;
8 8
 import com.alibaba.fastjson.JSON;
9 9
 import com.alibaba.fastjson.JSONObject;
10 10
 import com.ruoyi.common.core.domain.AjaxResult;
11
+import com.ruoyi.common.core.domain.entity.SysUser;
11 12
 import com.ruoyi.common.core.domain.model.LoginUser;
12 13
 import com.ruoyi.common.utils.SecurityUtils;
14
+import com.ruoyi.system.mapper.SysUserMapper;
13 15
 import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
14 16
 import com.ruoyi.wisdomarbitrate.mapper.IdentityAuthenticationMapper;
15 17
 import com.ruoyi.wisdomarbitrate.service.IdentityAuthenticationService;
@@ -46,6 +48,7 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
46 48
 
47 49
     @Autowired
48 50
     private IdentityAuthenticationMapper identityAuthenticationMapper;
51
+    private SysUserMapper sysUserMapper;
49 52
 
50 53
     private static final Logger log = LoggerFactory.getLogger(IdentityAuthenticationServiceImpl.class);
51 54
 
@@ -147,7 +150,7 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
147 150
     @Transactional
148 151
     public AjaxResult selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication) {
149 152
         String eidToken = ientityAuthentication.getEidToken();
150
-
153
+        IdentityAuthentication authentication = new IdentityAuthentication();
151 154
         try {
152 155
             Credential cred = new Credential(credentialSecretId, credentialSecretKey);
153 156
             // 实例化一个http选项,可选的,没有特殊需求可以跳过
@@ -181,8 +184,8 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
181 184
                             String idcardno = info.getString("idnum");
182 185
                             String name = info.getString("name");
183 186
                             //2.在用户认证表中插入用户认证记录
184
-                            LoginUser loginUser = SecurityUtils.getLoginUser();
185
-                            IdentityAuthentication authentication = new IdentityAuthentication();
187
+                          //  LoginUser loginUser = SecurityUtils.getLoginUser();
188
+
186 189
                             /**
187 190
                              * 用户名
188 191
                              * 用户名id
@@ -192,15 +195,17 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
192 195
                              * 认证状态0表示成功
193 196
                              * 请求id
194 197
                              */
195
-                            authentication.setUserName(loginUser.getUsername());
196
-                            authentication.setUserId(loginUser.getUserId());
198
+                           // authentication.setUserName(loginUser.getUsername());
199
+                          //  authentication.setUserId(loginUser.getUserId());
197 200
                             authentication.setName(name);
198 201
                             authentication.setIdentityNo(idcardno);
199 202
                             authentication.setCertificationTime(new Date());
200 203
                             authentication.setCertificationStatus(0);
201
-                            authentication.setCreateBy(loginUser.getUsername());
204
+                            authentication.setCreateBy(name);
205
+                          //  authentication.setCreateBy(loginUser.getUsername());
202 206
                             try {
203 207
                                 identityAuthenticationMapper.insertIdentityAuthentication(authentication);
208
+                                authentication.setId(authentication.getId());
204 209
                             } catch (Exception e) {
205 210
                                 System.out.println("认证记录新增失败");
206 211
                             }
@@ -210,12 +215,14 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
210 215
                     }
211 216
                 }
212 217
             }
213
-            return AjaxResult.success();
218
+            return AjaxResult.success(authentication);
214 219
         } catch (TencentCloudSDKException e) {
215 220
             System.out.println(e.toString());
216 221
         }
217
-        return null;
222
+        return AjaxResult.success();
218 223
     }
219 224
 
220 225
 
226
+
227
+
221 228
 }

+ 157
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/WeChatUserServiceImpl.java Просмотреть файл

@@ -0,0 +1,157 @@
1
+package com.ruoyi.wisdomarbitrate.service.impl;
2
+
3
+import cn.hutool.core.util.StrUtil;
4
+import cn.hutool.http.HttpUtil;
5
+import cn.hutool.json.JSONUtil;
6
+import com.alibaba.fastjson2.JSONArray;
7
+import com.alibaba.fastjson2.JSONObject;
8
+import com.ruoyi.common.constant.CacheConstants;
9
+import com.ruoyi.common.core.domain.AjaxResult;
10
+import com.ruoyi.common.core.domain.entity.SysDictData;
11
+import com.ruoyi.common.core.domain.entity.SysUser;
12
+import com.ruoyi.common.core.domain.model.LoginUser;
13
+import com.ruoyi.common.core.redis.RedisCache;
14
+import com.ruoyi.common.utils.SecurityUtils;
15
+import com.ruoyi.common.utils.SmsUtils;
16
+import com.ruoyi.common.utils.StringUtils;
17
+import com.ruoyi.common.utils.http.HttpUtils;
18
+import com.ruoyi.common.utils.spring.SpringUtils;
19
+import com.ruoyi.system.mapper.SysUserMapper;
20
+import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
21
+import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO;
22
+import com.ruoyi.wisdomarbitrate.mapper.IdentityAuthenticationMapper;
23
+import com.ruoyi.wisdomarbitrate.mapper.WeChatUserMapper;
24
+import com.ruoyi.wisdomarbitrate.service.WeChatUserService;
25
+import lombok.extern.slf4j.Slf4j;
26
+import org.springframework.beans.factory.annotation.Autowired;
27
+import org.springframework.stereotype.Service;
28
+import org.springframework.transaction.annotation.Transactional;
29
+
30
+import java.util.HashMap;
31
+import java.util.List;
32
+import java.util.Random;
33
+import java.util.concurrent.TimeUnit;
34
+
35
+/**
36
+ * @author wangqiong
37
+ * @description 微信小程序用户注册登录
38
+ * @date 2023-10-16 11:45
39
+ */
40
+@Service
41
+@Slf4j
42
+public class WeChatUserServiceImpl implements WeChatUserService {
43
+    String appid="wx91cb8459dca561b4";//自行获取
44
+    //小程序secret
45
+    String secret="190aaa3bda96a65d25318fbb0e133fc6";//自己去公众号后台获取
46
+    // 获取openId
47
+    String openIdUrl = "https://api.weixin.qq.com/sns/jscode2session";
48
+    @Autowired
49
+    private WeChatUserMapper weChatUserMapper;
50
+    @Autowired
51
+    private SysUserMapper sysUserMapper;
52
+    @Autowired
53
+    private IdentityAuthenticationMapper identityAuthenticationMapper;
54
+
55
+    @Override
56
+    public String sendCode(WeChatUserVO userVO) {
57
+
58
+        Random random = new Random();
59
+        String code = "";
60
+        for (int i = 0; i < 6; i++) {
61
+
62
+            code += random.nextInt(10);
63
+        }
64
+        SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
65
+        request.setTemplateId("1955047");
66
+        //  1954926 普通短信 短信验证码 验证码:,为了保证您的账户安全,请勿想他人泄露验证码信息。如非本人操作,请忽略本短信。
67
+        request.setPhone(userVO.getPhone());
68
+        request.setTemplateParamSet(new String[]{ code});
69
+        Boolean flag = SmsUtils.sendSms(request);
70
+        if(flag){
71
+            setCodeCache(userVO.getPhone(),code);
72
+            return "短信发送成功";
73
+        }
74
+        return "短信发送失败";
75
+    }
76
+    /**
77
+     * 设置验证码缓存
78
+     *
79
+     * @param key 参数键
80
+     * @param code 验证码
81
+     */
82
+    public static void setCodeCache(String key, String code)
83
+    {
84
+        SpringUtils.getBean(RedisCache.class).setCacheObject(getVerifyCodeCacheKey(key), code, 5,TimeUnit.MINUTES);
85
+    }
86
+
87
+
88
+    /**
89
+     * 获取字典缓存
90
+     *
91
+     * @param key 参数键
92
+     * @return dictDatas 字典数据列表
93
+     */
94
+    public static String getCodeCache(String key)
95
+    {
96
+        String codeCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getVerifyCodeCacheKey(key));
97
+        if (StringUtils.isNotNull(codeCache))
98
+        {
99
+            return codeCache;
100
+        }
101
+        return null;
102
+    }
103
+
104
+    private static String getVerifyCodeCacheKey(String key) {
105
+        return CacheConstants.WE_CHAT_SMS_VERIFY_CODE_KEY + key;
106
+    }
107
+    @Transactional
108
+    @Override
109
+    public AjaxResult registerUser(IdentityAuthentication ientityAuthentication) {
110
+        String codeCache = getCodeCache(ientityAuthentication.getPhone());
111
+        // 校验短信验证码
112
+        if(StrUtil.isEmpty(codeCache)){
113
+            return AjaxResult.warn("验证码校验失败");
114
+        }else if(!codeCache.equals(ientityAuthentication.getVerifyCode())){
115
+            return AjaxResult.warn("验证码校验失败");
116
+        }
117
+        SysUser sysUserName=sysUserMapper.selectUserByUserName(ientityAuthentication.getUserName());
118
+        if(sysUserName!=null){
119
+            return AjaxResult.warn("账号已存在");
120
+        }
121
+        // 根据身份证查询系统用户表中是否存在该用户,存在则同步已认证的信息,不存在则新增
122
+        SysUser sysUser=sysUserMapper.selectUserByIdCard(ientityAuthentication.getIdentityNo());
123
+
124
+        if(sysUser!=null){
125
+            sysUser.setIdCard(ientityAuthentication.getIdentityNo());
126
+            sysUser.setNickName(ientityAuthentication.getName());
127
+            sysUser.setUserName(ientityAuthentication.getUserName());
128
+            sysUser.setPhonenumber(ientityAuthentication.getPhone());
129
+            sysUser.setEmail(ientityAuthentication.getEmail());
130
+            sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
131
+            sysUserMapper.updateUser(sysUser);
132
+            ientityAuthentication.setUserId(sysUser.getUserId());
133
+        }else {
134
+            sysUser=new SysUser();
135
+            // 用户名设为电话号
136
+            sysUser.setUserName(ientityAuthentication.getPhone());
137
+            sysUser.setIdCard(ientityAuthentication.getIdentityNo());
138
+            sysUser.setNickName(ientityAuthentication.getName());
139
+            sysUser.setUserName(ientityAuthentication.getUserName());
140
+            sysUser.setPhonenumber(ientityAuthentication.getPhone());
141
+            sysUser.setEmail(ientityAuthentication.getEmail());
142
+            sysUser.setCreateBy(ientityAuthentication.getPhone());
143
+            sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
144
+            int row = sysUserMapper.insertUser(sysUser);
145
+            if(row<1) {
146
+                return AjaxResult.warn("注册失败");
147
+            }
148
+        }
149
+
150
+        ientityAuthentication.setUserId(sysUser.getUserId());
151
+        ientityAuthentication.setUserName(sysUser.getUserName());
152
+        // 已经认证过的用户才能注册,认证表中已经有该数据
153
+        identityAuthenticationMapper.updateIdentityAuthentication(ientityAuthentication);
154
+        return AjaxResult.success("注册成功");
155
+    }
156
+
157
+}

+ 5
- 2
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml Просмотреть файл

@@ -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>

+ 7
- 1
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml Просмотреть файл

@@ -177,7 +177,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
177 177
 
178 178
 	</select>
179 179
 
180
-	<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
180
+	<select id="selectUserByIdCard" parameterType="String" resultMap="SysUserResult">
181
+		select u.* from sys_user u
182
+		where u.id_card = #{idCard} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
183
+	</select>
184
+
185
+
186
+    <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
181 187
  		insert into sys_user(
182 188
  			<if test="userId != null and userId != 0">user_id,</if>
183 189
  			<if test="deptId != null and deptId != 0">dept_id,</if>

+ 305
- 35
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Просмотреть файл

@@ -42,28 +42,36 @@
42 42
     </resultMap>
43 43
 
44 44
     <select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
45
-select t1.* from(
46
-        select t.* from(
45
+        select t1.* from(
46
+        select DISTINCT(t.id),t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
47
+             t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims ,
48
+        t.loan_start_date ,t.loan_end_date ,t.claim_princi_owed ,t.claim_interest_owed ,t.claim_liquid_damag,t.fee_payable ,
49
+        t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
50
+        t.update_by ,t.update_time , t.arbitrator_name,t.name,t.application_organ_id,t.applicantName,
51
+        t.arbitrator_id,t.identity_num , t.identity_type,t.filearbitra_url
52
+        from(
47 53
         select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
48 54
         CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
49
-            ELSE '无审理方式'
50
-            END arbitratMethodName,
55
+        ELSE '无审理方式'
56
+        END arbitratMethodName,
51 57
         c.case_status ,
52 58
         CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
53
-                            when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
54
-                            when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
55
-                            when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
56
-                            when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
57
-                            when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
58
-                            ELSE '无案件状态'
59
-                            END caseStatusName,
59
+        when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
60
+        when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
61
+        when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
62
+        when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
63
+        when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
64
+        ELSE '无案件状态'
65
+        END caseStatusName,
60 66
         c.hear_date ,c.arbitrat_claims ,
61
-        c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
67
+        c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
68
+        ,c.fee_payable ,
62 69
         c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
63
-        c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name as applicantName,
70
+        c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name as
71
+        applicantName,
64 72
         c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url
65 73
         from case_application c
66
-        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
74
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id
67 75
         <where>
68 76
             <if test="caseStatus != null">
69 77
                 AND c.case_status = #{caseStatus}
@@ -81,35 +89,149 @@ select t1.* from(
81 89
         ) t
82 90
         <where>
83 91
 
84
-        <!--被申请人-->
85
-        <if test="idCard != null and idCard != ''">
86
-            or (t.identity_num=#{idCard}  AND t.identity_type=2)
87
-        </if>
88
-        <!--仲裁员-->
89
-        <if test="userId != null and userId != ''">
90
-            or instr  (t.arbitrator_id,#{userId})>0
91
-        </if>
92
-        <!--法律顾问-->
93
-        <if test="deptIds != null and deptIds.size() > 0">
94
-            or t.name
95
-            in
96
-            <foreach item="item" collection="deptIds" open="(" separator="," close=")">
97
-                #{item}
98
-            </foreach>
99
-        </if>
92
+            <!--被申请人-->
93
+            <if test="idCard != null and idCard != ''">
94
+                or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
95
+            </if>
96
+            <!--仲裁员-->
97
+            <if test="userId != null and userId != ''">
98
+                or ( t.identity_type=1 and
99
+                       t.case_status in (7,8,9,12,13,14)
100
+                and
101
+                instr (t.arbitrator_id,#{userId})>0)
102
+            </if>
103
+            <!--法律顾问-->
104
+            <if test="deptIds != null and deptIds.size() > 0">
105
+                or (t.identity_type=1 and t.case_status in (1,5,11,15,16)
106
+                and t.application_organ_id in
107
+                <foreach item="item" collection="deptIds" open="(" separator="," close=")">
108
+                    #{item}
109
+                </foreach> )
110
+            </if>
111
+
112
+                <!--申请人-->
113
+                <if test="nameId != null and nameId != ''">
114
+                    or ( t.application_organ_id = #{nameId} AND t.identity_type=1
115
+                    and t.case_status in (0,2))
100 116
 
101
-    </where>
117
+                </if>
118
+        <!--部门长-->
119
+            <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
120
+            or (t.identity_type=1 and t.case_status in
121
+            <foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">#{caseStatus}
122
+            </foreach>)
123
+            </if>
124
+            <!--财务-->
125
+            <if test="financeStatus != null and financeStatus != ''">
126
+                or(t.identity_type=1 and t.case_status =#{financeStatus})
127
+
128
+            </if>
129
+        </where>
102 130
         ) t1
131
+<!--        <where>-->
132
+<!--            &lt;!&ndash;申请人&ndash;&gt;-->
133
+<!--            <if test="nameId != null and nameId != ''">-->
134
+<!--                and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1-->
135
+<!--                    and t1.case_status in (0,2)-->
136
+<!--                )-->
137
+<!--            </if>-->
138
+<!--        </where>-->
139
+        order by t1.create_time desc,t1.case_num desc
140
+    </select>
141
+    <select id="selectTodoCountByRole" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
142
+        select sum( case when t1.case_status=0 then 1 else 0 end) caseApply,
143
+        sum( case when t1.case_status=1 then 1 else 0 end) caseApplyCheck,
144
+        sum( case when t1.case_status=2 then 1 else 0 end) caseApplyPay,
145
+        sum( case when t1.case_status=3 then 1 else 0 end) caseApplyPayCheck,
146
+        sum( case when t1.case_status=4 then 1 else 0 end) caseApplyEvidence,
147
+        sum( case when t1.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
148
+        sum( case when t1.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
149
+        sum( case when t1.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
150
+        sum( case when t1.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
151
+        sum( case when t1.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
152
+        sum( case when t1.case_status=10 then 1 else 0 end) caseApplyAward,
153
+        sum( case when t1.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
154
+        sum( case when t1.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
155
+        sum( case when t1.case_status=13 then 1 else 0 end) caseApplyAwardSign,
156
+        sum( case when t1.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
157
+        sum( case when t1.case_status=15 then 1 else 0 end) caseApplyAwardSend,
158
+        sum( case when t1.case_status=16 then 1 else 0 end) caseApplyStored,
159
+        sum( case when t1.case_status=17 then 1 else 0 end) caseApplyArchived
160
+        from(
161
+        select  DISTINCT(t.id),t.case_status,t.application_organ_id, t.arbitrator_id,t.identity_num , t.identity_type from(
162
+        select c.id ,
163
+         c.case_status,ca.application_organ_id,
164
+        c.arbitrator_id,ca.identity_num , ca.identity_type
165
+        from case_application c
166
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id
167
+        <where>
168
+            <if test="caseStatus != null">
169
+                AND c.case_status = #{caseStatus}
170
+            </if>
171
+            <if test="caseNum != null and caseNum != ''">
172
+                AND c.case_num = #{caseNum}
173
+            </if>
174
+            <if test="caseStatusList != null and caseStatusList.size() > 0">
175
+                and c.case_status in
176
+                <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
177
+                    #{caseStatus}
178
+                </foreach>
179
+            </if>
180
+        </where>
181
+        ) t
103 182
         <where>
183
+
184
+            <!--被申请人-->
185
+            <if test="idCard != null and idCard != ''">
186
+                or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
187
+            </if>
188
+            <!--仲裁员-->
189
+            <if test="userId != null and userId != ''">
190
+                or ( t.identity_type=1 and
191
+                t.case_status in (7,8,9,12,13,14)
192
+                and
193
+                instr (t.arbitrator_id,#{userId})>0)
194
+            </if>
195
+            <!--法律顾问-->
196
+            <if test="deptIds != null and deptIds.size() > 0">
197
+                or (t.identity_type=1 and t.case_status in (1,5,11,15,16)
198
+                and t.application_organ_id in
199
+                <foreach item="item" collection="deptIds" open="(" separator="," close=")">
200
+                    #{item}
201
+                </foreach> )
202
+            </if>
104 203
             <!--申请人-->
105 204
             <if test="nameId != null and nameId != ''">
106
-                and ( t1.application_organ_id = #{nameId}  AND t1.identity_type=1 )
205
+                or ( t.application_organ_id = #{nameId} AND t.identity_type=1
206
+                and t.case_status in (0,2))
207
+
208
+            </if>
209
+            <!--部门长-->
210
+            <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
211
+                or (t.identity_type=1 and t.case_status in
212
+                <foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">
213
+                    #{caseStatus}
214
+                </foreach>)
215
+            </if>
216
+            <!--财务-->
217
+            <if test="financeStatus != null and financeStatus != ''">
218
+                or( t.identity_type=1 and t.case_status =#{financeStatus})
219
+
107 220
             </if>
108 221
         </where>
109
-        order by t1.create_time desc,t1.case_num desc
222
+        ) t1
223
+        <!--      <where>
224
+                   &lt;!&ndash;申请人&ndash;&gt;-->
225
+<!--            <if test="nameId != null and nameId != ''">-->
226
+<!--                and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1-->
227
+<!--                and t1.case_status in (0,2)-->
228
+<!--                )-->
229
+<!--            </if>
230
+        </where> -->
110 231
     </select>
232
+
111 233
     <select id="selectAdminCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
112
-        select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
234
+        select DISTINCT(c.id) id,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
113 235
         CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
114 236
         ELSE '无审理方式'
115 237
         END arbitratMethodName,
@@ -147,6 +269,154 @@ select t1.* from(
147 269
         </where>
148 270
         order by c.create_time desc,c.case_num desc
149 271
     </select>
272
+    <select id="selectAdminCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
273
+        SELECT
274
+            sum( case when c.case_status=0 then 1 else 0 end) caseApply,
275
+            sum( case when c.case_status=1 then 1 else 0 end) caseApplyCheck,
276
+            sum( case when c.case_status=2 then 1 else 0 end) caseApplyPay,
277
+            sum( case when c.case_status=3 then 1 else 0 end) caseApplyPayCheck,
278
+            sum( case when c.case_status=4 then 1 else 0 end) caseApplyEvidence,
279
+            sum( case when c.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
280
+            sum( case when c.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
281
+            sum( case when c.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
282
+            sum( case when c.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
283
+            sum( case when c.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
284
+            sum( case when c.case_status=10 then 1 else 0 end) caseApplyAward,
285
+            sum( case when c.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
286
+            sum( case when c.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
287
+            sum( case when c.case_status=13 then 1 else 0 end) caseApplyAwardSign,
288
+            sum( case when c.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
289
+            sum( case when c.case_status=15 then 1 else 0 end) caseApplyAwardSend,
290
+            sum( case when c.case_status=16 then 1 else 0 end) caseApplyStored,
291
+            sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived
292
+        FROM
293
+            case_application c
294
+                 JOIN case_affiliate ca ON ca.case_appli_id = c.id
295
+                AND ca.identity_type = 1
296
+        WHERE
297
+                c.case_status IN (
298
+                                  0,
299
+                                  1,
300
+                                  2,
301
+                                  3,
302
+                                  4,
303
+                                  5,
304
+                                  6,
305
+                                  7,
306
+                                  8,
307
+                                  9,
308
+                                  10,
309
+                                  11,
310
+                                  12,
311
+                                  13,
312
+                                  14,
313
+                                  15,
314
+                                  16,
315
+                                  17
316
+                )
317
+
318
+    </select>
319
+    <select id="selectDeptHeadCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
320
+        select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
321
+        CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
322
+        ELSE '无审理方式'
323
+        END arbitratMethodName,
324
+        c.case_status ,
325
+        CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
326
+        when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
327
+        when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
328
+        when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
329
+        when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
330
+        when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
331
+        ELSE '无案件状态'
332
+        END caseStatusName,
333
+        c.hear_date ,c.arbitrat_claims ,
334
+        c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
335
+        c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
336
+        c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url
337
+        from case_application c
338
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
339
+        <where>
340
+            c.case_status in
341
+            <foreach item="caseStatus" collection="statusList" open="(" separator="," close=")">
342
+                #{caseStatus}
343
+            </foreach>
344
+            <if test="caseApplication.caseStatus != null">
345
+                AND c.case_status = #{caseApplication.caseStatus}
346
+            </if>
347
+            <if test="caseApplication.caseNum != null and caseApplication.caseNum != ''">
348
+                AND c.case_num = #{caseApplication.caseNum}
349
+            </if>
350
+            <if test="caseApplication.nameId != null and caseApplication.nameId != ''">
351
+                AND ca.application_organ_id=#{caseApplication.nameId}  AND ca.identity_type=1
352
+            </if>
353
+            <if test="caseApplication.caseStatusList != null and caseApplication.caseStatusList.size() > 0">
354
+                and c.case_status in
355
+                <foreach item="caseStatus" collection="caseApplication.caseStatusList" open="(" separator="," close=")">
356
+                    #{caseStatus}
357
+                </foreach>
358
+            </if>
359
+        </where>
360
+        order by c.create_time desc,c.case_num desc
361
+    </select>
362
+    <select id="selectDeptHeadCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
363
+        select  sum( case when c.case_status=0 then 1 else 0 end) caseApply,
364
+        sum( case when c.case_status=1 then 1 else 0 end) caseApplyCheck,
365
+        sum( case when c.case_status=2 then 1 else 0 end) caseApplyPay,
366
+        sum( case when c.case_status=3 then 1 else 0 end) caseApplyPayCheck,
367
+        sum( case when c.case_status=4 then 1 else 0 end) caseApplyEvidence,
368
+        sum( case when c.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
369
+        sum( case when c.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
370
+        sum( case when c.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
371
+        sum( case when c.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
372
+        sum( case when c.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
373
+        sum( case when c.case_status=10 then 1 else 0 end) caseApplyAward,
374
+        sum( case when c.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
375
+        sum( case when c.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
376
+        sum( case when c.case_status=13 then 1 else 0 end) caseApplyAwardSign,
377
+        sum( case when c.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
378
+        sum( case when c.case_status=15 then 1 else 0 end) caseApplyAwardSend,
379
+        sum( case when c.case_status=16 then 1 else 0 end) caseApplyStored,
380
+        sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived
381
+        from case_application c
382
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
383
+        <where>
384
+            <!--部门长-->
385
+            <if test="statusList != null and statusList.size() > 0">
386
+            or c.case_status in
387
+            <foreach item="caseStatus" collection="statusList" open="(" separator="," close=")">
388
+                #{caseStatus}
389
+            </foreach>
390
+                <!--被申请人-->
391
+                <if test="idCard != null and idCard != ''">
392
+                    or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
393
+                </if>
394
+                <!--仲裁员-->
395
+                <if test="userId != null and userId != ''">
396
+                    or ( t.identity_type=1 and
397
+                    t.case_status in (7,8,9,12,13,14)
398
+                    and
399
+                    instr (t.arbitrator_id,#{userId})>0)
400
+                </if>
401
+                <!--法律顾问-->
402
+                <if test="deptIds != null and deptIds.size() > 0">
403
+                    or (t.identity_type=1 and t.case_status in (1,5,11,15,16)
404
+                    and t.application_organ_id in
405
+                    <foreach item="item" collection="deptIds" open="(" separator="," close=")">
406
+                        #{item}
407
+                    </foreach> )
408
+                </if>
409
+                <!--申请人-->
410
+                <if test="nameId != null and nameId != ''">
411
+                    or( ( t.application_organ_id = #{nameId} AND t.identity_type=1
412
+                    and t.case_status in (0,2))
413
+                    )
414
+                </if>
415
+            </if>
416
+        </where>
417
+
418
+    </select>
419
+
150 420
 
151 421
     <select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">
152 422
         select count(1) from  case_application c
@@ -333,7 +603,7 @@ select t1.* from(
333 603
         END paymentStatusName,c.pay_type,
334 604
         CASE c.pay_type when 0 then '线上支付' when 0 then '线下支付' else '' end payTypeName
335 605
         from case_application c left join case_payment_record p on c.id  = p.case_id
336
-        where c.case_status  = 3 and p.payment_status  = 1
606
+        where c.case_status  = 3
337 607
             AND c.id = #{id}
338 608
 
339 609
     </select>

+ 14
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml Просмотреть файл

@@ -11,12 +11,14 @@
11 11
         <result property="certificationStatus"        column="certification_status"        />
12 12
         <result property="userId"  column="user_id"  />
13 13
         <result property="userName"          column="user_name"          />
14
+        <result property="idAddress"          column="id_address"          />
14 15
 
15 16
     </resultMap>
16 17
 
17 18
     <insert id="insertIdentityAuthentication" parameterType="IdentityAuthentication" useGeneratedKeys="true" keyProperty="id">
18 19
         insert into identi_authenti(
19 20
         <if test="userId != null">user_id,</if>
21
+        <if test="idAddress != null and idAddress != ''">id_address,</if>
20 22
         <if test="name != null and name != ''">name,</if>
21 23
         <if test="identityNo != null and identityNo != ''">identity_no,</if>
22 24
         certification_time,
@@ -26,6 +28,7 @@
26 28
         create_time
27 29
         )values(
28 30
         <if test="userId != null ">#{userId},</if>
31
+        <if test="idAddress != null and idAddress != ''">#{idAddress},</if>
29 32
         <if test="name != null and name != ''">#{name},</if>
30 33
         <if test="identityNo != null and identityNo != ''">#{identityNo},</if>
31 34
         sysdate(),
@@ -35,6 +38,17 @@
35 38
         sysdate()
36 39
         )
37 40
     </insert>
41
+    <update id="updateIdentityAuthentication">
42
+        update identi_authenti
43
+        <set>
44
+            <if test="userId != null ">user_id = #{userId},</if>
45
+            <if test="userName != null and userName != ''">user_name = #{userName},</if>
46
+            <if test="identityNo != null and identityNo != ''">identity_no = #{identityNo},</if>
47
+            <if test="updateBy != null  and updateBy != ''">update_by = #{updateBy},</if>
48
+            update_time = sysdate()
49
+        </set>
50
+        where id = #{id}
51
+    </update>
38 52
 
39 53
     <select id="selectIdentityAuthentication" parameterType="IdentityAuthentication" resultMap="IdentityAuthenticationResult">
40 54
         SELECT  i.id ,i.name ,i.identity_no ,i.certification_time ,i.certification_status ,i.user_id ,i.user_name

+ 61
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/WeChatUserMapper.xml Просмотреть файл

@@ -0,0 +1,61 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.WeChatUserMapper">
6
+    <resultMap type="com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO" id="BaseResult">
7
+        <id     property="id"       column="id"      />
8
+        <result property="name"       column="name"      />
9
+        <result property="identityNo"     column="identity_no"    />
10
+        <result property="certificationTime"     column="certification_time"    />
11
+        <result property="certificationStatus"        column="certification_status"        />
12
+        <result property="openId"  column="open_id"  />
13
+        <result property="phone"          column="phone"          />
14
+        <result property="email"          column="email"          />
15
+
16
+    </resultMap>
17
+    <insert id="insertUser">
18
+        insert into identi_authenti(
19
+        <if test="name != null and name != ''">name,</if>
20
+        <if test="identityNo != null and identityNo != ''">identity_no,</if>
21
+        certification_time,
22
+        <if test="certificationStatus != null ">certification_status,</if>
23
+        <if test="openId != null ">open_id,</if>
24
+        <if test="createBy != null  and createBy != ''">create_by,</if>
25
+        <if test="phone != null  and phone != ''">phone,</if>
26
+        <if test="email != null  and email != ''">email,</if>
27
+        create_time
28
+
29
+        )values(
30
+        <if test="name != null and name != ''">#{name},</if>
31
+        <if test="identityNo != null and identityNo != ''">#{identityNo},</if>
32
+        sysdate(),
33
+        <if test="certificationStatus != null ">#{certificationStatus},</if>
34
+        <if test="openId != null ">#{openId},</if>
35
+        <if test="createBy != null  and createBy != ''">#{createBy},</if>
36
+        <if test="phone != null  and phone != ''">#{phone},</if>
37
+        <if test="email != null  and email != ''">#{email},</if>
38
+        sysdate()
39
+        )
40
+    </insert>
41
+    <update id="updateUser">
42
+        update identi_authenti
43
+        <set>
44
+            <if test="phone != null and phone != ''">phone = #{phone},</if>
45
+            <if test="email != null and email != ''">email = #{email},</if>
46
+            <if test="updateBy != null  and updateBy != ''">update_by = #{updateBy},</if>
47
+            update_time = sysdate()
48
+        </set>
49
+        where id = #{id}
50
+    </update>
51
+    <select id="selectIdentityAuthentication"  resultMap="BaseResult">
52
+        SELECT  i.id ,i.name ,i.identity_no ,i.certification_time ,i.certification_status ,i.user_id ,i.user_name,open_id,phone,email
53
+        from identi_authenti i
54
+    </select>
55
+    <select id="selectUserByOppenId" resultMap="BaseResult">
56
+        SELECT  i.id ,i.name ,i.identity_no ,i.certification_time ,i.certification_status ,i.user_id ,i.user_name,open_id,phone,email
57
+        from identi_authenti i where open_id=#{oppenId}
58
+    </select>
59
+
60
+
61
+</mapper>