Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
H
hzsomms
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZTGK
hzsomms
Commits
6497f030
Commit
6497f030
authored
Jul 06, 2024
by
hkl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:1.新需求提交
parent
305ac4e7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
14 deletions
+53
-14
WorkBatchMapper.xml
...cg/modules/maintenanceWork/mapper/xml/WorkBatchMapper.xml
+5
-2
WorkBatchUserVO.java
...org/jeecg/modules/maintenanceWork/vo/WorkBatchUserVO.java
+17
-1
SysUserController.java
...rg/jeecg/modules/system/controller/SysUserController.java
+31
-11
No files found.
jeecg-module-system/src/main/java/org/jeecg/modules/maintenanceWork/mapper/xml/WorkBatchMapper.xml
View file @
6497f030
...
@@ -173,13 +173,16 @@
...
@@ -173,13 +173,16 @@
t1.username,
t1.username,
t1.realname,
t1.realname,
t1.user_identity,
t1.user_identity,
t3.role_name
t3.role_name,
CONCAT(t1.username, ' | ', t1.realname, ' | ', t3.role_name) AS label
FROM
FROM
sys_user t1
sys_user t1
INNER JOIN sys_user_role t2 ON t2.user_id = t1.id
INNER JOIN sys_user_role t2 ON t2.user_id = t1.id
INNER JOIN sys_role t3 ON t3.id = t2.role_id
INNER JOIN sys_role t3 ON t3.id = t2.role_id
WHERE
WHERE
t1.del_flag = 0
t1.del_flag = 0
<if
test=
"query != null and query != ''"
>
AND (t1.username LIKE concat('%',#{query},'%') OR t1.realname LIKE concat('%',#{query},'%'))
AND (t1.username LIKE concat('%',#{query},'%') OR t1.realname LIKE concat('%',#{query},'%'))
</if>
</select>
</select>
</mapper>
</mapper>
jeecg-module-system/src/main/java/org/jeecg/modules/maintenanceWork/vo/WorkBatchUserVO.java
View file @
6497f030
package
org
.
jeecg
.
modules
.
maintenanceWork
.
vo
;
package
org
.
jeecg
.
modules
.
maintenanceWork
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
/**
/**
...
@@ -15,7 +16,22 @@ import lombok.Data;
...
@@ -15,7 +16,22 @@ import lombok.Data;
@ApiModel
(
value
=
"WorkBatchUserVO对象"
,
description
=
"维修作业管理-派工用户"
)
@ApiModel
(
value
=
"WorkBatchUserVO对象"
,
description
=
"维修作业管理-派工用户"
)
public
class
WorkBatchUserVO
{
public
class
WorkBatchUserVO
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
private
String
id
;
@ApiModelProperty
(
"用户id"
)
private
String
userId
;
@ApiModelProperty
(
"工号"
)
private
String
username
;
@ApiModelProperty
(
"名称"
)
private
String
realname
;
@ApiModelProperty
(
"用户身份"
)
private
String
userIdentity
;
@ApiModelProperty
(
"角色名称"
)
private
String
roleName
;
@ApiModelProperty
(
"显示字段"
)
private
String
label
;
}
}
jeecg-module-system/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
View file @
6497f030
...
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Constants
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
@@ -604,10 +605,13 @@ public class SysUserController {
...
@@ -604,10 +605,13 @@ public class SysUserController {
})
})
public
Result
<
String
>
importUser
(
MultipartFile
file
)
{
public
Result
<
String
>
importUser
(
MultipartFile
file
)
{
List
<
SysRole
>
roleList
=
sysRoleService
.
list
();
List
<
SysRole
>
roleList
=
sysRoleService
.
list
();
List
<
SysUser
>
sysUserList
=
this
.
sysUserService
.
lambdaQuery
()
.
eq
(
SysUser:
:
getDelFlag
,
CommonConstant
.
DEL_FLAG_0
)
.
list
();
try
(
InputStream
inputStream
=
file
.
getInputStream
())
{
try
(
InputStream
inputStream
=
file
.
getInputStream
())
{
// 1.excel导入List<List<Object>> 中
// 1.excel导入List<List<Object>> 中
CurrentRowHandler
currentRowHandler
=
new
CurrentRowHandler
(
roleList
);
CurrentRowHandler
currentRowHandler
=
new
CurrentRowHandler
(
roleList
,
sysUserList
);
ExcelUtil
.
readBySax
(
inputStream
,
0
,
currentRowHandler
);
ExcelUtil
.
readBySax
(
inputStream
,
0
,
currentRowHandler
);
...
@@ -643,23 +647,29 @@ public class SysUserController {
...
@@ -643,23 +647,29 @@ public class SysUserController {
/**
/**
* 角色
code映射
* 角色
映射:用来检查是否存在
*/
*/
private
Map
<
String
,
String
>
roleMap
;
private
Map
<
String
,
String
>
roleMap
;
/**
* 用户映射:用来判断角色是否存在
*/
private
Set
<
String
>
userSet
;
/**
/**
* 用户列表
* 用户列表
*/
*/
public
List
<
SysUser
>
sysUserList
;
public
List
<
SysUser
>
sysUserList
;
/**
/**
* 用户角色id
* 用户角色id
*/
*/
public
List
<
SysUserRole
>
sysUserRoleList
;
public
List
<
SysUserRole
>
sysUserRoleList
;
public
CurrentRowHandler
(
List
<
SysRole
>
roles
)
{
public
CurrentRowHandler
(
List
<
SysRole
>
roles
,
List
<
SysUser
>
sysUsers
)
{
this
.
disposeMark
=
true
;
this
.
disposeMark
=
true
;
this
.
msg
=
new
StringBuffer
();
this
.
msg
=
new
StringBuffer
();
// 将角色映射表
// 将角色映射表
...
@@ -667,6 +677,13 @@ public class SysUserController {
...
@@ -667,6 +677,13 @@ public class SysUserController {
for
(
SysRole
role
:
roles
)
{
for
(
SysRole
role
:
roles
)
{
roleMap
.
put
(
role
.
getRoleName
(),
role
.
getId
());
roleMap
.
put
(
role
.
getRoleName
(),
role
.
getId
());
}
}
// 将用户放入映射表中
this
.
userSet
=
new
HashSet
<>();
for
(
SysUser
sysUser
:
sysUsers
)
{
userSet
.
add
(
sysUser
.
getUsername
());
}
this
.
sysUserList
=
new
ArrayList
<>();
this
.
sysUserRoleList
=
new
ArrayList
<>();
}
}
...
@@ -681,14 +698,17 @@ public class SysUserController {
...
@@ -681,14 +698,17 @@ public class SysUserController {
String
realName
=
Convert
.
toStr
(
rowList
.
get
(
0
));
String
realName
=
Convert
.
toStr
(
rowList
.
get
(
0
));
if
(
ObjectUtil
.
isEmpty
(
realName
))
{
if
(
ObjectUtil
.
isEmpty
(
realName
))
{
this
.
disposeMark
=
false
;
this
.
disposeMark
=
false
;
msg
.
append
(
"第【"
+
rowIndex
+
1
+
"】行名称不能为空"
);
msg
.
append
(
"第【"
+
(
rowIndex
+
1
)
+
"】行名称不能为空"
);
}
}
// 工号 = 用户账号
// 工号 = 用户账号
String
username
=
Convert
.
toStr
(
rowList
.
get
(
1
));
String
username
=
Convert
.
toStr
(
rowList
.
get
(
1
));
if
(
ObjectUtil
.
isEmpty
(
username
))
{
if
(
ObjectUtil
.
isEmpty
(
username
))
{
this
.
disposeMark
=
false
;
this
.
disposeMark
=
false
;
msg
.
append
(
"第【"
+
rowIndex
+
1
+
"】行工号不能为空"
);
msg
.
append
(
"第【"
+
(
rowIndex
+
1
)
+
"】行工号不能为空"
);
}
else
if
(
userSet
.
contains
(
username
))
{
this
.
disposeMark
=
false
;
msg
.
append
(
"第【"
+
(
rowIndex
+
1
)
+
"】行已存在"
);
}
}
// 身份 中文
// 身份 中文
...
@@ -696,13 +716,13 @@ public class SysUserController {
...
@@ -696,13 +716,13 @@ public class SysUserController {
Integer
userIdentity
=
1
;
Integer
userIdentity
=
1
;
if
(
ObjectUtil
.
isEmpty
(
userIdentityStr
))
{
if
(
ObjectUtil
.
isEmpty
(
userIdentityStr
))
{
this
.
disposeMark
=
false
;
this
.
disposeMark
=
false
;
msg
.
append
(
"第【"
+
rowIndex
+
1
+
"】行身份不能为空"
);
msg
.
append
(
"第【"
+
(
rowIndex
+
1
)
+
"】行身份不能为空"
);
}
else
if
(
"正式"
.
equals
(
userIdentityStr
))
{
}
else
if
(
"正式"
.
equals
(
userIdentityStr
))
{
userIdentity
=
1
;
userIdentity
=
1
;
}
else
if
(
"委外"
.
equals
(
userIdentityStr
))
{
}
else
if
(
"委外"
.
equals
(
userIdentityStr
))
{
userIdentity
=
2
;
userIdentity
=
2
;
}
else
{
}
else
{
msg
.
append
(
"第【"
+
rowIndex
+
1
+
"】行身份识别失败"
);
msg
.
append
(
"第【"
+
(
rowIndex
+
1
)
+
"】行身份识别失败"
);
}
}
// 角色名称
// 角色名称
...
@@ -710,11 +730,11 @@ public class SysUserController {
...
@@ -710,11 +730,11 @@ public class SysUserController {
String
roleId
=
""
;
String
roleId
=
""
;
if
(
ObjectUtil
.
isEmpty
(
roleName
))
{
if
(
ObjectUtil
.
isEmpty
(
roleName
))
{
this
.
disposeMark
=
false
;
this
.
disposeMark
=
false
;
msg
.
append
(
"第【"
+
rowIndex
+
1
+
"】行角色不能为空"
);
msg
.
append
(
"第【"
+
(
rowIndex
+
1
)
+
"】行角色不能为空"
);
}
else
if
(
roleMap
.
containsKey
(
roleName
))
{
}
else
if
(
roleMap
.
containsKey
(
roleName
))
{
roleId
=
roleMap
.
get
(
roleName
);
roleId
=
roleMap
.
get
(
roleName
);
}
else
{
}
else
{
msg
.
append
(
"第【"
+
rowIndex
+
1
+
"】行角色识别失败"
);
msg
.
append
(
"第【"
+
(
rowIndex
+
1
)
+
"】行角色识别失败"
);
}
}
// 添加换行符号
// 添加换行符号
...
@@ -725,10 +745,10 @@ public class SysUserController {
...
@@ -725,10 +745,10 @@ public class SysUserController {
SysUser
currentUser
=
new
SysUser
();
SysUser
currentUser
=
new
SysUser
();
currentUser
.
setId
(
IdWorker
.
getIdStr
());
currentUser
.
setId
(
IdWorker
.
getIdStr
());
currentUser
.
setUsername
(
username
);
currentUser
.
setUsername
(
username
);
currentUser
.
setRealname
(
r
ole
Name
);
currentUser
.
setRealname
(
r
eal
Name
);
currentUser
.
setUserIdentity
(
userIdentity
);
// 正式员工身份
currentUser
.
setUserIdentity
(
userIdentity
);
// 正式员工身份
currentUser
.
setWorkNo
(
username
);
currentUser
.
setWorkNo
(
username
);
currentUser
.
setDelFlag
(
0
);
currentUser
.
setDelFlag
(
CommonConstant
.
DEL_FLAG_
0
);
currentUser
.
setLoginTenantId
(
0
);
currentUser
.
setLoginTenantId
(
0
);
currentUser
.
setStatus
(
CommonConstant
.
USER_UNFREEZE
);
currentUser
.
setStatus
(
CommonConstant
.
USER_UNFREEZE
);
String
salt
=
oConvertUtils
.
randomGen
(
8
);
String
salt
=
oConvertUtils
.
randomGen
(
8
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment