新增修改案件申请代理人关系修改
This commit is contained in:
+39
-25
@@ -189,6 +189,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
|
caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// 组装申请代理人信息
|
||||||
|
buildAgentInfo(caseAffiliate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,8 +278,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
|
caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
buildAgentInfo(caseAffiliate);
|
||||||
|
|
||||||
}
|
}
|
||||||
caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
|
|
||||||
|
caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -293,6 +298,38 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组装申请代理人信息
|
||||||
|
* @param caseAffiliate
|
||||||
|
*/
|
||||||
|
private void buildAgentInfo(CaseAffiliate caseAffiliate) {
|
||||||
|
if(StrUtil.isNotEmpty(caseAffiliate.getNameAgent())){
|
||||||
|
// 组装申请机构代理人信息,用户表新增并且和部门关联
|
||||||
|
// 根据代理人身份证去用户表查询,有修改,么有新增
|
||||||
|
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()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int submitCaseApplication(CaseApplication caseApplication) {
|
public int submitCaseApplication(CaseApplication caseApplication) {
|
||||||
@@ -466,30 +503,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
if(caseAffiliates!=null&&caseAffiliates.size()>0){
|
if(caseAffiliates!=null&&caseAffiliates.size()>0){
|
||||||
for (CaseAffiliate caseAffiliate : caseAffiliates){
|
for (CaseAffiliate caseAffiliate : caseAffiliates){
|
||||||
caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
|
caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
|
||||||
// 组装申请机构代理人信息,用户表新增并且和部门关联
|
buildAgentInfo(caseAffiliate);
|
||||||
// 根据代理人身份证去用户表查询,有修改,么有新增
|
|
||||||
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);
|
caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
|
||||||
|
|||||||
@@ -71,6 +71,7 @@
|
|||||||
identity_type= #{identityType},
|
identity_type= #{identityType},
|
||||||
application_organ_id= #{applicationOrganId},
|
application_organ_id= #{applicationOrganId},
|
||||||
application_organ_name= #{applicationOrganName},
|
application_organ_name= #{applicationOrganName},
|
||||||
|
applicant_agent_user_id= #{applicantAgentUserId},
|
||||||
name = #{name},
|
name = #{name},
|
||||||
identity_num = #{identityNum},
|
identity_num = #{identityNum},
|
||||||
contact_telphone = #{contactTelphone},
|
contact_telphone = #{contactTelphone},
|
||||||
|
|||||||
Reference in New Issue
Block a user