Ver código fonte

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

hejinbo 2 anos atrás
pai
commit
2104c70e25
22 arquivos alterados com 648 adições e 83 exclusões
  1. 1
    0
      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. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
  7. 12
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java
  8. 20
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java
  9. 63
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/WeChatUserVO.java
  10. 8
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java
  11. 1
    2
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java
  12. 21
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/WeChatUserMapper.java
  13. 1
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java
  14. 18
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/WeChatUserService.java
  15. 93
    36
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java
  16. 15
    8
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java
  17. 154
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/WeChatUserServiceImpl.java
  18. 7
    1
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
  19. 3
    2
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml
  20. 83
    32
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml
  21. 14
    0
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml
  22. 61
    0
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/WeChatUserMapper.xml

+ 1
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java Ver arquivo

38
     @GetMapping("/list")
38
     @GetMapping("/list")
39
     public TableDataInfo list(CaseApplication caseApplication) {
39
     public TableDataInfo list(CaseApplication caseApplication) {
40
         startPage();
40
         startPage();
41
+//        List<CaseApplication> list = caseApplicationService.selectCaseApplicationListNew(caseApplication);
41
         List<CaseApplication> list = caseApplicationService.selectCaseApplicationList(caseApplication);
42
         List<CaseApplication> list = caseApplicationService.selectCaseApplicationList(caseApplication);
42
         return getDataTable(list);
43
         return getDataTable(list);
43
     }
44
     }

+ 3
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/IdentityAuthenticationController.java Ver arquivo

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

+ 61
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/WeChatUserController.java Ver arquivo

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 Ver arquivo

41
      * 登录账户密码错误次数 redis key
41
      * 登录账户密码错误次数 redis key
42
      */
42
      */
43
     public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
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 Ver arquivo

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

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java Ver arquivo

134
     public SysUser checkEmailUnique(String email);
134
     public SysUser checkEmailUnique(String email);
135
 
135
 
136
     List<SysUser> selectUserListByIds(@Param("idList") List<Long> idList);
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
 }

+ 12
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java Ver arquivo

23
      * 申请机构名称
23
      * 申请机构名称
24
      */
24
      */
25
     private String applicationOrganName;
25
     private String applicationOrganName;
26
+    /**
27
+     * 代理人用户id
28
+     */
29
+    private String applicantAgentUserId;
26
     /** 身份证号 */
30
     /** 身份证号 */
27
     @Excel(name = "身份证号")
31
     @Excel(name = "身份证号")
28
     private String identityNum;
32
     private String identityNum;
57
     /** 快递单号 */
61
     /** 快递单号 */
58
     private String trackNum;
62
     private String trackNum;
59
 
63
 
64
+    public String getApplicantAgentUserId() {
65
+        return applicantAgentUserId;
66
+    }
67
+
68
+    public void setApplicantAgentUserId(String applicantAgentUserId) {
69
+        this.applicantAgentUserId = applicantAgentUserId;
70
+    }
71
+
60
     public String getApplicationOrganId() {
72
     public String getApplicationOrganId() {
61
         return applicationOrganId;
73
         return applicationOrganId;
62
     }
74
     }

+ 20
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/IdentityAuthentication.java Ver arquivo

3
 import com.fasterxml.jackson.annotation.JsonFormat;
3
 import com.fasterxml.jackson.annotation.JsonFormat;
4
 import com.ruoyi.common.annotation.Excel;
4
 import com.ruoyi.common.annotation.Excel;
5
 import com.ruoyi.common.core.domain.BaseEntity;
5
 import com.ruoyi.common.core.domain.BaseEntity;
6
+import lombok.Data;
6
 
7
 
7
 import java.util.Date;
8
 import java.util.Date;
