|
@@ -4,6 +4,7 @@ import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -35,9 +36,10 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
|
|
|
private OrganizationFacade organizationFacade;
|
|
|
|
|
|
/**
|
|
|
- * @Description:用户认证
|
|
|
- * @author: zhaops
|
|
|
- * @time: 2018/9/13 19:30
|
|
|
+ * 用户认证
|
|
|
+ *
|
|
|
+ * @param userAuthenticationVO
|
|
|
+ * @return
|
|
|
*/
|
|
|
public UserAuthenticationDTO userAuthentication(UserAuthenticationVO userAuthenticationVO) {
|
|
|
UserAuthenticationDTO userAuthenticationDTO = new UserAuthenticationDTO();
|
|
@@ -76,7 +78,10 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
|
|
|
organizationFacade.updateById(organization);
|
|
|
|
|
|
//更新验证信息
|
|
|
- UserAuthentication userAuthentication = this.getByUserId(userId);
|
|
|
+ QueryWrapper<UserAuthentication> qw = new QueryWrapper<>();
|
|
|
+ qw.eq("user_id", userId);
|
|
|
+ qw.eq("is_deleted", "N");
|
|
|
+ UserAuthentication userAuthentication = this.getOne(qw);
|
|
|
if (userAuthentication == null) {
|
|
|
userAuthentication = new UserAuthentication();
|
|
|
userAuthentication.setCreator(userId.toString());
|
|
@@ -102,15 +107,18 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @Description:获取用户认证信息
|
|
|
- * @author: zhaops
|
|
|
- * @time: 2018/9/13 19:30
|
|
|
+ * 获取待认证用户信息
|
|
|
+ *
|
|
|
+ * @return
|
|
|
*/
|
|
|
public UserAuthenticationDTO getuserAuthenticationInfo() {
|
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
|
User user = userFacade.getById(userId);
|
|
|
Organization organization = organizationFacade.getByUserId(userId);
|
|
|
- UserAuthentication userAuthentication = this.getByUserId(userId);
|
|
|
+ QueryWrapper<UserAuthentication> qw = new QueryWrapper<>();
|
|
|
+ qw.eq("user_id", userId);
|
|
|
+ qw.eq("is_deleted", "N");
|
|
|
+ UserAuthentication userAuthentication = this.getOne(qw);
|
|
|
UserAuthenticationDTO userAuthenticationDTO = new UserAuthenticationDTO();
|
|
|
userAuthenticationDTO.setUser(user);
|
|
|
userAuthenticationDTO.setOrganization(organization);
|
|
@@ -124,32 +132,22 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @Description:获取用户认证状态
|
|
|
- * @author: zhaops
|
|
|
- * @time: 2018/9/13 19:30
|
|
|
+ * 获取用户认证状态
|
|
|
+ *
|
|
|
+ * @return
|
|
|
*/
|
|
|
public Map<Integer, Object> getUserAuthenticationStatus() {
|
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
|
- UserAuthentication userAuthentication = this.getByUserId(userId);
|
|
|
+ QueryWrapper<UserAuthentication> qw = new QueryWrapper<>();
|
|
|
+ qw.eq("user_id", userId);
|
|
|
+ qw.eq("is_deleted", "N");
|
|
|
+ UserAuthentication userAuthentication = this.getOne(qw);
|
|
|
Map<Integer, Object> map = new HashMap<>();
|
|
|
if (userAuthentication == null) {
|
|
|
map.put(99, "当前用户没有认证信息");
|
|
|
} else {
|
|
|
Integer status = userAuthentication.getStatus();
|
|
|
String statusName = AuthStatusEnum.getName(status);
|
|
|
-// switch (status) {
|
|
|
-// case 0:
|
|
|
-// statusName = AuthStatusEnum.Unauthorized.getName();
|
|
|
-// break;
|
|
|
-// case 1:
|
|
|
-// statusName = AuthStatusEnum.Authorized.getName();
|
|
|
-// break;
|
|
|
-// case 2:
|
|
|
-// statusName = AuthStatusEnum.Authorizing.getName();
|
|
|
-// break;
|
|
|
-// default:
|
|
|
-// break;
|
|
|
-// }
|
|
|
map.put(status, statusName);
|
|
|
}
|
|
|
return map;
|
|
@@ -157,11 +155,15 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
|
|
|
|
|
|
/**
|
|
|
* 控制台-获取用户账号的认证进度
|
|
|
+ *
|
|
|
* @return 包含当前账号的认证状态
|
|
|
*/
|
|
|
public QueryAuthProgressDTO queryAuthProgress() {
|
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
|
- UserAuthentication userAuthentication = this.getByUserId(userId);
|
|
|
+ QueryWrapper<UserAuthentication> qw = new QueryWrapper<>();
|
|
|
+ qw.eq("user_id", userId);
|
|
|
+ qw.eq("is_deleted", "N");
|
|
|
+ UserAuthentication userAuthentication = this.getOne(qw);
|
|
|
|
|
|
QueryAuthProgressDTO queryAuthProgressDTO = new QueryAuthProgressDTO();
|
|
|
queryAuthProgressDTO.setStatus(userAuthentication.getStatus());
|
|
@@ -170,14 +172,15 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
|
|
|
|
|
|
return queryAuthProgressDTO;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 控制台-获取待认证的账号数量
|
|
|
+ *
|
|
|
* @return 待认证的账号个数
|
|
|
*/
|
|
|
- public WaitAuthenDTO waitAuthen(){
|
|
|
- WaitAuthenDTO waitAuthenDTO = new WaitAuthenDTO();
|
|
|
- waitAuthenDTO.setCount(baseMapper.getAllWaitAuthCou());
|
|
|
- return waitAuthenDTO;
|
|
|
+ public WaitAuthenDTO waitAuthen() {
|
|
|
+ WaitAuthenDTO waitAuthenDTO = new WaitAuthenDTO();
|
|
|
+ waitAuthenDTO.setCount(baseMapper.getAllWaitAuthCou());
|
|
|
+ return waitAuthenDTO;
|
|
|
}
|
|
|
}
|