Просмотр исходного кода

导入案件申请代理人修改

18792927508 2 лет назад
Родитель
Сommit
d7d9bb51b2

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

@@ -49,6 +49,7 @@ public class WeChatUserController extends BaseController {
49 49
                 || StrUtil.isEmpty(ientityAuthentication.getName())
50 50
                 || StrUtil.isEmpty(ientityAuthentication.getIdentityNo())
51 51
                 || StrUtil.isEmpty(ientityAuthentication.getPhone())
52
+                || StrUtil.isEmpty(ientityAuthentication.getUserName())
52 53
                 || StrUtil.isEmpty(ientityAuthentication.getEmail())
53 54
                 || StrUtil.isEmpty(ientityAuthentication.getVerifyCode())
54 55
         ){

+ 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对象白名单配置(仅允许解析的包名,范围越小越安全)

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

@@ -23,6 +23,10 @@ public class CaseAffiliate   extends BaseEntity {
23 23
      * 申请机构名称
24 24
      */
25 25
     private String applicationOrganName;
26
+    /**
27
+     * 代理人用户id
28
+     */
29
+    private String applicantAgentUserId;
26 30
     /** 身份证号 */
27 31
     @Excel(name = "身份证号")
28 32
     private String identityNum;
@@ -57,6 +61,14 @@ public class CaseAffiliate   extends BaseEntity {
57 61
     /** 快递单号 */
58 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 72
     public String getApplicationOrganId() {
61 73
         return applicationOrganId;
62 74
     }

+ 27
- 0
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
 
@@ -465,9 +466,35 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
465 466
                             if(caseAffiliates!=null&&caseAffiliates.size()>0){
466 467
                                 for (CaseAffiliate caseAffiliate : caseAffiliates){
467 468
                                     caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
469
+                                    // 组装申请机构代理人信息,用户表新增并且和部门关联
470
+                                    // 根据代理人身份证去用户表查询,有修改,么有新增
471
+                                    if(caseAffiliate.getIdentityType()==1) {
472
+                                        SysUser agentUser = sysUserMapper.selectUserByIdCard(caseAffiliate.getIdentityNumAgent());
473
+                                        if(agentUser==null){
474
+                                            agentUser = new SysUser();
475
+                                            agentUser.setIdCard(caseAffiliate.getIdentityNumAgent());
476
+                                            agentUser.setNickName(caseAffiliate.getNameAgent());
477
+                                            agentUser.setUserName(caseAffiliate.getIdentityNumAgent());
478
+                                            agentUser.setPhonenumber(caseAffiliate.getContactTelphoneAgent());
479
+                                            agentUser.setPassword(SecurityUtils.encryptPassword(Constants.DEFAULT_PASSWORD));
480
+                                            agentUser.setDeptId(Long.valueOf(caseAffiliate.getApplicationOrganId()));
481
+                                            int insertUserRow = sysUserMapper.insertUser(agentUser);
482
+                                            if(insertUserRow>0) {
483
+                                                caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
484
+                                                // 发送短信 todo
485
+                                            }
486
+                                        }else {
487
+                                            // 同步用户表和案件关联人表的手机号和名称
488
+                                            caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
489
+                                            caseAffiliate.setNameAgent(agentUser.getNickName());
490
+                                            caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
491
+                                        }
492
+                                    }
493
+
468 494
                                 }
469 495
                                 caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
470 496
                             }
497
+
471 498
                             successNum++;
472 499
                             successMsg.append("<br/>" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功");
473 500
                         }

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

@@ -54,6 +54,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
54 54
 
55 55
     @Override
56 56
     public String sendCode(WeChatUserVO userVO) {
57
+
57 58
         Random random = new Random();
58 59
         String code = "";
59 60
         for (int i = 0; i < 6; i++) {
@@ -61,15 +62,16 @@ public class WeChatUserServiceImpl implements WeChatUserService {
61 62
             code += random.nextInt(10);
62 63
         }
63 64
         SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
64
-        request.setTemplateId("1952136");
65
-        // 1948332 普通短信 开庭审理房间号通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请知晓,如非本人操作,请忽略本短信。
65
+        request.setTemplateId("1955047");
66
+        //  1954926 普通短信 短信验证码 验证码:,为了保证您的账户安全,请勿想他人泄露验证码信息。如非本人操作,请忽略本短信。
66 67
         request.setPhone(userVO.getPhone());
67
-        request.setTemplateParamSet(new String[]{"王琼", "验证码", code});
68
+        request.setTemplateParamSet(new String[]{ code});
68 69
         Boolean flag = SmsUtils.sendSms(request);
69 70
         if(flag){
70 71
             setCodeCache(userVO.getPhone(),code);
72
+            return "短信发送成功";
71 73
         }
72
-        return "短信发送成功";
74
+        return "短信发送失败";
73 75
     }
74 76
     /**
75 77
      * 设置字典缓存
@@ -109,6 +111,10 @@ public class WeChatUserServiceImpl implements WeChatUserService {
109 111
 //        if(StrUtil.isEmpty(getCodeCache(ientityAuthentication.getPhone()))){
110 112
 //            return AjaxResult.success("验证码校验失败");
111 113
 //        }
114
+        SysUser sysUserName=sysUserMapper.selectUserByUserName(ientityAuthentication.getUserName());
115
+        if(sysUserName!=null){
116
+            return AjaxResult.warn("用户名已存在");
117
+        }
112 118
         // 根据身份证查询系统用户表中是否存在该用户,存在则同步已认证的信息,不存在则新增
113 119
         SysUser sysUser=sysUserMapper.selectUserByIdCard(ientityAuthentication.getIdentityNo());
114 120
 
@@ -134,7 +140,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
134 140
             sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
135 141
             int row = sysUserMapper.insertUser(sysUser);
136 142
             if(row<1) {
137
-                return AjaxResult.success("注册失败");
143
+                return AjaxResult.error("注册失败");
138 144
             }
139 145
         }
140 146
 

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

@@ -54,11 +54,11 @@
54 54
     <insert id="batchCaseAffiliate">
55 55
         insert into case_affiliate(case_appli_id, identity_type,application_organ_id,application_organ_name,name,identity_num,contact_telphone,
56 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 58
         <foreach item="item" index="index" collection="list" separator=",">
59 59
             (#{item.caseAppliId},#{item.identityType},#{item.applicationOrganId},#{item.applicationOrganName},#{item.name},#{item.identityNum},#{item.contactTelphone},
60 60
             #{item.contactAddress},#{item.workAddress},#{item.workTelphone},  #{item.nameAgent},#{item.identityNumAgent},
61
-            #{item.contactTelphoneAgent},#{item.contactAddressAgent})
61
+            #{item.contactTelphoneAgent},#{item.contactAddressAgent},#{item.applicantAgentUserId})
62 62
         </foreach>
63 63
     </insert>
64 64