From 03b3b72756f2933f408da17a9c677b415f9dc679 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Fri, 13 Aug 2021 20:46:50 +0800
Subject: [PATCH] 1.许可审批
---
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java | 40 ++++++++++++++++++++++------------------
1 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java b/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
index 808e324..b42672c 100644
--- a/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
+++ b/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -95,10 +95,10 @@
if (Func.isNotEmpty(user.getPassword())) {
user.setPassword(DigestUtil.encrypt(user.getPassword()));
}
- Integer userCount = baseMapper.selectCount(Wrappers.<User>query().lambda().eq(User::getTenantId, tenantId).eq(User::getAccount, user.getAccount()));
- if (userCount > 0 && Func.isEmpty(user.getId())) {
- throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
- }
+// Integer userCount = baseMapper.selectCount(Wrappers.<User>query().lambda().eq(User::getTenantId, tenantId).eq(User::getAccount, user.getAccount()));
+// if (userCount > 0 && Func.isEmpty(user.getId())) {
+// throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
+// }
return save(user) && submitUserDept(user);
}
@@ -302,21 +302,21 @@
if (!AuthUtil.isAdministrator() || StringUtil.isBlank(user.getTenantId())) {
user.setTenantId(AuthUtil.getTenantId());
}
- if (userExcel.getStatus().equals("在职")){
- user.setStatus(1);
+ if (null != userExcel.getStatus() && userExcel.getStatus() != "") {
+ if (userExcel.getStatus().equals("在职")) {
+ user.setStatus(1);
+ } else {
+ user.setStatus(2);
+ }
}
- else {
- user.setStatus(2);
- }
- if (userExcel.getSex().equals("男性")){
+ if (userExcel.getSex().equals("男性")) {
user.setSex(1);
- }
- else {
+ } else {
user.setSex(2);
}
user.setRoleId("1412226235153731586");
String deptname = user.getDeptId();
- String id =userDeptService.selectIn(deptname);
+ String id = userDeptService.selectIn(deptname);
user.setDeptId(id);
//获取默认密码配置
String initPassword = ParamCache.getValue(DEFAULT_PARAM_PASSWORD);
@@ -420,6 +420,7 @@
/**
* 通过 身份证号查询用户信息
+ *
* @param idCardNo 身份证号
* @return
*/
@@ -446,6 +447,7 @@
/**
* 保安员列表,帅选无保安证
+ *
* @param page
* @param user
* @param deptId
@@ -460,18 +462,19 @@
/**
* 保安员列表树 安员列表树,帅选无保安证,下拉tree
+ *
* @param user 用户信息
* @return
*/
@Override
public List<TreeNode> getSecurityApplyTree(UserVO user) {
- Map<Long,TreeNode> map = baseMapper.getSecurityApplyTree(user);
+ Map<Long, TreeNode> map = baseMapper.getSecurityApplyTree(user);
List<TreeNode> tree = new ArrayList<>();
- if (map.size()>1){
- map.forEach((id,treeNode) ->{
- if (map.containsKey(treeNode.getParentId())){
+ if (map.size() > 1) {
+ map.forEach((id, treeNode) -> {
+ if (map.containsKey(treeNode.getParentId())) {
map.get(treeNode.getParentId()).getChildren().add(treeNode);
- }else {
+ } else {
tree.add(treeNode);
}
});
@@ -486,6 +489,7 @@
/**
* 查询当前年份已有的保安证编号
+ *
* @param pre 前缀
* @return
*/
--
Gitblit v1.9.3