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;