|
@@ -59,12 +59,14 @@ import com.diagbot.vo.UserExportVO;
|
|
|
import com.diagbot.vo.UserInfoAuditVO;
|
|
|
import com.diagbot.vo.UserInfoOrganizationsVO;
|
|
|
import com.diagbot.vo.UserSaveVO;
|
|
|
+import com.diagbot.vo.UsernameVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.crypto.factory.PasswordEncoderFactories;
|
|
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
|
|
import org.springframework.security.oauth2.common.OAuth2AccessToken;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.Serializable;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
@@ -72,8 +74,6 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-
|
|
|
/**
|
|
|
* @Description: 用户业务层
|
|
|
* @author: gaodm
|
|
@@ -143,6 +143,28 @@ public class UserFacade extends UserServiceImpl {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 校验用户(手机号)是否注册
|
|
|
+ *
|
|
|
+ * @param usernameVO 参数
|
|
|
+ * @return 返回状态
|
|
|
+ */
|
|
|
+ public Boolean verifyUser(UsernameVO usernameVO) {
|
|
|
+ String username = usernameVO.getUsername();
|
|
|
+ if(StringUtil.isEmpty(username)) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请输入手机号");
|
|
|
+ }
|
|
|
+ if(!RegexValidateUtil.checkMobileNumber(username)) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请输入正确的手机号");
|
|
|
+ }
|
|
|
+ User bean = findByName(username);
|
|
|
+ if (bean != null) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该手机已注册");
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* @param page 分页参数
|
|
|
* @param userSaveVO 参数
|