Browse Source

企业认证bug修复

wangmh 8 years ago
parent
commit
e3e2bae24f

+ 9 - 0
sso-server/src/main/java/com/uas/sso/controller/ValidController.java

@@ -9,6 +9,7 @@ import com.uas.sso.support.SystemSession;
 import com.uas.sso.util.ParameterUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.ui.ModelMap;
+import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -48,6 +49,9 @@ public class ValidController extends BaseController {
     public ModelMap submitSpaceInfo(Userspace userspace) throws Exception {
         // 获取认证的企业和申请者
         UserAccount loginUser = SystemSession.getUserAccount();
+        if (StringUtils.isEmpty(loginUser.getSpaceUU())) {
+            return error("您当前登录账号为个人账号,无法进行企业认证");
+        }
         Userspace validSpace = userspaceService.findOne(loginUser.getSpaceUU());
         User submitter = userService.findOne(loginUser.getUserUU());
 
@@ -67,6 +71,11 @@ public class ValidController extends BaseController {
         params.put("营业执照", businessCodeImage);
         ParameterUtils.checkEmptyParameter(params);
 
+        // 校验企业名称不能和其他企业重复
+        if (!validSpace.getSpaceName().equals(spaceName)) {
+            userspaceService.checkSpaceName(spaceName);
+        }
+
         // 将企业添加到待认证
         userspaceService.submitValidInfo(validSpace, userspace, submitter);