|
|
|
@ -17,7 +17,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 +96,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 +113,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 +124,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 +136,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 +152,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 +160,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 +169,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 +198,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 +213,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 +221,13 @@ 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<SysRefUserDepartment> findSysRefUserDepartmentByUserId(Long userId) {
|
|
|
|
|
LOGGER.info("平台账号部门 SysRefUserDepartment userId:{}", userId);
|
|
|
|
|
return refUserDepartmentRDao.findByProperty("userId",userId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -252,14 +251,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 +276,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++) {
|
|
|
|
@ -294,7 +293,7 @@ public class PersonnelServiceService implements IPersonnelService {
|
|
|
|
|
|
|
|
|
|
@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 +310,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 +328,16 @@ 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<SysRefUserPosition> findSysRefUserPositionById(Long infoId) {
|
|
|
|
|
LOGGER.debug("平台用户岗位 SysRefUserPosition infoId:{}", infoId);
|
|
|
|
|
LOGGER.info("平台用户岗位 SysRefUserPosition infoId:{}", infoId);
|
|
|
|
|
return refUserPositionRDao.findByProperty("userId",infoId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -387,7 +394,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 +417,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 +452,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 +497,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 +554,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 +770,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 +808,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){
|
|
|
|
|