diff --git a/modules/i3plus-core-api/pom.xml b/modules/i3plus-core-api/pom.xml
index 42c86a0..fbc6758 100644
--- a/modules/i3plus-core-api/pom.xml
+++ b/modules/i3plus-core-api/pom.xml
@@ -5,7 +5,7 @@
i3plus-core
i3plus.core
- 1.0-TEST-SNAPSHOT
+ 1.0.0.2
../../pom.xml
4.0.0
@@ -69,4 +69,4 @@
${project.artifactId}-${project.version}
-
\ No newline at end of file
+
diff --git a/modules/i3plus-core-api/src/main/java/cn/estsh/i3plus/core/api/iservice/busi/IPersonnelService.java b/modules/i3plus-core-api/src/main/java/cn/estsh/i3plus/core/api/iservice/busi/IPersonnelService.java
index 2513378..94a6fd8 100644
--- a/modules/i3plus-core-api/src/main/java/cn/estsh/i3plus/core/api/iservice/busi/IPersonnelService.java
+++ b/modules/i3plus-core-api/src/main/java/cn/estsh/i3plus/core/api/iservice/busi/IPersonnelService.java
@@ -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 findSysUserIdByDepartmentId(Long ...departmentId);
+ @ApiOperation(value = "查询账号ID", notes = "根据部门ID 查询所有的人员信息")
+ List findSysUserIdByDepartmentId(Long... departmentId);
// @ApiOperation(value = "查询账号ID",notes = "根据组织代码 查询所有的人员信息")
// List findSysUserIdByOrganizeCode(String ...organizeCode);
@@ -64,13 +66,13 @@ public interface IPersonnelService {
List querySysUserByUserDetailModelOrIds(UserDetailModel model, List ids);
@ApiOperation(value = "查询账号信息")
- ListPager querySysUserPagerByUserDetailModelOrIds(UserDetailModel model,Pager pager, List ids);
+ ListPager querySysUserPagerByUserDetailModelOrIds(UserDetailModel model, Pager pager, List ids);
@ApiOperation(value = "获取用户信息")
SysUserInfo getSysUserInfoById(Long id);
- @ApiOperation(value = "查询账号ID",notes = "根据部门ID 查询所有的人员信息")
- List findSysUserInfoIdByDepartmentId(Long ...departmentId);
+ @ApiOperation(value = "查询账号ID", notes = "根据部门ID 查询所有的人员信息")
+ List findSysUserInfoIdByDepartmentId(Long... departmentId);
// @ApiOperation(value = "查询账号ID",notes = "根据组织代码 查询所有的人员信息")
// List findSysUserInfoIdByOrganizeCode(String ...organizeCode);
@@ -87,46 +89,49 @@ public interface IPersonnelService {
@ApiOperation(value = "查询用户信息")
List findSysUserInfoByIds(Long[] ids);
- @ApiOperation(value = "查询角色",notes = "查询制定用户的角色信息")
+ @ApiOperation(value = "查询角色", notes = "查询制定用户的角色信息")
List findSysRoleByUserId(Long userId);
// @ApiOperation(value = "查询角色",notes = "查询所有角色信息")
// List findSysRoleList();
- @ApiOperation(value = "查询权限",notes = "查询所有权限")
+ @ApiOperation(value = "查询权限", notes = "查询所有权限")
List findSysMenuList();
- @ApiOperation(value = "查询权限",notes = "查询所有权限")
+ @ApiOperation(value = "查询权限", notes = "查询所有权限")
List findSysMenuByUserId(Long userId);
// @ApiOperation(value = "查询权限",notes = "查询所有权限")
// List findSysMenuByIdList(List ids);
- @ApiOperation(value = "查询权限",notes = "查询所有权限")
+ @ApiOperation(value = "查询权限", notes = "查询所有权限")
List findSysMenuByRefRoleMenu(List refList);
@ApiOperation(value = "查询账号角色关系")
List findSysRefUserRole(Long userId);
@ApiOperation(value = "查询账号角色关系")
- List findSysRefUserRole(Long roleId,String organizeCode);
+ List findSysRefUserRole(Long roleId, String organizeCode);
@ApiOperation(value = "查询账号角色关系")
- List findSysRefUserRole(Long userId,Long roleId,String organizeCode);
+ List findSysRefUserRole(Long userId, Long roleId, String organizeCode);
- @ApiOperation(value = "角色权限关系",notes = "根据角色ID 查询权限")
+ @ApiOperation(value = "角色权限关系", notes = "根据角色ID 查询权限")
List findSysRefRoleMenuByUserId(Long userId);
- @ApiOperation(value = "查询角色账号关系",notes = "查询角色账号关系")
- ListPager findSysRefUserRoleByRoleIds(List roleIdList,Pager pager);
+ @ApiOperation(value = "查询角色账号关系", notes = "查询角色账号关系")
+ ListPager findSysRefUserRoleByRoleIds(List roleIdList, Pager pager);
- @ApiOperation(value = "角色权限关系",notes = "根据角色ID 查询权限")
+ @ApiOperation(value = "查询人员拥有的角色信息", notes = "查询人员是否拥有对应角色")
+ List findSysRefUserRoleByRoleNameAndUserID(String roleName, Long userId);
+
+ @ApiOperation(value = "角色权限关系", notes = "根据角色ID 查询权限")
List findSysRefRoleMenuByRoleIds(List roleIdList);
- @ApiOperation(value = "角色权限关系",notes = "根据角色ID 查询权限")
+ @ApiOperation(value = "角色权限关系", notes = "根据角色ID 查询权限")
List findSysRefRoleMenuByRole(List roleList);
- @ApiOperation(value = "角色权限关系",notes = "根据角色ID 查询权限")
+ @ApiOperation(value = "角色权限关系", notes = "根据角色ID 查询权限")
List findSysRefRoleMenuByRefUserRole(List refList);
@ApiOperation(value = "查询账号部门关系")
diff --git a/modules/i3plus-core-apiservice/pom.xml b/modules/i3plus-core-apiservice/pom.xml
index f6d2309..af92ab0 100644
--- a/modules/i3plus-core-apiservice/pom.xml
+++ b/modules/i3plus-core-apiservice/pom.xml
@@ -5,7 +5,7 @@
i3plus-core
i3plus.core
- 1.0-TEST-SNAPSHOT
+ 1.0.0.2
../../pom.xml
4.0.0
@@ -357,4 +357,4 @@
-
\ No newline at end of file
+
diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysRoleController.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysRoleController.java
index 6bb27eb..6585b68 100644
--- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysRoleController.java
+++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysRoleController.java
@@ -34,6 +34,7 @@ import org.springframework.beans.BeanWrapper;
import org.springframework.beans.factory.annotation.Autowired;
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;
@@ -241,7 +242,7 @@ public class SysRoleController extends CrudBaseController {
}
}
- @PostMapping(value = "/queryAllRoleRefUser", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
+ @PostMapping(value = "/queryAllRoleRefUser")
@ApiOperation(value = "在所有角色中查询角色及关联的人员信息", notes = "查询角色及关联的人员信息")
public BaseResultBean queryAllRoleRefUser(@RequestBody SysRoleModel sysRoleModel) {
try {
@@ -272,7 +273,7 @@ public class SysRoleController extends CrudBaseController {
}
- @PostMapping(value = "/queryRoleRefUser", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
+ @PostMapping(value = "/queryRoleRefUser")
@ApiOperation(value = "查询当前请求人员的角色及关联的人员信息", notes = "查询角色及关联的人员信息")
public BaseResultBean queryRoleRefUser(@RequestBody SysRoleModel sysRoleModel) {
try {
@@ -280,12 +281,15 @@ public class SysRoleController extends CrudBaseController {
SysRole sysRole = sysRoleModel.getSysRole();
Pager pager = sysRoleModel.getPager();
if (ObjectUtils.isEmpty(sysRole)){
- sysRole = new SysRole();
+ return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}
if (ObjectUtils.isEmpty(pager)){
pager = new Pager();
}
- List refList = personnelService.findSysRefUserRole(getSessionUser().getUser().getId());
+ if (StringUtils.isEmpty(sysRole.getName())){
+ return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
+ }
+ List refList = personnelService.findSysRefUserRoleByRoleNameAndUserID(sysRole.getName(), getSessionUser().getUser().getId());
if (refList != null && refList.size() > 0) {
List idList = new ArrayList<>(refList.size());
refList.forEach(ref -> {
diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/PersonnelServiceService.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/PersonnelServiceService.java
index a24d66d..5ecfcee 100644
--- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/PersonnelServiceService.java
+++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/serviceimpl/busi/PersonnelServiceService.java
@@ -130,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);
}
@@ -140,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
@@ -170,9 +170,9 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List findSysUserIdByDepartmentId(Long... departmentId) {
List result = new ArrayList<>();
- if(departmentId != null && departmentId.length > 0){
+ if (departmentId != null && departmentId.length > 0) {
List 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()));
}
}
@@ -208,14 +208,14 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public ListPager querySysUser(UserDetailModel model, Pager pager) {
Set 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)));
}
@@ -234,7 +234,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
@ApiOperation(value = "查询账号信息")
- public ListPager querySysUserPagerByUserDetailModelOrIds(UserDetailModel model,Pager pager, List ids) {
+ public ListPager querySysUserPagerByUserDetailModelOrIds(UserDetailModel model, Pager pager, List ids) {
LOGGER.info("平台用户 SysUser model:{} ids:{}", model, ids);
String modeWhere = HqlModelPack.packHqlSysUserByModelOrIds(model, ids);
@@ -250,9 +250,9 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List findSysUserInfoIdByDepartmentId(Long... departmentId) {
List result = new ArrayList<>();
- if(departmentId != null && departmentId.length > 0){
+ if (departmentId != null && departmentId.length > 0) {
List 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()));
}
}
@@ -286,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;
@@ -296,7 +296,6 @@ public class PersonnelServiceService implements IPersonnelService {
public ListPager querySysUserInfo(UserDetailModel model, Pager pager) {
-
DdlPackBean packBean = CoreHqlPack.packDdlBeanSysUserInfo(model.getSysUserInfo(), StringTool.getListLong(model.getUserInfoIdList()));
pager = PagerHelper.getPager(pager, userInfoRDao.findByHqlWhereCount(packBean));
@@ -317,7 +316,7 @@ public class PersonnelServiceService implements IPersonnelService {
LOGGER.debug("平台账号角色 SysRole userId:{}", userId);
List refList = findSysRefUserRole(userId);
- if(refList != null && refList.size() > 0){
+ if (refList != null && refList.size() > 0) {
List idList = new ArrayList<>();
refList.forEach(ref -> idList.add(ref.getRoleId()));
@@ -351,7 +350,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List findSysMenuByUserId(Long userId) {
- LOGGER.info("平台账号权限 SysMenu userId:{}",userId);
+ LOGGER.info("平台账号权限 SysMenu userId:{}", userId);
List refUserRoleList = findSysRefUserRole(userId);
List refRoleMenuList = findSysRefRoleMenuByRefUserRole(refUserRoleList);
return findSysMenuByRefRoleMenu(refRoleMenuList);
@@ -369,7 +368,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List findSysMenuByRefRoleMenu(List refList) {
LOGGER.info("平台账号角色 SysRefRoleMenu refList:{}", refList);
- if(refList != null && refList.size() > 0){
+ if (refList != null && refList.size() > 0) {
List idList = new ArrayList<>(refList.size());
refList.forEach(ref -> idList.add(ref.getMenuId()));
return menuService.findByIdList(idList);
@@ -389,44 +388,53 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List 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 findSysRefRoleMenuByUserId(Long userId) {
LOGGER.info("平台账号角色 SysRefRoleMenu userId:{}", userId);
- if(userId != null){
+ if (userId != null) {
List refRoleList = findSysRefUserRole(userId);
- if(refRoleList != null && refRoleList.size() > 0){
+ if (refRoleList != null && refRoleList.size() > 0) {
List idList = new ArrayList<>(refRoleList.size());
refRoleList.forEach(ref -> idList.add(ref.getRoleId()));
- return findSysRefRoleMenuByRoleIds( idList);
+ return findSysRefRoleMenuByRoleIds(idList);
}
}
return null;
}
@Override
- public ListPager findSysRefUserRoleByRoleIds(List roleIdList,Pager pager) {
- if (ObjectUtils.isEmpty(roleIdList)){
- return null;
+ public ListPager findSysRefUserRoleByRoleIds(List 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));
+ DdlPreparedPack.getInPackList(roleIdList, "roleId", packBean);
+ pager = PagerHelper.getPager(pager, refUserRoleRDao.findByHqlWhereCount(packBean));
return new ListPager<>(refUserRoleRDao.findByHqlWherePage(packBean, pager), pager);
}
@Override
+ public List 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 findSysRefRoleMenuByRoleIds(List 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());
}
@@ -436,7 +444,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List findSysRefRoleMenuByRole(List roleList) {
LOGGER.info("平台账号角色 SysRefRoleMenu roleList:{}", roleList);
- if(roleList != null && roleList.size() > 0){
+ if (roleList != null && roleList.size() > 0) {
List idList = new ArrayList<>(roleList.size());
roleList.forEach(ref -> idList.add(ref.getId()));
return findSysRefRoleMenuByRoleIds(idList);
@@ -447,7 +455,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List findSysRefRoleMenuByRefUserRole(List refList) {
LOGGER.info("平台账号角色 SysRefRoleMenu refList:{}", refList);
- if(refList != null && refList.size() > 0){
+ if (refList != null && refList.size() > 0) {
List idList = new ArrayList<>(refList.size());
refList.forEach(ref -> idList.add(ref.getRoleId()));
return findSysRefRoleMenuByRoleIds(idList);
@@ -458,7 +466,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List findSysRefUserDepartmentByUserId(Long userId) {
LOGGER.info("平台账号部门 SysRefUserDepartment userId:{}", userId);
- return refUserDepartmentRDao.findByProperty("userId",userId);
+ return refUserDepartmentRDao.findByProperty("userId", userId);
}
@Override
@@ -466,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);
}
@@ -476,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);
}
@@ -486,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 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;
}
}
@@ -512,7 +520,7 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List findSysRefUserInfoDepartmentById(Long infoId) {
LOGGER.info("平台用户部门关系 SysRefUserInfoDepartment infoId:{}", infoId);
- return refUserInfoDepartmentRDao.findByProperty("userId",infoId);
+ return refUserInfoDepartmentRDao.findByProperty("userId", infoId);
}
@Override
@@ -520,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);
}
@@ -530,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);
}
@@ -548,7 +556,7 @@ public class PersonnelServiceService implements IPersonnelService {
List result = new ArrayList<>();
List refs = findSysRefUserInfoDepartmentById(infoId);
- if(refs != null && refs.size() > 0){
+ if (refs != null && refs.size() > 0) {
List ids = new ArrayList<>();
refs.forEach(ref -> ids.add(ref.getDepartmentId()));
@@ -564,7 +572,7 @@ public class PersonnelServiceService implements IPersonnelService {
List result = new ArrayList<>();
List refs = findSysRefUserDepartmentByUserId(infoId);
- if(refs != null && refs.size() > 0){
+ if (refs != null && refs.size() > 0) {
List ids = new ArrayList<>();
refs.forEach(ref -> ids.add(ref.getDepartmentId()));
@@ -587,7 +595,7 @@ public class PersonnelServiceService implements IPersonnelService {
List result = new ArrayList<>();
List refs = findSysRefUserInfoDepartmentById(infoId);
- if(refs != null && refs.size() > 0){
+ if (refs != null && refs.size() > 0) {
List ids = new ArrayList<>();
refs.forEach(ref -> ids.add(ref.getOrganizeId()));
@@ -602,7 +610,7 @@ public class PersonnelServiceService implements IPersonnelService {
List result = new ArrayList<>();
List refs = findSysRefUserDepartmentByUserId(infoId);
- if(refs != null && refs.size() > 0){
+ if (refs != null && refs.size() > 0) {
List ids = new ArrayList<>();
refs.forEach(ref -> ids.add(ref.getOrganizeId()));
@@ -630,14 +638,14 @@ public class PersonnelServiceService implements IPersonnelService {
@Override
public List findSysRefUserPositionByUserInfoId(Long infoId) {
LOGGER.info("平台用户岗位 SysRefUserPosition infoId:{}", infoId);
- return refUserPositionRDao.findByProperty("userId",infoId);
+ return refUserPositionRDao.findByProperty("userId", infoId);
}
@Override
public List findSysRefUserPositionByIdList(List 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;
@@ -645,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())
@@ -679,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())
@@ -695,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())
@@ -709,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;
}
@@ -718,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 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();
}
@@ -745,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();
}
@@ -756,13 +764,13 @@ public class PersonnelServiceService implements IPersonnelService {
public void checkSysDepartmentRef(Long departmentId) {
LOGGER.info("平台部门 SysDepartment departmentId:{}", departmentId);
- if(departmentId != null){
- List departmentList = departmentService.findAllByBean(new SysDepartment(null,departmentId,null));
+ if (departmentId != null) {
+ List 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();
}
@@ -772,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();
}
@@ -782,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();
}
@@ -793,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 organizeList = organizeService.findAllByBean(org);
@@ -801,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();
}
@@ -816,12 +824,12 @@ public class PersonnelServiceService implements IPersonnelService {
// .buildSearch();
// }
- List departmentList = departmentService.findAllByBean(new SysDepartment(null,null,organizeId));
+ List 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();
}
@@ -831,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();
}
@@ -841,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();
}
@@ -954,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 departmentList = departmentService.findByIdList(Arrays.asList(departmentIds));
- if(departmentList != null && departmentList.size() >0){
+ if (departmentList != null && departmentList.size() > 0) {
List list = new ArrayList<>();
SysRefUserDepartment ref = null;
for (SysDepartment department : departmentList) {
@@ -986,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());
}
}
}
@@ -1028,12 +1036,12 @@ public class PersonnelServiceService implements IPersonnelService {
}
List 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);
@@ -1044,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 departmentList = departmentService.findByIdList(Arrays.asList(departmentIds));
- if(departmentList != null && departmentList.size() >0){
+ if (departmentList != null && departmentList.size() > 0) {
List list = new ArrayList<>();
SysRefUserInfoDepartment ref = null;
for (SysDepartment department : departmentList) {
@@ -1076,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())
@@ -1131,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 positionList = positionService.findByIdList(Arrays.asList(positionIds));
- if(positionList != null && positionList.size() >0){
+ if (positionList != null && positionList.size() > 0) {
List list = new ArrayList<>();
SysRefUserPosition ref = null;
for (SysPosition position : positionList) {
@@ -1161,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())
@@ -1183,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;
}
@@ -1204,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);
}
}
@@ -1227,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);
}
}
@@ -1250,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);
}
}
@@ -1273,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);
}
}
@@ -1303,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;
}
}
diff --git a/pom.xml b/pom.xml
index 347af6b..b298123 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
i3plus.core
i3plus-core
pom
- 1.0-TEST-SNAPSHOT
+ 1.0.0.2
modules/i3plus-core-api
modules/i3plus-core-apiservice
@@ -37,6 +37,7 @@
true
UTF-8
1.8
+ 1.0-TEST-SNAPSHOT
@@ -48,82 +49,82 @@
impp.framework
impp-framework-boot
- ${project.version}
+ ${project.dependency.version}
i3plus.core
i3plus-core-icloud
- ${project.version}
+ ${project.dependency.version}
i3plus.icloud
i3plus-icloud-wms
- ${project.version}
+ ${project.dependency.version}
i3plus.icloud
i3plus-icloud-mes
- ${project.version}
+ ${project.dependency.version}
i3plus.icloud
i3plus-icloud-mes-pcn
- ${project.version}
+ ${project.dependency.version}
i3plus.icloud
i3plus-icloud-ptl
- ${project.version}
+ ${project.dependency.version}
i3plus.icloud
i3plus-icloud-andon
- ${project.version}
+ ${project.dependency.version}
i3plus.icloud
i3plus-icloud-form
- ${project.version}
+ ${project.dependency.version}
i3plus.icloud
i3plus-icloud-softswitch
- ${project.version}
+ ${project.dependency.version}
i3plus.icloud
i3plus-icloud-mdm
- ${project.version}
+ ${project.dependency.version}
i3plus.icloud
i3plus-icloud-screen
- ${project.version}
+ ${project.dependency.version}
i3plus.pojo
i3plus-pojo-model
- ${project.version}
+ ${project.dependency.version}
i3plus.pojo
i3plus-pojo-mdm
- ${project.version}
+ ${project.dependency.version}
@@ -136,65 +137,65 @@
i3plus.sdk
i3plus-sdk-dingtalk
- ${project.version}
+ ${project.dependency.version}
i3plus.sdk
i3plus-sdk-wechat
- ${project.version}
+ ${project.dependency.version}
i3plus.sdk
i3plus-sdk-sms
- ${project.version}
+ ${project.dependency.version}
i3plus.platform
i3plus-platform-common
- ${project.version}
+ ${project.dependency.version}
i3plus.platform
i3plus-platform-plugin
- ${project.version}
+ ${project.dependency.version}
i3plus.platform
i3plus-platform-plugin
- ${project.version}
+ ${project.dependency.version}
i3plus.pojo
i3plus-pojo-platform
- ${project.version}
+ ${project.dependency.version}
i3plus.pojo
i3plus-pojo-mes
- ${project.version}
+ ${project.dependency.version}
i3plus.pojo
i3plus-pojo-base
- ${project.version}
+ ${project.dependency.version}
i3plus.pojo
i3plus-pojo-mes
- ${project.version}
+ ${project.dependency.version}
i3plus.icloud
i3plus-icloud-core
- ${project.version}
+ ${project.dependency.version}
@@ -423,4 +424,4 @@
-
\ No newline at end of file
+