|
|
|
@ -6,6 +6,7 @@ import cn.estsh.i3plus.core.api.iservice.busi.ISysRoleService;
|
|
|
|
|
import cn.estsh.i3plus.core.apiservice.util.HqlModelPack;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.StringTool;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.PagerHelper;
|
|
|
|
@ -17,7 +18,6 @@ import cn.estsh.i3plus.pojo.model.platform.UserDetailModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.repository.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.wms.sqlpack.WmsHqlPack;
|
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
|
|
|
|
@ -97,13 +97,13 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public SysUser saveSysUser(SysUser user) {
|
|
|
|
|
LOGGER.debug("平台账号 SysUser user:{}", user);
|
|
|
|
|
LOGGER.info("平台账号 SysUser user:{}", user);
|
|
|
|
|
return userRDao.save(user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public SysUserInfo saveSysUserInfo(SysUserInfo info) {
|
|
|
|
|
LOGGER.debug("平台用户 SysUserInfo info:{}", info);
|
|
|
|
|
LOGGER.info("平台用户 SysUserInfo info:{}", info);
|
|
|
|
|
return userInfoRDao.save(info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -114,7 +114,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void updateSysUserOrganize(Long userId, Long organizeId) {
|
|
|
|
|
LOGGER.debug("平台账号 SysUser userId:{} organizeId",userId, organizeId);
|
|
|
|
|
LOGGER.info("平台账号 SysUser userId:{} organizeId",userId, organizeId);
|
|
|
|
|
SysUser user = userRDao.getById(userId);
|
|
|
|
|
if(user != null){
|
|
|
|
|
user.setOrganizeId(organizeId);
|
|
|
|
@ -125,7 +125,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "删除账号信息")
|
|
|
|
|
public void deleteSysUser(Long[] userIdList,String userName) {
|
|
|
|
|
LOGGER.debug("平台账号 SysUser userIdList:{}", userIdList);
|
|
|
|
|
LOGGER.info("平台账号 SysUser userIdList:{}", userIdList);
|
|
|
|
|
// 删除账号信息
|
|
|
|
|
userRDao.updateValidStatusByPropertyIn("id", userIdList,CommonEnumUtil.IS_VAILD.INVAILD.getValue(), userName);
|
|
|
|
|
|
|
|
|
@ -137,7 +137,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "删除用户信息")
|
|
|
|
|
public void deleteSysUserInfo(Long[] infoIdList,String userName) {
|
|
|
|
|
LOGGER.debug("平台用户 SysUserInfo infoIdList:{}", infoIdList);
|
|
|
|
|
LOGGER.info("平台用户 SysUserInfo infoIdList:{}", infoIdList);
|
|
|
|
|
// 删除用户信息
|
|
|
|
|
userInfoRDao.updateValidStatusByPropertyIn("id", infoIdList,CommonEnumUtil.IS_VAILD.INVAILD.getValue(), userName);
|
|
|
|
|
|
|
|
|
@ -153,7 +153,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysUser> findSysUserByIds(Long[] ids) {
|
|
|
|
|
LOGGER.debug("平台用户 SysUserInfo ids:{}", ids);
|
|
|
|
|
LOGGER.info("平台用户 SysUserInfo ids:{}", ids);
|
|
|
|
|
|
|
|
|
|
String infoWhere = CoreHqlPack.packHqlIds("id", ids);
|
|
|
|
|
return userRDao.findByHqlWhere(infoWhere);
|
|
|
|
@ -161,7 +161,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysUser> querySysUserByUserDetailModelOrIds(UserDetailModel model, List<Long> ids) {
|
|
|
|
|
LOGGER.debug("平台用户 SysUser model:{} ids:{}", model, ids);
|
|
|
|
|
LOGGER.info("平台用户 SysUser model:{} ids:{}", model, ids);
|
|
|
|
|
String modeWhere = HqlModelPack.packHqlSysUserByModelOrIds(model, ids);
|
|
|
|
|
|
|
|
|
|
return userRDao.findByHqlWhere(modeWhere);
|
|
|
|
@ -170,7 +170,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "查询账号信息")
|
|
|
|
|
public ListPager<SysUser> querySysUserPagerByUserDetailModelOrIds(UserDetailModel model,Pager pager, List<Long> ids) {
|
|
|
|
|
LOGGER.debug("平台用户 SysUser model:{} ids:{}", model, ids);
|
|
|
|
|
LOGGER.info("平台用户 SysUser model:{} ids:{}", model, ids);
|
|
|
|
|
String modeWhere = HqlModelPack.packHqlSysUserByModelOrIds(model, ids);
|
|
|
|
|
|
|
|
|
|
pager = PagerHelper.getPager(pager, userRDao.findByHqlWhereCount(modeWhere));
|
|
|
|
@ -199,7 +199,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public SessionUser queryUserLogin(String userName, String password, String languageCode) {
|
|
|
|
|
LOGGER.debug("平台用户 SYS_USER loginName:{} \t password:{} \t languageCode:{}", userName, password, languageCode);
|
|
|
|
|
LOGGER.info("平台用户 SYS_USER loginName:{} \t password:{} \t languageCode:{}", userName, password, languageCode);
|
|
|
|
|
UserToken token = new UserToken(userName,password,languageCode);
|
|
|
|
|
SessionUser sessionUser = AuthUtil.login(token);
|
|
|
|
|
AuthUtil.setSessionUser(sessionUser);
|
|
|
|
@ -214,7 +214,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysUserInfo> findSysUserInfoByIds(Long[] ids) {
|
|
|
|
|
LOGGER.debug("平台用户 SysUserInfo ids:{}", ids);
|
|
|
|
|
LOGGER.info("平台用户 SysUserInfo ids:{}", ids);
|
|
|
|
|
|
|
|
|
|
String infoWhere = CoreHqlPack.packHqlIds("id", ids);
|
|
|
|
|
return userInfoRDao.findByHqlWhere(infoWhere);
|
|
|
|
@ -222,13 +222,33 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysRefUserRole> findSysRefUserRoleById(Long userId) {
|
|
|
|
|
LOGGER.debug("平台账号角色 SysRefUserRole userId:{}", userId);
|
|
|
|
|
LOGGER.info("平台账号角色 SysRefUserRole userId:{}", userId);
|
|
|
|
|
return refUserRoleRDao.findByProperty("userId",userId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysRefUserDepartment> findSysRefUserDepartmentById(Long userId) {
|
|
|
|
|
LOGGER.debug("平台账号部门 SysRefUserDepartment userId:{}", userId);
|
|
|
|
|
public List<SysRole> findSysRoleByUserId(Long userId) {
|
|
|
|
|
LOGGER.debug("平台账号角色 SysRole userId:{}", userId);
|
|
|
|
|
|
|
|
|
|
List<SysRefUserRole> refList = findSysRefUserRoleById(userId);
|
|
|
|
|
if(refList != null && refList.size() > 0){
|
|
|
|
|
List<Long> idList = new ArrayList<>();
|
|
|
|
|
StringBuffer findWhere = new StringBuffer();
|
|
|
|
|
refList.forEach(ref -> idList.add(ref.getRoleId()));
|
|
|
|
|
|
|
|
|
|
HqlPack.getInPack(StringUtils.join(idList,","),"id",findWhere);
|
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(),"isDeleted",findWhere);
|
|
|
|
|
HqlPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(),"isValid",findWhere);
|
|
|
|
|
|
|
|
|
|
return roleRDao.findByHqlWhere(findWhere.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysRefUserDepartment> findSysRefUserDepartmentByUserId(Long userId) {
|
|
|
|
|
LOGGER.info("平台账号部门 SysRefUserDepartment userId:{}", userId);
|
|
|
|
|
return refUserDepartmentRDao.findByProperty("userId",userId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -252,14 +272,14 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysRefUserInfoDepartment> findSysRefUserInfoDepartmentById(Long infoId) {
|
|
|
|
|
LOGGER.debug("平台用户部门关系 SysRefUserInfoDepartment infoId:{}", infoId);
|
|
|
|
|
LOGGER.info("平台用户部门关系 SysRefUserInfoDepartment infoId:{}", infoId);
|
|
|
|
|
return refUserInfoDepartmentRDao.findByProperty("userId",infoId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "查询用户部门关系")
|
|
|
|
|
public List<SysDepartment> findSysUserInfoDepartmentByInfoId(Long infoId) {
|
|
|
|
|
LOGGER.debug("平台用户部门 SysDepartment infoId:{}", infoId);
|
|
|
|
|
LOGGER.info("平台用户部门 SysDepartment infoId:{}", infoId);
|
|
|
|
|
List<SysDepartment> result = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
List<SysRefUserInfoDepartment> refs = findSysRefUserInfoDepartmentById(infoId);
|
|
|
|
@ -277,10 +297,10 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "查询账号部门关系")
|
|
|
|
|
public List<SysDepartment> findSysUserDepartmentByInfoId(Long infoId) {
|
|
|
|
|
LOGGER.debug("平台用户部门 SysDepartment infoId:{}", infoId);
|
|
|
|
|
LOGGER.info("平台用户部门 SysDepartment infoId:{}", infoId);
|
|
|
|
|
List<SysDepartment> result = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
List<SysRefUserDepartment> refs = findSysRefUserDepartmentById(infoId);
|
|
|
|
|
List<SysRefUserDepartment> refs = findSysRefUserDepartmentByUserId(infoId);
|
|
|
|
|
if(refs != null && refs.size() > 0){
|
|
|
|
|
Long[] ids = new Long[refs.size()];
|
|
|
|
|
for (int i = 0; i < refs.size(); i++) {
|
|
|
|
@ -293,8 +313,16 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysDepartment> findSysUserDepartmentList() {
|
|
|
|
|
LOGGER.info("平台用户部门 SysOrganize Find All");
|
|
|
|
|
return departmentRDao.findByProperty(
|
|
|
|
|
new String[]{"isDeleted","isValid"},
|
|
|
|
|
new Object[]{CommonEnumUtil.IS_DEAL.NO.getValue(),CommonEnumUtil.IS_VAILD.VAILD.getValue()});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysOrganize> findSysUserInfoOrganize(Long infoId) {
|
|
|
|
|
LOGGER.debug("平台用户部门 SysDepartment infoId:{}", infoId);
|
|
|
|
|
LOGGER.info("平台用户部门 SysDepartment infoId:{}", infoId);
|
|
|
|
|
List<SysOrganize> result = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
List<SysRefUserInfoDepartment> refs = findSysRefUserInfoDepartmentById(infoId);
|
|
|
|
@ -311,10 +339,10 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysOrganize> findSysUserOrganize(Long infoId) {
|
|
|
|
|
LOGGER.debug("平台用户部门 SysDepartment infoId:{}", infoId);
|
|
|
|
|
LOGGER.info("平台用户部门 SysOrganize infoId:{}", infoId);
|
|
|
|
|
List<SysOrganize> result = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
List<SysRefUserDepartment> refs = findSysRefUserDepartmentById(infoId);
|
|
|
|
|
List<SysRefUserDepartment> refs = findSysRefUserDepartmentByUserId(infoId);
|
|
|
|
|
if(refs != null && refs.size() > 0){
|
|
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
|
|
refs.forEach(ref -> {
|
|
|
|
@ -329,8 +357,24 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysOrganize> findSysOrganizeList() {
|
|
|
|
|
LOGGER.info("平台用户组织 SysOrganize Find All");
|
|
|
|
|
return organizeRDao.findByProperty(
|
|
|
|
|
new String[]{"isDeleted","isValid"},
|
|
|
|
|
new Object[]{CommonEnumUtil.IS_DEAL.NO.getValue(),CommonEnumUtil.IS_VAILD.VAILD.getValue()});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysPosition> findSysPositionList() {
|
|
|
|
|
LOGGER.info("平台用户岗位 SysOrganize Find All");
|
|
|
|
|
return positionRDao.findByProperty(
|
|
|
|
|
new String[]{"isDeleted","isValid"},
|
|
|
|
|
new Object[]{CommonEnumUtil.IS_DEAL.NO.getValue(),CommonEnumUtil.IS_VAILD.VAILD.getValue()});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SysRefUserPosition> findSysRefUserPositionById(Long infoId) {
|
|
|
|
|
LOGGER.debug("平台用户岗位 SysRefUserPosition infoId:{}", infoId);
|
|
|
|
|
LOGGER.info("平台用户岗位 SysRefUserPosition infoId:{}", infoId);
|
|
|
|
|
return refUserPositionRDao.findByProperty("userId",infoId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -387,7 +431,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
@Override
|
|
|
|
|
@ApiOperation(value = "重置密码检查")
|
|
|
|
|
public Integer checkSysUserResetPassword(SysUser user) {
|
|
|
|
|
LOGGER.debug("平台用户岗位 SysUser user:{}", user);
|
|
|
|
|
LOGGER.info("平台用户岗位 SysUser user:{}", user);
|
|
|
|
|
Integer num = 0;
|
|
|
|
|
if(user != null){
|
|
|
|
|
String day = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.format(new Date());
|
|
|
|
@ -410,7 +454,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void checkSysPositionRef(Long positionId) {
|
|
|
|
|
LOGGER.debug("平台岗位 SysPosition positionId:{}", positionId);
|
|
|
|
|
LOGGER.info("平台岗位 SysPosition positionId:{}", positionId);
|
|
|
|
|
|
|
|
|
|
if(positionId != null){
|
|
|
|
|
List<SysPosition> positionList = positionRDao.findByProperty("parentId", positionId);
|
|
|
|
@ -445,7 +489,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void checkSysDepartmentRef(Long departmentId) {
|
|
|
|
|
LOGGER.debug("平台部门 SysDepartment departmentId:{}", departmentId);
|
|
|
|
|
LOGGER.info("平台部门 SysDepartment departmentId:{}", departmentId);
|
|
|
|
|
|
|
|
|
|
if(departmentId != null){
|
|
|
|
|
List<SysDepartment> departmentList = departmentRDao.findByProperty("parentId", departmentId);
|
|
|
|
@ -490,7 +534,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void checkSysOrganizeRef(Long organizeId) {
|
|
|
|
|
LOGGER.debug("平台部门 SysOrganize organizeId:{}", organizeId);
|
|
|
|
|
LOGGER.info("平台部门 SysOrganize organizeId:{}", organizeId);
|
|
|
|
|
|
|
|
|
|
if(organizeId != null){
|
|
|
|
|
List<SysOrganize> organizeList = organizeRDao.findByProperty("parentId", organizeId);
|
|
|
|
@ -547,7 +591,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void checkSysUserPassword(String password) {
|
|
|
|
|
LOGGER.debug("平台用户 SysUser password:{}", password);
|
|
|
|
|
LOGGER.info("平台用户 SysUser password:{}", password);
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(password)){
|
|
|
|
|
// 密码长度校验
|
|
|
|
@ -763,7 +807,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void refreshRefSysUserRole(Long userId, Long[] roleIds) {
|
|
|
|
|
LOGGER.debug("账号角色关系信息 RefSysUserRole userId:{} roleIds:{} ", userId,roleIds);
|
|
|
|
|
LOGGER.info("账号角色关系信息 RefSysUserRole userId:{} roleIds:{} ", userId,roleIds);
|
|
|
|
|
SysUser user = userRDao.getById(userId);
|
|
|
|
|
if(user != null){
|
|
|
|
|
// 根据IDS 查询所有的角色信息
|
|
|
|
@ -801,7 +845,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void refreshUpdateSysRoleRdd(Long roleId) {
|
|
|
|
|
LOGGER.debug("角色信息 RefSysUserRole roleId:{}", roleId);
|
|
|
|
|
LOGGER.info("角色信息 RefSysUserRole roleId:{}", roleId);
|
|
|
|
|
if(roleId != null){
|
|
|
|
|
SysRole role = roleRDao.getById(roleId);
|
|
|
|
|
if(role != null){
|
|
|
|
|