Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
a0380bea
Commit
a0380bea
authored
Dec 27, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
B端服务添加
parent
97201675
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
1253 additions
and
4 deletions
+1253
-4
MSetttleCustomerUser.java
...ud/plus/v1/yifu/archives/entity/MSetttleCustomerUser.java
+56
-0
MSetttleCustomerUserVo.java
...loud/plus/v1/yifu/archives/vo/MSetttleCustomerUserVo.java
+19
-0
MSetttleCustomerUserController.java
...u/archives/controller/MSetttleCustomerUserController.java
+118
-0
MSetttleCustomerUserMapper.java
...s/v1/yifu/archives/mapper/MSetttleCustomerUserMapper.java
+31
-0
MSetttleCustomerUserService.java
...v1/yifu/archives/service/MSetttleCustomerUserService.java
+32
-0
MSetttleCustomerUserServiceImpl.java
...rchives/service/impl/MSetttleCustomerUserServiceImpl.java
+54
-0
MSetttleCustomerUserMapper.xml
.../src/main/resources/mapper/MSetttleCustomerUserMapper.xml
+55
-0
CommonConstants.java
...ud/plus/v1/yifu/common/core/constant/CommonConstants.java
+5
-0
ServiceNameConstants.java
...us/v1/yifu/common/core/constant/ServiceNameConstants.java
+5
-0
Common.java
.../com/yifu/cloud/plus/v1/yifu/common/core/util/Common.java
+6
-0
YifuUser.java
.../com/yifu/cloud/plus/v1/yifu/common/core/vo/YifuUser.java
+9
-0
ArchivesDaprUtil.java
...cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java
+10
-0
SecurityUtils.java
...loud/plus/v1/yifu/common/security/util/SecurityUtils.java
+9
-1
UserInfo.java
...a/com/yifu.cloud.plus.v1/yifu/admin/api/dto/UserInfo.java
+5
-0
SysMenu.java
...com/yifu.cloud.plus.v1/yifu/admin/api/entity/SysMenu.java
+3
-0
SysRole.java
...com/yifu.cloud.plus.v1/yifu/admin/api/entity/SysRole.java
+3
-0
BusinessRoleMenuVo.java
...u.cloud.plus.v1/yifu/admin/api/vo/BusinessRoleMenuVo.java
+26
-0
BusinessUserVo.java
.../yifu.cloud.plus.v1/yifu/admin/api/vo/BusinessUserVo.java
+41
-0
MenuTreeForVue.java
.../yifu.cloud.plus.v1/yifu/admin/api/vo/MenuTreeForVue.java
+112
-0
MenuVO.java
...java/com/yifu.cloud.plus.v1/yifu/admin/api/vo/MenuVO.java
+107
-0
RoleMenuR.java
...a/com/yifu.cloud.plus.v1/yifu/admin/api/vo/RoleMenuR.java
+26
-0
BusinessUserController.java
...plus/v1/yifu/admin/controller/BusinessUserController.java
+318
-0
SysRoleMapper.java
...m/yifu/cloud/plus/v1/yifu/admin/mapper/SysRoleMapper.java
+6
-0
SysUserMapper.java
...m/yifu/cloud/plus/v1/yifu/admin/mapper/SysUserMapper.java
+2
-0
SysUserRoleMapper.java
...fu/cloud/plus/v1/yifu/admin/mapper/SysUserRoleMapper.java
+2
-0
SysRoleService.java
...yifu/cloud/plus/v1/yifu/admin/service/SysRoleService.java
+17
-0
SysUserRoleService.java
.../cloud/plus/v1/yifu/admin/service/SysUserRoleService.java
+7
-0
SysUserService.java
...yifu/cloud/plus/v1/yifu/admin/service/SysUserService.java
+12
-0
SysRoleServiceImpl.java
...d/plus/v1/yifu/admin/service/impl/SysRoleServiceImpl.java
+11
-0
SysUserRoleServiceImpl.java
...us/v1/yifu/admin/service/impl/SysUserRoleServiceImpl.java
+4
-1
SysUserServiceImpl.java
...d/plus/v1/yifu/admin/service/impl/SysUserServiceImpl.java
+78
-0
SysDictMapper.xml
...yifu-upms-biz/src/main/resources/mapper/SysDictMapper.xml
+0
-1
SysRoleMapper.xml
...yifu-upms-biz/src/main/resources/mapper/SysRoleMapper.xml
+24
-0
SysUserMapper.xml
...yifu-upms-biz/src/main/resources/mapper/SysUserMapper.xml
+26
-0
SysUserRoleMapper.xml
...-upms-biz/src/main/resources/mapper/SysUserRoleMapper.xml
+14
-1
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/entity/MSetttleCustomerUser.java
0 → 100644
View file @
a0380bea
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.Data
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotBlank
;
/**
* b端用户客户关系表
*
* @author pwang
* @date 2020-08-26 12:00:12
*/
@Data
@TableName
(
"m_setttle_customer_user"
)
@Tag
(
name
=
"b端用户客户关系表"
)
public
class
MSetttleCustomerUser
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@Schema
(
description
=
"主键"
,
name
=
"id"
)
private
String
id
;
/**
* 客户id
*/
@NotBlank
(
message
=
"客户id不能为空"
)
@Length
(
max
=
32
,
message
=
"客户id不能超过32个字符"
)
@ExcelAttribute
(
name
=
"客户id"
,
isNotEmpty
=
true
,
errorInfo
=
"客户id不能为空"
,
maxLength
=
32
)
@Schema
(
description
=
"客户id"
,
name
=
"customerId"
)
private
String
customerId
;
/**
* 结算主体id
*/
@NotBlank
(
message
=
"结算主体id不能为空"
)
@Length
(
max
=
32
,
message
=
"结算主体id不能超过32个字符"
)
@ExcelAttribute
(
name
=
"结算主体id"
,
isNotEmpty
=
true
,
errorInfo
=
"结算主体id不能为空"
,
maxLength
=
32
)
@Schema
(
description
=
"结算主体id"
,
name
=
"settleId"
)
private
String
settleId
;
/**
* 用户id
*/
@NotBlank
(
message
=
"用户id不能为空"
)
@Length
(
max
=
32
,
message
=
"用户id不能超过32个字符"
)
@ExcelAttribute
(
name
=
"用户id"
,
isNotEmpty
=
true
,
errorInfo
=
"用户id不能为空"
,
maxLength
=
32
)
@Schema
(
description
=
"用户id"
,
name
=
"userId"
)
private
String
userId
;
}
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/MSetttleCustomerUserVo.java
0 → 100644
View file @
a0380bea
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.MSetttleCustomerUser
;
import
lombok.Data
;
/**
* @Author fxj
* @Description 用户客户关系包装类
* @Date 16:32 2022/12/27
* @Param
* @return
**/
@Data
public
class
MSetttleCustomerUserVo
extends
MSetttleCustomerUser
{
/**
* 客户名称
**/
private
String
customerName
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/MSetttleCustomerUserController.java
0 → 100644
View file @
a0380bea
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.MSetttleCustomerUser
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.MSetttleCustomerUserService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.AllArgsConstructor
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Author fxj
* @Description b端用户客户关系表
* @Date 16:24 2022/12/27
* @Param
* @return
**/
@RestController
@AllArgsConstructor
@RequestMapping
(
"/msetttlecustomeruser"
)
@Tag
(
name
=
"b端用户客户关系表"
)
public
class
MSetttleCustomerUserController
{
private
final
MSetttleCustomerUserService
mSetttleCustomerUserService
;
/**
* 简单分页查询
*
* @param page 分页对象
* @param mSetttleCustomerUser b端用户客户关系表
* @return
*/
@Operation
(
description
=
"简单分页查询"
)
@GetMapping
(
"/page"
)
public
R
<
IPage
<
MSetttleCustomerUser
>>
getMSetttleCustomerUserPage
(
Page
<
MSetttleCustomerUser
>
page
,
MSetttleCustomerUser
mSetttleCustomerUser
)
{
return
new
R
<>(
mSetttleCustomerUserService
.
getMSetttleCustomerUserPage
(
page
,
mSetttleCustomerUser
));
}
/**
* 通过id查询单条记录
*
* @param id
* @return R
*/
@Operation
(
description
=
"id查询"
)
@GetMapping
(
"/{id}"
)
public
R
<
MSetttleCustomerUser
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
return
new
R
<>(
mSetttleCustomerUserService
.
getById
(
id
));
}
/**
* 新增记录
*
* @param mSetttleCustomerUser
* @return R
*/
@Operation
(
description
=
"新增(wxhr:msetttlecustomeruser_add)"
)
@PostMapping
@PreAuthorize
(
"@pms.hasPermission('wxhr:msetttlecustomeruser_add')"
)
public
R
<
Boolean
>
save
(
@Valid
@RequestBody
MSetttleCustomerUser
mSetttleCustomerUser
)
{
return
new
R
<>(
mSetttleCustomerUserService
.
save
(
mSetttleCustomerUser
));
}
/**
* 修改记录
*
* @param mSetttleCustomerUser
* @return R
*/
@Operation
(
description
=
"修改(wxhr:msetttlecustomeruser_edit)"
)
@SysLog
(
"修改b端用户客户关系表"
)
@PutMapping
@PreAuthorize
(
"@pms.hasPermission('wxhr:msetttlecustomeruser_edit')"
)
public
R
<
Boolean
>
update
(
@RequestBody
MSetttleCustomerUser
mSetttleCustomerUser
)
{
return
new
R
<>(
mSetttleCustomerUserService
.
updateById
(
mSetttleCustomerUser
));
}
/**
* 通过id删除一条记录
*
* @param id
* @return R
*/
@Operation
(
description
=
"删除(wxhr:msetttlecustomeruser_del)"
)
@SysLog
(
"删除b端用户客户关系表"
)
@DeleteMapping
(
"/{id}"
)
@PreAuthorize
(
"@pms.hasPermission('wxhr:msetttlecustomeruser_del')"
)
public
R
<
Boolean
>
removeById
(
@PathVariable
String
id
)
{
return
new
R
<>(
mSetttleCustomerUserService
.
removeById
(
id
));
}
/**
* 远程接口获取客户用户关系
*/
@Inner
@PostMapping
(
"/inner/getCustomerUserMap"
)
public
Map
<
String
,
String
>
getCustomerUserMap
(
@RequestBody
List
<
Integer
>
userIdList
)
{
return
mSetttleCustomerUserService
.
getCustomerUser
(
userIdList
);
}
/**
* 远程接口获取客户关系数
*/
@Inner
@GetMapping
(
"/inner/getCustomerCount"
)
public
Integer
getCustomerCount
()
{
return
mSetttleCustomerUserService
.
getCustomerCount
();
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/mapper/MSetttleCustomerUserMapper.java
0 → 100644
View file @
a0380bea
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.MSetttleCustomerUser
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.MSetttleCustomerUserVo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* b端用户客户关系表
*
* @author pwang
* @date 2020-08-26 12:00:12
*/
public
interface
MSetttleCustomerUserMapper
extends
BaseMapper
<
MSetttleCustomerUser
>
{
/**
* b端用户客户关系表简单分页查询
*
* @param mSetttleCustomerUser b端用户客户关系表
* @return
*/
IPage
<
MSetttleCustomerUser
>
getMSetttleCustomerUserPage
(
Page
<
MSetttleCustomerUser
>
page
,
@Param
(
"mSetttleCustomerUser"
)
MSetttleCustomerUser
mSetttleCustomerUser
);
List
<
MSetttleCustomerUserVo
>
getCustomerUser
(
@Param
(
"userIdList"
)
List
<
Integer
>
userIdList
);
Integer
getCustomerCount
();
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/MSetttleCustomerUserService.java
0 → 100644
View file @
a0380bea
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.MSetttleCustomerUser
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Author fxj
* @Description b端用户客户关系表
* @Date 16:34 2022/12/27
* @Param
* @return
**/
public
interface
MSetttleCustomerUserService
extends
IService
<
MSetttleCustomerUser
>
{
/**
* b端用户客户关系表简单分页查询
*
* @param mSetttleCustomerUser b端用户客户关系表
* @return
*/
IPage
<
MSetttleCustomerUser
>
getMSetttleCustomerUserPage
(
Page
<
MSetttleCustomerUser
>
page
,
MSetttleCustomerUser
mSetttleCustomerUser
);
Map
<
String
,
String
>
getCustomerUser
(
List
<
Integer
>
userIdList
);
Integer
getCustomerCount
();
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/MSetttleCustomerUserServiceImpl.java
0 → 100644
View file @
a0380bea
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.MSetttleCustomerUser
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.MSetttleCustomerUserMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.MSetttleCustomerUserService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.MSetttleCustomerUserVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Author fxj
* @Description b端用户客户关系表
* @Date 16:33 2022/12/27
* @Param
* @return
**/
@Service
public
class
MSetttleCustomerUserServiceImpl
extends
ServiceImpl
<
MSetttleCustomerUserMapper
,
MSetttleCustomerUser
>
implements
MSetttleCustomerUserService
{
/**
* b端用户客户关系表简单分页查询
*
* @param mSetttleCustomerUser b端用户客户关系表
* @return
*/
@Override
public
IPage
<
MSetttleCustomerUser
>
getMSetttleCustomerUserPage
(
Page
<
MSetttleCustomerUser
>
page
,
MSetttleCustomerUser
mSetttleCustomerUser
)
{
return
baseMapper
.
getMSetttleCustomerUserPage
(
page
,
mSetttleCustomerUser
);
}
@Override
public
Map
<
String
,
String
>
getCustomerUser
(
List
<
Integer
>
userIdList
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
List
<
MSetttleCustomerUserVo
>
list
=
baseMapper
.
getCustomerUser
(
userIdList
);
if
(
Common
.
isNotNull
(
list
)){
for
(
MSetttleCustomerUserVo
vo
:
list
){
map
.
put
(
vo
.
getUserId
(),
vo
.
getCustomerName
());
}
}
return
map
;
}
@Override
public
Integer
getCustomerCount
()
{
return
baseMapper
.
getCustomerCount
();
}
}
yifu-archives/yifu-archives-biz/src/main/resources/mapper/MSetttleCustomerUserMapper.xml
0 → 100644
View file @
a0380bea
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.yifu.archives.mapper.MSetttleCustomerUserMapper"
>
<resultMap
id=
"mSetttleCustomerUserMap"
type=
"com.yifu.cloud.plus.v1.yifu.archives.entity.MSetttleCustomerUser"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"customerId"
column=
"customer_id"
/>
<result
property=
"settleId"
column=
"settle_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
a.id,
a.customer_id,
a.settle_id,
a.user_id
</sql>
<sql
id=
"mSetttleCustomerUser_where"
>
<if
test=
"mSetttleCustomerUser != null"
>
<if
test=
"mSetttleCustomerUser.id != null and mSetttleCustomerUser.id.trim() != ''"
>
AND a.id = #{mSetttleCustomerUser.id}
</if>
<if
test=
"mSetttleCustomerUser.customerId != null and mSetttleCustomerUser.customerId.trim() != ''"
>
AND a.customer_id = #{mSetttleCustomerUser.customerId}
</if>
<if
test=
"mSetttleCustomerUser.settleId != null and mSetttleCustomerUser.settleId.trim() != ''"
>
AND a.settle_id = #{mSetttleCustomerUser.settleId}
</if>
<if
test=
"mSetttleCustomerUser.userId != null and mSetttleCustomerUser.userId.trim() != ''"
>
AND a.user_id = #{mSetttleCustomerUser.userId}
</if>
</if>
</sql>
<!--mSetttleCustomerUser简单分页查询-->
<select
id=
"getMSetttleCustomerUserPage"
resultMap=
"mSetttleCustomerUserMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM m_setttle_customer_user a
<where>
1=1
<include
refid=
"mSetttleCustomerUser_where"
/>
</where>
</select>
<select
id=
"getCustomerUser"
resultType=
"com.yifu.cloud.plus.v1.yifu.archives.vo.MSetttleCustomerUserVo"
>
select a.user_id,GROUP_CONCAT(DISTINCT b.CUSTOMER_NAME) as CUSTOMER_NAME from m_setttle_customer_user a
left join t_customer_info b on a.customer_id = b.id
where a.user_id in
<foreach
item=
"item"
index=
"index"
collection=
"userIdList"
open=
"("
separator=
","
close=
")"
>
'${item}'
</foreach>
GROUP BY a.user_id
</select>
<select
id=
"getCustomerCount"
resultType=
"java.lang.Integer"
>
SELECT count(DISTINCT customer_id) from m_setttle_customer_user a ;
</select>
</mapper>
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CommonConstants.java
View file @
a0380bea
...
...
@@ -507,4 +507,9 @@ public interface CommonConstants {
public
static
final
String
A_CREATE_BY
=
"a.CREATE_BY"
;
String
SETTLE_DOMAIN_GET_ERROR
=
"获取结算主体信息失败!"
;
/**
* b端机构节点
* @Author fxj
**/
public
static
final
long
HR_B_ORG_ID
=
295
;
}
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/ServiceNameConstants.java
View file @
a0380bea
...
...
@@ -45,4 +45,9 @@ public interface ServiceNameConstants {
* hrms-archives模块
*/
String
ARCHIVES_SERVICE
=
"yifu-archives"
;
/**
* hr b端Client id
**/
String
CLIENT_ID_HR_B
=
"hrCustomer"
;
}
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/util/Common.java
View file @
a0380bea
...
...
@@ -311,6 +311,12 @@ public class Common {
}
return
null
;
}
public
static
String
isNotNullToStr
(
Long
value
)
{
if
(
Common
.
isNotNull
(
value
)){
return
Long
.
toString
(
value
);
}
return
null
;
}
public
static
Integer
isNotNullToInt
(
String
value
)
{
if
(
Common
.
isNotNull
(
value
)){
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/vo/YifuUser.java
View file @
a0380bea
...
...
@@ -17,10 +17,13 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
core
.
vo
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.userdetails.User
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author lengleng
...
...
@@ -70,6 +73,12 @@ public class YifuUser extends User {
@Getter
private
final
String
userGroup
;
/**
* key是客户端id,val是角色id数组
*/
@Getter
@Setter
private
Map
<
String
,
List
<
Long
>>
clientRoleMap
;
/**
* LDAP_DN
*/
...
...
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java
View file @
a0380bea
...
...
@@ -30,6 +30,16 @@ import java.util.Map;
public
class
ArchivesDaprUtil
{
@Autowired
private
DaprArchivesProperties
daprArchivesProperties
;
public
R
<
Map
<
String
,
String
>>
getCustomerUserMap
(
List
<
String
>
userList
){
R
<
Map
>
res
=
HttpDaprUtil
.
invokeMethodPost
(
daprArchivesProperties
.
getAppUrl
(),
daprArchivesProperties
.
getAppId
(),
"/msetttlecustomeruser/inner/getCustomerUserMap"
,
JSON
.
toJSONString
(
userList
),
Map
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
Common
.
isEmpty
(
res
)){
return
R
.
failed
(
"获取档案派单信息失败!"
);
}
Map
<
String
,
String
>
map
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
res
.
getData
()),
new
TypeReference
<
HashMap
<
String
,
String
>>(){});
return
R
.
ok
(
map
);
}
/**
* @Author fxj
* @Description 获取派单校验需要的档案信息
...
...
yifu-common/yifu-common-security/src/main/java/com/yifu/cloud/plus/v1/yifu/common/security/util/SecurityUtils.java
View file @
a0380bea
...
...
@@ -81,5 +81,13 @@ public class SecurityUtils {
});
return
roleIds
;
}
/**
* 获取用户client终端角色信息
*
* @return 角色集合
*/
public
List
<
Long
>
getRolesByClient
(
String
client
)
{
YifuUser
user
=
getUser
();
return
null
!=
user
&&
null
!=
user
.
getClientRoleMap
()
?
user
.
getClientRoleMap
().
get
(
client
)
:
null
;
}
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/dto/UserInfo.java
View file @
a0380bea
...
...
@@ -23,6 +23,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author lengleng
...
...
@@ -64,4 +65,8 @@ public class UserInfo implements Serializable {
*/
private
List
<
SysPost
>
postList
;
/**
* key是客户端id,val是角色id数组
*/
private
Map
<
String
,
List
<
Long
>>
clientRoleMap
;
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/entity/SysMenu.java
View file @
a0380bea
...
...
@@ -115,4 +115,7 @@ public class SysMenu extends BaseEntity {
*/
@Schema
(
description
=
"是否系统内置"
)
private
String
systemFlag
;
@NotBlank
(
message
=
"所属终端 不能为空"
)
private
String
clientId
;
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/entity/SysRole.java
View file @
a0380bea
...
...
@@ -64,4 +64,7 @@ public class SysRole extends BaseEntity {
@Schema
(
description
=
"是否是系统内置"
)
private
String
systemFlag
;
@NotBlank
(
message
=
"所属终端 不能为空"
)
private
String
clientId
;
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/vo/BusinessRoleMenuVo.java
0 → 100644
View file @
a0380bea
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.Data
;
/**
* @program: master
* @description: b端角色菜单包装类
* @author: pwang
* @create: 2020-08-25 21:13
**/
@Data
@Tag
(
name
=
"b端角色菜单包装类"
)
public
class
BusinessRoleMenuVo
{
@Schema
(
description
=
"角色id"
)
private
String
roleId
;
@Schema
(
description
=
"角色名称"
)
private
String
roleName
;
@Schema
(
description
=
"菜单id"
)
private
String
menuId
;
@Schema
(
description
=
"菜单名称"
)
private
String
name
;
@Schema
(
description
=
"菜单排序"
)
private
String
sort
;
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/vo/BusinessUserVo.java
0 → 100644
View file @
a0380bea
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
vo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
lombok.Data
;
import
java.util.List
;
/**
* b端客户包装类
* @program: master
* @description:
* @author: pwang
* @create: 2020-08-25 14:05
**/
@Data
public
class
BusinessUserVo
extends
SysUser
{
/**
* 客户单位
* @Author fxj
* @Date 2020-08-25 14:54
* @param null
* @return
**/
private
String
customerName
;
/**
* B端的部门ID
* @author fxj
*/
private
String
organIdB
;
/**
* B端的部门等级
* @author fxj
*/
private
String
organLevelB
;
/**
* 用户IDs
* @author fxj
*/
private
List
<
String
>
userIdsB
;
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/vo/MenuTreeForVue.java
0 → 100644
View file @
a0380bea
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
vo
;
import
cn.hutool.json.JSONObject
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysMenu
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
MenuTreeForVue
extends
TreeNode
{
private
Integer
id
;
private
String
icon
;
private
String
name
;
private
String
path
;
private
String
authority
;
private
String
redirect
;
private
String
type
;
private
Integer
sort
;
private
String
url
;
/*private Meta meta;*/
private
JSONObject
meta
;
private
String
component
;
private
String
route
=
"1"
;
private
String
alwaysShow
;
private
boolean
hidden
;
public
MenuTreeForVue
()
{
}
public
MenuTreeForVue
(
int
id
,
String
name
,
int
parentId
)
{
this
.
id
=
id
;
this
.
parentId
=
Common
.
isNotNullToStr
(
parentId
);
this
.
name
=
name
;
/*this.meta=new Meta(name,null,null);*/
this
.
meta
=
new
JSONObject
();
meta
.
put
(
"title"
,
name
);
}
public
MenuTreeForVue
(
int
id
,
String
name
,
MenuTreeForVue
parent
)
{
this
.
id
=
id
;
this
.
parentId
=
Common
.
isNotNullToStr
(
parent
.
getId
());
this
.
name
=
name
;
/*this.meta=new Meta(name,null,null);*/
this
.
meta
=
new
JSONObject
();
meta
.
put
(
"title"
,
name
);
}
public
MenuTreeForVue
(
MenuVO
menuVo
)
{
this
.
id
=
menuVo
.
getMenuId
();
this
.
parentId
=
Common
.
isNotNullToStr
(
menuVo
.
getParentId
());
this
.
icon
=
menuVo
.
getIcon
();
this
.
name
=
menuVo
.
getName
();
if
(
null
!=
menuVo
.
getPath
()){
this
.
path
=
menuVo
.
getPath
().
replace
(
"#"
,
""
);
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
menuVo
.
getType
())){
this
.
component
=
menuVo
.
getPermission
();
}
else
{
this
.
component
=
this
.
path
;
}
this
.
type
=
menuVo
.
getType
();
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
menuVo
.
getType
())){
alwaysShow
=
"true"
;
hidden
=
false
;
}
else
{
alwaysShow
=
"false"
;
hidden
=
true
;
}
this
.
sort
=
menuVo
.
getSort
();
this
.
url
=
menuVo
.
getUrl
();
/*this.meta=new Meta(menuVo.getName(),menuVo.getIcon(),menuVo.getKeepAlive());*/
this
.
meta
=
new
JSONObject
();
meta
.
put
(
"title"
,
menuVo
.
getName
());
meta
.
put
(
"icon"
,
menuVo
.
getIcon
());
meta
.
put
(
"keepAlive"
,
menuVo
.
getKeepAlive
());
/*this.authority = menuVo.getPermission();*/
}
public
MenuTreeForVue
(
SysMenu
menuVo
)
{
this
.
id
=
menuVo
.
getMenuId
().
intValue
();
this
.
parentId
=
Common
.
isNotNullToStr
(
menuVo
.
getParentId
());
this
.
icon
=
menuVo
.
getIcon
();
this
.
name
=
menuVo
.
getName
();
if
(
null
!=
menuVo
.
getPath
()){
this
.
path
=
menuVo
.
getPath
().
replace
(
"#"
,
""
);
}
if
(
CommonConstants
.
ONE_STRING
.
equals
(
menuVo
.
getType
())){
this
.
component
=
menuVo
.
getPermission
();
}
else
{
this
.
component
=
this
.
path
;
}
this
.
type
=
menuVo
.
getType
();
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
menuVo
.
getType
())){
alwaysShow
=
"true"
;
hidden
=
false
;
}
else
{
alwaysShow
=
"false"
;
hidden
=
true
;
}
this
.
sort
=
menuVo
.
getSortOrder
();
this
.
url
=
menuVo
.
getPath
();
/*this.meta=new Meta(menuVo.getName(),menuVo.getIcon(),menuVo.getKeepAlive());*/
this
.
meta
=
new
JSONObject
();
meta
.
put
(
"title"
,
menuVo
.
getName
());
meta
.
put
(
"icon"
,
menuVo
.
getIcon
());
meta
.
put
(
"keepAlive"
,
menuVo
.
getKeepAlive
());
/*this.authority = menuVo.getPermission();*/
}
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/vo/MenuVO.java
0 → 100644
View file @
a0380bea
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* <p>
* 菜单权限表
* </p>
*
*/
@Data
public
class
MenuVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 菜单ID
*/
private
Integer
menuId
;
/**
* 菜单名称
*/
private
String
name
;
/**
* 菜单权限标识
*/
private
String
permission
;
/**
* 父菜单ID
*/
private
Integer
parentId
;
/**
* 图标
*/
private
String
icon
;
/**
* 一个路径
*/
private
String
path
;
/**
* 排序值
*/
private
Integer
sort
;
/**
* 菜单类型 (0菜单 1按钮)
*/
private
String
type
;
/**
* 是否缓冲
*/
private
String
keepAlive
;
/**
* 创建时间
*/
private
LocalDateTime
createTime
;
/**
* 更新时间
*/
private
LocalDateTime
updateTime
;
/**
* 0--正常 1--删除
*/
private
String
delFlag
;
/**
* 菜单或功能按钮访问的URL
*/
private
String
url
;
/**
* 用于功能按钮权限设置的临时变量
*/
private
Integer
roleOwnerButton
;
/**
* 功能或菜单描述
*/
private
String
description
;
/**
*
* 终端主键ID
*/
private
String
clientId
;
@Override
public
int
hashCode
()
{
return
menuId
.
hashCode
();
}
/**
* menuId 相同则相同
*
* @param obj
* @return
*/
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
instanceof
MenuVO
)
{
Integer
targetMenuId
=
((
MenuVO
)
obj
).
getMenuId
();
return
menuId
.
equals
(
targetMenuId
);
}
return
super
.
equals
(
obj
);
}
}
yifu-upms/yifu-upms-api/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/api/vo/RoleMenuR.java
0 → 100644
View file @
a0380bea
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
api
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.Data
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* @program: master
* @description: b端角色菜单返回结果类
* @author: pwang
* @create: 2020-08-25 21:20
**/
@Data
@Tag
(
name
=
"b端角色菜单返回结果类"
)
public
class
RoleMenuR
{
@Schema
(
description
=
"已有角色集合"
)
private
Set
<
String
>
havaRole
;
@Schema
(
description
=
"权限组名称集合,key权限组id,value权限组名称"
)
private
Map
<
String
,
String
>
roleNameMap
;
@Schema
(
description
=
"菜单集合,key权限组id,value菜单集合"
)
private
Map
<
String
,
List
<
BusinessRoleMenuVo
>>
roleMenuMap
;
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/controller/BusinessUserController.java
0 → 100644
View file @
a0380bea
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
admin
.
controller
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysMenu
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUserRole
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.util.TreeUtil
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessRoleMenuVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessUserVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.MenuTreeForVue
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleMenuR
;
import
com.yifu.cloud.plus.v1.yifu.admin.service.*
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ServiceNameConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.security.oauth2.provider.OAuth2Authentication
;
import
org.springframework.security.oauth2.provider.token.RemoteTokenServices
;
import
org.springframework.web.bind.annotation.*
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* @program: master
* @description: b端用户权限控制器
* @author: fxj
* @create: 2022-09-25 11:12
**/
@RestController
@AllArgsConstructor
@RequestMapping
(
"/customerBusiness/user"
)
@Tag
(
name
=
"b端用户权限控制器"
)
@Slf4j
public
class
BusinessUserController
{
private
final
SysUserService
userService
;
private
final
SysMenuService
sysMenuService
;
@Autowired
protected
RemoteTokenServices
remoteTokenServices
;
@Autowired
protected
ArchivesDaprUtil
remoteBasicArchivesService
;
private
static
final
PasswordEncoder
ENCODER
=
new
BCryptPasswordEncoder
();
private
final
SysRoleService
roleService
;
private
final
SysUserRoleService
userRoleService
;
// 字典
private
final
SysDictService
sysDictService
;
private
final
RedisUtil
redisUtil
;
/**
* 获取b端用户分页
*
* @param page
* @return
* @Author fxj
* @Date 2020-08-25 11:25
**/
@GetMapping
(
"/page"
)
@Operation
(
description
=
"B端用户分页"
)
public
R
<
Page
<
BusinessUserVo
>>
getBusinessUserPage
(
Page
<
BusinessUserVo
>
page
,
BusinessUserVo
user
)
{
user
.
setDeptId
(
CommonConstants
.
HR_B_ORG_ID
);
Page
<
BusinessUserVo
>
businessUserVoPage
=
userService
.
getBusinessUserVoPage
(
page
,
user
);
//获取客户信息
if
(
Common
.
isNotNull
(
businessUserVoPage
.
getRecords
())){
List
<
String
>
userList
=
new
ArrayList
<>();
// 封装查询条件
for
(
BusinessUserVo
vo:
businessUserVoPage
.
getRecords
()){
userList
.
add
(
vo
.
getUserId
());
}
Map
<
String
,
String
>
customerUserMap
=
null
;
// 查询条件客户名
R
<
Map
<
String
,
String
>>
resR
=
remoteBasicArchivesService
.
getCustomerUserMap
(
userList
);
if
(
Common
.
isNotNull
(
resR
)
&&
Common
.
isNotNull
(
resR
.
getData
())){
customerUserMap
=
resR
.
getData
();
}
//信息封装
if
(
Common
.
isNotNull
(
customerUserMap
)){
for
(
BusinessUserVo
vo:
businessUserVoPage
.
getRecords
()){
vo
.
setCustomerName
(
customerUserMap
.
get
(
vo
.
getUserId
().
toString
()));
}
}
}
return
new
R
<>(
businessUserVoPage
);
}
/**
* 新建b端用户
*
* @return
* @Author fxj
* @Date 2020-08-25 11:25
**/
@PostMapping
(
"/saveBusinessUser"
)
@Operation
(
description
=
"新建b端用户"
)
public
R
<
SysUser
>
saveBusinessUser
(
@RequestBody
SysUser
user
)
{
//数据验证
if
(
Common
.
isEmpty
(
user
.
getNickname
())){
return
R
.
failed
(
"姓名不能为空"
);
}
//数据填充
user
.
setUsername
(
user
.
getUsername
());
user
.
setLockFlag
(
CommonConstants
.
ZERO_STRING
);
user
.
setDelFlag
(
CommonConstants
.
ZERO_STRING
);
user
.
setCreateTime
(
LocalDateTime
.
now
());
user
.
setDeptName
(
"客户单位"
);
user
.
setDeptId
(
CommonConstants
.
HR_B_ORG_ID
);
//使用根节点
user
.
setDeptId
(
CommonConstants
.
HR_B_ORG_ID
);
if
(
Common
.
isNotNull
(
user
.
getPassword
())){
user
.
setPassword
(
ENCODER
.
encode
(
user
.
getPassword
()));
}
//系统规定检查
SysUser
sysUser
=
null
;
SysUser
userTemp
=
null
;
if
(
null
!=
user
&&
null
!=
user
.
getUserId
()){
sysUser
=
userService
.
getOne
(
Wrappers
.<
SysUser
>
lambdaQuery
().
eq
(
SysUser:
:
getUsername
,
user
.
getUsername
()).
ne
(
SysUser:
:
getUserId
,
user
.
getUserId
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
user
.
getPhone
())){
userTemp
=
userService
.
getOne
(
Wrappers
.<
SysUser
>
lambdaQuery
().
eq
(
SysUser:
:
getPhone
,
user
.
getPhone
()).
ne
(
SysUser:
:
getUserId
,
user
.
getUserId
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
}
}
else
{
sysUser
=
userService
.
getOne
(
Wrappers
.<
SysUser
>
lambdaQuery
().
eq
(
SysUser:
:
getUsername
,
user
.
getUsername
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
user
.
getPhone
())){
userTemp
=
userService
.
getOne
(
Wrappers
.<
SysUser
>
lambdaQuery
().
eq
(
SysUser:
:
getPhone
,
user
.
getPhone
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
}
}
if
(
null
!=
sysUser
){
return
R
.
failed
(
"操作失败,该账号已存在!"
);
}
if
(
null
!=
userTemp
){
return
R
.
failed
(
"操作失败,该手机号已存在!"
);
}
//存储并返回数据
boolean
res
;
if
(
Common
.
isNotNull
(
user
.
getUserId
())){
res
=
userService
.
updateById
(
user
);
}
else
{
res
=
userService
.
save
(
user
);
}
if
(
res
){
return
new
R
<>(
user
);
}
else
{
return
R
.
failed
(
"插入失败请联系管理员!"
);
}
}
/**
* 获取b端角色信息和菜单
*
* @return
* @Author fxj
* @Date 2020-08-25 11:25
**/
@GetMapping
(
"/getRoleAndMenu"
)
@Operation
(
description
=
"获取b端角色信息和菜单,TYPE:类型 0:菜单 1:按钮 2:菜单加按钮(默认查菜单),userId:用户id"
)
public
R
<
RoleMenuR
>
getRoleAndMenu
(
String
type
,
Integer
userId
)
{
//结果声明
RoleMenuR
result
=
new
RoleMenuR
();
//结果初始化
Map
<
String
,
String
>
roleNameMap
=
new
HashMap
<>();
Map
<
String
,
List
<
BusinessRoleMenuVo
>>
roleMenuMap
=
new
HashMap
<>();
result
.
setRoleNameMap
(
roleNameMap
);
result
.
setRoleMenuMap
(
roleMenuMap
);
//默认获取菜单
if
(
Common
.
isEmpty
(
type
)){
type
=
CommonConstants
.
ZERO_STRING
;
}
else
if
(
CommonConstants
.
dingleDigitStrArray
[
2
].
equals
(
type
)){
type
=
null
;
}
List
<
BusinessRoleMenuVo
>
list
=
roleService
.
getRoleAndMenu
(
type
);
//组装结果
if
(
Common
.
isNotNull
(
list
)){
//临时变量
List
<
BusinessRoleMenuVo
>
businessRoleMenuVo
=
null
;
for
(
BusinessRoleMenuVo
vo:
list
){
//不是第一次出现的角色把菜单放入对应map的对应集合即可
if
(
roleMenuMap
.
containsKey
(
vo
.
getRoleId
())){
businessRoleMenuVo
=
roleMenuMap
.
get
(
vo
.
getRoleId
());
}
else
{
//第一次出现的角色创建一个集合把菜单放进去,并把角色信息放进roleNameMap做权限组展示
businessRoleMenuVo
=
new
ArrayList
<>();
roleMenuMap
.
put
(
vo
.
getRoleId
(),
businessRoleMenuVo
);
roleNameMap
.
put
(
vo
.
getRoleId
(),
vo
.
getRoleName
());
}
businessRoleMenuVo
.
add
(
vo
);
}
//获取用户已有权限
if
(
null
!=
userId
){
result
.
setHavaRole
(
roleService
.
getRoleByUserIdAndClient
(
userId
,
ServiceNameConstants
.
CLIENT_ID_HR_B
));
}
}
return
new
R
<>(
result
);
}
/**
* 返回当前用户的树形菜单集合
*
* @return 当前用户的树形菜单
*/
@Operation
(
description
=
"返回当前用户的树形菜单集合"
)
@GetMapping
(
"/menu"
)
public
R
<
List
<
MenuTreeForVue
>>
getUserMenuForVue
(
@RequestHeader
(
value
=
HttpHeaders
.
AUTHORIZATION
,
required
=
false
)
String
authHeader
,
String
type
)
{
OAuth2Authentication
oAuth2Auth
=
remoteTokenServices
.
loadAuthentication
(
authHeader
.
replace
(
"bearer "
,
""
).
trim
());
// 获取符合条件的菜单
Set
<
SysMenu
>
all
=
new
HashSet
<>();
SecurityUtils
.
getRolesByClient
(
oAuth2Auth
.
getOAuth2Request
().
getClientId
())
.
forEach
(
roleId
->
all
.
addAll
(
sysMenuService
.
findMenuByRoleId
(
roleId
)));
List
<
MenuTreeForVue
>
menuTreeList
;
if
(
Common
.
isNotNull
(
type
))
{
menuTreeList
=
all
.
stream
()
.
filter
(
menuVo
->
type
.
equals
(
menuVo
.
getType
()))
.
map
(
MenuTreeForVue:
:
new
)
.
sorted
(
Comparator
.
comparingInt
(
MenuTreeForVue:
:
getSort
))
.
collect
(
Collectors
.
toList
());
}
else
{
menuTreeList
=
all
.
stream
()
.
map
(
MenuTreeForVue:
:
new
)
.
sorted
(
Comparator
.
comparingInt
(
MenuTreeForVue:
:
getSort
))
.
collect
(
Collectors
.
toList
());
}
return
new
R
<>(
TreeUtil
.
bulid
(
menuTreeList
,
-
1
));
}
/**
* 获取b端角色信息和菜单
*
* @return
* @Author fxj
* @Date 2020-08-25 11:25
* name = "roleList", value = "角色(权限组)id集合"
* name = "userId", value = "用户id"
**/
@PostMapping
(
"/saveRoleM"
)
@Operation
(
description
=
"b端用户角色关系保存"
)
public
R
<
String
>
saveRoleM
(
@RequestBody
List
<
Long
>
roleList
,
Integer
userId
)
{
if
(
null
==
userId
){
return
R
.
failed
(
"用户id不能为空!"
);
}
if
(
Common
.
isEmpty
(
roleList
)){
return
R
.
failed
(
"权限组不能为空!"
);
}
List
<
SysUserRole
>
list
=
new
ArrayList
<>();
SysUserRole
userRole
=
null
;
for
(
Long
role:
roleList
){
if
(
null
!=
role
){
userRole
=
new
SysUserRole
();
userRole
.
setRoleId
(
role
);
userRole
.
setUserId
(
Common
.
isNotNullToStr
(
userId
));
list
.
add
(
userRole
);
}
}
if
(
Common
.
isNotNull
(
list
)){
userRoleService
.
removeByUserAndClientId
(
userId
,
ServiceNameConstants
.
CLIENT_ID_HR_B
);
userRoleService
.
saveBatch
(
list
);
//清除用户缓存
SysUser
user
=
userService
.
getById
(
userId
);
if
(
null
!=
user
){
redisUtil
.
remove
(
ServiceNameConstants
.
UMPS_SERVICE
+
"_user_details::"
+
user
.
getUsername
());
if
(
Common
.
isNotNull
(
user
.
getPhone
())){
redisUtil
.
remove
(
ServiceNameConstants
.
UMPS_SERVICE
+
"_user_details_phone::"
+
user
.
getPhone
());
}
}
return
R
.
ok
(
CommonConstants
.
RESULT_DATA_SUCESS
);
}
else
{
return
R
.
failed
(
"保存失败,用户角色数据错误!"
);
}
}
/**
* b端获取用户信息
*
* @return
* @Author fxj
* @Date 2020-08-25 11:25
**/
@GetMapping
(
"/userInfo/{userId}"
)
@Operation
(
description
=
"b端获取用户信息"
)
public
R
<
SysUser
>
getUserInfo
(
@PathVariable
Integer
userId
)
{
//获取用户信息
return
new
R
<>(
userService
.
getById
(
userId
));
}
/**
* 存在的方法 复制到这 便于控制权限 通过ID更新用户锁定状态
*
* @param id ID
* @return 用户信息
*/
@Operation
(
description
=
"通过ID更新用户锁定状态"
)
@GetMapping
(
"/updateLock"
)
public
R
<
Boolean
>
updateLockFlag
(
@RequestParam
(
"id"
)
Integer
id
,
@RequestParam
(
"lockFlag"
)
String
lockFlag
)
{
SysUser
user
=
userService
.
getById
(
id
);
if
(
null
==
user
)
{
return
R
.
failed
(
"操作失败,无此用户!"
);
}
if
(
CommonConstants
.
HR_B_ORG_ID
!=
user
.
getDeptId
()){
return
R
.
failed
(
"操作失败,此客户非b端用户,不允许在此禁(启)用!"
);
}
return
new
R
<>(
userService
.
updateLockFlagById
(
user
,
lockFlag
));
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/mapper/SysRoleMapper.java
View file @
a0380bea
...
...
@@ -18,9 +18,12 @@ package com.yifu.cloud.plus.v1.yifu.admin.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessRoleMenuVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Set
;
/**
* <p>
...
...
@@ -40,4 +43,7 @@ public interface SysRoleMapper extends BaseMapper<SysRole> {
*/
List
<
SysRole
>
listRolesByUserId
(
String
userId
);
List
<
BusinessRoleMenuVo
>
getRoleAndMenu
(
@Param
(
"type"
)
String
type
);
Set
<
String
>
getRoleByUserIdAndClient
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"clientId"
)
String
clientId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/mapper/SysUserMapper.java
View file @
a0380bea
...
...
@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserDTO
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessUserVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserVO
;
import
com.yifu.cloud.plus.v1.yifu.common.ldap.entity.PersonVo
;
import
org.apache.ibatis.annotations.Mapper
;
...
...
@@ -75,4 +76,5 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
void
updateUser
(
@Param
(
"list"
)
List
<
Map
<
String
,
Object
>>
list
);
Page
<
BusinessUserVo
>
getBusinessUserVoPage
(
Page
page
,
@Param
(
"query"
)
BusinessUserVo
user
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/mapper/SysUserRoleMapper.java
View file @
a0380bea
...
...
@@ -41,4 +41,6 @@ public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
*/
Boolean
deleteByUserId
(
@Param
(
"userId"
)
String
userId
);
Boolean
removeByUserAndClientId
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"clientId"
)
String
clientId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/SysRoleService.java
View file @
a0380bea
...
...
@@ -19,11 +19,13 @@ package com.yifu.cloud.plus.v1.yifu.admin.service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessRoleMenuVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
org.springframework.validation.BindingResult
;
import
java.util.List
;
import
java.util.Set
;
/**
* <p>
...
...
@@ -72,4 +74,19 @@ public interface SysRoleService extends IService<SysRole> {
* @return
**/
R
<
Boolean
>
getBooleanR
(
SysRole
sysRole
);
/**
* 获取b角色菜单集合
* @param type 0 菜单 1 按钮 null所有
* @return
**/
List
<
BusinessRoleMenuVo
>
getRoleAndMenu
(
String
type
);
/**
* 获取该用户在此客户端的所有角色id
* @param userId
* @param clientId
* @return
**/
Set
<
String
>
getRoleByUserIdAndClient
(
Integer
userId
,
String
clientId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/SysUserRoleService.java
View file @
a0380bea
...
...
@@ -28,5 +28,12 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUserRole;
* @since 2019/2/1
*/
public
interface
SysUserRoleService
extends
IService
<
SysUserRole
>
{
/**
* 根据用户id和角色所在终端id删除这个用户在这个终端的所有角色
* @param userId
* @param clientId
* @return
**/
Boolean
removeByUserAndClientId
(
Integer
userId
,
String
clientId
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/SysUserService.java
View file @
a0380bea
...
...
@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserDTO
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessUserVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserPasswordVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserVO
;
...
...
@@ -145,4 +146,15 @@ public interface SysUserService extends IService<SysUser> {
*/
R
<
Boolean
>
loginAuthentication
(
String
userName
,
String
password
)
throws
NoSuchAlgorithmException
;
Page
<
BusinessUserVo
>
getBusinessUserVoPage
(
Page
page
,
BusinessUserVo
user
);
/**
* 更新用户锁定状态
*
* @param user
* @param lockFlag
* @return
*/
Boolean
updateLockFlagById
(
SysUser
user
,
String
lockFlag
);
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/impl/SysRoleServiceImpl.java
View file @
a0380bea
...
...
@@ -27,6 +27,7 @@ import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRoleMenu
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUserRole
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessRoleMenuVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysRoleMapper
;
import
com.yifu.cloud.plus.v1.yifu.admin.mapper.SysRoleMenuMapper
;
...
...
@@ -227,4 +228,14 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
wrapper
.
last
(
CommonConstants
.
LAST_ONE_SQL
);
return
wrapper
;
}
@Override
public
List
<
BusinessRoleMenuVo
>
getRoleAndMenu
(
String
type
)
{
return
baseMapper
.
getRoleAndMenu
(
type
);
}
@Override
public
Set
<
String
>
getRoleByUserIdAndClient
(
Integer
userId
,
String
clientId
)
{
return
baseMapper
.
getRoleByUserIdAndClient
(
userId
,
clientId
);
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/impl/SysUserRoleServiceImpl.java
View file @
a0380bea
...
...
@@ -32,5 +32,8 @@ import org.springframework.stereotype.Service;
*/
@Service
public
class
SysUserRoleServiceImpl
extends
ServiceImpl
<
SysUserRoleMapper
,
SysUserRole
>
implements
SysUserRoleService
{
@Override
public
Boolean
removeByUserAndClientId
(
Integer
userId
,
String
clientId
)
{
return
baseMapper
.
removeByUserAndClientId
(
userId
,
clientId
);
}
}
yifu-upms/yifu-upms-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/admin/service/impl/SysUserServiceImpl.java
View file @
a0380bea
...
...
@@ -30,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserDTO;
import
com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.*
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.util.ParamResolver
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessUserVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserExcelVO
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserPasswordVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.UserVO
;
...
...
@@ -38,11 +39,13 @@ import com.yifu.cloud.plus.v1.yifu.admin.service.SysMenuService;
import
com.yifu.cloud.plus.v1.yifu.admin.service.SysUserService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.ServiceNameConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.enums.MenuTypeEnum
;
import
com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.ldap.entity.PersonVo
;
import
com.yifu.cloud.plus.v1.yifu.common.ldap.util.LdapUtil
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -60,6 +63,9 @@ import java.security.NoSuchAlgorithmException;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
/**
* @author lengleng
...
...
@@ -84,6 +90,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
private
final
LdapUtil
ldapUtil
;
private
final
RedisUtil
redisUtil
;
/**
* 保存用户信息
* @param userDto DTO 对象
...
...
@@ -139,6 +147,33 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
.
filter
(
m
->
MenuTypeEnum
.
BUTTON
.
getType
().
equals
(
m
.
getType
())).
map
(
SysMenu:
:
getPermission
)
.
filter
(
StrUtil:
:
isNotBlank
).
collect
(
Collectors
.
toSet
());
userInfo
.
setPermissions
(
ArrayUtil
.
toArray
(
permissions
,
String
.
class
));
//设置角色列表 (ID)
List
<
SysRole
>
roles
=
sysRoleMapper
.
listRolesByUserId
(
sysUser
.
getUserId
());
Map
<
String
,
List
<
Long
>>
clientRoleMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
roles
)){
roles
.
forEach
(
role
->
{
if
(
null
!=
clientRoleMap
.
get
(
role
.
getClientId
()))
{
clientRoleMap
.
get
(
role
.
getClientId
()).
add
(
role
.
getRoleId
());
}
else
{
clientRoleMap
.
put
(
role
.
getClientId
(),
Stream
.
of
(
role
.
getRoleId
()).
collect
(
toList
()));
}
/* List<String> permissionList = sysMenuService.findMenuByRoleId(role.getRoleId())
.stream()
.filter(menuVo -> Common.isNotNull(menuVo.getPermission()))
.map(menuVo -> {
if (menuVo.getPermission().contains(":")) {
return menuVo.getPermission();
} else {
return role.getClientId() + ":" + menuVo.getPermission();
}
})
.collect(toList());
permissions.addAll(permissionList);*/
}
);
}
userInfo
.
setClientRoleMap
(
clientRoleMap
);
return
userInfo
;
}
...
...
@@ -551,4 +586,47 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
}
return
R
.
failed
(
"验证不通过"
);
}
@Override
public
Page
<
BusinessUserVo
>
getBusinessUserVoPage
(
Page
page
,
BusinessUserVo
user
)
{
if
(
Common
.
isNotNull
(
user
.
getOrganIdB
())
||
Common
.
isNotNull
(
user
.
getOrganLevelB
())){
R
<
List
<
String
>>
userIdR
=
null
;
//remoteBusinessService.getUserIdByOrganInfo(user.getOrganIdB(), user.getOrganLevelB(), SecurityConstants.FROM_IN);
if
(
null
!=
userIdR
&&
Common
.
isNotNull
(
userIdR
.
getData
())){
user
.
setUserIdsB
(
userIdR
.
getData
());
}
}
return
baseMapper
.
getBusinessUserVoPage
(
page
,
user
);
}
/**
* 更新用户锁定状态
*
* @param user
* @param lockFlag
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
//不用原因user.phone和user.wxUserId做键时可能为空 服务报错
public
Boolean
updateLockFlagById
(
SysUser
user
,
String
lockFlag
)
{
clenrUserCache
(
user
.
getUsername
(),
null
,
user
.
getPhone
());
SysUser
sysUser
=
new
SysUser
();
sysUser
.
setUserId
(
user
.
getUserId
());
sysUser
.
setLockFlag
(
lockFlag
);
return
this
.
updateById
(
sysUser
);
}
private
void
clenrUserCache
(
String
username
,
String
wxUserId
,
String
phone
){
//用户名登录用户缓存清除
if
(
Common
.
isNotNull
(
username
)){
redisUtil
.
remove
(
CacheConstants
.
USER_DETAILS
+
"::"
+
username
);
}
//微信登录用户缓存清除
if
(
Common
.
isNotNull
(
wxUserId
)){
redisUtil
.
remove
(
CacheConstants
.
USER_DETAILS
+
"_wx::"
+
wxUserId
);
}
//手机号登录用户缓存清除
if
(
Common
.
isNotNull
(
phone
)){
redisUtil
.
remove
(
CacheConstants
.
USER_DETAILS
+
"_phone::"
+
phone
);
}
}
}
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysDictMapper.xml
View file @
a0380bea
...
...
@@ -76,7 +76,6 @@
and t.parent_id= #{parentId} and t.del_flag='0'
)
</select>
<select
id=
"getDictRedisVo"
resultMap=
"dictRedisMap"
>
SELECT
CONCAT(a.type,"_",a.`value`) as "key",
...
...
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysRoleMapper.xml
View file @
a0380bea
...
...
@@ -49,4 +49,28 @@
AND r.del_flag = 0
and ur.user_id = #{userId}
</select>
<select
id=
"getRoleAndMenu"
resultType=
"com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessRoleMenuVo"
>
SELECT
a.role_id,
a.role_name,
c.menu_id,
c.name,
c.sort
FROM
sys_role a,
sys_role_menu b
LEFT JOIN sys_menu c on b.menu_id =c.menu_id
where a.client_id = "hrCustomer" and a.del_flag = '0'
<if
test=
"null != type"
>
and c.type = #{type}
</if>
and c.del_flag = "0" and a.role_id =b.role_id ;
</select>
<select
id=
"getRoleByUserIdAndClient"
resultType=
"java.lang.String"
>
select a.role_id from sys_user_role a
left join sys_role b on a.role_id = b.role_id
where a.user_id = #{userId} and b.client_id = #{clientId} and b.del_flag = '0'
</select>
</mapper>
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysUserMapper.xml
View file @
a0380bea
...
...
@@ -295,4 +295,30 @@
username=#{i.userId}
</foreach>
</update>
<!-- 获取b端用户分页 fxj 2022-12-27 -->
<select
id=
"getBusinessUserVoPage"
resultType=
"com.yifu.cloud.plus.v1.yifu.admin.api.vo.BusinessUserVo"
>
select *
from sys_user AS `user`
<where>
`user`.del_flag = '0'
<if
test=
"query.organId != null and query.organId != ''"
>
and `user`.organ_id = #{query.organId}
</if>
<if
test=
"query.nickname != null and query.nickname != ''"
>
and `user`.nickname LIKE CONCAT('%',#{query.nickname},'%')
</if>
<if
test=
"query.username != null and query.username != ''"
>
and `user`.username LIKE CONCAT('%',#{query.username},'%')
</if>
<if
test=
"query.organCode != null and query.organCode != ''"
>
and `user`.organ_code LIKE CONCAT(#{query.organCode},'%')
</if>
<if
test=
"null != query.userIdsB and query.userIdsB.size > 0"
>
where b.user_id in
<foreach
collection=
"query.userIdsB"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
</where>
ORDER BY `user`.create_time DESC
</select>
</mapper>
yifu-upms/yifu-upms-biz/src/main/resources/mapper/SysUserRoleMapper.xml
View file @
a0380bea
...
...
@@ -28,5 +28,18 @@
<delete
id=
"deleteByUserId"
>
DELETE FROM sys_user_role WHERE user_id = #{userId}
</delete>
<delete
id=
"removeByUserAndClientId"
>
DELETE
FROM
sys_user_role
WHERE
user_id = #{userId}
AND role_id IN (
SELECT
b.role_id
FROM
sys_role b
WHERE
b.client_id = #{clientId} )
</delete>
</mapper>
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