Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
3c35a0e9
Commit
3c35a0e9
authored
May 09, 2025
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
需求:3309
parent
43fa47c1
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
298 additions
and
94 deletions
+298
-94
UserPermissionDto.java
...in/amos/boot/module/common/api/dto/UserPermissionDto.java
+10
-0
TzsUserInfoDto.java
.../yeejoin/amos/boot/module/tcm/api/dto/TzsUserInfoDto.java
+15
-3
TzsUserInfo.java
.../yeejoin/amos/boot/module/tcm/api/entity/TzsUserInfo.java
+24
-0
ITzsUserInfoService.java
...amos/boot/module/tcm/api/service/ITzsUserInfoService.java
+6
-1
TzsUserInfoVo.java
...om/yeejoin/amos/boot/module/tcm/api/vo/TzsUserInfoVo.java
+6
-0
TzsUserInfoMapper.xml
...e-tcm-api/src/main/resources/mapper/TzsUserInfoMapper.xml
+18
-8
TzsUserInfoController.java
...boot/module/tcm/biz/controller/TzsUserInfoController.java
+43
-9
TzsUserInfoServiceImpl.java
...t/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
+176
-73
No files found.
amos-boot-system-tzs/amos-boot-module-common/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/UserPermissionDto.java
View file @
3c35a0e9
...
...
@@ -112,4 +112,14 @@ public class UserPermissionDto {
* 人员类型code
*/
private
String
postCode
;
/**
* 人员子类型code
*/
private
String
subPostCode
;
/**
* 人员子类型名称
*/
private
String
subPostName
;
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/dto/TzsUserInfoDto.java
View file @
3c35a0e9
...
...
@@ -8,7 +8,6 @@ import lombok.Data;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
import
java.util.List
;
/**
* 用户信息
...
...
@@ -115,10 +114,23 @@ public class TzsUserInfoDto extends BaseDto {
@ApiModelProperty
(
value
=
"菜单类型,具体见TzsUserInfoServiceImpl中的menuMap"
)
private
String
menuType
;
@ApiModelProperty
(
value
=
"菜单类型下的所有人员类型"
)
private
List
<
String
>
menuTypeUnderPost
;
// 需求调整 一个菜单整合所有人员
// @ApiModelProperty(value = "菜单类型下的所有人员类型")
// private List<String> menuTypeUnderPost;
@ApiModelProperty
(
"二维码状态0异常1正常"
)
private
String
qrCodeState
;
@ApiModelProperty
(
"岗位子类型(多个逗号分割)"
)
private
String
subPost
;
@ApiModelProperty
(
"岗位子类型名称(多个逗号分割)"
)
private
String
subPostName
;
@ApiModelProperty
(
value
=
"人员转出标识(1:已转出,0:未转出,空值默认为未转出0)"
)
protected
String
transferOut
;
@ApiModelProperty
(
value
=
"人员转出时间"
)
protected
Date
transferOutTime
;
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/entity/TzsUserInfo.java
View file @
3c35a0e9
...
...
@@ -200,4 +200,28 @@ public class TzsUserInfo extends BaseEntity {
*/
@TableField
(
"qr_code_state"
)
private
String
qrCodeState
;
/**
* 岗位子类型(多个逗号分割)
*/
@TableField
(
"sub_post"
)
private
String
subPost
;
/**
* 岗位子类型名称(多个逗号分割)
*/
@TableField
(
"sub_post_name"
)
private
String
subPostName
;
/**
* 人员转出标识(1:已转出,0:未转出,空值默认为未转出0)
*/
@TableField
(
value
=
"transfer_out"
)
protected
String
transferOut
;
/**
* 人员转出时间
*/
@TableField
(
value
=
"transfer_out_time"
)
protected
Date
transferOutTime
;
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/service/ITzsUserInfoService.java
View file @
3c35a0e9
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tcm.api.service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzIndividualityDto
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto
;
...
...
@@ -33,7 +34,11 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> {
List
<
Map
<
String
,
Object
>>
getEquipmentType
(
String
creditCode
);
List
<
Map
<
String
,
Object
>>
getUserType
(
String
unitType
,
String
formType
);
List
<
Map
<
String
,
Object
>>
getUserAllPostType
();
List
<
DataDictionary
>
getSubPostByParentsIds
(
String
postIds
);
Boolean
personnelTransferOut
(
String
userSeqNbrs
);
Map
<
String
,
Integer
>
getArrangementStatistic
(
String
companyCode
);
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/vo/TzsUserInfoVo.java
View file @
3c35a0e9
...
...
@@ -161,4 +161,10 @@ public class TzsUserInfoVo {
@ApiModelProperty
(
value
=
"人员类型名称"
)
private
String
postName
;
@ApiModelProperty
(
"岗位子类型(多个逗号分割)"
)
private
JSONArray
subPost
;
@ApiModelProperty
(
"岗位子类型名称(多个逗号分割)"
)
private
String
subPostName
;
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/resources/mapper/TzsUserInfoMapper.xml
View file @
3c35a0e9
...
...
@@ -23,7 +23,8 @@
'男' ELSE '女'
END AS gender,
unit_code,
case when (SELECT count(1) from tzs_user_equip WHERE user_seq = sequence_nbr )>0 then '是' else '否' END as state
case when (SELECT count(1) from tzs_user_equip WHERE user_seq = sequence_nbr )>0 then '是' else '否' END as state,
IFNULL(sub_post_name, '—') as sub_post_name
FROM
tzs_user_info
</sql>
...
...
@@ -50,13 +51,16 @@
<if
test=
"dto.amosUserName != '' and dto.amosUserName != null"
>
and amos_user_name like concat('%',#{dto.amosUserName},'%')
</if>
<if
test=
"dto.menuTypeUnderPost != null and dto.menuTypeUnderPost.size() > 0"
>
AND (
<foreach
collection=
"dto.menuTypeUnderPost"
separator=
"or"
item=
"postType"
>
new_post like concat('%',#{postType},'%')
</foreach>
)
<if
test=
"dto.subPost != '' and dto.subPost != null"
>
and sub_post like concat('%',#{dto.subPost},'%')
</if>
<!-- <if test="dto.menuTypeUnderPost != null and dto.menuTypeUnderPost.size() > 0">-->
<!-- AND (-->
<!-- <foreach collection="dto.menuTypeUnderPost" separator="or" item="postType">-->
<!-- new_post like concat('%',#{postType},'%')-->
<!-- </foreach>-->
<!-- )-->
<!-- </if>-->
<if
test=
"dto.postName != '' and dto.postName != null"
>
and post like concat('%',#{dto.postName},'%')
</if>
...
...
@@ -242,6 +246,7 @@
"cb_data_dictionary"
WHERE
is_delete = false
and (parent is null or parent = '')
and type in
<foreach
collection=
"typeList"
separator=
","
item=
"type"
open=
"("
close=
")"
>
#{type}
...
...
@@ -300,6 +305,7 @@
u.certificate_num,
u.identification as identificationStr,
e.use_unit,
u.sub_post_name,
u.new_post as post,
u.sequence_nbr as uid,
u.sequence_nbr as "rowId",
...
...
@@ -325,6 +331,9 @@
<if
test=
"filter.postCode != null and filter.postCode != ''"
>
and u.new_post like concat('%',#{filter.postCode}, '%')
</if>
<if
test=
"filter.subPostCode != null and filter.subPostCode != ''"
>
and u.sub_post like concat('%',#{filter.subPostCode}, '%')
</if>
<if
test=
"filter.superviseOrgCode != null and filter.superviseOrgCode != ''"
>
and e.supervise_org_code like concat('%',#{filter.superviseOrgCode}, '%')
</if>
...
...
@@ -343,6 +352,6 @@
and (a.fullAddress like concat('%',#{filter.fullAddress},'%'))
</if>
</where>
order by a.
rec_date
order by a.
uid desc
</select>
</mapper>
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/controller/TzsUserInfoController.java
View file @
3c35a0e9
...
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.tcm.biz.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
...
...
@@ -37,9 +39,9 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@RestController
@Api
(
tags
=
"用户信息Api"
)
...
...
@@ -193,10 +195,16 @@ public class TzsUserInfoController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getUserType"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据单位类型获取人员类型"
,
notes
=
"根据单位类型获取人员类型"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getUserType
(
@RequestParam
(
value
=
"unitType"
)
String
unitType
,
@RequestParam
(
value
=
"formType"
,
defaultValue
=
"add"
)
String
formType
)
{
return
ResponseHelper
.
buildResponse
(
tzsUserInfoService
.
getUserType
(
unitType
,
formType
));
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取所有人员类型"
,
notes
=
"获取所有人员类型"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getUserAllPostType
()
{
return
ResponseHelper
.
buildResponse
(
tzsUserInfoService
.
getUserAllPostType
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getSubPostByParentsIds"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据岗位父类型ids获取对应岗位子类型"
,
notes
=
"根据岗位父类型ids获取对应岗位子类型"
)
public
ResponseModel
<
List
<
DataDictionary
>>
getSubPostByParentsIds
(
@RequestParam
(
value
=
"postIds"
)
String
postIds
)
{
return
ResponseHelper
.
buildResponse
(
tzsUserInfoService
.
getSubPostByParentsIds
(
postIds
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -326,10 +334,10 @@ public class TzsUserInfoController extends BaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"人员管理-人员类型-查询
指定菜单下的人员类型"
,
notes
=
"人员管理-人员类型-查询指定菜单下的
人员类型"
)
@GetMapping
(
value
=
"/
userTypeUnderMenu
"
)
public
ResponseModel
<
List
<
DataDictionary
>>
userTypeUnderMenu
(
@RequestParam
(
"menuType"
)
String
menuType
)
{
List
<
DataDictionary
>
dataDictionaries
=
tzsUserInfoServiceImpl
.
userTypeUnderMenu
(
menuType
);
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"人员管理-人员类型-查询
所有人员类型"
,
notes
=
"人员管理-人员类型-查询所有
人员类型"
)
@GetMapping
(
value
=
"/
getAllUserType
"
)
public
ResponseModel
<
List
<
DataDictionary
>>
getAllUserType
(
)
{
List
<
DataDictionary
>
dataDictionaries
=
tzsUserInfoServiceImpl
.
getAllUserType
(
);
return
ResponseHelper
.
buildResponse
(
dataDictionaries
);
}
...
...
@@ -360,4 +368,30 @@ public class TzsUserInfoController extends BaseController {
public
ResponseModel
<?>
importUser
(
@RequestBody
MultipartFile
file
)
{
return
tzsUserInfoService
.
importUserBatch
(
file
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/personnelTransferOut"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"人员转出:逻辑删除人员并删除关联的系统账号"
,
notes
=
"人员转出:逻辑删除人员并删除关联的系统账号"
)
public
ResponseModel
<
Boolean
>
personnelTransferOut
(
@RequestParam
(
value
=
"userSeqNbrs"
)
String
userSeqNbrs
)
{
return
ResponseHelper
.
buildResponse
(
tzsUserInfoService
.
personnelTransferOut
(
userSeqNbrs
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/historicalOperatorHandling"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"需求3309 人员管理调整后:历史的维保人员(作业人员含电梯维修资质的刷入子类型:持证人员)"
,
notes
=
"需求3309 人员管理调整后:历史的维保人员(作业人员含电梯维修资质的刷入子类型:持证人员)"
)
public
ResponseModel
<
Object
>
historicalOperatorHandling
()
{
// userinfo表中旧的post字段保存了旧字典值6618(维保人员)
List
<
Long
>
sesqNbrs
=
tzsUserInfoService
.
getBaseMapper
()
.
selectList
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
like
(
TzsUserInfo:
:
getPost
,
"6618"
)
.
select
(
TzsUserInfo:
:
getSequenceNbr
))
.
stream
()
.
map
(
TzsUserInfo:
:
getSequenceNbr
)
.
collect
(
Collectors
.
toList
());
tzsUserInfoService
.
getBaseMapper
().
update
(
null
,
new
LambdaUpdateWrapper
<
TzsUserInfo
>()
.
set
(
TzsUserInfo:
:
getSubPost
,
"[\"6713\"]"
)
.
set
(
TzsUserInfo:
:
getSubPostName
,
"持证人员"
)
.
in
(
TzsUserInfo:
:
getSequenceNbr
,
sesqNbrs
));
return
ResponseHelper
.
buildResponse
(
"更新数据:"
+
sesqNbrs
.
size
()
+
"条"
);
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
View file @
3c35a0e9
...
...
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Sets
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
...
...
@@ -137,7 +138,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
// 检验人员管理
menuMap
.
put
(
"jyry"
,
Collections
.
singletonList
(
"66151"
));
// 其他人员管理
menuMap
.
put
(
"qtry"
,
Collections
.
singletonList
(
"6546
"
));
menuMap
.
put
(
"qtry"
,
Arrays
.
asList
(
"6546"
,
"6617"
,
"6553
"
));
}
@Autowired
...
...
@@ -149,12 +150,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
@Override
public
Page
<
TzsUserInfoDto
>
page
(
TzsUserInfoDto
dto
,
Page
<
TzsUserInfoDto
>
page
)
{
dto
.
setMenuTypeUnderPost
(
menuMap
.
get
(
dto
.
getMenuType
()));
// 其他人员管理 包含 普通员工、安全管理员、安改维负责人
// 上面menuMap中的其他人员只是在新增人员时为页面赋默认值
if
(
"qtry"
.
equals
(
dto
.
getMenuType
()))
{
dto
.
setMenuTypeUnderPost
(
Arrays
.
asList
(
"6546"
,
"6617"
,
"6553"
));
}
// dto.setMenuTypeUnderPost(menuMap.get(dto.getMenuType()));
Page
<
TzsUserInfoDto
>
tzsUserInfoDtoPage
=
tzsUserInfoMapper
.
selectPageMessage
(
page
,
dto
);
tzsUserInfoDtoPage
.
getRecords
().
forEach
(
item
->
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
getProfile
()))
{
...
...
@@ -276,9 +272,14 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
if
(!
ObjectUtils
.
isEmpty
(
tzsUserInfo
.
getPost
()))
{
tzsUserInfoVo
.
setPost
(
JSON
.
parseArray
(
tzsUserInfo
.
getPost
()));
}
if
(!
ObjectUtils
.
isEmpty
(
tzsUserInfo
.
getNewPost
()))
{
tzsUserInfoVo
.
setNewPost
(
JSON
.
parseArray
(
tzsUserInfo
.
getNewPost
()));
}
Optional
.
ofNullable
(
tzsUserInfo
.
getNewPost
())
.
filter
(
post
->
!
ObjectUtils
.
isEmpty
(
post
))
.
map
(
JSON:
:
parseArray
)
.
ifPresent
(
tzsUserInfoVo:
:
setNewPost
);
Optional
.
ofNullable
(
tzsUserInfo
.
getSubPost
())
.
filter
(
post
->
!
ObjectUtils
.
isEmpty
(
post
))
.
map
(
JSON:
:
parseArray
)
.
ifPresent
(
tzsUserInfoVo:
:
setSubPost
);
if
(!
ObjectUtils
.
isEmpty
(
tzsUserInfo
.
getEquipType
()))
{
JSONArray
equipTypeJSONArray
=
JSON
.
parseArray
(
tzsUserInfo
.
getEquipType
());
tzsUserInfoVo
.
setEquipType
(
equipTypeJSONArray
);
...
...
@@ -683,34 +684,75 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
@Override
public
List
<
Map
<
String
,
Object
>>
getUserType
(
String
unitType
,
String
formType
)
{
// 详情可展示所有的人员类型
List
<
String
>
type
=
new
ArrayList
<>();
type
.
add
(
"QYRYGW"
);
if
(
"detail"
.
equals
(
formType
))
{
type
.
addAll
(
Arrays
.
asList
(
public
List
<
Map
<
String
,
Object
>>
getUserAllPostType
()
{
// 需求3309 提出展示所有人员类型供用户选择
List
<
String
>
type
=
new
ArrayList
<>(
Arrays
.
asList
(
"QYRYGW"
,
"QYRYGW-SYDW"
,
"QYRYGW-SCDW"
,
"QYRYGW-INSTALL"
,
"QYRYGW-INSPECTION"
));
}
else
{
if
(
unitType
.
contains
(
"use"
))
{
type
.
add
(
"QYRYGW-SYDW"
);
}
if
(
unitType
.
contains
(
"pro"
))
{
type
.
add
(
"QYRYGW-SCDW"
);
}
if
(
unitType
.
contains
(
"install"
))
{
type
.
add
(
"QYRYGW-INSTALL"
);
type
.
add
(
"QYRYGW-INSPECTION"
);
}
if
(
unitType
.
contains
(
"inspection"
))
{
type
.
add
(
"QYRYGW-INSPECTION"
);
type
.
add
(
"QYRYGW-SCDW"
);
// if ("detail".equals(formType)) {
// type.addAll(Arrays.asList(
// "QYRYGW-SYDW",
// "QYRYGW-SCDW",
// "QYRYGW-INSTALL",
// "QYRYGW-INSPECTION"
// ));
// } else {
// if (unitType.contains("use")) {
// type.add("QYRYGW-SYDW");
// }
// if (unitType.contains("pro")) {
// type.add("QYRYGW-SCDW");
// }
// if (unitType.contains("install")) {
// type.add("QYRYGW-INSTALL");
// type.add("QYRYGW-INSPECTION");
// }
// if (unitType.contains("inspection")) {
// type.add("QYRYGW-INSPECTION");
// type.add("QYRYGW-SCDW");
// }
// }
return
tzsUserInfoMapper
.
getUserTypeList
(
type
);
}
@Override
public
List
<
DataDictionary
>
getSubPostByParentsIds
(
String
postIds
)
{
return
iDataDictionaryService
.
lambdaQuery
()
.
in
(
DataDictionary:
:
getParent
,
new
ArrayList
<>(
Arrays
.
asList
(
postIds
.
split
(
","
))))
.
orderByAsc
(
DataDictionary:
:
getSortNum
)
.
list
();
}
return
tzsUserInfoMapper
.
getUserTypeList
(
type
);
/**
* 人员转出
* @param userSeqNbrs 用户seqNbrs,逗号分隔
* @return res
*/
@Override
public
Boolean
personnelTransferOut
(
String
userSeqNbrs
)
{
List
<
Long
>
seqNbrs
=
new
ArrayList
<>(
Arrays
.
asList
(
userSeqNbrs
.
split
(
","
))).
stream
().
map
(
Long:
:
parseLong
).
collect
(
Collectors
.
toList
());
// 逻辑删除用户+标识转出操作时间
this
.
update
(
new
LambdaUpdateWrapper
<
TzsUserInfo
>()
.
set
(
TzsUserInfo:
:
getIsDelete
,
Boolean
.
TRUE
)
.
set
(
TzsUserInfo:
:
getTransferOut
,
"1"
)
.
set
(
TzsUserInfo:
:
getTransferOutTime
,
new
Date
())
.
in
(
TzsUserInfo:
:
getSequenceNbr
,
seqNbrs
));
// 逻辑删除系统账号
String
deleteUserIds
=
this
.
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
isNotNull
(
TzsUserInfo:
:
getAmosUserId
)
.
isNotNull
(
TzsUserInfo:
:
getAmosUserName
)
.
select
(
TzsUserInfo:
:
getAmosUserId
)
.
in
(
TzsUserInfo:
:
getSequenceNbr
,
seqNbrs
))
.
stream
()
.
map
(
TzsUserInfo:
:
getAmosUserId
)
.
collect
(
Collectors
.
joining
(
","
));
Privilege
.
agencyUserClient
.
multDeleteUser
(
deleteUserIds
);
return
Boolean
.
TRUE
;
}
public
List
<
LinkedHashMap
>
screenData
(
List
<
LinkedHashMap
>
result
,
List
<
LinkedHashMap
>
data
,
String
id
)
{
...
...
@@ -846,23 +888,6 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
TzsUserInfoDto
saveUserInfo
(
TzsUserInfoDto
tzsUserInfo
)
{
LambdaQueryWrapper
<
TzsUserInfo
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
TzsUserInfo:
:
getCertificateType
,
tzsUserInfo
.
getCertificateType
());
queryWrapper
.
eq
(
TzsUserInfo:
:
getCertificateNum
,
tzsUserInfo
.
getCertificateNum
());
queryWrapper
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
);
TzsUserInfo
certificateNum
=
tzsUserInfoMapper
.
selectOne
(
queryWrapper
);
if
(!
ObjectUtils
.
isEmpty
(
certificateNum
))
{
throw
new
BadRequest
(
"证件号码重复,请核对!"
);
}
LambdaQueryWrapper
<
TzsUserInfo
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
queryWrapper1
.
eq
(
TzsUserInfo:
:
getPhone
,
tzsUserInfo
.
getPhone
());
queryWrapper1
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
);
TzsUserInfo
phone
=
tzsUserInfoMapper
.
selectOne
(
queryWrapper1
);
if
(!
ObjectUtils
.
isEmpty
(
phone
))
{
throw
new
BadRequest
(
"联系电话重复,请核对!"
);
}
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
ObjectUtils
.
isEmpty
(
reginParams
))
{
return
null
;
...
...
@@ -871,6 +896,37 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
if
(
ObjectUtils
.
isEmpty
(
companyModel
))
{
throw
new
BadRequest
(
"未指定人员归属单位信息"
);
}
if
(!
ObjectUtils
.
isEmpty
(
tzsUserInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
eq
(
TzsUserInfo:
:
getCertificateType
,
tzsUserInfo
.
getCertificateType
())
.
eq
(
TzsUserInfo:
:
getCertificateNum
,
tzsUserInfo
.
getCertificateNum
())
.
eq
(
TzsUserInfo:
:
getUnitCode
,
companyModel
.
getCompanyCode
())
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
))))
{
throw
new
BadRequest
(
"本单位下用户证件号码重复,请核对!"
);
}
if
(!
ObjectUtils
.
isEmpty
(
tzsUserInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
eq
(
TzsUserInfo:
:
getCertificateType
,
tzsUserInfo
.
getCertificateType
())
.
eq
(
TzsUserInfo:
:
getCertificateNum
,
tzsUserInfo
.
getCertificateNum
())
.
ne
(
TzsUserInfo:
:
getUnitCode
,
companyModel
.
getCompanyCode
())
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
))))
{
throw
new
BadRequest
(
"该用户已被其他单位绑定,请联系原单位转出!"
);
}
if
(!
ObjectUtils
.
isEmpty
(
tzsUserInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
eq
(
TzsUserInfo:
:
getUnitCode
,
companyModel
.
getCompanyCode
())
.
eq
(
TzsUserInfo:
:
getPhone
,
tzsUserInfo
.
getPhone
())
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
))))
{
throw
new
BadRequest
(
"本单位下用户联系电话重复,请核对!"
);
}
if
(!
ObjectUtils
.
isEmpty
(
tzsUserInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
ne
(
TzsUserInfo:
:
getUnitCode
,
companyModel
.
getCompanyCode
())
.
eq
(
TzsUserInfo:
:
getPhone
,
tzsUserInfo
.
getPhone
())
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
))))
{
throw
new
BadRequest
(
"该用户手机号已被其他单位人员绑定!"
);
}
tzsUserInfo
.
setUnitName
(
companyModel
.
getCompanyName
());
tzsUserInfo
.
setUnitCode
(
companyModel
.
getCompanyCode
());
tzsUserInfo
.
setAppointDoc
(
tzsUserInfo
.
getAppointDoc
());
...
...
@@ -889,6 +945,20 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
}
tzsUserInfo
.
setPost
(
JSONArray
.
toJSONString
(
postArray
));
tzsUserInfo
.
setPostName
(
this
.
setPostName
(
tzsUserInfo
.
getNewPost
()));
// 兼容前端只传一个值,并且非json类型的情况
JSONArray
subPostArray
=
JSONArray
.
parseArray
(
this
.
isJSONValid
(
tzsUserInfo
.
getSubPost
())
?
tzsUserInfo
.
getSubPost
()
:
"[\""
+
tzsUserInfo
.
getSubPost
()
+
"\"]"
);
if
(
subPostArray
!=
null
)
{
tzsUserInfo
.
setSubPost
(
JSONArray
.
toJSONString
(
subPostArray
));
String
subPostNames
=
iDataDictionaryService
.
lambdaQuery
()
.
in
(
DataDictionary:
:
getCode
,
subPostArray
)
.
orderByAsc
(
DataDictionary:
:
getSortNum
)
.
select
(
DataDictionary:
:
getName
)
.
list
()
.
stream
()
.
map
(
DataDictionary:
:
getName
)
.
collect
(
Collectors
.
joining
(
","
));
tzsUserInfo
.
setSubPostName
(
subPostNames
);
}
tzsUserInfo
=
this
.
createWithModel
(
tzsUserInfo
);
// 保存资质
tzsUserPermissionServiceImpl
.
savePermissionData
(
tzsUserInfo
);
...
...
@@ -897,24 +967,6 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
TzsUserInfoDto
updateUserInfo
(
Long
rowId
,
TzsUserInfoDto
tzsUserInfoDto
)
{
LambdaQueryWrapper
<
TzsUserInfo
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
TzsUserInfo:
:
getCertificateType
,
tzsUserInfoDto
.
getCertificateType
());
queryWrapper
.
eq
(
TzsUserInfo:
:
getCertificateNum
,
tzsUserInfoDto
.
getCertificateNum
());
queryWrapper
.
ne
(
TzsUserInfo:
:
getSequenceNbr
,
rowId
);
queryWrapper
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
);
TzsUserInfo
certificateNum
=
tzsUserInfoMapper
.
selectOne
(
queryWrapper
);
if
(!
ObjectUtils
.
isEmpty
(
certificateNum
))
{
throw
new
BadRequest
(
"证件号码重复,请核对!"
);
}
LambdaQueryWrapper
<
TzsUserInfo
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
queryWrapper1
.
eq
(
TzsUserInfo:
:
getPhone
,
tzsUserInfoDto
.
getPhone
());
queryWrapper1
.
ne
(
TzsUserInfo:
:
getSequenceNbr
,
rowId
);
queryWrapper1
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
);
TzsUserInfo
phone
=
tzsUserInfoMapper
.
selectOne
(
queryWrapper1
);
if
(!
ObjectUtils
.
isEmpty
(
phone
))
{
throw
new
BadRequest
(
"联系电话重复,请核对!"
);
}
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
ObjectUtils
.
isEmpty
(
reginParams
))
{
...
...
@@ -925,6 +977,36 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
throw
new
BadRequest
(
"未指定人员归属单位信息"
);
}
if
(!
ObjectUtils
.
isEmpty
(
tzsUserInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
eq
(
TzsUserInfo:
:
getCertificateType
,
tzsUserInfoDto
.
getCertificateType
())
.
eq
(
TzsUserInfo:
:
getCertificateNum
,
tzsUserInfoDto
.
getCertificateNum
())
.
eq
(
TzsUserInfo:
:
getUnitCode
,
companyModel
.
getCompanyCode
())
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
))))
{
throw
new
BadRequest
(
"本单位下用户证件号码重复,请核对!"
);
}
if
(!
ObjectUtils
.
isEmpty
(
tzsUserInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
eq
(
TzsUserInfo:
:
getCertificateType
,
tzsUserInfoDto
.
getCertificateType
())
.
eq
(
TzsUserInfo:
:
getCertificateNum
,
tzsUserInfoDto
.
getCertificateNum
())
.
ne
(
TzsUserInfo:
:
getUnitCode
,
companyModel
.
getCompanyCode
())
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
))))
{
throw
new
BadRequest
(
"该用户已被其他单位绑定,请联系原单位转出!"
);
}
if
(!
ObjectUtils
.
isEmpty
(
tzsUserInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
eq
(
TzsUserInfo:
:
getUnitCode
,
companyModel
.
getCompanyCode
())
.
eq
(
TzsUserInfo:
:
getPhone
,
tzsUserInfoDto
.
getPhone
())
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
))))
{
throw
new
BadRequest
(
"本单位下用户联系电话重复,请核对!"
);
}
if
(!
ObjectUtils
.
isEmpty
(
tzsUserInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
ne
(
TzsUserInfo:
:
getUnitCode
,
companyModel
.
getCompanyCode
())
.
eq
(
TzsUserInfo:
:
getPhone
,
tzsUserInfoDto
.
getPhone
())
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
))))
{
throw
new
BadRequest
(
"该用户手机号已被其他单位人员绑定!"
);
}
//删除人员与组的关系
QueryWrapper
<
TzsUserInfo
>
queryWrapper2
=
new
QueryWrapper
<>();
queryWrapper2
.
eq
(
"sequence_nbr"
,
rowId
);
...
...
@@ -964,6 +1046,20 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
}
}
}
// 兼容前端只传一个值,并且非json类型的情况
JSONArray
subPostArray
=
JSONArray
.
parseArray
(
this
.
isJSONValid
(
tzsUserInfoDto
.
getSubPost
())
?
tzsUserInfoDto
.
getSubPost
()
:
"[\""
+
tzsUserInfoDto
.
getSubPost
()
+
"\"]"
);
if
(
subPostArray
!=
null
)
{
tzsUserInfoDto
.
setSubPost
(
JSONArray
.
toJSONString
(
subPostArray
));
String
subPostNames
=
iDataDictionaryService
.
lambdaQuery
()
.
in
(
DataDictionary:
:
getCode
,
subPostArray
)
.
orderByAsc
(
DataDictionary:
:
getSortNum
)
.
select
(
DataDictionary:
:
getName
)
.
list
()
.
stream
()
.
map
(
DataDictionary:
:
getName
)
.
collect
(
Collectors
.
joining
(
","
));
tzsUserInfoDto
.
setSubPostName
(
subPostNames
);
}
// 更新资质
tzsUserPermissionServiceImpl
.
updatePermissionData
(
tzsUserInfoDto
);
tzsUserInfoDto
.
setQrCodeState
(
"1"
);
...
...
@@ -971,13 +1067,20 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
return
tzsUserInfoDto
;
}
public
List
<
DataDictionary
>
userTypeUnderMenu
(
String
menu
)
{
List
<
String
>
userTypeCode
=
menuMap
.
getOrDefault
(
menu
,
new
ArrayList
<>());
if
(
userTypeCode
.
isEmpty
())
{
return
Collections
.
emptyList
();
}
List
<
String
>
act
=
new
ArrayList
<>(
userTypeCode
);
return
iDataDictionaryService
.
getBaseMapper
().
selectBatchIds
(
act
);
public
List
<
DataDictionary
>
getAllUserType
()
{
List
<
String
>
type
=
new
ArrayList
<>(
Arrays
.
asList
(
"QYRYGW"
,
"QYRYGW-SYDW"
,
"QYRYGW-SCDW"
,
"QYRYGW-INSTALL"
,
"QYRYGW-INSPECTION"
));
return
iDataDictionaryService
.
lambdaQuery
()
.
select
(
DataDictionary:
:
getName
,
DataDictionary:
:
getCode
)
.
eq
(
DataDictionary:
:
getIsDelete
,
false
)
.
isNull
(
DataDictionary:
:
getParent
)
.
in
(
DataDictionary:
:
getType
,
type
)
.
list
();
}
/**
...
...
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