Преглед на файлове

导入案件申请代理人修改

18792927508 преди 2 години
родител
ревизия
d7d9bb51b2

+ 1
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/WeChatUserController.java Целия файл

49
                 || StrUtil.isEmpty(ientityAuthentication.getName())
49
                 || StrUtil.isEmpty(ientityAuthentication.getName())
50
                 || StrUtil.isEmpty(ientityAuthentication.getIdentityNo())
50
                 || StrUtil.isEmpty(ientityAuthentication.getIdentityNo())
51
                 || StrUtil.isEmpty(ientityAuthentication.getPhone())
51
                 || StrUtil.isEmpty(ientityAuthentication.getPhone())
52
+                || StrUtil.isEmpty(ientityAuthentication.getUserName())
52
                 || StrUtil.isEmpty(ientityAuthentication.getEmail())
53
                 || StrUtil.isEmpty(ientityAuthentication.getEmail())
53
                 || StrUtil.isEmpty(ientityAuthentication.getVerifyCode())
54
                 || StrUtil.isEmpty(ientityAuthentication.getVerifyCode())
54
         ){
55
         ){

+ 1
- 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java Целия файл

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

+ 12
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java Целия файл

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
     }

+ 27
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Целия файл

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
 
465
                             if(caseAffiliates!=null&&caseAffiliates.size()>0){
466
                             if(caseAffiliates!=null&&caseAffiliates.size()>0){
466
                                 for (CaseAffiliate caseAffiliate : caseAffiliates){
467
                                 for (CaseAffiliate caseAffiliate : caseAffiliates){
467
                                     caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
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
                                 caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
495
                                 caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
470
                             }
496
                             }
497
+
471
                             successNum++;
498
                             successNum++;
472
                             successMsg.append("<br/>" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功");
499
                             successMsg.append("<br/>" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功");
473
                         }
500
                         }

+ 11
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/WeChatUserServiceImpl.java Целия файл

54
 
54
 
55
     @Override
55
     @Override
56
     public String sendCode(WeChatUserVO userVO) {
56
     public String sendCode(WeChatUserVO userVO) {
57
+
57
         Random random = new Random();
58
         Random random = new Random();
58
         String code = "";
59
         String code = "";
59
         for (int i = 0; i < 6; i++) {
60
         for (int i = 0; i < 6; i++) {
61
             code += random.nextInt(10);
62
             code += random.nextInt(10);
62
         }
63
         }
63
         SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
64
         SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
64
-        request.setTemplateId("1952136");
65
-        // 1948332 普通短信 开庭审理房间号通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请知晓,如非本人操作,请忽略本短信。
65
+        request.setTemplateId("1955047");
66
+        //  1954926 普通短信 短信验证码 验证码:,为了保证您的账户安全,请勿想他人泄露验证码信息。如非本人操作,请忽略本短信。
66
         request.setPhone(userVO.getPhone());
67
         request.setPhone(userVO.getPhone());
67
-        request.setTemplateParamSet(new String[]{"王琼", "验证码", code});
68
+        request.setTemplateParamSet(new String[]{ code});
68
         Boolean flag = SmsUtils.sendSms(request);
69
         Boolean flag = SmsUtils.sendSms(request);
69
         if(flag){
70
         if(flag){
70
             setCodeCache(userVO.getPhone(),code);
71
             setCodeCache(userVO.getPhone(),code);
72
+            return "短信发送成功";
71
         }
73
         }
72
-        return "短信发送成功";
74
+        return "短信发送失败";
73
     }
75
     }
74
     /**
76
     /**
75
      * 设置字典缓存
77
      * 设置字典缓存
109
 //        if(StrUtil.isEmpty(getCodeCache(ientityAuthentication.getPhone()))){
111
 //        if(StrUtil.isEmpty(getCodeCache(ientityAuthentication.getPhone()))){
110
 //            return AjaxResult.success("验证码校验失败");
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
         SysUser sysUser=sysUserMapper.selectUserByIdCard(ientityAuthentication.getIdentityNo());
119
         SysUser sysUser=sysUserMapper.selectUserByIdCard(ientityAuthentication.getIdentityNo());
114
 
120
 
134
             sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
140
             sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
135
             int row = sysUserMapper.insertUser(sysUser);
141
             int row = sysUserMapper.insertUser(sysUser);
136
             if(row<1) {
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
     <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