From c8e5e745ceead2006f83f27c98555ba2aeb5af61 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Mon, 16 Oct 2023 18:47:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9=E6=A1=88?= =?UTF-8?q?=E4=BB=B6=E7=94=B3=E8=AF=B7=E4=BB=A3=E7=90=86=E4=BA=BA=E5=85=B3?= =?UTF-8?q?=E7=B3=BB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CaseApplicationServiceImpl.java | 64 +++++++++++-------- .../wisdomarbitrate/CaseAffiliateMapper.xml | 1 + 2 files changed, 40 insertions(+), 25 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 412e592..d1c739b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -189,6 +189,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); } + // 组装申请代理人信息 + buildAgentInfo(caseAffiliate); } } @@ -276,8 +278,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { 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; } + /** + * 组装申请代理人信息 + * @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 @Transactional public int submitCaseApplication(CaseApplication caseApplication) { @@ -466,30 +503,7 @@ 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())); - } - } + buildAgentInfo(caseAffiliate); } caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml index 4e861c4..05bbf48 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml @@ -71,6 +71,7 @@ identity_type= #{identityType}, application_organ_id= #{applicationOrganId}, application_organ_name= #{applicationOrganName}, + applicant_agent_user_id= #{applicantAgentUserId}, name = #{name}, identity_num = #{identityNum}, contact_telphone = #{contactTelphone}, -- 2.54.0