From 92b5353dfa86d6d26709d611108f45045904ac31 Mon Sep 17 00:00:00 2001 From: kylin L <452061493@qq.com> Date: Tue, 11 Jun 2024 17:17:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E6=96=B0=E5=A2=9E=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/EnterpriseInformationServiceImpl.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java index 23ea82e8..a0c2dab3 100644 --- a/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java +++ b/lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java @@ -118,14 +118,17 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS //生成企业统一信用代码盐 String salt = PasswordTools.encrypt(enterpriseInformation.getEnterpriseNumber()); enterpriseInformation.setSalt(salt); - EnterpriseInformation info = enterpriseInformationMapper.selectEnterpriseInformationById(enterpriseInformation.getId()); + + //判断当前登录人是否已经在本系统中登记了企业信息 + EnterpriseInformation enterpriseInformation1 = new EnterpriseInformation(); + enterpriseInformation1.setEnterpriseNumber(enterpriseInformation.getEnterpriseNumber()); + List enterpriseInformations = enterpriseInformationMapper.selectEnterpriseInformationList(enterpriseInformation1); + int i=0; - if (null!=info && null != info.getId()) { - i = enterpriseInformationMapper.updateEnterpriseInformationByEnterpriseNumber(enterpriseInformation); - } else { - System.out.println("````````````````````````````````````````"); - System.out.println(enterpriseInformation.getEnterpriseName()); + if(enterpriseInformations.size() == 0){ i = enterpriseInformationMapper.insertEnterpriseInformation(enterpriseInformation); + } else { + i = enterpriseInformationMapper.updateEnterpriseInformationByEnterpriseNumber(enterpriseInformation); } if(i > 0){ String text = salt;