Commit 463299f6 authored by 赵啸非's avatar 赵啸非

修改构建api文档

parent 7d08bfd6
......@@ -96,7 +96,7 @@ public class AuthTokenService {
* @return 令牌
*/
public String createToken(UserEntity user) {
String token = IdUtil.fastUUID();
String token = IdUtil.fastSimpleUUID();
user.setToken(token);
refreshToken(user);
Map<String, Object> claims = new HashMap<>();
......
package com.mortals.xhx.base.system.user.model;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.model.model.ModelEntity;
import lombok.Data;
import java.util.List;
/**
*
* Description:User
......@@ -28,4 +31,9 @@ public class UserEntityExt extends BaseEntityLong {
* 过期时间
*/
private Long expireTime;
private List<ModelEntity> modleList;
}
\ No newline at end of file
......@@ -37,7 +37,7 @@ public interface UserService extends ICRUDService<UserEntity,Long> {
* @return
* @throws AppException
*/
public UserEntity doLogin(String loginName, String password, String loginIp) throws AppException;
UserEntity doLogin(String loginName, String password, String loginIp) throws AppException;
/**
* 校验用户名与密码是否正确
......@@ -47,7 +47,7 @@ public interface UserService extends ICRUDService<UserEntity,Long> {
* @return
* @throws AppException
*/
public UserEntity doCheckUser(String loginName, String password) throws AppException;
UserEntity doCheckUser(String loginName, String password) throws AppException;
/**
* 检查用户是否存在
......@@ -56,7 +56,7 @@ public interface UserService extends ICRUDService<UserEntity,Long> {
* @param userId 密码
* @return
*/
public boolean existUser(String loginName, Long userId) throws AppException;
boolean existUser(String loginName, Long userId) throws AppException;
/**
* 通过登录用户获取菜单功能权限
......@@ -64,7 +64,7 @@ public interface UserService extends ICRUDService<UserEntity,Long> {
* @param user
* @return
*/
public List<MenuEntity> findOutlookBarList(IUser user);
List<MenuEntity> findOutlookBarList(IUser user);
/**
* 查询用户所有有权限的菜单ID
......@@ -72,7 +72,7 @@ public interface UserService extends ICRUDService<UserEntity,Long> {
* @param userEntity
* @return
*/
public Set<Long> findAllAuthIds(UserEntity userEntity) throws AppException;
Set<Long> findAllAuthIds(UserEntity userEntity) throws AppException;
/**
* 查询用户记录
......@@ -84,7 +84,7 @@ public interface UserService extends ICRUDService<UserEntity,Long> {
* @return
* @throws AppException
*/
public Result<UserEntity> find(Long platformId, UserEntity params, int currPage, int prePageResult) throws AppException;
Result<UserEntity> find(Long platformId, UserEntity params, int currPage, int prePageResult) throws AppException;
/**
* 为客户创建用户
......@@ -99,7 +99,7 @@ public interface UserService extends ICRUDService<UserEntity,Long> {
* @return
* @throws AppException
*/
public UserEntity createUser(IUser currUser, Long customerId, String customerName, String loginName, String password,
UserEntity createUser(IUser currUser, Long customerId, String customerName, String loginName, String password,
String userName, String mobile) throws AppException;
/**
......@@ -111,5 +111,10 @@ public interface UserService extends ICRUDService<UserEntity,Long> {
* @return
* @throws AppException
*/
public boolean updateUserPwd(String loginName, String oldPwd, String newPwd) throws AppException;
boolean updateUserPwd(String loginName, String oldPwd, String newPwd) throws AppException;
}
\ No newline at end of file
......@@ -27,17 +27,25 @@ import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.module.model.model.ModelEntity;
import com.mortals.xhx.module.model.model.ModelQuery;
import com.mortals.xhx.module.model.service.ModelService;
import com.mortals.xhx.module.workman.model.WorkmanEntity;
import com.mortals.xhx.module.workman.model.WorkmanQuery;
import com.mortals.xhx.module.workman.service.WorkmanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* <p>Title: 用户信息</p>
* <p>Description: UserServiceImpl service接口 </p>
* <p>Copyright: Copyright &reg; </p>
* <p>Company: </p>
*
* @author
* @version 1.0.0
*/
......@@ -49,6 +57,11 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
private MenuService menuService;
@Autowired
private ResourceService resourceService;
@Autowired
private WorkmanService workmanServicel;
@Autowired
private ModelService modelService;
private void doHandlerUser(UserEntity entity) throws AppException {
if (StringUtils.isNotEmpty(entity.getLoginPwd())) {
......@@ -119,6 +132,16 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
} catch (Exception e) {
throw new AppException("密码验认出错!", e);
}
//查询是否关联了工作人员,并且关联的模块
WorkmanEntity workmanEntity = workmanServicel.selectOne(new WorkmanQuery().systemUserId(sysUser.getId()));
if (!ObjectUtils.isEmpty(workmanEntity)) {
List<Long> modleIdList = Arrays.asList(workmanEntity.getMobile().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
ModelQuery modelQuery = new ModelQuery();
modelQuery.setIdList(modleIdList);
List<ModelEntity> modelEntities = modelService.find(modelQuery);
sysUser.setModleList(modelEntities);
}
return sysUser;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment