|
|
|
@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -65,6 +66,12 @@ public class SysUserService implements ISysUserService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private SysFileRepository sysFileRDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private SysDepartmentRepository sysDepartmentRDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private SysPositionRepository sysPositionRDao;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public SessionUser queryUserLogin(String loginName, String password, String languageCode) throws AuthenticationException {
|
|
|
|
|
LOGGER.debug("平台用户 SYS_USER loginName:{} \t password:{} \t languageCode:{}", loginName, password, languageCode);
|
|
|
|
@ -388,17 +395,14 @@ public class SysUserService implements ISysUserService {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public void packSysUserDepartment(SessionUser sessionUser, SysUserInfo userInfo){
|
|
|
|
|
List<SysDepartment> list = null;
|
|
|
|
|
try {
|
|
|
|
|
LOGGER.debug("平台用户 SYS_USER user id :{}", userInfo.getId());
|
|
|
|
|
|
|
|
|
|
list = userPermissionDao.findDepartmentByUser(userInfo);
|
|
|
|
|
userInfo.setDepartmentList(userPermissionDao.findDepartmentByUser(userInfo));
|
|
|
|
|
userInfo.setDepartment(sysDepartmentRDao.getById(userInfo.getDepartmentId()));
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
LOGGER.error(" SysUser Peck Department information Error userId : {} Exception Message : {} " ,userInfo.getId(),e.getMessage());
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
userInfo.setDepartmentList(list);
|
|
|
|
|
sessionUser.setUserInfo(userInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -408,17 +412,14 @@ public class SysUserService implements ISysUserService {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public void packSysUserPosition(SessionUser sessionUser, SysUserInfo userInfo){
|
|
|
|
|
List<SysPosition> list = null;
|
|
|
|
|
try {
|
|
|
|
|
LOGGER.debug("平台用户 SYS_USER user id :{}", userInfo.getId());
|
|
|
|
|
|
|
|
|
|
list = userPermissionDao.findPositionByUser(userInfo);
|
|
|
|
|
userInfo.setPositionList(userPermissionDao.findPositionByUser(userInfo));
|
|
|
|
|
userInfo.setPosition(sysPositionRDao.getById(userInfo.getPositionId()));
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
LOGGER.error(" SysUser Peck Position information Error userId : {} Exception Message : {} " ,userInfo.getId(),e.getMessage());
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
userInfo.setPositionList(list);
|
|
|
|
|
sessionUser.setUserInfo(userInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -428,16 +429,25 @@ public class SysUserService implements ISysUserService {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public void packSysUserOrganize(SessionUser sessionUser, SysUserInfo userInfo){
|
|
|
|
|
SysOrganize organize = null;
|
|
|
|
|
try {
|
|
|
|
|
LOGGER.debug("平台用户 SYS_USER user id :{}", userInfo.getId());
|
|
|
|
|
userInfo.setOrganize(organizeRDao.getById(userInfo.getOrganizeId()));
|
|
|
|
|
|
|
|
|
|
List<SysDepartment> departmentList = userInfo.getDepartmentList();
|
|
|
|
|
if(departmentList != null && departmentList.size() > 0){
|
|
|
|
|
Long[] ids = new Long[departmentList.size()];
|
|
|
|
|
for (int i = 0; i < departmentList.size(); i++) {
|
|
|
|
|
ids[i] = departmentList.get(i).getOrganizeId();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
organize = organizeRDao.getById(userInfo.getOrganizeId());
|
|
|
|
|
String hqlWhere = CoreHqlPack.packHqlIds("id", ids);
|
|
|
|
|
List<SysOrganize> organizeList = organizeRDao.findByHqlWhere(hqlWhere);
|
|
|
|
|
|
|
|
|
|
userInfo.setOrganizeList(organizeList);
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
LOGGER.error(" SysUser Peck Organize information Error userId : {} Exception Message : {} " ,userInfo.getId(),e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
userInfo.setOrganize(organize);
|
|
|
|
|
sessionUser.setUserInfo(userInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|