8
-
9
+@Data
9
 public class IdentityAuthentication   extends BaseEntity {
10
 public class IdentityAuthentication   extends BaseEntity {
10
     private static final long serialVersionUID = 1L;
11
     private static final long serialVersionUID = 1L;
11
 
12
 
15
     private String name;
16
     private String name;
16
     /** 身份证号 */
17
     /** 身份证号 */
17
     private String identityNo;
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
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
34
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
20
     private Date certificationTime;
35
     private Date certificationTime;
44
     private Long userId;
59
     private Long userId;
45
     /** 用户账号 */
60
     /** 用户账号 */
46
     private String userName;
61
     private String userName;
62
+    /**
63
+     * 用户昵称
64
+     */
65
+    private String nickName;
47
 
66
 
48
     /** EID商户id */
67
     /** EID商户id */
49
     private String merchantId;
68
     private String merchantId;

+ 63
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/WeChatUserVO.java Ver arquivo

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

+ 8
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java Ver arquivo

43
 
43
 
44
     /**
44
     /**
45
      * 查询仲裁员根据案件id
45
      * 查询仲裁员根据案件id
46
-     * @param arbitrator
46
+     * @param id
47
      * @return
47
      * @return
48
      */
48
      */
49
     String selectArbitratorList(@Param("id") String id);
49
     String selectArbitratorList(@Param("id") String id);
53
      * @param payDTO
53
      * @param payDTO
54
      */
54
      */
55
     void updatePayType(CaseConfirmPayDTO payDTO);
55
     void updatePayType(CaseConfirmPayDTO payDTO);
56
+
57
+    /**
58
+     * 查询部门长案件
59
+     * @param caseApplication
60
+     * @return
61
+     */
62
+    List<CaseApplication> selectDeptHeadCaseApplicationList(@Param("caseApplication") CaseApplication caseApplication, @Param("statusList")List<Integer> caseStatusList);
56
 }
63
 }

+ 1
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/IdentityAuthenticationMapper.java Ver arquivo

8
     IdentityAuthentication  selectIdentityAuthentication(IdentityAuthentication identityAuthentication);
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 Ver arquivo

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

+ 1
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java Ver arquivo

11
 
11
 
12
 public interface ICaseApplicationService {
12
 public interface ICaseApplicationService {
13
     List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication);
13
     List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication);
14
+    List<CaseApplication> selectCaseApplicationListNew(CaseApplication caseApplication);
14
 
15
 
15
 
16
 
16
     int insertcaseApplication(CaseApplication caseApplication);
17
     int insertcaseApplication(CaseApplication caseApplication);

+ 18
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/WeChatUserService.java Ver arquivo

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

+ 93
- 36
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Ver arquivo

13
 import com.google.gson.JsonObject;
13
 import com.google.gson.JsonObject;
14
 import com.ruoyi.common.annotation.DataScope;
14
 import com.ruoyi.common.annotation.DataScope;
15
 import com.ruoyi.common.constant.CaseApplicationConstants;
15
 import com.ruoyi.common.constant.CaseApplicationConstants;
16
+import com.ruoyi.common.constant.Constants;
16
 import com.ruoyi.common.core.domain.AjaxResult;
17
 import com.ruoyi.common.core.domain.AjaxResult;
17
 import com.ruoyi.common.core.domain.entity.*;
18
 import com.ruoyi.common.core.domain.entity.*;
18
 
19
 
98
      * @return
99
      * @return
99
      */
100
      */
100
 //    @Override
101
 //    @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
