Browse Source

企业新增重复问题解决

v2
蟑螂恶霸 2 years ago
parent
commit
92b5353dfa
  1. 15
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java

15
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()); String salt = PasswordTools.encrypt(enterpriseInformation.getEnterpriseNumber());
enterpriseInformation.setSalt(salt); enterpriseInformation.setSalt(salt);
EnterpriseInformation info = enterpriseInformationMapper.selectEnterpriseInformationById(enterpriseInformation.getId());
//判断当前登录人是否已经在本系统中登记了企业信息
EnterpriseInformation enterpriseInformation1 = new EnterpriseInformation();
enterpriseInformation1.setEnterpriseNumber(enterpriseInformation.getEnterpriseNumber());
List<EnterpriseInformation> enterpriseInformations = enterpriseInformationMapper.selectEnterpriseInformationList(enterpriseInformation1);
int i=0; int i=0;
if (null!=info && null != info.getId()) { if(enterpriseInformations.size() == 0){
i = enterpriseInformationMapper.updateEnterpriseInformationByEnterpriseNumber(enterpriseInformation);
} else {
System.out.println("````````````````````````````````````````");
System.out.println(enterpriseInformation.getEnterpriseName());
i = enterpriseInformationMapper.insertEnterpriseInformation(enterpriseInformation); i = enterpriseInformationMapper.insertEnterpriseInformation(enterpriseInformation);
} else {
i = enterpriseInformationMapper.updateEnterpriseInformationByEnterpriseNumber(enterpriseInformation);
} }
if(i > 0){ if(i > 0){
String text = salt; String text = salt;

Loading…
Cancel
Save