Merge remote-tracking branch 'upstream/test' into test

yun-zuoyi
castle.zang 3 years ago
commit 2624ca1974

@ -5,7 +5,7 @@
<parent>
<artifactId>i3plus-core</artifactId>
<groupId>i3plus.core</groupId>
<version>1.0-TEST-SNAPSHOT</version>
<version>1.0.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -19,6 +19,7 @@ public interface IPersonnelService {
/**
*
*
* @param user
* @return
*/
@ -27,6 +28,7 @@ public interface IPersonnelService {
/**
*
*
* @param info
* @return
*/
@ -34,22 +36,22 @@ public interface IPersonnelService {
SysUserInfo saveSysUserInfo(SysUserInfo info);
@ApiOperation(value = "更新用户状态")
void updateSysUserInfoStatus(Long userInfoId,Integer status);
void updateSysUserInfoStatus(Long userInfoId, Integer status);
@ApiOperation(value = "修改用户主组织信息")
void updateSysUserOrganize(Long userId, Long organizeId);
@ApiOperation(value = "删除账号信息")
void deleteSysUser(Long[] userIdList,String userName);
void deleteSysUser(Long[] userIdList, String userName);
@ApiOperation(value = "删除用户信息")
void deleteSysUserInfo(Long[] infoIdList,String userName);
void deleteSysUserInfo(Long[] infoIdList, String userName);
@ApiOperation(value = "获取账号信息")
SysUser getSysUserById(Long id);
@ApiOperation(value = "查询账号ID",notes = "根据部门ID 查询所有的人员信息")
List<Long> findSysUserIdByDepartmentId(Long ...departmentId);
@ApiOperation(value = "查询账号ID", notes = "根据部门ID 查询所有的人员信息")
List<Long> findSysUserIdByDepartmentId(Long... departmentId);
// @ApiOperation(value = "查询账号ID",notes = "根据组织代码 查询所有的人员信息")
// List<Long> findSysUserIdByOrganizeCode(String ...organizeCode);
@ -64,13 +66,13 @@ public interface IPersonnelService {
List<SysUser> querySysUserByUserDetailModelOrIds(UserDetailModel model, List<Long> ids);
@ApiOperation(value = "查询账号信息")
ListPager<SysUser> querySysUserPagerByUserDetailModelOrIds(UserDetailModel model,Pager pager, List<Long> ids);
ListPager<SysUser> querySysUserPagerByUserDetailModelOrIds(UserDetailModel model, Pager pager, List<Long> ids);
@ApiOperation(value = "获取用户信息")
SysUserInfo getSysUserInfoById(Long id);
@ApiOperation(value = "查询账号ID",notes = "根据部门ID 查询所有的人员信息")
List<Long> findSysUserInfoIdByDepartmentId(Long ...departmentId);
@ApiOperation(value = "查询账号ID", notes = "根据部门ID 查询所有的人员信息")
List<Long> findSysUserInfoIdByDepartmentId(Long... departmentId);
// @ApiOperation(value = "查询账号ID",notes = "根据组织代码 查询所有的人员信息")
// List<Long> findSysUserInfoIdByOrganizeCode(String ...organizeCode);
@ -87,43 +89,49 @@ public interface IPersonnelService {
@ApiOperation(value = "查询用户信息")
List<SysUserInfo> findSysUserInfoByIds(Long[] ids);
@ApiOperation(value = "查询角色",notes = "查询制定用户的角色信息")
@ApiOperation(value = "查询角色", notes = "查询制定用户的角色信息")
List<SysRole> findSysRoleByUserId(Long userId);
// @ApiOperation(value = "查询角色",notes = "查询所有角色信息")
// List<SysRole> findSysRoleList();
@ApiOperation(value = "查询权限",notes = "查询所有权限")
@ApiOperation(value = "查询权限", notes = "查询所有权限")
List<SysMenu> findSysMenuList();
@ApiOperation(value = "查询权限",notes = "查询所有权限")
@ApiOperation(value = "查询权限", notes = "查询所有权限")
List<SysMenu> findSysMenuByUserId(Long userId);
// @ApiOperation(value = "查询权限",notes = "查询所有权限")
// List<SysMenu> findSysMenuByIdList(List<Long> ids);
@ApiOperation(value = "查询权限",notes = "查询所有权限")
@ApiOperation(value = "查询权限", notes = "查询所有权限")
List<SysMenu> findSysMenuByRefRoleMenu(List<SysRefRoleMenu> refList);
@ApiOperation(value = "查询账号角色关系")
List<SysRefUserRole> findSysRefUserRole(Long userId);
@ApiOperation(value = "查询账号角色关系")
List<SysRefUserRole> findSysRefUserRole(Long roleId,String organizeCode);
List<SysRefUserRole> findSysRefUserRole(Long roleId, String organizeCode);
@ApiOperation(value = "查询账号角色关系")
List<SysRefUserRole> findSysRefUserRole(Long userId,Long roleId,String organizeCode);
List<SysRefUserRole> findSysRefUserRole(Long userId, Long roleId, String organizeCode);
@ApiOperation(value = "角色权限关系",notes = "根据角色ID 查询权限")
@ApiOperation(value = "角色权限关系", notes = "根据角色ID 查询权限")
List<SysRefRoleMenu> findSysRefRoleMenuByUserId(Long userId);
@ApiOperation(value = "角色权限关系",notes = "根据角色ID 查询权限")
@ApiOperation(value = "查询角色账号关系", notes = "查询角色账号关系")
ListPager<SysRefUserRole> findSysRefUserRoleByRoleIds(List<Long> roleIdList, Pager pager);
@ApiOperation(value = "查询人员拥有的角色信息", notes = "查询人员是否拥有对应角色")
List<SysRefUserRole> findSysRefUserRoleByRoleNameAndUserID(String roleName, Long userId);
@ApiOperation(value = "角色权限关系", notes = "根据角色ID 查询权限")
List<SysRefRoleMenu> findSysRefRoleMenuByRoleIds(List<Long> roleIdList);
@ApiOperation(value = "角色权限关系",notes = "根据角色ID 查询权限")
@ApiOperation(value = "角色权限关系", notes = "根据角色ID 查询权限")
List<SysRefRoleMenu> findSysRefRoleMenuByRole(List<SysRole> roleList);
@ApiOperation(value = "角色权限关系",notes = "根据角色ID 查询权限")
@ApiOperation(value = "角色权限关系", notes = "根据角色ID 查询权限")
List<SysRefRoleMenu> findSysRefRoleMenuByRefUserRole(List<SysRefUserRole> refList);
@ApiOperation(value = "查询账号部门关系")

@ -64,4 +64,13 @@ public interface ISysRoleService extends ICrudService<SysRole> {
*/
@ApiOperation(value = "查询符合条件的角色")
List<SysRole> findAllByBaseBean(SysRole sysRole);
/**
* sysRole
*
* @param sysRole
* @return
*/
@ApiOperation(value = "查询符合条件的角色")
List<SysRole> findAllByRoleProperty(SysRole sysRole);
}

@ -57,6 +57,15 @@ public interface ISysUserService {
void updateBatchSysUserStatus(Long[] ids, int status, SessionUser user);
/**
*
*
* @param userLoginNameList
* @param status
*/
@ApiOperation(value = "根据用户名批量修改账号状态", notes = "根据用户名批量修改账号状态")
void updateBatchSysUserStatusByUserLoginNames(List<String> userLoginNameList, int status);
/**
*
*
* @param sysUser

@ -5,7 +5,7 @@
<parent>
<artifactId>i3plus-core</artifactId>
<groupId>i3plus.core</groupId>
<version>1.0-TEST-SNAPSHOT</version>
<version>1.0.0.2</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -155,15 +155,18 @@ public class AuthController extends CoreBaseController {
*/
@GetMapping(value = "/menu/find-module-list/{parentId}")
@ApiOperation(value = "获取登录用户功能权限信息", notes = "获取首页权限信息")
public ResultBean findMenuModuleList(@PathVariable("parentId") String parentId) {
public ResultBean findMenuModuleList(@PathVariable("parentId") String parentId, Integer menuSort) {
try {
ValidatorBean.checkIsNumber(parentId, "父节点不能为空");
List<SysMenu> result = memTreeService.packTreeSysMenuByUserIdAndParentId(getSessionUser().getUser().getId(), Long.parseLong(parentId));
for (SysMenu sysMenu : result) {
sysMenu.setChildList(sysMenu.getChildList().stream().sorted(Comparator.comparing(SysMenu::getMenuSort)).collect(Collectors.toList()));
//如果menuSort为0,则不用通过menuSort字段进行排序
if (menuSort == null || menuSort != 0) {
for (SysMenu sysMenu : result) {
sysMenu.setChildList(sysMenu.getChildList().stream().sorted(Comparator.comparing(SysMenu::getMenuSort)).collect(Collectors.toList()));
}
result = result.stream().sorted(Comparator.comparing(SysMenu::getMenuSort)).collect(Collectors.toList());
}
result = result.stream().sorted(Comparator.comparing(SysMenu::getMenuSort)).collect(Collectors.toList());
result = sysMenuService.setLanguageSysMenuName(AuthUtil.getSessionUser().getLanguageCode(), result);
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(result);
} catch (ImppBusiException busExcep) {

@ -158,6 +158,24 @@ public class BackstageController extends CoreBaseController {
}
}
@GetMapping(value = "/license")
@ApiOperation(value = "获取授权信息", notes = "获取授权信息")
public ResultBean getLicense(){
try {
ImppLicense license = ImppLicenseTool.getLicense();
//icense.getMaturityDateTime() 可能从lockEndTime和licenseEndDateTime字段获取值
license.setMaturityDateTime(license.getMaturityDateTime());
ResultBean result = ResultBean.success("查询成功").setResultObject(license);
return result;
} catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep);
} catch (Exception e) {
return ResultBean.fail(e).setCode(ImppExceptionEnum.SYSTEM_EXCEPTION.getCode());
}
}
@GetMapping(value = "/update-clean-menu-soft-type")
@ApiOperation(value = "更新并清理功能软件模块数据", notes = "更新并清理功能软件模块数据")
public ResultBean updateCleanMenuSoftType(){

@ -4,8 +4,7 @@ import cn.estsh.i3plus.core.api.iservice.base.ISynchronizedService;
import cn.estsh.i3plus.core.api.iservice.base.ISystemInitService;
import cn.estsh.i3plus.core.api.iservice.base.ISystemLoginStrategyService;
import cn.estsh.i3plus.core.api.iservice.busi.*;
import cn.estsh.i3plus.core.apiservice.controller.busi.PersonnelController;
import cn.estsh.i3plus.core.apiservice.controller.busi.SysUserInfoController;
import cn.estsh.i3plus.core.apiservice.controller.busi.*;
import cn.estsh.i3plus.core.apiservice.util.SysUserPasswordUtil;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
@ -16,15 +15,16 @@ import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
import cn.estsh.i3plus.pojo.base.annotation.AnnoIgnoreLog;
import cn.estsh.i3plus.pojo.base.bean.BaseConstWords;
import cn.estsh.i3plus.pojo.base.bean.BaseThreadLocal;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.bean.*;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.model.common.CloudPagerModel;
import cn.estsh.i3plus.pojo.model.common.ImppSmsContent;
import cn.estsh.i3plus.pojo.model.license.ImppLicense;
import cn.estsh.i3plus.pojo.model.platform.SysLoginModel;
import cn.estsh.i3plus.pojo.model.platform.SysRoleModel;
import cn.estsh.i3plus.pojo.model.platform.UserDetailModel;
import cn.estsh.i3plus.pojo.model.platform.UserDetailPagerModel;
import cn.estsh.i3plus.pojo.platform.bean.*;
@ -33,6 +33,7 @@ import cn.estsh.impp.framework.base.controller.CoreBaseController;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.fileservice.ImppFileService;
import cn.estsh.impp.framework.boot.license.ImppLicenseTool;
import cn.estsh.impp.framework.boot.license.serviceimpl.ImppLicenseDecoder;
import cn.estsh.impp.framework.boot.util.ImppRedis;
@ -58,6 +59,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -82,6 +84,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @Description :
@ -157,6 +160,18 @@ public class WhiteController extends CoreBaseController {
@Autowired
private IDingTalkService dingTalkService;
@Autowired
private SysSmsSendRecordController smsSendRecordController;
@Autowired
private ISysRoleService sysRoleService;
@Autowired
private SysUserController sysUserController;
@Autowired
private SysFileController sysFileController;
private Cache<String, Integer> unsavedLocaleResSwitch = CacheBuilder.newBuilder()
.maximumSize(1)
.expireAfterWrite(1, TimeUnit.MINUTES)
@ -396,7 +411,16 @@ public class WhiteController extends CoreBaseController {
} catch (AuthenticationException e) {
// 系统异常
result = ResultBean.fail(ImppExceptionEnum.LOGIN_EXCEPTION_USER_PASSWORD.getDescription()).setCode(ImppExceptionEnum.LOGIN_EXCEPTION_USER_PASSWORD.getCode());
result.setErrorMsg(e.getMessage());
if (e.getCause() != null) {
if (e.getCause() instanceof ImppBusiException) {
ImppBusiException imppBusiException = (ImppBusiException) e.getCause();
result.setErrorMsg(LocaleUtils.getLocaleRes(imppBusiException.getErrorDetail()));
}else {
result.setErrorMsg(e.getCause().getMessage());
}
} else {
result.setErrorMsg(e.getMessage());
}
userLoginStatus = CommonEnumUtil.USER_LOGIN_STATUS.SYSTEM_ERROR;
LOGGER.warn("Impp业务异常AuthenticationException 登录失败 ", e);
} catch (ImppBusiException e) {
@ -578,6 +602,18 @@ public class WhiteController extends CoreBaseController {
}
/**
* id
*
* @param idStr
* @return
*/
@DeleteMapping(value = "/sys-file/delete/{id}")
@ApiOperation(value = "根据id删除文件资源", notes = "根据id删除文件资源")
public ResultBean deleteSysFileById(@PathVariable("id") String idStr) {
return sysFileController.deleteSysFileById(idStr);
}
/**
*
*
* @param fileCode
@ -899,4 +935,55 @@ public class WhiteController extends CoreBaseController {
public ResultBean querySysUserInfo(@RequestBody CloudPagerModel<SysUserInfo> cloudPagerModel) {
return sysUserInfoController.querySysUserInfo(cloudPagerModel.getObj(), cloudPagerModel.getPager());
}
@PostMapping("/sendSms")
@ApiOperation("无需登录 发送短信")
public ResultBean sendSms(@RequestBody ImppSmsContent imppSmsContent){
return smsSendRecordController.send(imppSmsContent);
}
@PostMapping(value = "/queryAllRoleRefUser")
@ApiOperation(value = "在所有角色中查询角色及关联的人员信息", notes = "查询角色及关联的人员信息")
public BaseResultBean queryAllRoleRefUser(@RequestBody SysRoleModel sysRoleModel) {
try {
ListPager result = null;
List<SysRole> roleList = null;
SysRole sysRole = sysRoleModel.getSysRole();
Pager pager = sysRoleModel.getPager();
if (ObjectUtils.isEmpty(sysRole)) {
sysRole = new SysRole();
}
if (ObjectUtils.isEmpty(pager)) {
pager = new Pager();
}
//过滤SysRefUserRole
roleList = sysRoleService.findAllByRoleProperty(sysRole);
if (ObjectUtils.isEmpty(roleList)){
return ResultBean.success("操作成功");
}
List<Long> roleIdList = roleList.stream().map(el -> el.getId()).collect(Collectors.toList());
result = personnelService.findSysRefUserRoleByRoleIds(roleIdList, pager);
return ResultBean.success("操作成功").setListPager(result).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
/**
*
*
* @param userLoginNames
* @param status
* @return
*/
@PutMapping(value = "/batch-status/userLoginNames")
@ApiOperation(value = "根据用户名批量修改账号状态", notes = "根据用户名批量修改账号状态")
public ResultBean updateBatchStatusByUserLoginNames(String[] userLoginNames, Integer status) {
return sysUserController.updateBatchStatusByUserLoginNames(userLoginNames,status);
}
}

@ -10,13 +10,13 @@ import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.i3plus.platform.common.util.FileContentTypeTool;
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.bean.BaseResultBean;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.SysRefRoleMenu;
import cn.estsh.i3plus.pojo.platform.bean.SysRefUserRole;
import cn.estsh.i3plus.pojo.platform.bean.SysRole;
import cn.estsh.i3plus.pojo.model.platform.SysRoleModel;
import cn.estsh.i3plus.pojo.platform.bean.*;
import cn.estsh.impp.framework.base.controller.CrudBaseController;
import cn.estsh.impp.framework.base.service.ICrudService;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
@ -30,14 +30,12 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.persistence.EntityManager;
@ -47,9 +45,7 @@ import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -246,6 +242,74 @@ public class SysRoleController extends CrudBaseController<SysRole> {
}
}
@PostMapping(value = "/queryAllRoleRefUser")
@ApiOperation(value = "在所有角色中查询角色及关联的人员信息", notes = "查询角色及关联的人员信息")
public BaseResultBean queryAllRoleRefUser(@RequestBody SysRoleModel sysRoleModel) {
try {
ListPager result = null;
List<SysRole> roleList = null;
SysRole sysRole = sysRoleModel.getSysRole();
Pager pager = sysRoleModel.getPager();
if (ObjectUtils.isEmpty(sysRole)) {
sysRole = new SysRole();
}
if (ObjectUtils.isEmpty(pager)) {
pager = new Pager();
}
roleList = sysRoleService.findAllByRoleProperty(sysRole);
//过滤SysRefUserRole
if (ObjectUtils.isEmpty(roleList)){
return ResultBean.success("操作成功");
}
List<Long> roleIdList = roleList.stream().map(el -> el.getId()).collect(Collectors.toList());
result = personnelService.findSysRefUserRoleByRoleIds(roleIdList, pager);
return ResultBean.success("操作成功").setListPager(result).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
@PostMapping(value = "/queryRoleRefUser")
@ApiOperation(value = "查询当前请求人员的角色及关联的人员信息", notes = "查询角色及关联的人员信息")
public BaseResultBean queryRoleRefUser(@RequestBody SysRoleModel sysRoleModel) {
try {
ListPager result = null;
SysRole sysRole = sysRoleModel.getSysRole();
Pager pager = sysRoleModel.getPager();
if (ObjectUtils.isEmpty(sysRole)){
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}
if (ObjectUtils.isEmpty(pager)){
pager = new Pager();
}
if (StringUtils.isEmpty(sysRole.getName())){
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}
List<SysRefUserRole> refList = personnelService.findSysRefUserRoleByRoleNameAndUserID(sysRole.getName(), getSessionUser().getUser().getId());
if (refList != null && refList.size() > 0) {
List<Long> idList = new ArrayList<>(refList.size());
refList.forEach(ref -> {
idList.add(ref.getRoleId());
});
// result = sysRoleService.querySysRole(sysRole, idList, pager);
// List<SysRole> roleList = result.getObjectList();
// //过滤SysRefUserRole
//
// List<Long> roleIdList = roleList.stream().map(el -> el.getId()).collect(Collectors.toList());
result = personnelService.findSysRefUserRoleByRoleIds(idList,pager);
}
return ResultBean.success("操作成功").setListPager(result).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
/**
*
*

@ -39,6 +39,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -59,6 +60,7 @@ import java.sql.ResultSet;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static java.util.stream.Collectors.toCollection;
@ -290,6 +292,31 @@ public class SysUserController extends CoreBaseController {
}
/**
*
*
* @param userLoginNames
* @param status
* @return
*/
@PutMapping(value = "/batch-status/userLoginNames")
@ApiOperation(value = "根据用户名批量修改账号状态", notes = "根据用户名批量修改账号状态")
public ResultBean updateBatchStatusByUserLoginNames(String[] userLoginNames, Integer status) {
try {
if(ObjectUtils.isEmpty(userLoginNames)){
return ResultBean.success("操作失败").setCode(ResourceEnumUtil.MESSAGE.FAIL.getCode()).setErrorMsg("用户名不能为空");
}
ValidatorBean.checkNotZero(status, "账号状态不能为空");
List<String> userLoginNameList = Stream.of(userLoginNames).collect(Collectors.toList());
sysUserService.updateBatchSysUserStatusByUserLoginNames(userLoginNameList,status);
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
/**
*
*
* @param password

@ -426,8 +426,15 @@ public class SysUserInfoController extends CoreBaseController {
userInfo = new SysUserInfo();
}
try {
ListPager<SysUserInfo> result = sysUserInfoService.querySysUserInfo(userInfo, packUserInfo(userInfo), pager);
List<SysUserInfo> list = result.getObjectList();
ListPager<SysUserInfo> result = null;
List<SysUserInfo> list = null;
if (ObjectUtils.isEmpty(pager)|| pager.getPageSize() == 0) {
list = sysUserInfoService.querySysUserInfoList(userInfo, packUserInfo(userInfo));
} else {
result = sysUserInfoService.querySysUserInfo(userInfo, packUserInfo(userInfo), pager);
list = result.getObjectList();
}
Map<Long, SysUser> sysUserMap = sysUserService.list().stream()
.collect(Collectors.toMap(SysUser::getId, Function.identity()));
List<UserExportModel> exportModelList = new ArrayList<>();

@ -33,6 +33,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.*;
@ -129,9 +130,9 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public void updateSysUserOrganize(Long userId, Long organizeId) {
LOGGER.info("平台账号 SysUser userId:{} organizeId",userId, organizeId);
LOGGER.info("平台账号 SysUser userId:{} organizeId", userId, organizeId);
SysUser user = userRDao.getById(userId);
if(user != null){
if (user != null) {
user.setOrganizeId(organizeId);
userRDao.save(user);
}
@ -139,26 +140,26 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
@ApiOperation(value = "删除账号信息")
public void deleteSysUser(Long[] userIdList,String userName) {
public void deleteSysUser(Long[] userIdList, String userName) {
LOGGER.info("平台账号 SysUser userIdList:{}", userIdList);
// 删除账号信息
userRDao.updateValidStatusByPropertyIn("id", userIdList,CommonEnumUtil.IS_VAILD.INVAILD.getValue(), userName);
userRDao.updateValidStatusByPropertyIn("id", userIdList, CommonEnumUtil.IS_VAILD.INVAILD.getValue(), userName);
// 删除账号关系
refUserDepartmentRDao.deleteByPropertyIn("userId",userIdList);
refUserDepartmentRDao.deleteByPropertyIn("userId", userIdList);
refUserRoleRDao.deleteByPropertyIn("userId", userIdList);
}
@Override
@ApiOperation(value = "删除用户信息")
public void deleteSysUserInfo(Long[] infoIdList,String userName) {
public void deleteSysUserInfo(Long[] infoIdList, String userName) {
LOGGER.info("平台用户 SysUserInfo infoIdList:{}", infoIdList);
// 删除用户信息
userInfoRDao.updateValidStatusByPropertyIn("id", infoIdList,CommonEnumUtil.IS_VAILD.INVAILD.getValue(), userName);
userInfoRDao.updateValidStatusByPropertyIn("id", infoIdList, CommonEnumUtil.IS_VAILD.INVAILD.getValue(), userName);
// 删除用户关系
refUserInfoDepartmentRDao.deleteByPropertyIn("userId",infoIdList);
refUserPositionRDao.deleteByPropertyIn("userId",infoIdList);
refUserInfoDepartmentRDao.deleteByPropertyIn("userId", infoIdList);
refUserPositionRDao.deleteByPropertyIn("userId", infoIdList);
}
@Override
@ -169,9 +170,9 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List<Long> findSysUserIdByDepartmentId(Long... departmentId) {
List<Long> result = new ArrayList<>();
if(departmentId != null && departmentId.length > 0){
if (departmentId != null && departmentId.length > 0) {
List<SysRefUserDepartment> departmentList = refUserDepartmentRDao.findByHqlWhere(CoreHqlPack.packHqlIds("departmentId", departmentId));
if(departmentList != null && departmentList.size() > 0){
if (departmentList != null && departmentList.size() > 0) {
departmentList.forEach(department -> result.add(department.getUserId()));
}
}
@ -207,14 +208,14 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public ListPager<SysUser> querySysUser(UserDetailModel model, Pager pager) {
Set<Long> idList = new HashSet<>();
if(model.getSysUser() != null && model.getSysUser().getDepartmentId() != null){
if (model.getSysUser() != null && model.getSysUser().getDepartmentId() != null) {
idList.addAll(findSysUserIdByDepartmentId(model.getSysUser().getDepartmentId()));
}
// if(model.getSysUser() != null && model.getSysUser().getOrganizeCode() != null){
// idList.addAll(findSysUserIdByOrganizeCode(model.getSysUser().getOrganizeCode()));
// }
if(model.getUserIdList() != null){
if (model.getUserIdList() != null) {
model.getUserIdList().forEach(idStr -> idList.add(Long.parseLong(idStr)));
}
@ -233,7 +234,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
@ApiOperation(value = "查询账号信息")
public ListPager<SysUser> querySysUserPagerByUserDetailModelOrIds(UserDetailModel model,Pager pager, List<Long> ids) {
public ListPager<SysUser> querySysUserPagerByUserDetailModelOrIds(UserDetailModel model, Pager pager, List<Long> ids) {
LOGGER.info("平台用户 SysUser model:{} ids:{}", model, ids);
String modeWhere = HqlModelPack.packHqlSysUserByModelOrIds(model, ids);
@ -249,9 +250,9 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List<Long> findSysUserInfoIdByDepartmentId(Long... departmentId) {
List<Long> result = new ArrayList<>();
if(departmentId != null && departmentId.length > 0){
if (departmentId != null && departmentId.length > 0) {
List<SysRefUserInfoDepartment> departmentList = refUserInfoDepartmentRDao.findByHqlWhere(CoreHqlPack.packHqlIds("departmentId", departmentId));
if(departmentList != null && departmentList.size() > 0){
if (departmentList != null && departmentList.size() > 0) {
departmentList.forEach(department -> result.add(department.getUserId()));
}
}
@ -285,7 +286,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public SessionUser queryUserLogin(String userName, String password, String languageCode) {
LOGGER.info("平台用户 SYS_USER loginName:{} \t password:{} \t languageCode:{}", userName, password, languageCode);
UserToken token = new UserToken(userName,password,languageCode);
UserToken token = new UserToken(userName, password, languageCode);
SessionUser sessionUser = AuthUtil.login(token);
AuthUtil.setSessionUser(sessionUser);
return sessionUser;
@ -295,7 +296,6 @@ public class PersonnelServiceService implements IPersonnelService {
public ListPager<SysUserInfo> querySysUserInfo(UserDetailModel model, Pager pager) {
DdlPackBean packBean = CoreHqlPack.packDdlBeanSysUserInfo(model.getSysUserInfo(), StringTool.getListLong(model.getUserInfoIdList()));
pager = PagerHelper.getPager(pager, userInfoRDao.findByHqlWhereCount(packBean));
@ -316,7 +316,7 @@ public class PersonnelServiceService implements IPersonnelService {
LOGGER.debug("平台账号角色 SysRole userId:{}", userId);
List<SysRefUserRole> refList = findSysRefUserRole(userId);
if(refList != null && refList.size() > 0){
if (refList != null && refList.size() > 0) {
List<Long> idList = new ArrayList<>();
refList.forEach(ref -> idList.add(ref.getRoleId()));
@ -350,7 +350,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List<SysMenu> findSysMenuByUserId(Long userId) {
LOGGER.info("平台账号权限 SysMenu userId:{}",userId);
LOGGER.info("平台账号权限 SysMenu userId:{}", userId);
List<SysRefUserRole> refUserRoleList = findSysRefUserRole(userId);
List<SysRefRoleMenu> refRoleMenuList = findSysRefRoleMenuByRefUserRole(refUserRoleList);
return findSysMenuByRefRoleMenu(refRoleMenuList);
@ -368,7 +368,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List<SysMenu> findSysMenuByRefRoleMenu(List<SysRefRoleMenu> refList) {
LOGGER.info("平台账号角色 SysRefRoleMenu refList:{}", refList);
if(refList != null && refList.size() > 0){
if (refList != null && refList.size() > 0) {
List<Long> idList = new ArrayList<>(refList.size());
refList.forEach(ref -> idList.add(ref.getMenuId()));
return menuService.findByIdList(idList);
@ -388,33 +388,53 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List<SysRefUserRole> findSysRefUserRole(Long userId, Long roleId, String organizeCode) {
LOGGER.info("平台账号角色 SysRefUserRole userId:{} roleId:{} organizeCode:{}",userId, roleId,organizeCode);
LOGGER.info("平台账号角色 SysRefUserRole userId:{} roleId:{} organizeCode:{}", userId, roleId, organizeCode);
return refUserRoleRDao.findByHqlWhere(CoreHqlPack.packDdlBeanSysRefUserRole(userId, roleId, organizeCode));
}
@Override
public List<SysRefRoleMenu> findSysRefRoleMenuByUserId(Long userId) {
LOGGER.info("平台账号角色 SysRefRoleMenu userId:{}", userId);
if(userId != null){
if (userId != null) {
List<SysRefUserRole> refRoleList = findSysRefUserRole(userId);
if(refRoleList != null && refRoleList.size() > 0){
if (refRoleList != null && refRoleList.size() > 0) {
List<Long> idList = new ArrayList<>(refRoleList.size());
refRoleList.forEach(ref -> idList.add(ref.getRoleId()));
return findSysRefRoleMenuByRoleIds( idList);
return findSysRefRoleMenuByRoleIds(idList);
}
}
return null;
}
@Override
public ListPager<SysRefUserRole> findSysRefUserRoleByRoleIds(List<Long> roleIdList, Pager pager) {
if (ObjectUtils.isEmpty(roleIdList)) {
return new ListPager();
}
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
DdlPreparedPack.getInPackList(roleIdList, "roleId", packBean);
pager = PagerHelper.getPager(pager, refUserRoleRDao.findByHqlWhereCount(packBean));
return new ListPager<>(refUserRoleRDao.findByHqlWherePage(packBean, pager), pager);
}
@Override
public List<SysRefUserRole> findSysRefUserRoleByRoleNameAndUserID(String roleName, Long userId) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
DdlPreparedPack.getStringLikerPack(roleName, "roleNameRdd", packBean);
DdlPreparedPack.getNumEqualPack(userId, "userId", packBean);
return refUserRoleRDao.findByHqlWhere(packBean);
}
@Override
public List<SysRefRoleMenu> findSysRefRoleMenuByRoleIds(List<Long> roleIdList) {
LOGGER.info("平台账号角色 SysRefRoleMenu roleIdList:{}", roleIdList);
if(roleIdList != null){
if (roleIdList != null) {
StringBuffer findWhere = new StringBuffer();
HqlPack.getInPack(StringUtils.join(roleIdList,","),"roleId",findWhere);
HqlPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(),"isDeleted",findWhere);
HqlPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(),"isValid",findWhere);
HqlPack.getInPack(StringUtils.join(roleIdList, ","), "roleId", findWhere);
HqlPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", findWhere);
HqlPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(), "isValid", findWhere);
return refRoleMenuRDao.findByHqlWhere(findWhere.toString());
}
@ -424,7 +444,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List<SysRefRoleMenu> findSysRefRoleMenuByRole(List<SysRole> roleList) {
LOGGER.info("平台账号角色 SysRefRoleMenu roleList:{}", roleList);
if(roleList != null && roleList.size() > 0){
if (roleList != null && roleList.size() > 0) {
List<Long> idList = new ArrayList<>(roleList.size());
roleList.forEach(ref -> idList.add(ref.getId()));
return findSysRefRoleMenuByRoleIds(idList);
@ -435,7 +455,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List<SysRefRoleMenu> findSysRefRoleMenuByRefUserRole(List<SysRefUserRole> refList) {
LOGGER.info("平台账号角色 SysRefRoleMenu refList:{}", refList);
if(refList != null && refList.size() > 0){
if (refList != null && refList.size() > 0) {
List<Long> idList = new ArrayList<>(refList.size());
refList.forEach(ref -> idList.add(ref.getRoleId()));
return findSysRefRoleMenuByRoleIds(idList);
@ -446,7 +466,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List<SysRefUserDepartment> findSysRefUserDepartmentByUserId(Long userId) {
LOGGER.info("平台账号部门 SysRefUserDepartment userId:{}", userId);
return refUserDepartmentRDao.findByProperty("userId",userId);
return refUserDepartmentRDao.findByProperty("userId", userId);
}
@Override
@ -454,7 +474,7 @@ public class PersonnelServiceService implements IPersonnelService {
LOGGER.info("平台账号部门 SysRefUserDepartment organizeIdList:{}", organizeIdList);
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
DdlPreparedPack.getInPackList(organizeIdList,"organizeId",packBean);
DdlPreparedPack.getInPackList(organizeIdList, "organizeId", packBean);
return refUserDepartmentRDao.findByHqlWhere(packBean);
}
@ -464,7 +484,7 @@ public class PersonnelServiceService implements IPersonnelService {
LOGGER.info("平台账号部门 SysRefUserDepartment organizeCode:{}", organizeCode);
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
DdlPreparedPack.getStringEqualPack(organizeCode,"organizeCode",packBean);
DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", packBean);
return refUserDepartmentRDao.findByHqlWhere(packBean);
}
@ -474,25 +494,25 @@ public class PersonnelServiceService implements IPersonnelService {
LOGGER.info("平台账号部门 SysRefUserDepartment departmentIdList:{}", departmentIdList);
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
DdlPreparedPack.getInPackList(departmentIdList,"departmentId",packBean);
DdlPreparedPack.getInPackList(departmentIdList, "departmentId", packBean);
return refUserDepartmentRDao.findByHqlWhere(packBean);
}
@Override
public List<SysRefUserDepartment> querySysRefUserDepartmentByUserDetailModel(UserDetailModel model) {
if(model != null){
if (model != null) {
StringBuffer userIdWhere = new StringBuffer();
if(model.getUserDepartmentIdList() != null){
HqlPack.getInPack(StringUtils.join(model.getInfoDepartmentIdList(),","),"departmentId", userIdWhere);
if (model.getUserDepartmentIdList() != null) {
HqlPack.getInPack(StringUtils.join(model.getInfoDepartmentIdList(), ","), "departmentId", userIdWhere);
}
if(model.getUserOrganizeIdList() != null){
HqlPack.getInPack( StringUtils.join(model.getUserOrganizeIdList(),","),"organizeId",userIdWhere);
if (model.getUserOrganizeIdList() != null) {
HqlPack.getInPack(StringUtils.join(model.getUserOrganizeIdList(), ","), "organizeId", userIdWhere);
}
return refUserDepartmentRDao.findByHqlWhere(userIdWhere.toString());
}else {
} else {
return null;
}
}
@ -500,7 +520,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List<SysRefUserInfoDepartment> findSysRefUserInfoDepartmentById(Long infoId) {
LOGGER.info("平台用户部门关系 SysRefUserInfoDepartment infoId:{}", infoId);
return refUserInfoDepartmentRDao.findByProperty("userId",infoId);
return refUserInfoDepartmentRDao.findByProperty("userId", infoId);
}
@Override
@ -508,7 +528,7 @@ public class PersonnelServiceService implements IPersonnelService {
LOGGER.info("平台账号部门 SysRefUserDepartment organizeIdList:{}", organizeIdList);
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
DdlPreparedPack.getInPackList(organizeIdList,"organizeId",packBean);
DdlPreparedPack.getInPackList(organizeIdList, "organizeId", packBean);
return refUserInfoDepartmentRDao.findByHqlWhere(packBean);
}
@ -518,7 +538,7 @@ public class PersonnelServiceService implements IPersonnelService {
LOGGER.info("平台账号部门 SysRefUserInfoDepartment departmentIdList:{}", departmentIdList);
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
DdlPreparedPack.getInPackList(departmentIdList,"departmentId",packBean);
DdlPreparedPack.getInPackList(departmentIdList, "departmentId", packBean);
return refUserInfoDepartmentRDao.findByHqlWhere(packBean);
}
@ -536,7 +556,7 @@ public class PersonnelServiceService implements IPersonnelService {
List<SysDepartment> result = new ArrayList<>();
List<SysRefUserInfoDepartment> refs = findSysRefUserInfoDepartmentById(infoId);
if(refs != null && refs.size() > 0){
if (refs != null && refs.size() > 0) {
List<Long> ids = new ArrayList<>();
refs.forEach(ref -> ids.add(ref.getDepartmentId()));
@ -552,7 +572,7 @@ public class PersonnelServiceService implements IPersonnelService {
List<SysDepartment> result = new ArrayList<>();
List<SysRefUserDepartment> refs = findSysRefUserDepartmentByUserId(infoId);
if(refs != null && refs.size() > 0){
if (refs != null && refs.size() > 0) {
List<Long> ids = new ArrayList<>();
refs.forEach(ref -> ids.add(ref.getDepartmentId()));
@ -575,7 +595,7 @@ public class PersonnelServiceService implements IPersonnelService {
List<SysOrganize> result = new ArrayList<>();
List<SysRefUserInfoDepartment> refs = findSysRefUserInfoDepartmentById(infoId);
if(refs != null && refs.size() > 0){
if (refs != null && refs.size() > 0) {
List<Long> ids = new ArrayList<>();
refs.forEach(ref -> ids.add(ref.getOrganizeId()));
@ -590,7 +610,7 @@ public class PersonnelServiceService implements IPersonnelService {
List<SysOrganize> result = new ArrayList<>();
List<SysRefUserDepartment> refs = findSysRefUserDepartmentByUserId(infoId);
if(refs != null && refs.size() > 0){
if (refs != null && refs.size() > 0) {
List<Long> ids = new ArrayList<>();
refs.forEach(ref -> ids.add(ref.getOrganizeId()));
@ -618,14 +638,14 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List<SysRefUserPosition> findSysRefUserPositionByUserInfoId(Long infoId) {
LOGGER.info("平台用户岗位 SysRefUserPosition infoId:{}", infoId);
return refUserPositionRDao.findByProperty("userId",infoId);
return refUserPositionRDao.findByProperty("userId", infoId);
}
@Override
public List<SysRefUserPosition> findSysRefUserPositionByIdList(List<Long> idList) {
if(idList != null && idList.size() > 0){
if (idList != null && idList.size() > 0) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
DdlPreparedPack.getInPackList(idList,"positionId",packBean);
DdlPreparedPack.getInPackList(idList, "positionId", packBean);
return refUserPositionRDao.findByHqlWhere(packBean);
}
return null;
@ -633,9 +653,9 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public void checkSysUserOnly(SysUser user) {
if(user != null){
if (user != null) {
// 登录名唯一教研
if(!checkSysUserLoginName(user.getUserLoginName(), user.getId() == null ? 0 : user.getId())){
if (!checkSysUserLoginName(user.getUserLoginName(), user.getId() == null ? 0 : user.getId())) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode())
@ -667,7 +687,7 @@ public class PersonnelServiceService implements IPersonnelService {
// }
// 工号唯一教研
if(!checkSysUserEmpNo(user.getUserEmpNo(),user.getUserInfoId() == null ? 0 : user.getUserInfoId())){
if (!checkSysUserEmpNo(user.getUserEmpNo(), user.getUserInfoId() == null ? 0 : user.getUserInfoId())) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode())
@ -683,13 +703,13 @@ public class PersonnelServiceService implements IPersonnelService {
public Integer checkSysUserResetPassword(SysUser user) {
LOGGER.info("平台用户岗位 SysUser user:{}", user);
Integer num = 0;
if(user != null){
if (user != null) {
String redisKey = CommonConstWords.REDIS_PREFIX_USER_RESET_PASSWORD + ":" + TimeTool.getToday() + ":" + user.getId();
Object redisValue = redisCore.getObject(redisKey);
num = redisValue == null ? 1 : Integer.parseInt(redisValue.toString()) + 1;
int numMax = RedisCacheTool.getSysConfigIntVal(CommonConstWords.CONFIG_PWD_RESET_PASSWORD, CommonConstWords.CONFIG_PWD_RESET_PASSWORD_DEFAULT);
if(num > numMax){
if (num > numMax) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.USER_PERMISSION_RUN_OUT.getCode())
@ -697,7 +717,7 @@ public class PersonnelServiceService implements IPersonnelService {
.setErrorSolution("请明日再次使用")
.build();
}
redisCore.putObject(redisKey,num,CommonConstWords.REDIS_TIME_DAY_ONE);
redisCore.putObject(redisKey, num, CommonConstWords.REDIS_TIME_DAY_ONE);
}
return num;
}
@ -706,16 +726,16 @@ public class PersonnelServiceService implements IPersonnelService {
public void checkSysPositionRef(Long positionId) {
LOGGER.info("平台岗位 SysPosition positionId:{}", positionId);
if(positionId != null){
if (positionId != null) {
SysPosition sp = new SysPosition();
sp.setParentId(positionId);
List<SysPosition> positionList = positionService.findAllByBean(sp);
if (positionList!= null && positionList.size() >= 1) {
if (positionList != null && positionList.size() >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在岗位信息["+positionList.get(0).getName()+"]无法删除!")
.setErrorDetail("存在岗位信息[" + positionList.get(0).getName() + "]无法删除!")
.setErrorSolution("请先删除子集信息在操作")
.build();
}
@ -733,7 +753,7 @@ public class PersonnelServiceService implements IPersonnelService {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在用户信息["+userInfoList.get(0).getName()+"]无法删除!")
.setErrorDetail("存在用户信息[" + userInfoList.get(0).getName() + "]无法删除!")
.setErrorSolution("请先删除用户引用信息再操作")
.build();
}
@ -744,13 +764,13 @@ public class PersonnelServiceService implements IPersonnelService {
public void checkSysDepartmentRef(Long departmentId) {
LOGGER.info("平台部门 SysDepartment departmentId:{}", departmentId);
if(departmentId != null){
List<SysDepartment> departmentList = departmentService.findAllByBean(new SysDepartment(null,departmentId,null));
if (departmentId != null) {
List<SysDepartment> departmentList = departmentService.findAllByBean(new SysDepartment(null, departmentId, null));
if (departmentList != null && departmentList.size() >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在相关部门信息["+departmentList.get(0).getName()+"]无法删除!")
.setErrorDetail("存在相关部门信息[" + departmentList.get(0).getName() + "]无法删除!")
.setErrorSolution("请先删除子集信息在操作")
.build();
}
@ -760,7 +780,7 @@ public class PersonnelServiceService implements IPersonnelService {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在用户信息["+userInfoList.get(0).getName()+"]无法删除!")
.setErrorDetail("存在用户信息[" + userInfoList.get(0).getName() + "]无法删除!")
.setErrorSolution("请先删除用户引用信息再操作")
.build();
}
@ -770,7 +790,7 @@ public class PersonnelServiceService implements IPersonnelService {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在账号信息["+userList.get(0).getUserLoginName()+"]无法删除!")
.setErrorDetail("存在账号信息[" + userList.get(0).getUserLoginName() + "]无法删除!")
.setErrorSolution("请先删除账号引用信息再操作")
.build();
}
@ -781,7 +801,7 @@ public class PersonnelServiceService implements IPersonnelService {
public void checkSysOrganizeRef(Long organizeId) {
LOGGER.info("平台部门 SysOrganize organizeId:{}", organizeId);
if(organizeId != null){
if (organizeId != null) {
SysOrganize org = new SysOrganize();
org.setParentId(organizeId);
List<SysOrganize> organizeList = organizeService.findAllByBean(org);
@ -789,7 +809,7 @@ public class PersonnelServiceService implements IPersonnelService {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在相关组织信息["+organizeList.get(0).getName()+"]无法删除!")
.setErrorDetail("存在相关组织信息[" + organizeList.get(0).getName() + "]无法删除!")
.setErrorSolution("请先删除子集信息在操作")
.build();
}
@ -804,12 +824,12 @@ public class PersonnelServiceService implements IPersonnelService {
// .buildSearch();
// }
List<SysDepartment> departmentList = departmentService.findAllByBean(new SysDepartment(null,null,organizeId));
List<SysDepartment> departmentList = departmentService.findAllByBean(new SysDepartment(null, null, organizeId));
if (departmentList != null && departmentList.size() >= 1) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在部门信息["+departmentList.get(0).getName()+"]无法删除!")
.setErrorDetail("存在部门信息[" + departmentList.get(0).getName() + "]无法删除!")
.setErrorSolution("请先删除部门引用信息再操作")
.build();
}
@ -819,7 +839,7 @@ public class PersonnelServiceService implements IPersonnelService {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在用户信息["+userInfoList.get(0).getName()+"]无法删除!")
.setErrorDetail("存在用户信息[" + userInfoList.get(0).getName() + "]无法删除!")
.setErrorSolution("请先删除用户引用信息再操作")
.build();
}
@ -829,7 +849,7 @@ public class PersonnelServiceService implements IPersonnelService {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("存在账号信息["+userList.get(0).getUserLoginName()+"]无法删除!")
.setErrorDetail("存在账号信息[" + userList.get(0).getUserLoginName() + "]无法删除!")
.setErrorSolution("请先删除账号引用信息再操作")
.build();
}
@ -942,18 +962,18 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public void refreshRefSysUserDepartment(Long userId, Long[] departmentIds) {
LOGGER.info("账号部门信息 SysUser userInfoId:{} departmentIds:{}",userId,departmentIds);
LOGGER.info("账号部门信息 SysUser userInfoId:{} departmentIds:{}", userId, departmentIds);
SysUser user = userRDao.getById(userId);
if(user != null ){
if (user != null) {
// 删除用户部门关系
refUserDepartmentRDao.deleteByProperty("userId",user.getId());
refUserDepartmentRDao.deleteByProperty("userId", user.getId());
if(departmentIds.length > 0){
if (departmentIds.length > 0) {
// 查询部门信息
List<SysDepartment> departmentList = departmentService.findByIdList(Arrays.asList(departmentIds));
if(departmentList != null && departmentList.size() >0){
if (departmentList != null && departmentList.size() > 0) {
List<SysRefUserDepartment> list = new ArrayList<>();
SysRefUserDepartment ref = null;
for (SysDepartment department : departmentList) {
@ -974,7 +994,7 @@ public class PersonnelServiceService implements IPersonnelService {
refUserDepartmentRDao.saveAll(list);
userRDao.save(user);
LOGGER.info("账号部门信息 SysUserInfo RefUserDepartmentRDao Insert Size :{}",list.size());
LOGGER.info("账号部门信息 SysUserInfo RefUserDepartmentRDao Insert Size :{}", list.size());
}
}
}
@ -1016,12 +1036,12 @@ public class PersonnelServiceService implements IPersonnelService {
}
List<String> roleRdds = refUserRoles.stream().map(SysRefUserRole::getRoleNameRdd).collect(Collectors.toList());
currentRole = StringUtils.join(roleRdds, ",");
SysLogRoleChange logRoleChange=new SysLogRoleChange();
SysLogRoleChange logRoleChange = new SysLogRoleChange();
logRoleChange.setUserName(user.getUserName());
logRoleChange.setUserId(userId);
logRoleChange.setPreviousRoles(previousRole);
logRoleChange.setCurrentRoles(currentRole);
ConvertBean.serviceModelInitialize(logRoleChange,AuthUtil.getSessionUser().getUserName());
ConvertBean.serviceModelInitialize(logRoleChange, AuthUtil.getSessionUser().getUserName());
logRoleChangeRepository.save(logRoleChange);
refUserRoleRDao.saveAll(refUserRoles);
@ -1032,18 +1052,18 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public void refreshUpdateRefSysUserInfoDepartment(Long userInfoId, Long[] departmentIds) {
LOGGER.info("用户部门关系信息 SysUser userInfoId:{} departmentIds:{}",userInfoId,departmentIds);
LOGGER.info("用户部门关系信息 SysUser userInfoId:{} departmentIds:{}", userInfoId, departmentIds);
SysUserInfo info = userInfoRDao.getById(userInfoId);
if(info != null ){
if (info != null) {
// 删除用户部门关系
refUserInfoDepartmentRDao.deleteByProperty("userId",info.getId());
refUserInfoDepartmentRDao.deleteByProperty("userId", info.getId());
if(departmentIds.length > 0){
if (departmentIds.length > 0) {
// 查询部门信息
List<SysDepartment> departmentList = departmentService.findByIdList(Arrays.asList(departmentIds));
if(departmentList != null && departmentList.size() >0){
if (departmentList != null && departmentList.size() > 0) {
List<SysRefUserInfoDepartment> list = new ArrayList<>();
SysRefUserInfoDepartment ref = null;
for (SysDepartment department : departmentList) {
@ -1064,10 +1084,10 @@ public class PersonnelServiceService implements IPersonnelService {
refUserInfoDepartmentRDao.saveAll(list);
userInfoRDao.save(info);
LOGGER.info("用户部门关系信息 SysUserInfo RefUserDepartmentRDao Insert Size :{}",list.size());
LOGGER.info("用户部门关系信息 SysUserInfo RefUserDepartmentRDao Insert Size :{}", list.size());
}
}
}else {
} else {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(cn.estsh.impp.framework.boot.exception.ImppExceptionEnum.VARIFY_EXCEPTION_DATA_NOT_EXIT.getCode())
@ -1119,19 +1139,19 @@ public class PersonnelServiceService implements IPersonnelService {
// }
// }
@Override
@Override
public void refreshRefSysUserInfoPosition(Long userInfoId, Long[] positionIds) {
LOGGER.info("用户岗位关系信息 RefSysUserInfoPosition userInfoId:{} positionIds:{} ",userInfoId,positionIds);
LOGGER.info("用户岗位关系信息 RefSysUserInfoPosition userInfoId:{} positionIds:{} ", userInfoId, positionIds);
SysUserInfo userInfo = userInfoRDao.getById(userInfoId);
if(userInfo != null ){
if (userInfo != null) {
// 删除用户岗位关系
refUserPositionRDao.deleteByProperty("userId",userInfo.getId());
refUserPositionRDao.deleteByProperty("userId", userInfo.getId());
if(positionIds.length > 0){
if (positionIds.length > 0) {
List<SysPosition> positionList = positionService.findByIdList(Arrays.asList(positionIds));
if(positionList != null && positionList.size() >0){
if (positionList != null && positionList.size() > 0) {
List<SysRefUserPosition> list = new ArrayList<>();
SysRefUserPosition ref = null;
for (SysPosition position : positionList) {
@ -1149,10 +1169,10 @@ public class PersonnelServiceService implements IPersonnelService {
refUserPositionRDao.saveAll(list);
userInfoRDao.save(userInfo);
LOGGER.info("用户岗位关系信息 SysUserInfo RefUserPositionRDao Insert Size :{}",list.size());
LOGGER.info("用户岗位关系信息 SysUserInfo RefUserPositionRDao Insert Size :{}", list.size());
}
}
}else {
} else {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_NOT_EXIT.getCode())
@ -1171,18 +1191,19 @@ public class PersonnelServiceService implements IPersonnelService {
/**
*
*
* @return
*/
private boolean checkPasswordLength(SysConfig config,String password){
if(config != null){
if(config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.NUMBER.getValue())){
private boolean checkPasswordLength(SysConfig config, String password) {
if (config != null) {
if (config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.NUMBER.getValue())) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
.setErrorDetail("系统配置格式错误(密码长度)")
.setErrorSolution("请先配置系统参数")
.build();
}else {
} else {
int length = Integer.parseInt(config.getConfigValue());
return password.trim().length() >= length;
}
@ -1192,20 +1213,21 @@ public class PersonnelServiceService implements IPersonnelService {
/**
*
*
* @param password
* @return
*/
private boolean checkPasswordLowerEnglish(SysConfig config,String password){
if(config != null){
if(config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())){
private boolean checkPasswordLowerEnglish(SysConfig config, String password) {
if (config != null) {
if (config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
.setErrorDetail("系统配置格式错误(密码英文小写配置)")
.setErrorSolution("请先配置系统参数")
.build();
}else {
if(config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())){
} else {
if (config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) {
return StringTool.isContainLowerCase(password);
}
}
@ -1215,20 +1237,21 @@ public class PersonnelServiceService implements IPersonnelService {
/**
*
*
* @param password
* @return
*/
private boolean checkPasswordUpperEnglish(SysConfig config,String password){
if(config != null){
if(config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())){
private boolean checkPasswordUpperEnglish(SysConfig config, String password) {
if (config != null) {
if (config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
.setErrorDetail("系统配置格式错误(密码英文大写配置)")
.setErrorSolution("请先配置系统参数")
.build();
}else {
if(config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())){
} else {
if (config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) {
return StringTool.isContainUpperCase(password);
}
}
@ -1238,20 +1261,21 @@ public class PersonnelServiceService implements IPersonnelService {
/**
*
*
* @param password
* @return
*/
private boolean checkPasswordNumber(SysConfig config,String password){
if(config != null){
if(config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())){
private boolean checkPasswordNumber(SysConfig config, String password) {
if (config != null) {
if (config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
.setErrorDetail("系统配置格式错误(密码数字配置)")
.setErrorSolution("请先配置系统参数")
.build();
}else {
if(config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())){
} else {
if (config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) {
return StringTool.isContainNumber(password);
}
}
@ -1261,20 +1285,21 @@ public class PersonnelServiceService implements IPersonnelService {
/**
*
*
* @param password
* @return
*/
private boolean checkPasswordSpecialChar(SysConfig config,String password){
if(config != null){
if(config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())){
private boolean checkPasswordSpecialChar(SysConfig config, String password) {
if (config != null) {
if (config.getConfigValue() == null || config.getConfigType().equals(ImppEnumUtil.SYS_VALUE_TYPE.SWITCH.getValue())) {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())
.setErrorDetail("系统配置格式错误(密码特殊字符配置)")
.setErrorSolution("请先配置系统参数")
.build();
}else {
if(config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())){
} else {
if (config.getConfigValue().equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr())) {
return StringTool.isConSpeCharacters(password);
}
}
@ -1291,88 +1316,91 @@ public class PersonnelServiceService implements IPersonnelService {
*/
private boolean checkSysUserLoginName(String userLoginName, long userId) {
int count = 0;
if(userId > 0){
if (userId > 0) {
StringBuffer sw = new StringBuffer();
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(),"isValid",sw);
HqlPack.getStringEqualPack(userLoginName,"userLoginName",sw);
HqlPack.getNumNOEqualPack(userId,"id",sw);
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", sw);
HqlPack.getStringEqualPack(userLoginName, "userLoginName", sw);
HqlPack.getNumNOEqualPack(userId, "id", sw);
count = userRDao.findByHqlWhereCount(sw.toString());
}else{
} else {
count = userRDao.findByPropertyCount(
new String[]{"userLoginName","isValid"},
new Object[]{userLoginName,CommonEnumUtil.IS_VAILD.VAILD.getValue()});
new String[]{"userLoginName", "isValid"},
new Object[]{userLoginName, CommonEnumUtil.IS_VAILD.VAILD.getValue()});
}
return count <= 0 ;
return count <= 0;
}
/**
*
*
* @param email
* @param infoId
* @return
*/
private boolean checkSysUserEmail(String email, long infoId) {
int count;
if(infoId > 0){
if (infoId > 0) {
StringBuffer sw = new StringBuffer();
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(),"isValid",sw);
HqlPack.getStringEqualPack(email,"userEmail",sw);
HqlPack.getNumNOEqualPack(infoId,"userInfoId",sw);
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", sw);
HqlPack.getStringEqualPack(email, "userEmail", sw);
HqlPack.getNumNOEqualPack(infoId, "userInfoId", sw);
count = userRDao.findByHqlWhereCount(sw.toString());
}else{
} else {
count = userRDao.findByPropertyCount(
new String[]{"userEmail","isValid"},
new Object[]{email,CommonEnumUtil.IS_VAILD.VAILD.getValue()});
new String[]{"userEmail", "isValid"},
new Object[]{email, CommonEnumUtil.IS_VAILD.VAILD.getValue()});
}
return count <= 0 ;
return count <= 0;
}
/**
*
*
* @param phone
* @param infoId
* @return
*/
private boolean checkSysUserPhone(String phone, long infoId) {
int count;
if(infoId > 0){
if (infoId > 0) {
StringBuffer sw = new StringBuffer();
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(),"isValid",sw);
HqlPack.getStringEqualPack(phone,"userPhone",sw);
HqlPack.getNumNOEqualPack(infoId,"userInfoId",sw);
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", sw);
HqlPack.getStringEqualPack(phone, "userPhone", sw);
HqlPack.getNumNOEqualPack(infoId, "userInfoId", sw);
count = userRDao.findByHqlWhereCount(sw.toString());
}else{
} else {
count = userRDao.findByPropertyCount(
new String[]{"userPhone","isValid"},
new Object[]{phone,CommonEnumUtil.IS_VAILD.VAILD.getValue()});
new String[]{"userPhone", "isValid"},
new Object[]{phone, CommonEnumUtil.IS_VAILD.VAILD.getValue()});
}
return count <= 0 ;
return count <= 0;
}
/**
*
*
* @param empNo
* @param infoId
* @return
*/
private boolean checkSysUserEmpNo(String empNo, long infoId) {
int count;
if(infoId > 0){
if (infoId > 0) {
StringBuffer sw = new StringBuffer();
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(),"isValid",sw);
HqlPack.getStringEqualPack(empNo,"userEmpNo",sw);
HqlPack.getNumNOEqualPack(infoId,"userInfoId",sw);
HqlPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", sw);
HqlPack.getStringEqualPack(empNo, "userEmpNo", sw);
HqlPack.getNumNOEqualPack(infoId, "userInfoId", sw);
count = userRDao.findByHqlWhereCount(sw.toString());
}else{
} else {
count = userRDao.findByPropertyCount(
new String[]{"userEmpNo","isValid"},
new Object[]{empNo,CommonEnumUtil.IS_VAILD.VAILD.getValue()});
new String[]{"userEmpNo", "isValid"},
new Object[]{empNo, CommonEnumUtil.IS_VAILD.VAILD.getValue()});
}
return count <= 0 ;
return count <= 0;
}
}

@ -6,6 +6,7 @@ import cn.estsh.i3plus.core.api.iservice.busi.ISysRoleService;
import cn.estsh.i3plus.core.apiservice.dao.IUserPermissionDao;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
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;
@ -36,6 +37,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
@ -299,6 +301,14 @@ public class SysRoleService extends CrudService<SysRole> implements ISysRoleServ
return this.roleRDao.findAll(example);
}
@Override
public List<SysRole> findAllByRoleProperty(SysRole sysRole) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(sysRole);
DdlPreparedPack.getNumEqualPack(sysRole.getRoleStatus(), "roleStatus", packBean);
DdlPreparedPack.getStringLikerPack(sysRole.getName(), "name", packBean);
return roleRDao.findByHqlWhere(packBean);
}
// @Override
// public void packAfterRefreshCache() {

@ -223,6 +223,29 @@ public class SysUserService implements ISysUserService {
}
@Override
public void updateBatchSysUserStatusByUserLoginNames(List<String> userLoginNameList, int status) {
DdlPackBean ddlPackBean = new DdlPackBean();
DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", ddlPackBean);
DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", ddlPackBean);
DdlPreparedPack.getInPackList(userLoginNameList, "userLoginName", ddlPackBean);
String modifiedUser = "系统";
try {
modifiedUser = AuthUtil.getSessionUser().getUserName();
} catch (Exception e) {
}
userRDao.updateByProperties(
new String[]{"userStatus", "modifyDatetime", "modifyUser"},
new Object[]{status, TimeTool.getNowTime(true), modifiedUser},
ddlPackBean);
// userRDao.updateByProperties(
// new String[]{"userStatus", "modifyUser"},
// new Object[]{status, modifiedUser},
// ddlPackBean);
}
@Override
@ApiOperation(value = "修改账号", notes = "修改账号信息")
public void updateSysUser(SysUser sysUser) {
LOGGER.debug("平台用户 SYS_USER SysUser :{}", sysUser);
@ -602,7 +625,7 @@ public class SysUserService implements ISysUserService {
public List<SysRefRoleMenu> findSysRefUserRoleMenuByUserId(Long userId) {
List<SysRefUserRole> roleList = findSysRefUserRoleByUserId(userId);
if (ObjectUtils.isEmpty(roleList)) {
return null;
return null;
}
List<Long> roleIdList = roleList.stream().map(el -> el.getRoleId()).collect(Collectors.toList());
List<SysRefRoleMenu> menuList = roleService.findSysRefRoleMenuByRoleIdList(roleIdList);

@ -19,6 +19,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.naming.NamingException;
@ -493,6 +495,7 @@ public class SysUserPasswordUtil {
int day = TimeTool.getSecoundsBetweenTime(4, user.getUserLoginLastDateTime(), TimeTool.getNowTime(true));
if(day > loginDayMax){
// 锁定账号信息
//todo: 账户没有被锁定,由于异常事务回滚,导致账户没有被锁定,这个更新操作就是多余的
userService.doLockSysUserById(user.getId());
throw ImppExceptionBuilder.newInstance()

@ -1,5 +1,5 @@
#\u4F7F\u7528\u914D\u7F6E
spring.profiles.active=test
spring.profiles.active=docker
#\u9879\u76EE\u63CF\u8FF0\u4FE1\u606F\uFF08swagger\u4E2D\u663E\u5F0F\uFF09\uFF0C\u4E2D\u6587\u4F7F\u7528uncode\u8F6C\u7801
desc.application.name=\u6838\u5FC3\u7BA1\u7406\u540E\u53F0

@ -7,7 +7,7 @@
<groupId>i3plus.core</groupId>
<artifactId>i3plus-core</artifactId>
<packaging>pom</packaging>
<version>1.0-TEST-SNAPSHOT</version>
<version>1.0.0.2</version>
<modules>
<module>modules/i3plus-core-api</module>
<module>modules/i3plus-core-apiservice</module>
@ -37,6 +37,7 @@
<skipTests>true</skipTests>
<app.charset>UTF-8</app.charset>
<app.jdk.version>1.8</app.jdk.version>
<project.dependency.version>1.0-TEST-SNAPSHOT</project.dependency.version>
</properties>
<dependencies>
@ -48,82 +49,82 @@
<dependency>
<groupId>impp.framework</groupId>
<artifactId>impp-framework-boot</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<!-- 微朝调用 -->
<dependency>
<groupId>i3plus.core</groupId>
<artifactId>i3plus-core-icloud</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.icloud</groupId>
<artifactId>i3plus-icloud-wms</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.icloud</groupId>
<artifactId>i3plus-icloud-mes</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.icloud</groupId>
<artifactId>i3plus-icloud-mes-pcn</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.icloud</groupId>
<artifactId>i3plus-icloud-ptl</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.icloud</groupId>
<artifactId>i3plus-icloud-andon</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.icloud</groupId>
<artifactId>i3plus-icloud-form</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.icloud</groupId>
<artifactId>i3plus-icloud-softswitch</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.icloud</groupId>
<artifactId>i3plus-icloud-mdm</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.icloud</groupId>
<artifactId>i3plus-icloud-screen</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<!-- 基础对象调用 -->
<dependency>
<groupId>i3plus.pojo</groupId>
<artifactId>i3plus-pojo-model</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.pojo</groupId>
<artifactId>i3plus-pojo-mdm</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<!-- 内部依赖声明 -->
@ -136,65 +137,65 @@
<dependency>
<groupId>i3plus.sdk</groupId>
<artifactId>i3plus-sdk-dingtalk</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.sdk</groupId>
<artifactId>i3plus-sdk-wechat</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.sdk</groupId>
<artifactId>i3plus-sdk-sms</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.platform</groupId>
<artifactId>i3plus-platform-common</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.platform</groupId>
<artifactId>i3plus-platform-plugin</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.platform</groupId>
<artifactId>i3plus-platform-plugin</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.pojo</groupId>
<artifactId>i3plus-pojo-platform</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.pojo</groupId>
<artifactId>i3plus-pojo-mes</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.pojo</groupId>
<artifactId>i3plus-pojo-base</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<dependency>
<groupId>i3plus.pojo</groupId>
<artifactId>i3plus-pojo-mes</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<!-- 微朝调用 -->
<dependency>
<groupId>i3plus.icloud</groupId>
<artifactId>i3plus-icloud-core</artifactId>
<version>${project.version}</version>
<version>${project.dependency.version}</version>
</dependency>
<!-- mysql -->

Loading…
Cancel
Save