|
|
@@ -129,6 +129,20 @@ public class UserSpaceServiceImpl implements UserSpaceService {
|
|
|
throw new ValidationFailedException(String.format("UU%d对应企业不存在", spaceInfo.getSpaceUU()));
|
|
|
}
|
|
|
|
|
|
+ if (!spaceInfo.getSpaceName().equals(userspace.getSpaceName())) {
|
|
|
+ Userspace oldSpace = userspaceDao.findBySpaceName(spaceInfo.getSpaceName());
|
|
|
+ if (oldSpace != null) {
|
|
|
+ throw new ValidationFailedException(String.format("企业名称'%s'已被注册,请确认 ", spaceInfo.getSpaceName()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!spaceInfo.getBusinessCode().equals(userspace.getBusinessCode())) {
|
|
|
+ Userspace oldSpace = userspaceDao.findByBusinessCode(spaceInfo.getBusinessCode());
|
|
|
+ if (oldSpace != null) {
|
|
|
+ throw new ValidationFailedException(String.format("企业营业执照号'%s'已被注册,请确认 ", spaceInfo.getBusinessCode()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (StringUtils.isEmpty(spaceInfo.getBusinessCode())) {
|
|
|
// 避免清空营业执照因唯一性约束导致报错
|
|
|
spaceInfo.setBusinessCode(null);
|