-//    }
102
+    public List<CaseApplication> selectCaseApplicationListNew(CaseApplication caseApplication) {
103
+        // 获取登录用户
104
+        LoginUser loginUser = getLoginUser();
105
+        SysUser user = loginUser.getUser();
106
+        Long userId = user.getUserId();
107
+
108
+        // 查询登录人身份证号
109
+        SysUser sysUser = sysUserMapper.selectUserById(userId);
110
+        List<SysRole> roles = sysUser.getRoles();
111
+        // 没有角色不能查看案件列表
112
+        if(CollectionUtil.isEmpty(roles)){
113
+            throw new ServiceException("该用户没有角色权限");
114
+        }
115
+        startPage();
116
+        for (SysRole role : roles) {
117
+            // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
118
+            if(role.getRoleName().equals("超级管理员")
119
+            ){
120
+                return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
121
+            }
122
+            if(role.getRoleName().equals("仲裁委")
123
+                    ||role.getRoleName().equals("部门长")){
124
+                List<Integer> caseStatusList=new ArrayList<>();
125
+                caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
126
+                caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
127
+                caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
128
+                return caseApplicationMapper.selectDeptHeadCaseApplicationList(caseApplication,caseStatusList);
129
+            }
130
+            if(role.getRoleName().equals("仲裁员")){
131
+                caseApplication.setUserId(String.valueOf(userId));
132
+            }
133
+            if(role.getRoleName().equals("法律顾问")){
134
+                // 查询角色有关的用户部门
135
+                List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
136
+                caseApplication.setDeptIds(deptIds);
137
+            }
138
+            if(StrUtil.isEmpty(caseApplication.getNameId())&&role.getRoleName().equals("申请人")){
139
+                // 查询角色有关的用户部门
140
+                caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
141
+            }
142
+            if(role.getRoleName().equals("被申请人")){
143
+                //
144
+                caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
145
+            }
146
+        }
147
+
148
+
149
+        // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
150
+        return caseApplicationMapper.selectCaseApplicationList(caseApplication);
151
+
152
+    }
136
     @Override
153
     @Override
137
     public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
154
     public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
138
         return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
155
         return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
188
                         caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
205
                         caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
189
 
206
 
190
                     }
207
                     }
208
+                    // 组装申请代理人信息
209
+                    buildAgentInfo(caseAffiliate);
191
                 }
210
                 }
192
             }
211
             }
193
 
212
 
275
                         caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
294
                         caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
276
 
295
 
277
                     }
296
                     }
297
+                    buildAgentInfo(caseAffiliate);
298
+
278
                 }
299
                 }
279
-                caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
300
+
301
+                    caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
280
             }
302
             }
281
 
303
 
282
         }
304
         }
292
         return rows;
314
         return rows;
293
     }
315
     }
294
 
316
 
317
+    /**
318
+     * 组装申请代理人信息
319
+     * @param caseAffiliate
320
+     */
321
+    private void buildAgentInfo(CaseAffiliate caseAffiliate) {
322
+        if(StrUtil.isNotEmpty(caseAffiliate.getNameAgent())){
323
+            // 组装申请机构代理人信息,用户表新增并且和部门关联
324
+            // 根据代理人身份证去用户表查询,有修改,么有新增
325
+            SysUser agentUser = sysUserMapper.selectUserByIdCard(caseAffiliate.getIdentityNumAgent());
326
+            if(agentUser==null){
327
+                agentUser = new SysUser();
328
+                agentUser.setIdCard(caseAffiliate.getIdentityNumAgent());
329
+                agentUser.setNickName(caseAffiliate.getNameAgent());
330
+                agentUser.setUserName(caseAffiliate.getIdentityNumAgent());
331
+                agentUser.setPhonenumber(caseAffiliate.getContactTelphoneAgent());
332
+                agentUser.setPassword(SecurityUtils.encryptPassword(Constants.DEFAULT_PASSWORD));
333
+                agentUser.setDeptId(Long.valueOf(caseAffiliate.getApplicationOrganId()));
334
+                int insertUserRow = sysUserMapper.insertUser(agentUser);
335
+                if(insertUserRow>0) {
336
+                    caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
337
+                    // 发送短信 todo
338
+                }
339
+            }else {
340
+                // 同步用户表和案件关联人表的手机号和名称
341
+                caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
342
+                caseAffiliate.setNameAgent(agentUser.getNickName());
343
+                caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
344
+            }
345
+
346
+        }
347
+    }
348
+
295
     @Override
