|
@@ -406,17 +406,39 @@ public class UserApiController {
|
|
|
}else if("1".equals(type)){
|
|
|
if(StringUtils.isNotEmpty(personInfo.getEnterpriseId())) {
|
|
|
EnterpriseInfo enterpriseInfo = enterpriseInfoService.get(personInfo.getEnterpriseId());
|
|
|
- enterpriseInfo.setUpdateBy(subject);
|
|
|
- enterpriseInfo.setUpdateTime(new Date());
|
|
|
- enterpriseInfo.setLicenseImage(licenseUrl);
|
|
|
- enterpriseInfo.setName(enterpriseName);
|
|
|
- enterpriseInfo.setStatus("0");
|
|
|
- enterpriseInfo.setAddress(address);
|
|
|
- enterpriseInfo.setContactsPersonId(contactsPersonId);
|
|
|
- enterpriseInfo.setContactsPhone(contactsPhone);
|
|
|
- enterpriseInfo.setCheckTime(new Date());//认证时间
|
|
|
-
|
|
|
- enterpriseInfoService.update(enterpriseInfo);
|
|
|
+ if(enterpriseInfo == null) {
|
|
|
+ enterpriseInfo.setUpdateBy(subject);
|
|
|
+ enterpriseInfo.setUpdateTime(new Date());
|
|
|
+ enterpriseInfo.setLicenseImage(licenseUrl);
|
|
|
+ enterpriseInfo.setName(enterpriseName);
|
|
|
+ enterpriseInfo.setStatus("0");
|
|
|
+ enterpriseInfo.setAddress(address);
|
|
|
+ enterpriseInfo.setContactsPersonId(contactsPersonId);
|
|
|
+ enterpriseInfo.setContactsPhone(contactsPhone);
|
|
|
+ enterpriseInfo.setCheckTime(new Date());//认证时间
|
|
|
+
|
|
|
+ enterpriseInfoService.update(enterpriseInfo);
|
|
|
+ }else{
|
|
|
+ enterpriseInfo = new EnterpriseInfo();
|
|
|
+ enterpriseInfo.setId(UUID.randomUUID().toString());
|
|
|
+ enterpriseInfo.setDelFlag(false);
|
|
|
+ enterpriseInfo.setCreateBy(subject);
|
|
|
+ enterpriseInfo.setCreateTime(new Date());
|
|
|
+ enterpriseInfo.setLicenseImage(licenseUrl);
|
|
|
+ enterpriseInfo.setName(enterpriseName);
|
|
|
+ enterpriseInfo.setStatus("0");
|
|
|
+ enterpriseInfo.setAddress(address);
|
|
|
+ enterpriseInfo.setContactsPersonId(contactsPersonId);
|
|
|
+ enterpriseInfo.setContactsPhone(contactsPhone);
|
|
|
+ enterpriseInfo.setCheckTime(new Date());//认证时间
|
|
|
+
|
|
|
+ int count = enterpriseInfoService.insert(enterpriseInfo);
|
|
|
+
|
|
|
+ if(count> 0) {
|
|
|
+ personInfo.setEnterpriseId(enterpriseInfo.getId());
|
|
|
+ personInfoService.update(personInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
}else{
|
|
|
EnterpriseInfo enterpriseInfo = new EnterpriseInfo();
|
|
|
enterpriseInfo.setId(UUID.randomUUID().toString());
|