|
|
@@ -41,6 +41,7 @@ import com.goafanti.common.utils.TimeUtils;
|
|
|
import com.goafanti.common.utils.VerifyCodeUtils;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.easemob.EasemobUtils;
|
|
|
+import com.goafanti.user.bo.ExpertUserIdentity;
|
|
|
import com.goafanti.user.bo.InputOrgPro;
|
|
|
import com.goafanti.user.bo.InputOrganizationIdentity;
|
|
|
import com.goafanti.user.bo.InputOrganizationTech;
|
|
|
@@ -439,6 +440,56 @@ public class UserApiController extends BaseApiController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 更新专家信息
|
|
|
+ *
|
|
|
+ * @param userIdentity
|
|
|
+ * @param bindingResult
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/updateExpertDetail", method = RequestMethod.POST)
|
|
|
+ public Result updateExpertDetail(@Valid ExpertUserIdentity userIdentity, BindingResult bindingResult) {
|
|
|
+ Result res = new Result();
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ UserIdentityFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(StringUtils.isBlank(userIdentity.getUid())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "用户ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(userIdentity.getAuthentication().intValue() == UserAuthentication.AUTHENTICATION.getCode().intValue()
|
|
|
+ && userIdentity.getType().intValue() == UserType.ORGANIZATION.getCode().intValue()){
|
|
|
+ res.getError().add(buildError(null, "", "用户已经企业认证"));
|
|
|
+ return res;
|
|
|
+ }else if(userIdentity.getAuthentication().intValue() == UserAuthentication.UN_AUTHENTICATION.getCode().intValue()){
|
|
|
+ userIdentity.setType(UserType.PERSONAL.getCode());
|
|
|
+ userIdentity.setAuthentication(UserAuthentication.AUTHENTICATION.getCode());
|
|
|
+ }
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ UserIdentity ui = new UserIdentity();
|
|
|
+ User user = new User();
|
|
|
+ userIdentity.setExpert(1);//直接变为专家
|
|
|
+ BeanUtils.copyProperties(userIdentity, ui);
|
|
|
+ BeanUtils.copyProperties(userIdentity, user);
|
|
|
+ ui.setExpertAudit(2);//直接审核通过
|
|
|
+ UserIdentity u = userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId());
|
|
|
+ if (null == u) {
|
|
|
+ ui.setId(UUID.randomUUID().toString());
|
|
|
+ ui.setUid(TokenManager.getUserId());
|
|
|
+ userIdentityService.insert(ui);
|
|
|
+ } else {
|
|
|
+ ui.setId(u.getId());
|
|
|
+ userIdentityService.updateByPrimaryKeySelective(ui);
|
|
|
+ }
|
|
|
+ user.setId(TokenManager.getUserId());
|
|
|
+ userService.updateByPrimaryKeySelective(user);
|
|
|
+ }
|
|
|
+ res.setData(userIdentity);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 企业信息详情
|
|
|
* @return
|
|
|
*/
|