349
     @Override
296
     @Transactional
350
     @Transactional
297
     public int submitCaseApplication(CaseApplication caseApplication) {
351
     public int submitCaseApplication(CaseApplication caseApplication) {
465
                             if(caseAffiliates!=null&&caseAffiliates.size()>0){
519
                             if(caseAffiliates!=null&&caseAffiliates.size()>0){
466
                                 for (CaseAffiliate caseAffiliate : caseAffiliates){
520
                                 for (CaseAffiliate caseAffiliate : caseAffiliates){
467
                                     caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
521
                                     caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
522
+                                    buildAgentInfo(caseAffiliate);
523
+
468
                                 }
524
                                 }
469
                                 caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
525
                                 caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
470
                             }
526
                             }
527
+
471
                             successNum++;
528
                             successNum++;
472
                             successMsg.append("<br/>" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功");
529
                             successMsg.append("<br/>" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功");
473
                         }
530
                         }

+ 15
- 8
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/IdentityAuthenticationServiceImpl.java Ver arquivo

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

+ 154
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/WeChatUserServiceImpl.java Ver arquivo

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.MILLISECONDS);
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
+        // 校验短信验证码
111
+        if(StrUtil.isEmpty(getCodeCache(ientityAuthentication.getPhone()))){
112
+            return AjaxResult.success("验证码校验失败");
113
+        }
114
+        SysUser sysUserName=sysUserMapper.selectUserByUserName(ientityAuthentication.getUserName());
115
+        if(sysUserName!=null){
116
+            return AjaxResult.warn("账号已存在");
117
+        }
118
+        // 根据身份证查询系统用户表中是否存在该用户,存在则同步已认证的信息,不存在则新增
119
+        SysUser sysUser=sysUserMapper.selectUserByIdCard(ientityAuthentication.getIdentityNo());
120
+
121
+        if(sysUser!=null){
122
+            sysUser.setIdCard(ientityAuthentication.getIdentityNo());
123
+            sysUser.setNickName(ientityAuthentication.getName());
124
+            sysUser.setUserName(ientityAuthentication.getUserName());
125
+            sysUser.setPhonenumber(ientityAuthentication.getPhone());
126
+            sysUser.setEmail(ientityAuthentication.getEmail());
127
+            sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
128
+            sysUserMapper.updateUser(sysUser);
129
+            ientityAuthentication.setUserId(sysUser.getUserId());
130
+        }else {
131
+            sysUser=new SysUser();
132
+            // 用户名设为电话号
133
+            sysUser.setUserName(ientityAuthentication.getPhone());
134
+            sysUser.setIdCard(ientityAuthentication.getIdentityNo());
135
+            sysUser.setNickName(ientityAuthentication.getName());
136
+            sysUser.setUserName(ientityAuthentication.getUserName());
137
+            sysUser.setPhonenumber(ientityAuthentication.getPhone());
138
+            sysUser.setEmail(ientityAuthentication.getEmail());
139
+            sysUser.setCreateBy(ientityAuthentication.getPhone());
140
+            sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
141
+            int row = sysUserMapper.insertUser(sysUser);
142
+            if(row<1) {
143
+                return AjaxResult.error("注册失败");
144
+            }
145
+        }
146
+
147
+        ientityAuthentication.setUserId(sysUser.getUserId());
148
+        ientityAuthentication.setUserName(sysUser.getUserName());
149
+        // 已经认证过的用户才能注册,认证表中已经有该数据
150
+        identityAuthenticationMapper.updateIdentityAuthentication(ientityAuthentication);
151
+        return AjaxResult.success("注册成功");
152
+    }
153
+
154
+}

+ 7
- 1
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml Ver arquivo

177
 
177
 
