|
|
@@ -14,8 +14,10 @@ import org.springframework.util.Assert;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import com.goafanti.business.service.JtBusinessService;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.BaseApiController;
|
|
|
@@ -85,6 +87,9 @@ public class UserApiController extends BaseApiController {
|
|
|
private UserContactService userContactService;
|
|
|
@Autowired
|
|
|
private EasemobUtils easemobUtils;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private JtBusinessService jtBusinessService;
|
|
|
|
|
|
private static final Integer STEP_ONE = 1;
|
|
|
|
|
|
@@ -515,18 +520,11 @@ public class UserApiController extends BaseApiController {
|
|
|
UserIdentityFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
return res;
|
|
|
}
|
|
|
- if(StringUtils.isBlank(organizationIdentity.getUid())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "用户ID"));
|
|
|
+ res=validation(organizationIdentity, res);
|
|
|
+ if (!res.getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
- if(organizationIdentity.getAuthentication() == UserAuthentication.AUTHENTICATION.getCode()
|
|
|
- && organizationIdentity.getType() == UserType.PERSONAL.getCode()){
|
|
|
- res.getError().add(buildError(null, "", "用户已经个人认证"));
|
|
|
- return res;
|
|
|
- }else if(organizationIdentity.getAuthentication() == UserAuthentication.UN_AUTHENTICATION.getCode()){
|
|
|
- organizationIdentity.setType(UserType.ORGANIZATION.getCode());
|
|
|
- organizationIdentity.setAuthentication(UserAuthentication.AUTHENTICATION.getCode());
|
|
|
- }
|
|
|
+
|
|
|
if (res.getError().isEmpty()) {
|
|
|
OrganizationIdentity oi = new OrganizationIdentity();
|
|
|
User user = new User();
|
|
|
@@ -547,6 +545,50 @@ public class UserApiController extends BaseApiController {
|
|
|
res.setData(organizationIdentity);
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ private Result validation(InputOrganizationIdentity organizationIdentity, Result res) {
|
|
|
+ if(StringUtils.isBlank(organizationIdentity.getUid())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "用户ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(StringUtils.isBlank(organizationIdentity.getQq())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "QQ"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(StringUtils.isBlank(organizationIdentity.getIdentifyName())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "单位名称"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(StringUtils.isBlank(organizationIdentity.getCompanyLogoUrl())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "LOGO"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(StringUtils.isBlank(organizationIdentity.getBusinessScope())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "业务范围"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(StringUtils.isBlank(organizationIdentity.getIntroduction())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "单位简介"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(StringUtils.isBlank(organizationIdentity.getHonorPicture())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "荣誉资质"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(null==organizationIdentity.getLicenceProvince()||null==organizationIdentity.getLicenceCity()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "地区"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(organizationIdentity.getAuthentication() == UserAuthentication.AUTHENTICATION.getCode()
|
|
|
+ && organizationIdentity.getType() == UserType.PERSONAL.getCode()){
|
|
|
+ res.getError().add(buildError(null, "", "用户已经个人认证"));
|
|
|
+ return res;
|
|
|
+ }else if(organizationIdentity.getAuthentication() == UserAuthentication.UN_AUTHENTICATION.getCode()){
|
|
|
+ organizationIdentity.setType(UserType.ORGANIZATION.getCode());
|
|
|
+ organizationIdentity.setAuthentication(UserAuthentication.AUTHENTICATION.getCode());
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 个人资料/团体会员资料
|
|
|
@@ -914,4 +956,6 @@ public class UserApiController extends BaseApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
}
|