导入案件申请代理人修改

This commit is contained in:
18792927508
2023-10-16 18:31:56 +08:00
parent 2e91e53da7
commit d7d9bb51b2
6 changed files with 54 additions and 7 deletions
@@ -23,6 +23,10 @@ public class CaseAffiliate extends BaseEntity {
* 申请机构名称
*/
private String applicationOrganName;
/**
* 代理人用户id
*/
private String applicantAgentUserId;
/** 身份证号 */
@Excel(name = "身份证号")
private String identityNum;
@@ -57,6 +61,14 @@ public class CaseAffiliate extends BaseEntity {
/** 快递单号 */
private String trackNum;
public String getApplicantAgentUserId() {
return applicantAgentUserId;
}
public void setApplicantAgentUserId(String applicantAgentUserId) {
this.applicantAgentUserId = applicantAgentUserId;
}
public String getApplicationOrganId() {
return applicationOrganId;
}
@@ -13,6 +13,7 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.constant.CaseApplicationConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.*;
@@ -465,9 +466,35 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
if(caseAffiliates!=null&&caseAffiliates.size()>0){
for (CaseAffiliate caseAffiliate : caseAffiliates){
caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
// 组装申请机构代理人信息,用户表新增并且和部门关联
// 根据代理人身份证去用户表查询,有修改,么有新增
if(caseAffiliate.getIdentityType()==1) {
SysUser agentUser = sysUserMapper.selectUserByIdCard(caseAffiliate.getIdentityNumAgent());
if(agentUser==null){
agentUser = new SysUser();
agentUser.setIdCard(caseAffiliate.getIdentityNumAgent());
agentUser.setNickName(caseAffiliate.getNameAgent());
agentUser.setUserName(caseAffiliate.getIdentityNumAgent());
agentUser.setPhonenumber(caseAffiliate.getContactTelphoneAgent());
agentUser.setPassword(SecurityUtils.encryptPassword(Constants.DEFAULT_PASSWORD));
agentUser.setDeptId(Long.valueOf(caseAffiliate.getApplicationOrganId()));
int insertUserRow = sysUserMapper.insertUser(agentUser);
if(insertUserRow>0) {
caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
// 发送短信 todo
}
}else {
// 同步用户表和案件关联人表的手机号和名称
caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
caseAffiliate.setNameAgent(agentUser.getNickName());
caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
}
}
}
caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
}
successNum++;
successMsg.append("<br/>" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功");
}
@@ -54,6 +54,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
@Override
public String sendCode(WeChatUserVO userVO) {
Random random = new Random();
String code = "";
for (int i = 0; i < 6; i++) {
@@ -61,15 +62,16 @@ public class WeChatUserServiceImpl implements WeChatUserService {
code += random.nextInt(10);
}
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("1952136");
// 1948332 普通短信 开庭审理房间号通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请知晓,如非本人操作,请忽略本短信。
request.setTemplateId("1955047");
// 1954926 普通短信 短信验证码 验证码:,为了保证您的账户安全,请勿想他人泄露验证码信息。如非本人操作,请忽略本短信。
request.setPhone(userVO.getPhone());
request.setTemplateParamSet(new String[]{"王琼", "验证码", code});
request.setTemplateParamSet(new String[]{ code});
Boolean flag = SmsUtils.sendSms(request);
if(flag){
setCodeCache(userVO.getPhone(),code);
return "短信发送成功";
}
return "短信发送成功";
return "短信发送失败";
}
/**
* 设置字典缓存
@@ -109,6 +111,10 @@ public class WeChatUserServiceImpl implements WeChatUserService {
// if(StrUtil.isEmpty(getCodeCache(ientityAuthentication.getPhone()))){
// return AjaxResult.success("验证码校验失败");
// }
SysUser sysUserName=sysUserMapper.selectUserByUserName(ientityAuthentication.getUserName());
if(sysUserName!=null){
return AjaxResult.warn("用户名已存在");
}
// 根据身份证查询系统用户表中是否存在该用户,存在则同步已认证的信息,不存在则新增
SysUser sysUser=sysUserMapper.selectUserByIdCard(ientityAuthentication.getIdentityNo());
@@ -134,7 +140,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
int row = sysUserMapper.insertUser(sysUser);
if(row<1) {
return AjaxResult.success("注册失败");
return AjaxResult.error("注册失败");
}
}