178
 	</select>
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
  		insert into sys_user(
187
  		insert into sys_user(
182
  			<if test="userId != null and userId != 0">user_id,</if>
188
  			<if test="userId != null and userId != 0">user_id,</if>
183
  			<if test="deptId != null and deptId != 0">dept_id,</if>
189
  			<if test="deptId != null and deptId != 0">dept_id,</if>

+ 3
- 2
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml Ver arquivo

54
     <insert id="batchCaseAffiliate">
54
     <insert id="batchCaseAffiliate">
55
         insert into case_affiliate(case_appli_id, identity_type,application_organ_id,application_organ_name,name,identity_num,contact_telphone,
55
         insert into case_affiliate(case_appli_id, identity_type,application_organ_id,application_organ_name,name,identity_num,contact_telphone,
56
         contact_address,work_address,work_telphone ,name_agent,identity_num_agent,contact_telphone_agent,
56
         contact_address,work_address,work_telphone ,name_agent,identity_num_agent,contact_telphone_agent,
57
-        contact_address_agent ) values
57
+        contact_address_agent,applicant_agent_user_id ) values
58
         <foreach item="item" index="index" collection="list" separator=",">
58
         <foreach item="item" index="index" collection="list" separator=",">
59
             (#{item.caseAppliId},#{item.identityType},#{item.applicationOrganId},#{item.applicationOrganName},#{item.name},#{item.identityNum},#{item.contactTelphone},
59
             (#{item.caseAppliId},#{item.identityType},#{item.applicationOrganId},#{item.applicationOrganName},#{item.name},#{item.identityNum},#{item.contactTelphone},
60
             #{item.contactAddress},#{item.workAddress},#{item.workTelphone},  #{item.nameAgent},#{item.identityNumAgent},
60
             #{item.contactAddress},#{item.workAddress},#{item.workTelphone},  #{item.nameAgent},#{item.identityNumAgent},
61
-            #{item.contactTelphoneAgent},#{item.contactAddressAgent})
61
+            #{item.contactTelphoneAgent},#{item.contactAddressAgent},#{item.applicantAgentUserId})
62
         </foreach>
62
         </foreach>
63
     </insert>
63
     </insert>
64
 
64
 
71
         identity_type= #{identityType},
71
         identity_type= #{identityType},
72
         application_organ_id= #{applicationOrganId},
72
         application_organ_id= #{applicationOrganId},
73
         application_organ_name= #{applicationOrganName},
73
         application_organ_name= #{applicationOrganName},
74
+        applicant_agent_user_id= #{applicantAgentUserId},
74
         name = #{name},
75
         name = #{name},
75
         identity_num = #{identityNum},
76
         identity_num = #{identityNum},
76
         contact_telphone = #{contactTelphone},
77
         contact_telphone = #{contactTelphone},

+ 83
- 32
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Ver arquivo

38
     </resultMap>
38
     </resultMap>
39
 
39
 
40
     <select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
40
     <select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
41
-select t1.* from(
41
+        select t1.* from(
42
         select t.* from(
42
         select t.* from(
43
         select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
43
         select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
44
         CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
44
         CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
45
-            ELSE '无审理方式'
46
-            END arbitratMethodName,
45
+        ELSE '无审理方式'
46
+        END arbitratMethodName,
47
         c.case_status ,
47
         c.case_status ,
48
         CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
48
         CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
49
-                            when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
50
-                            when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
51
-                            when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
52
-                            when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
53
-                            when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
54
-                            ELSE '无案件状态'
55
-                            END caseStatusName,
49
+        when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
50
+        when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
51
+        when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
52
+        when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
53
+        when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
54
+        ELSE '无案件状态'
55
+        END caseStatusName,
56
         c.hear_date ,c.arbitrat_claims ,
56
         c.hear_date ,c.arbitrat_claims ,
57
-        c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
57
+        c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
58
+        ,c.fee_payable ,
58
         c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
59
         c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
59
-        c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name as applicantName,
60
+        c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name as
61
+        applicantName,
60
         c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url
62
         c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url
61
         from case_application c
63
         from case_application c
62
-        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
64
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id
63
         <where>
65
         <where>
64
             <if test="caseStatus != null">
66
             <if test="caseStatus != null">
65
                 AND c.case_status = #{caseStatus}
67
                 AND c.case_status = #{caseStatus}
77
         ) t
79
         ) t
78
         <where>
80
         <where>
79
 
81
 
80
-        <!--被申请人-->
81
-        <if test="idCard != null and idCard != ''">
82
-            or (t.identity_num=#{idCard}  AND t.identity_type=2)
83
-        </if>
84
-        <!--仲裁员-->
85
-        <if test="userId != null and userId != ''">
86
-            or instr  (t.arbitrator_id,#{userId})>0
87
-        </if>
88
-        <!--法律顾问-->
89
-        <if test="deptIds != null and deptIds.size() > 0">
90
-            or t.name
91
-            in
92
-            <foreach item="item" collection="deptIds" open="(" separator="," close=")">
93
-                #{item}
94
-            </foreach>
95
-        </if>
82
+            <!--被申请人-->
83
+            <if test="idCard != null and idCard != ''">
84
+                or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
85
+            </if>
86
+            <!--仲裁员-->
87
+            <if test="userId != null and userId != ''">
88
+                or ( t.identity_type=1 and
89
+                       t.case_status in (7,8,9,12,13,14)
90
+                and
91
+                instr (t.arbitrator_id,#{userId})>0)
92
+            </if>
93
+            <!--法律顾问-->
94
+            <if test="deptIds != null and deptIds.size() > 0">
95
+                or (t.identity_type=1 and t.case_status in (1,5,11,15,16)
96
+                and t.application_organ_id in
97
+                <foreach item="item" collection="deptIds" open="(" separator="," close=")">
98
+                    #{item}
99
+                </foreach> )
100
+            </if>
96
 
101
 
97
-    </where>
102
+        </where>
98
         ) t1
103
         ) t1
99
         <where>
104
         <where>
100
             <!--申请人-->
105
             <!--申请人-->
101
             <if test="nameId != null and nameId != ''">
106
             <if test="nameId != null and nameId != ''">
102
-                and ( t1.application_organ_id = #{nameId}  AND t1.identity_type=1 )
107
+                and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1
108
+                    and t1.case_status in (0,2)
109
+                )
103
             </if>
110
             </if>
104
         </where>
111
         </where>
105
         order by t1.create_time desc,t1.case_num desc
112
         order by t1.create_time desc,t1.case_num desc
143
         </where>
150
         </where>
144
         order by c.create_time desc,c.case_num desc
151
         order by c.create_time desc,c.case_num desc
145
     </select>
152
     </select>
153
+    <select id="selectDeptHeadCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
154
+        select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
155
+        CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
156
+        ELSE '无审理方式'
157
+        END arbitratMethodName,
158
+        c.case_status ,
159
+        CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
160
+        when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
161
+        when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
162
+        when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
163
+        when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
164
+        when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
165
+        ELSE '无案件状态'
166
+        END caseStatusName,
167
+        c.hear_date ,c.arbitrat_claims ,
168
+        c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
169
+        c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
170
+        c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url
171
+        from case_application c
172
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
173
+        <where>
174
+            c.case_status in
175
+            <foreach item="caseStatus" collection="statusList" open="(" separator="," close=")">
176
+                #{caseStatus}
177
+            </foreach>
178
+            <if test="caseApplication.caseStatus != null">
179
+                AND c.case_status = #{caseApplication.caseStatus}
180
+            </if>
181
+            <if test="caseApplication.caseNum != null and caseApplication.caseNum != ''">
182
+                AND c.case_num = #{caseApplication.caseNum}
183
+            </if>
184
+            <if test="caseApplication.nameId != null and caseApplication.nameId != ''">
185
+                AND ca.application_organ_id=#{caseApplication.nameId}  AND ca.identity_type=1
186
+            </if>
187
+            <if test="caseApplication.caseStatusList != null and caseApplication.caseStatusList.size() > 0">
188
+                and c.case_status in
189
+                <foreach item="caseStatus" collection="caseApplication.caseStatusList" open="(" separator="," close=")">
190
+                    #{caseStatus}
191
+                </foreach>
192
+            </if>
193
+        </where>
194
+        order by c.create_time desc,c.case_num desc
195
+    </select>
196
+
146
 
197
 
147
     <select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">
198
     <select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">
148
         select count(1) from  case_application c
199
         select count(1) from  case_application c
310
         END paymentStatusName,c.pay_type,
361
         END paymentStatusName,c.pay_type,
311
         CASE c.pay_type when 0 then '线上支付' when 0 then '线下支付' else '' end payTypeName
362
         CASE c.pay_type when 0 then '线上支付' when 0 then '线下支付' else '' end payTypeName
312
         from case_application c left join case_payment_record p on c.id  = p.case_id
363
         from case_application c left join case_payment_record p on c.id  = p.case_id
313
-        where c.case_status  = 3 and p.payment_status  = 1
364
+        where c.case_status  = 3
314
             AND c.id = #{id}
365
             AND c.id = #{id}
315
 
366
 
316
     </select>
367
     </select>

+ 14
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/IdentityAuthenticationMapper.xml Ver arquivo

11
         <result property="certificationStatus"        column="certification_status"        />
11
         <result property="certificationStatus"        column="certification_status"        />
12
         <result property="userId"  column="user_id"  />
12
         <result property="userId"  column="user_id"  />
13
         <result property="userName"          column="user_name"          />
13
         <result property="userName"          column="user_name"          />
14
+        <result property="idAddress"          column="id_address"          />
14
 
15
 
15
     </resultMap>
16
     </resultMap>
16
 
17
 
17
     <insert id="insertIdentityAuthentication" parameterType="IdentityAuthentication" useGeneratedKeys="true" keyProperty="id">
18
     <insert id="insertIdentityAuthentication" parameterType="IdentityAuthentication" useGeneratedKeys="true" keyProperty="id">
18
         insert into identi_authenti(
19
         insert into identi_authenti(
19
         <if test="userId != null">user_id,</if>
20
         <if test="userId != null">user_id,</if>
21
+        <if test="idAddress != null and idAddress != ''">id_address,</if>
20
         <if test="name != null and name != ''">name,</if>
22
         <if test="name != null and name != ''">name,</if>
21
         <if test="identityNo != null and identityNo != ''">identity_no,</if>
23
         <if test="identityNo != null and identityNo != ''">identity_no,</if>
22
         certification_time,
24
         certification_time,
26
         create_time
28
         create_time
27
         )values(
29
         )values(
28
         <if test="userId != null ">#{userId},</if>
30
         <if test="userId != null ">#{userId},</if>
31
+        <if test="idAddress != null and idAddress != ''">#{idAddress},</if>
29
         <if test="name != null and name != ''">#{name},</if>
32
         <if test="name != null and name != ''">#{name},</if>
30
         <if test="identityNo != null and identityNo != ''">#{identityNo},</if>
33
         <if test="identityNo != null and identityNo != ''">#{identityNo},</if>
31
         sysdate(),
34
         sysdate(),
35
         sysdate()
38
         sysdate()
36
         )
39
         )
37
     </insert>
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
     <select id="selectIdentityAuthentication" parameterType="IdentityAuthentication" resultMap="IdentityAuthenticationResult">
53
     <select id="selectIdentityAuthentication" parameterType="IdentityAuthentication" resultMap="IdentityAuthenticationResult">
40
         SELECT  i.id ,i.name ,i.identity_no ,i.certification_time ,i.certification_status ,i.user_id ,i.user_name
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 Ver arquivo

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>