Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
cms
Commits
7bfe9737
提交
7bfe9737
authored
7月 12, 2023
作者:
张小凤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ResultAndUser(update)
上级
4885ed4b
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
179 行增加
和
88 行删除
+179
-88
CodeUtil.java
...mon-util/src/main/java/com/mmc/iuav/general/CodeUtil.java
+2
-4
RoleController.java
...ain/java/com/mmc/iuav/user/controller/RoleController.java
+0
-7
UserAccountController.java
...a/com/mmc/iuav/user/controller/UserAccountController.java
+30
-23
RoleDao.java
...ice-user/src/main/java/com/mmc/iuav/user/dao/RoleDao.java
+1
-3
UserServiceDao.java
...r/src/main/java/com/mmc/iuav/user/dao/UserServiceDao.java
+28
-1
RoleInfoDO.java
...er/src/main/java/com/mmc/iuav/user/entity/RoleInfoDO.java
+15
-1
UserRoleRel.java
...r/src/main/java/com/mmc/iuav/user/entity/UserRoleRel.java
+39
-0
RoleService.java
.../src/main/java/com/mmc/iuav/user/service/RoleService.java
+1
-1
UserAccountService.java
...in/java/com/mmc/iuav/user/service/UserAccountService.java
+30
-1
RoleServiceImpl.java
.../java/com/mmc/iuav/user/service/impl/RoleServiceImpl.java
+0
-10
UserAccountServiceImpl.java
...om/mmc/iuav/user/service/impl/UserAccountServiceImpl.java
+26
-17
RoleDao.xml
...ce/cms-service-user/src/main/resources/mapper/RoleDao.xml
+7
-20
UserServiceDao.xml
...service-user/src/main/resources/mapper/UserServiceDao.xml
+0
-0
没有找到文件。
cms-common/cms-common-util/src/main/java/com/mmc/iuav/general/CodeUtil.java
浏览文件 @
7bfe9737
...
@@ -31,9 +31,7 @@ public class CodeUtil {
...
@@ -31,9 +31,7 @@ public class CodeUtil {
}
}
public
static
String
createRoleNo
()
{
public
static
String
createRoleNo
()
{
StringBuffer
sb
=
new
StringBuffer
();
String
s
=
"A"
+
System
.
currentTimeMillis
();
sb
.
append
(
"A"
);
return
s
;
sb
.
append
(
CodeUtil
.
getRandomNum
(
4
));
return
sb
.
toString
();
}
}
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/RoleController.java
浏览文件 @
7bfe9737
...
@@ -61,11 +61,4 @@ public class RoleController extends BaseController {
...
@@ -61,11 +61,4 @@ public class RoleController extends BaseController {
}
}
@ApiOperation
(
value
=
"角色管理-当前角色绑定了那些账号"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"roleAccountList"
)
public
ResultBody
<
RoleInfoDTO
>
roleAccountList
(
@ApiParam
(
value
=
"角色id"
,
required
=
true
)
@RequestParam
Integer
id
)
{
return
roleService
.
roleAccountList
(
id
);
}
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/UserAccountController.java
浏览文件 @
7bfe9737
...
@@ -3,8 +3,8 @@ package com.mmc.iuav.user.controller;
...
@@ -3,8 +3,8 @@ package com.mmc.iuav.user.controller;
import
com.mmc.iuav.group.Page
;
import
com.mmc.iuav.group.Page
;
import
com.mmc.iuav.group.Update
;
import
com.mmc.iuav.group.Update
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.model.dto.RoleInfoDTO
;
import
com.mmc.iuav.user.model.dto.UserAccountSimpleDTO
;
import
com.mmc.iuav.user.model.dto.UserAccountSimpleDTO
;
import
com.mmc.iuav.user.model.qo.BUserAccountQO
;
import
com.mmc.iuav.user.model.qo.UserAccountQO
;
import
com.mmc.iuav.user.model.qo.UserAccountQO
;
import
com.mmc.iuav.user.model.vo.UserAccountVO
;
import
com.mmc.iuav.user.model.vo.UserAccountVO
;
import
com.mmc.iuav.user.service.UserAccountService
;
import
com.mmc.iuav.user.service.UserAccountService
;
...
@@ -23,86 +23,86 @@ import java.util.List;
...
@@ -23,86 +23,86 @@ import java.util.List;
@Api
(
tags
=
"小程序用户账号相关接口"
)
@Api
(
tags
=
"小程序用户账号相关接口"
)
@RequestMapping
(
"/user-account/"
)
@RequestMapping
(
"/user-account/"
)
@RestController
@RestController
public
class
UserAccountController
extends
BaseController
{
public
class
UserAccountController
extends
BaseController
{
@Autowired
@Autowired
private
UserAccountService
userAccountService
;
private
UserAccountService
userAccountService
;
@ApiOperation
(
value
=
"客户列表"
)
@ApiOperation
(
value
=
"客户列表"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountVO
.
class
)
})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountVO
.
class
)
})
@PostMapping
(
"listAppUser"
)
@PostMapping
(
"listAppUser"
)
public
ResultBody
<
UserAccountVO
>
listAppUser
(
@Validated
(
value
=
{
Page
.
class
})
@RequestBody
UserAccountQO
userAccountQO
)
{
public
ResultBody
<
UserAccountVO
>
listAppUser
(
@Validated
(
value
=
{
Page
.
class
})
@RequestBody
UserAccountQO
userAccountQO
)
{
return
userAccountService
.
listAppUser
(
userAccountQO
);
return
userAccountService
.
listAppUser
(
userAccountQO
);
}
}
@ApiOperation
(
value
=
"获取用户信息"
)
@ApiOperation
(
value
=
"获取用户信息"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountVO
.
class
)
})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountVO
.
class
)
})
@GetMapping
(
"info"
)
@GetMapping
(
"info"
)
public
ResultBody
info
(
HttpServletRequest
request
)
{
public
ResultBody
info
(
HttpServletRequest
request
)
{
return
ResultBody
.
success
(
userAccountService
.
getUserAccountById
(
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
()));
return
ResultBody
.
success
(
userAccountService
.
getUserAccountById
(
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
()));
}
}
@ApiOperation
(
value
=
"修改用户信息"
)
@ApiOperation
(
value
=
"修改用户信息"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)
})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)
})
@PostMapping
(
"update"
)
@PostMapping
(
"update"
)
public
ResultBody
update
(
@Validated
(
value
=
{
Update
.
class
})
@RequestBody
UserAccountVO
userAccountVO
)
{
public
ResultBody
update
(
@Validated
(
value
=
{
Update
.
class
})
@RequestBody
UserAccountVO
userAccountVO
)
{
return
userAccountService
.
update
(
userAccountVO
);
return
userAccountService
.
update
(
userAccountVO
);
}
}
@ApiOperation
(
value
=
"获取用户基本信息"
,
hidden
=
true
)
@ApiOperation
(
value
=
"获取用户基本信息"
,
hidden
=
true
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountSimpleDTO
.
class
)
})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountSimpleDTO
.
class
)
})
@GetMapping
(
"feignGetUserSimpleInfo"
)
@GetMapping
(
"feignGetUserSimpleInfo"
)
public
UserAccountSimpleDTO
feignGetUserSimpleInfo
(
@RequestParam
Integer
userAccountId
){
public
UserAccountSimpleDTO
feignGetUserSimpleInfo
(
@RequestParam
Integer
userAccountId
)
{
return
userAccountService
.
getUserSimpleInfo
(
userAccountId
);
return
userAccountService
.
getUserSimpleInfo
(
userAccountId
);
}
}
@ApiOperation
(
value
=
"根据用户地区查询后台用户id"
,
hidden
=
true
)
@ApiOperation
(
value
=
"根据用户地区查询后台用户id"
,
hidden
=
true
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountSimpleDTO
.
class
)
})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountSimpleDTO
.
class
)
})
@GetMapping
(
"feignListUserAccountIds"
)
@GetMapping
(
"feignListUserAccountIds"
)
public
List
<
Integer
>
feignListUserAccountIds
(
@RequestParam
Integer
provinceCode
,
@RequestParam
(
required
=
false
)
Integer
cityCode
,
@RequestParam
(
required
=
false
)
Integer
districtCode
)
{
public
List
<
Integer
>
feignListUserAccountIds
(
@RequestParam
Integer
provinceCode
,
@RequestParam
(
required
=
false
)
Integer
cityCode
,
@RequestParam
(
required
=
false
)
Integer
districtCode
)
{
return
userAccountService
.
feignListUserAccountIds
(
provinceCode
,
cityCode
,
districtCode
);
return
userAccountService
.
feignListUserAccountIds
(
provinceCode
,
cityCode
,
districtCode
);
}
}
@ApiOperation
(
value
=
"授权手机号"
)
@ApiOperation
(
value
=
"授权手机号"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
Integer
.
class
)
})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
Integer
.
class
)
})
@GetMapping
(
"getUserPhoneNumber"
)
@GetMapping
(
"getUserPhoneNumber"
)
public
ResultBody
getUserPhoneNumber
(
HttpServletRequest
request
,
public
ResultBody
getUserPhoneNumber
(
HttpServletRequest
request
,
@ApiParam
(
value
=
"授权手机号code"
,
required
=
true
)
@RequestParam
String
code
)
{
@ApiParam
(
value
=
"授权手机号code"
,
required
=
true
)
@RequestParam
String
code
)
{
return
userAccountService
.
getUserPhoneNumber
(
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
(),
code
);
return
userAccountService
.
getUserPhoneNumber
(
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
(),
code
);
}
}
@ApiOperation
(
value
=
"根据用户id查询用户信息"
,
hidden
=
true
)
@ApiOperation
(
value
=
"根据用户id查询用户信息"
,
hidden
=
true
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountSimpleDTO
.
class
)
})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountSimpleDTO
.
class
)
})
@PostMapping
(
"feignListUserAccountByIds"
)
@PostMapping
(
"feignListUserAccountByIds"
)
public
List
<
UserAccountSimpleDTO
>
feignListUserAccountByIds
(
@RequestBody
List
<
Integer
>
ids
){
public
List
<
UserAccountSimpleDTO
>
feignListUserAccountByIds
(
@RequestBody
List
<
Integer
>
ids
)
{
return
userAccountService
.
feignListUserAccountByIds
(
ids
);
return
userAccountService
.
feignListUserAccountByIds
(
ids
);
}
}
@ApiOperation
(
value
=
"根据条件查询用户信息"
,
hidden
=
true
)
@ApiOperation
(
value
=
"根据条件查询用户信息"
,
hidden
=
true
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountSimpleDTO
.
class
)
})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountSimpleDTO
.
class
)
})
@PostMapping
(
"feignListAppUserAccount"
)
@PostMapping
(
"feignListAppUserAccount"
)
public
List
<
UserAccountSimpleDTO
>
feignListAppUserAccount
(
@ApiParam
(
value
=
"账号查询QO"
,
required
=
true
)
@RequestBody
UserAccountQO
userAccountQO
)
{
public
List
<
UserAccountSimpleDTO
>
feignListAppUserAccount
(
@ApiParam
(
value
=
"账号查询QO"
,
required
=
true
)
@RequestBody
UserAccountQO
userAccountQO
)
{
return
userAccountService
.
feignListUserAccount
(
userAccountQO
);
return
userAccountService
.
feignListUserAccount
(
userAccountQO
);
}
}
@ApiOperation
(
value
=
"根据用户ids上级推荐人信息"
,
hidden
=
true
)
@ApiOperation
(
value
=
"根据用户ids上级推荐人信息"
,
hidden
=
true
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountSimpleDTO
.
class
)
})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountSimpleDTO
.
class
)
})
@PostMapping
(
"feignListRcdUserInfo"
)
@PostMapping
(
"feignListRcdUserInfo"
)
public
List
<
UserAccountSimpleDTO
>
feignListRcdUserInfo
(
@RequestBody
List
<
Integer
>
userIds
){
public
List
<
UserAccountSimpleDTO
>
feignListRcdUserInfo
(
@RequestBody
List
<
Integer
>
userIds
)
{
return
userAccountService
.
feignListRcdUserInfo
(
userIds
);
return
userAccountService
.
feignListRcdUserInfo
(
userIds
);
}
}
@ApiOperation
(
value
=
"查询上级推荐人id"
,
hidden
=
true
)
@ApiOperation
(
value
=
"查询上级推荐人id"
,
hidden
=
true
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
Integer
.
class
)
})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
Integer
.
class
)
})
@GetMapping
(
"feignGetSuperiorRef"
)
@GetMapping
(
"feignGetSuperiorRef"
)
public
Integer
feignGetSuperiorRef
(
@RequestParam
Integer
userAccountId
){
public
Integer
feignGetSuperiorRef
(
@RequestParam
Integer
userAccountId
)
{
return
userAccountService
.
feignGetSuperiorRef
(
userAccountId
);
return
userAccountService
.
feignGetSuperiorRef
(
userAccountId
);
}
}
@ApiOperation
(
value
=
"查询上级推荐人信息"
,
hidden
=
true
)
@ApiOperation
(
value
=
"查询上级推荐人信息"
,
hidden
=
true
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountSimpleDTO
.
class
)
})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
UserAccountSimpleDTO
.
class
)
})
@GetMapping
(
"feignGetUserRcdInfo"
)
@GetMapping
(
"feignGetUserRcdInfo"
)
public
UserAccountSimpleDTO
feignGetUserRcdInfo
(
@RequestParam
Integer
userAccountId
){
public
UserAccountSimpleDTO
feignGetUserRcdInfo
(
@RequestParam
Integer
userAccountId
)
{
return
userAccountService
.
feignGetUserRcdInfo
(
userAccountId
);
return
userAccountService
.
feignGetUserRcdInfo
(
userAccountId
);
}
}
...
@@ -114,5 +114,12 @@ public class UserAccountController extends BaseController{
...
@@ -114,5 +114,12 @@ public class UserAccountController extends BaseController{
}
}
@ApiOperation
(
value
=
"角色管理-当前角色绑定了那些账号"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"roleAccountList"
)
public
ResultBody
<
RoleInfoDTO
>
roleAccountList
(
@ApiParam
(
value
=
"角色id"
,
required
=
true
)
@RequestParam
Integer
id
)
{
return
userAccountService
.
roleAccountList
(
id
);
}
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/RoleDao.java
浏览文件 @
7bfe9737
package
com
.
mmc
.
iuav
.
user
.
dao
;
package
com
.
mmc
.
iuav
.
user
.
dao
;
import
com.mmc.iuav.user.entity.RoleInfoDO
;
import
com.mmc.iuav.user.entity.RoleInfoDO
;
import
com.mmc.iuav.user.entity.UserAccountDO
;
import
com.mmc.iuav.user.model.qo.RoleInfoQO
;
import
com.mmc.iuav.user.model.qo.RoleInfoQO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
...
@@ -35,7 +34,6 @@ public interface RoleDao {
...
@@ -35,7 +34,6 @@ public interface RoleDao {
Integer
countNotDelUserAccountByRole
(
Integer
id
);
Integer
countNotDelUserAccountByRole
(
Integer
id
);
List
<
UserAccountDO
>
roleAccountList
(
Integer
id
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/UserServiceDao.java
浏览文件 @
7bfe9737
...
@@ -17,6 +17,7 @@ import java.util.List;
...
@@ -17,6 +17,7 @@ import java.util.List;
public
interface
UserServiceDao
{
public
interface
UserServiceDao
{
/**
/**
* 根据用户unionId查询用户信息
* 根据用户unionId查询用户信息
*
* @param unionId
* @param unionId
* @return
* @return
*/
*/
...
@@ -24,12 +25,14 @@ public interface UserServiceDao {
...
@@ -24,12 +25,14 @@ public interface UserServiceDao {
/**
/**
* 插入用户信息
* 插入用户信息
*
* @param userAccountDO
* @param userAccountDO
*/
*/
void
insertUserAccount
(
UserAccountDO
userAccountDO
);
void
insertUserAccount
(
UserAccountDO
userAccountDO
);
/**
/**
* 根据用户id查询用户信息
* 根据用户id查询用户信息
*
* @param userAccountId
* @param userAccountId
* @return
* @return
*/
*/
...
@@ -37,12 +40,14 @@ public interface UserServiceDao {
...
@@ -37,12 +40,14 @@ public interface UserServiceDao {
/**
/**
* 修改用户信息
* 修改用户信息
*
* @param userAccountDO
* @param userAccountDO
*/
*/
void
update
(
UserAccountDO
userAccountDO
);
void
update
(
UserAccountDO
userAccountDO
);
/**
/**
* 根据用户地区查询后台用户id
* 根据用户地区查询后台用户id
*
* @param provinceCode
* @param provinceCode
* @param cityCode
* @param cityCode
* @param districtCode
* @param districtCode
...
@@ -52,6 +57,7 @@ public interface UserServiceDao {
...
@@ -52,6 +57,7 @@ public interface UserServiceDao {
/**
/**
* 登录账号密码查询用户信息
* 登录账号密码查询用户信息
*
* @param accountNo
* @param accountNo
* @param passWord
* @param passWord
* @return
* @return
...
@@ -60,6 +66,7 @@ public interface UserServiceDao {
...
@@ -60,6 +66,7 @@ public interface UserServiceDao {
/**
/**
* 批量获取用户信息
* 批量获取用户信息
*
* @param userAccountQO
* @param userAccountQO
* @return
* @return
*/
*/
...
@@ -67,6 +74,7 @@ public interface UserServiceDao {
...
@@ -67,6 +74,7 @@ public interface UserServiceDao {
/**
/**
* 删除用户
* 删除用户
*
* @param removeNO
* @param removeNO
* @param userAccountId
* @param userAccountId
*/
*/
...
@@ -74,6 +82,7 @@ public interface UserServiceDao {
...
@@ -74,6 +82,7 @@ public interface UserServiceDao {
/**
/**
* 根据账号名称查询数量
* 根据账号名称查询数量
*
* @param excludeId
* @param excludeId
* @param accountNo
* @param accountNo
* @return
* @return
...
@@ -82,6 +91,7 @@ public interface UserServiceDao {
...
@@ -82,6 +91,7 @@ public interface UserServiceDao {
/**
/**
* 查询用户数量
* 查询用户数量
*
* @param param
* @param param
* @return
* @return
*/
*/
...
@@ -89,6 +99,7 @@ public interface UserServiceDao {
...
@@ -89,6 +99,7 @@ public interface UserServiceDao {
/**
/**
* 查询用户信息
* 查询用户信息
*
* @param param
* @param param
* @return
* @return
*/
*/
...
@@ -96,6 +107,7 @@ public interface UserServiceDao {
...
@@ -96,6 +107,7 @@ public interface UserServiceDao {
/**
/**
* 修改用户密码
* 修改用户密码
*
* @param id
* @param id
* @param passWord
* @param passWord
*/
*/
...
@@ -103,6 +115,7 @@ public interface UserServiceDao {
...
@@ -103,6 +115,7 @@ public interface UserServiceDao {
/**
/**
* 获取用户密码
* 获取用户密码
*
* @param id
* @param id
* @return
* @return
*/
*/
...
@@ -110,13 +123,15 @@ public interface UserServiceDao {
...
@@ -110,13 +123,15 @@ public interface UserServiceDao {
/**
/**
* 根据id查询用户信息
* 根据id查询用户信息
*
* @param userIds
* @param userIds
* @return
* @return
*/
*/
List
<
UserAccountDO
>
listUserAccountByIds
(
@Param
(
"userIds"
)
List
<
Integer
>
userIds
);
List
<
UserAccountDO
>
listUserAccountByIds
(
@Param
(
"userIds"
)
List
<
Integer
>
userIds
);
/**
/**
* 获取用户推荐人信息
* 获取用户推荐人信息
*
* @param userIds
* @param userIds
* @return
* @return
*/
*/
...
@@ -124,6 +139,7 @@ public interface UserServiceDao {
...
@@ -124,6 +139,7 @@ public interface UserServiceDao {
/**
/**
* 获取推荐人信息
* 获取推荐人信息
*
* @param userAccountId
* @param userAccountId
* @return
* @return
*/
*/
...
@@ -131,6 +147,7 @@ public interface UserServiceDao {
...
@@ -131,6 +147,7 @@ public interface UserServiceDao {
/**
/**
* 获取用户推荐信息
* 获取用户推荐信息
*
* @param userAccountId
* @param userAccountId
* @return
* @return
*/
*/
...
@@ -138,6 +155,7 @@ public interface UserServiceDao {
...
@@ -138,6 +155,7 @@ public interface UserServiceDao {
/**
/**
* 用户数量
* 用户数量
*
* @param param
* @param param
* @return
* @return
*/
*/
...
@@ -145,8 +163,17 @@ public interface UserServiceDao {
...
@@ -145,8 +163,17 @@ public interface UserServiceDao {
/**
/**
* 用户信息
* 用户信息
*
* @param param
* @param param
* @return
* @return
*/
*/
List
<
UserAccountDO
>
listAppUser
(
UserAccountQO
param
);
List
<
UserAccountDO
>
listAppUser
(
UserAccountQO
param
);
/**
* 角色关联了那些id
*
* @param id
* @return
*/
List
<
UserAccountDO
>
roleAccountList
(
Integer
id
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/entity/RoleInfoDO.java
浏览文件 @
7bfe9737
package
com
.
mmc
.
iuav
.
user
.
entity
;
package
com
.
mmc
.
iuav
.
user
.
entity
;
import
com.alibaba.fastjson2.annotation.JSONField
;
import
com.mmc.iuav.user.model.dto.RoleInfoDTO
;
import
com.mmc.iuav.user.model.dto.RoleInfoDTO
;
import
com.mmc.iuav.user.model.vo.RoleInfoVO
;
import
com.mmc.iuav.user.model.vo.RoleInfoVO
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
...
@@ -8,6 +9,7 @@ import lombok.Data;
...
@@ -8,6 +9,7 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* @Author small
* @Author small
...
@@ -41,13 +43,15 @@ public class RoleInfoDO {
...
@@ -41,13 +43,15 @@ public class RoleInfoDO {
/**
/**
* 创建时间
* 创建时间
*/
*/
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
private
Date
createTime
;
/**
/**
* 更新时间
* 更新时间
*/
*/
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
private
Date
updateTime
;
/**
/**
* 账号id
*
创建角色
账号id
*/
*/
private
Integer
userAccountId
;
private
Integer
userAccountId
;
/**
/**
...
@@ -55,6 +59,16 @@ public class RoleInfoDO {
...
@@ -55,6 +59,16 @@ public class RoleInfoDO {
*/
*/
private
String
userName
;
private
String
userName
;
/**
* 角色关联账号表
*/
List
<
UserRoleRel
>
userRoleRelList
;
/**
* 角色关联菜单
*/
List
<
MenuInfoDO
>
menuInfoDOList
;
/**
/**
* DTO转换
* DTO转换
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/entity/UserRoleRel.java
0 → 100644
浏览文件 @
7bfe9737
package
com
.
mmc
.
iuav
.
user
.
entity
;
import
com.alibaba.fastjson2.annotation.JSONField
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
* @Author small
* @Date 2023/7/12 13:29
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
UserRoleRel
{
/**
* 角色与账号关联表id
*/
private
Integer
id
;
/**
* 账号关联角色id
*/
private
Integer
userAccountId
;
/**
* 角色id
*/
private
Integer
roleId
;
/**
* 角色与账号关联表id
*/
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/RoleService.java
浏览文件 @
7bfe9737
...
@@ -21,5 +21,5 @@ public interface RoleService {
...
@@ -21,5 +21,5 @@ public interface RoleService {
PageResult
listPageRoleInfo
(
RoleInfoQO
param
,
LoginSuccessDTO
userLoginInfoFromRedis
);
PageResult
listPageRoleInfo
(
RoleInfoQO
param
,
LoginSuccessDTO
userLoginInfoFromRedis
);
ResultBody
roleAccountList
(
Integer
id
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/UserAccountService.java
浏览文件 @
7bfe9737
...
@@ -4,7 +4,6 @@ import com.mmc.iuav.response.ResultBody;
...
@@ -4,7 +4,6 @@ import com.mmc.iuav.response.ResultBody;
import
com.mmc.iuav.user.entity.UserAccountDO
;
import
com.mmc.iuav.user.entity.UserAccountDO
;
import
com.mmc.iuav.user.model.dto.UserAccountSimpleDTO
;
import
com.mmc.iuav.user.model.dto.UserAccountSimpleDTO
;
import
com.mmc.iuav.user.model.qo.BUserAccountQO
;
import
com.mmc.iuav.user.model.qo.BUserAccountQO
;
import
com.mmc.iuav.user.model.qo.LoginUserQO
;
import
com.mmc.iuav.user.model.qo.UserAccountQO
;
import
com.mmc.iuav.user.model.qo.UserAccountQO
;
import
com.mmc.iuav.user.model.vo.BUserAccountVO
;
import
com.mmc.iuav.user.model.vo.BUserAccountVO
;
import
com.mmc.iuav.user.model.vo.UserAccountVO
;
import
com.mmc.iuav.user.model.vo.UserAccountVO
;
...
@@ -18,6 +17,7 @@ import java.util.List;
...
@@ -18,6 +17,7 @@ import java.util.List;
public
interface
UserAccountService
{
public
interface
UserAccountService
{
/**
/**
* Get the user account
* Get the user account
*
* @param unionId
* @param unionId
* @return
* @return
*/
*/
...
@@ -25,12 +25,14 @@ public interface UserAccountService {
...
@@ -25,12 +25,14 @@ public interface UserAccountService {
/**
/**
* Insert the user account
* Insert the user account
*
* @param userAccountDO
* @param userAccountDO
*/
*/
void
insertUserAccount
(
UserAccountDO
userAccountDO
);
void
insertUserAccount
(
UserAccountDO
userAccountDO
);
/**
/**
* 通过用户id获取用户信息
* 通过用户id获取用户信息
*
* @param userAccountId
* @param userAccountId
* @return
* @return
*/
*/
...
@@ -38,6 +40,7 @@ public interface UserAccountService {
...
@@ -38,6 +40,7 @@ public interface UserAccountService {
/**
/**
* 修改用户信息
* 修改用户信息
*
* @param userAccountVO
* @param userAccountVO
* @return
* @return
*/
*/
...
@@ -45,6 +48,7 @@ public interface UserAccountService {
...
@@ -45,6 +48,7 @@ public interface UserAccountService {
/**
/**
* 获取用户基本信息
* 获取用户基本信息
*
* @param userAccountId
* @param userAccountId
* @return
* @return
*/
*/
...
@@ -52,6 +56,7 @@ public interface UserAccountService {
...
@@ -52,6 +56,7 @@ public interface UserAccountService {
/**
/**
* 根据用户地区查询后台用户id
* 根据用户地区查询后台用户id
*
* @param provinceCode
* @param provinceCode
* @param cityCode
* @param cityCode
* @param districtCode
* @param districtCode
...
@@ -61,6 +66,7 @@ public interface UserAccountService {
...
@@ -61,6 +66,7 @@ public interface UserAccountService {
/**
/**
* 添加后台用户
* 添加后台用户
*
* @param bUserAccountVO
* @param bUserAccountVO
* @return
* @return
*/
*/
...
@@ -68,6 +74,7 @@ public interface UserAccountService {
...
@@ -68,6 +74,7 @@ public interface UserAccountService {
/**
/**
* 删除用户信
* 删除用户信
*
* @param userAccountId
* @param userAccountId
* @return
* @return
*/
*/
...
@@ -75,6 +82,7 @@ public interface UserAccountService {
...
@@ -75,6 +82,7 @@ public interface UserAccountService {
/**
/**
* 后台用户列表
* 后台用户列表
*
* @param bUserAccountQO
* @param bUserAccountQO
* @return
* @return
*/
*/
...
@@ -82,6 +90,7 @@ public interface UserAccountService {
...
@@ -82,6 +90,7 @@ public interface UserAccountService {
/**
/**
* 登录账号密码查询用户信息
* 登录账号密码查询用户信息
*
* @param accountNo
* @param accountNo
* @param passWord
* @param passWord
* @return
* @return
...
@@ -90,6 +99,7 @@ public interface UserAccountService {
...
@@ -90,6 +99,7 @@ public interface UserAccountService {
/**
/**
* 内部获取用户列表
* 内部获取用户列表
*
* @param userAccountQO
* @param userAccountQO
* @return
* @return
*/
*/
...
@@ -97,6 +107,7 @@ public interface UserAccountService {
...
@@ -97,6 +107,7 @@ public interface UserAccountService {
/**
/**
* 修改用户信息
* 修改用户信息
*
* @param bUserAccountVO
* @param bUserAccountVO
* @return
* @return
*/
*/
...
@@ -104,6 +115,7 @@ public interface UserAccountService {
...
@@ -104,6 +115,7 @@ public interface UserAccountService {
/**
/**
* 修改用户密码
* 修改用户密码
*
* @param account
* @param account
* @return
* @return
*/
*/
...
@@ -111,6 +123,7 @@ public interface UserAccountService {
...
@@ -111,6 +123,7 @@ public interface UserAccountService {
/**
/**
* 验证用户密码
* 验证用户密码
*
* @param id
* @param id
* @param authPwd
* @param authPwd
* @return
* @return
...
@@ -119,6 +132,7 @@ public interface UserAccountService {
...
@@ -119,6 +132,7 @@ public interface UserAccountService {
/**
/**
* 授权手机号
* 授权手机号
*
* @param id
* @param id
* @param code
* @param code
* @return
* @return
...
@@ -127,6 +141,7 @@ public interface UserAccountService {
...
@@ -127,6 +141,7 @@ public interface UserAccountService {
/**
/**
* 根据id获取用户信息
* 根据id获取用户信息
*
* @param ids
* @param ids
* @return
* @return
*/
*/
...
@@ -134,6 +149,7 @@ public interface UserAccountService {
...
@@ -134,6 +149,7 @@ public interface UserAccountService {
/**
/**
* 根据用户id获取推荐人信息
* 根据用户id获取推荐人信息
*
* @param userIds
* @param userIds
* @return
* @return
*/
*/
...
@@ -141,6 +157,7 @@ public interface UserAccountService {
...
@@ -141,6 +157,7 @@ public interface UserAccountService {
/**
/**
* 获取推荐人id
* 获取推荐人id
*
* @param userAccountId
* @param userAccountId
* @return
* @return
*/
*/
...
@@ -148,6 +165,7 @@ public interface UserAccountService {
...
@@ -148,6 +165,7 @@ public interface UserAccountService {
/**
/**
* 获取推荐人信息
* 获取推荐人信息
*
* @param userAccountId
* @param userAccountId
* @return
* @return
*/
*/
...
@@ -155,6 +173,7 @@ public interface UserAccountService {
...
@@ -155,6 +173,7 @@ public interface UserAccountService {
/**
/**
* 用户列表
* 用户列表
*
* @param userAccountQO
* @param userAccountQO
* @return
* @return
*/
*/
...
@@ -162,8 +181,18 @@ public interface UserAccountService {
...
@@ -162,8 +181,18 @@ public interface UserAccountService {
/**
/**
* 删除小程序用户
* 删除小程序用户
*
* @param userAccountId
* @param userAccountId
* @return
* @return
*/
*/
ResultBody
removeAppAccount
(
Integer
userAccountId
);
ResultBody
removeAppAccount
(
Integer
userAccountId
);
/**
* 角色关联了那些账号
*
* @param id
* @return
*/
ResultBody
roleAccountList
(
Integer
id
);
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/RoleServiceImpl.java
浏览文件 @
7bfe9737
...
@@ -6,16 +6,13 @@ import com.mmc.iuav.response.ResultBody;
...
@@ -6,16 +6,13 @@ import com.mmc.iuav.response.ResultBody;
import
com.mmc.iuav.response.ResultEnum
;
import
com.mmc.iuav.response.ResultEnum
;
import
com.mmc.iuav.user.dao.RoleDao
;
import
com.mmc.iuav.user.dao.RoleDao
;
import
com.mmc.iuav.user.entity.RoleInfoDO
;
import
com.mmc.iuav.user.entity.RoleInfoDO
;
import
com.mmc.iuav.user.entity.UserAccountDO
;
import
com.mmc.iuav.user.model.dto.LoginSuccessDTO
;
import
com.mmc.iuav.user.model.dto.LoginSuccessDTO
;
import
com.mmc.iuav.user.model.dto.UserAccountSimpleDTO
;
import
com.mmc.iuav.user.model.qo.RoleInfoQO
;
import
com.mmc.iuav.user.model.qo.RoleInfoQO
;
import
com.mmc.iuav.user.model.vo.RoleInfoVO
;
import
com.mmc.iuav.user.model.vo.RoleInfoVO
;
import
com.mmc.iuav.user.service.RoleService
;
import
com.mmc.iuav.user.service.RoleService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -79,12 +76,5 @@ public class RoleServiceImpl implements RoleService {
...
@@ -79,12 +76,5 @@ public class RoleServiceImpl implements RoleService {
}).
collect
(
Collectors
.
toList
()));
}).
collect
(
Collectors
.
toList
()));
}
}
@Override
public
ResultBody
roleAccountList
(
Integer
id
)
{
List
<
UserAccountDO
>
roleInfoDOS
=
roleDao
.
roleAccountList
(
id
);
List
<
UserAccountSimpleDTO
>
accountSimpleDTOS
=
roleInfoDOS
.
stream
().
map
(
UserAccountDO:
:
buildUserAccountSimpleDTO
).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
accountSimpleDTOS
);
}
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/UserAccountServiceImpl.java
浏览文件 @
7bfe9737
...
@@ -13,7 +13,10 @@ import com.mmc.iuav.user.entity.UserRcdDO;
...
@@ -13,7 +13,10 @@ import com.mmc.iuav.user.entity.UserRcdDO;
import
com.mmc.iuav.user.model.dto.UserAccountSimpleDTO
;
import
com.mmc.iuav.user.model.dto.UserAccountSimpleDTO
;
import
com.mmc.iuav.user.model.qo.BUserAccountQO
;
import
com.mmc.iuav.user.model.qo.BUserAccountQO
;
import
com.mmc.iuav.user.model.qo.UserAccountQO
;
import
com.mmc.iuav.user.model.qo.UserAccountQO
;
import
com.mmc.iuav.user.model.vo.*
;
import
com.mmc.iuav.user.model.vo.BUserAccountVO
;
import
com.mmc.iuav.user.model.vo.CompanyAuthVO
;
import
com.mmc.iuav.user.model.vo.CooperationTagVO
;
import
com.mmc.iuav.user.model.vo.UserAccountVO
;
import
com.mmc.iuav.user.mq.MqProducer
;
import
com.mmc.iuav.user.mq.MqProducer
;
import
com.mmc.iuav.user.service.CompanyAuthService
;
import
com.mmc.iuav.user.service.CompanyAuthService
;
import
com.mmc.iuav.user.service.UserAccountService
;
import
com.mmc.iuav.user.service.UserAccountService
;
...
@@ -74,7 +77,7 @@ public class UserAccountServiceImpl implements UserAccountService {
...
@@ -74,7 +77,7 @@ public class UserAccountServiceImpl implements UserAccountService {
CompanyAuthVO
companyAuthVO
=
companyAuthService
.
getCompanyAuthByUId
(
userAccountId
);
CompanyAuthVO
companyAuthVO
=
companyAuthService
.
getCompanyAuthByUId
(
userAccountId
);
if
(
companyAuthVO
!=
null
)
{
if
(
companyAuthVO
!=
null
)
{
userAccountVO
.
setCompanyAuthStatus
(
companyAuthVO
.
getAuthStatus
());
userAccountVO
.
setCompanyAuthStatus
(
companyAuthVO
.
getAuthStatus
());
}
else
{
}
else
{
userAccountVO
.
setCompanyAuthStatus
(
0
);
userAccountVO
.
setCompanyAuthStatus
(
0
);
}
}
List
<
CooperationTagDO
>
cooperationTagDOS
=
cooperationDao
.
listUserCooperationTag
(
userAccountId
);
List
<
CooperationTagDO
>
cooperationTagDOS
=
cooperationDao
.
listUserCooperationTag
(
userAccountId
);
...
@@ -96,18 +99,18 @@ public class UserAccountServiceImpl implements UserAccountService {
...
@@ -96,18 +99,18 @@ public class UserAccountServiceImpl implements UserAccountService {
@Override
@Override
public
UserAccountSimpleDTO
getUserSimpleInfo
(
Integer
userAccountId
)
{
public
UserAccountSimpleDTO
getUserSimpleInfo
(
Integer
userAccountId
)
{
UserAccountDO
userAccountDO
=
userServiceDao
.
getUserAccountById
(
userAccountId
);
UserAccountDO
userAccountDO
=
userServiceDao
.
getUserAccountById
(
userAccountId
);
if
(
userAccountDO
==
null
){
if
(
userAccountDO
==
null
)
{
return
null
;
return
null
;
}
}
UserAccountSimpleDTO
userAccountSimpleDTO
=
userAccountDO
.
buildUserAccountSimpleDTO
();
UserAccountSimpleDTO
userAccountSimpleDTO
=
userAccountDO
.
buildUserAccountSimpleDTO
();
CompanyAuthVO
companyAuthVO
=
companyAuthService
.
getCompanyAuthByUId
(
userAccountId
);
CompanyAuthVO
companyAuthVO
=
companyAuthService
.
getCompanyAuthByUId
(
userAccountId
);
if
(
companyAuthVO
!=
null
)
{
if
(
companyAuthVO
!=
null
)
{
userAccountSimpleDTO
.
setCompanyAuthStatus
(
companyAuthVO
.
getAuthStatus
());
userAccountSimpleDTO
.
setCompanyAuthStatus
(
companyAuthVO
.
getAuthStatus
());
}
else
{
}
else
{
userAccountSimpleDTO
.
setCompanyAuthStatus
(
0
);
userAccountSimpleDTO
.
setCompanyAuthStatus
(
0
);
}
}
List
<
CooperationTagDO
>
cooperationTagDOS
=
cooperationDao
.
listUserCooperationTag
(
userAccountId
);
List
<
CooperationTagDO
>
cooperationTagDOS
=
cooperationDao
.
listUserCooperationTag
(
userAccountId
);
if
(!
CollectionUtils
.
isEmpty
(
cooperationTagDOS
)){
if
(!
CollectionUtils
.
isEmpty
(
cooperationTagDOS
))
{
List
<
CooperationTagVO
>
cooperationTags
=
cooperationTagDOS
.
stream
().
map
(
CooperationTagDO:
:
buildCooperationTagVO
).
collect
(
Collectors
.
toList
());
List
<
CooperationTagVO
>
cooperationTags
=
cooperationTagDOS
.
stream
().
map
(
CooperationTagDO:
:
buildCooperationTagVO
).
collect
(
Collectors
.
toList
());
userAccountSimpleDTO
.
setCooperationTagVOS
(
cooperationTags
);
userAccountSimpleDTO
.
setCooperationTagVOS
(
cooperationTags
);
}
}
...
@@ -184,15 +187,15 @@ public class UserAccountServiceImpl implements UserAccountService {
...
@@ -184,15 +187,15 @@ public class UserAccountServiceImpl implements UserAccountService {
return
accountSimpleDTOS
;
return
accountSimpleDTOS
;
}
}
public
void
buildCooperationTagVO
(
List
<
UserAccountSimpleDTO
>
accountSimpleDTOS
){
public
void
buildCooperationTagVO
(
List
<
UserAccountSimpleDTO
>
accountSimpleDTOS
)
{
List
<
Integer
>
uIds
=
accountSimpleDTOS
.
stream
().
map
(
UserAccountSimpleDTO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
uIds
=
accountSimpleDTOS
.
stream
().
map
(
UserAccountSimpleDTO:
:
getId
).
collect
(
Collectors
.
toList
());
//设置用户的渠道等级
//设置用户的渠道等级
List
<
CooperationTagDO
>
cooperationTagDOS
=
cooperationDao
.
listUserCooperationTagByUIds
(
uIds
);
List
<
CooperationTagDO
>
cooperationTagDOS
=
cooperationDao
.
listUserCooperationTagByUIds
(
uIds
);
if
(!
CollectionUtils
.
isEmpty
(
cooperationTagDOS
)){
if
(!
CollectionUtils
.
isEmpty
(
cooperationTagDOS
))
{
Map
<
Integer
,
List
<
CooperationTagDO
>>
userTagsMap
=
cooperationTagDOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
CooperationTagDO:
:
getUserAccountId
));
Map
<
Integer
,
List
<
CooperationTagDO
>>
userTagsMap
=
cooperationTagDOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
CooperationTagDO:
:
getUserAccountId
));
for
(
UserAccountSimpleDTO
simpleDTO
:
accountSimpleDTOS
)
{
for
(
UserAccountSimpleDTO
simpleDTO
:
accountSimpleDTOS
)
{
List
<
CooperationTagDO
>
tagDOS
=
userTagsMap
.
get
(
simpleDTO
.
getId
());
List
<
CooperationTagDO
>
tagDOS
=
userTagsMap
.
get
(
simpleDTO
.
getId
());
if
(!
CollectionUtils
.
isEmpty
(
tagDOS
)){
if
(!
CollectionUtils
.
isEmpty
(
tagDOS
))
{
List
<
CooperationTagVO
>
cooperationTagVOS
=
tagDOS
.
stream
().
map
(
CooperationTagDO:
:
buildCooperationTagVO
).
collect
(
Collectors
.
toList
());
List
<
CooperationTagVO
>
cooperationTagVOS
=
tagDOS
.
stream
().
map
(
CooperationTagDO:
:
buildCooperationTagVO
).
collect
(
Collectors
.
toList
());
simpleDTO
.
setCooperationTagVOS
(
cooperationTagVOS
);
simpleDTO
.
setCooperationTagVOS
(
cooperationTagVOS
);
}
}
...
@@ -253,7 +256,7 @@ public class UserAccountServiceImpl implements UserAccountService {
...
@@ -253,7 +256,7 @@ public class UserAccountServiceImpl implements UserAccountService {
@Override
@Override
public
ResultBody
getUserPhoneNumber
(
Integer
id
,
String
code
)
{
public
ResultBody
getUserPhoneNumber
(
Integer
id
,
String
code
)
{
String
userPhoneNumber
=
wxService
.
getUserPhoneNumber
(
id
,
code
);
String
userPhoneNumber
=
wxService
.
getUserPhoneNumber
(
id
,
code
);
if
(
StringUtils
.
isBlank
(
userPhoneNumber
)){
if
(
StringUtils
.
isBlank
(
userPhoneNumber
))
{
return
ResultBody
.
error
(
ResultEnum
.
AUTH_PHONE_NUMBER_ERROR
);
return
ResultBody
.
error
(
ResultEnum
.
AUTH_PHONE_NUMBER_ERROR
);
}
}
UserAccountDO
userAccount
=
new
UserAccountDO
();
UserAccountDO
userAccount
=
new
UserAccountDO
();
...
@@ -266,7 +269,7 @@ public class UserAccountServiceImpl implements UserAccountService {
...
@@ -266,7 +269,7 @@ public class UserAccountServiceImpl implements UserAccountService {
@Override
@Override
public
List
<
UserAccountSimpleDTO
>
feignListUserAccountByIds
(
List
<
Integer
>
ids
)
{
public
List
<
UserAccountSimpleDTO
>
feignListUserAccountByIds
(
List
<
Integer
>
ids
)
{
List
<
UserAccountDO
>
userAccountDOS
=
userServiceDao
.
listUserAccountByIds
(
ids
);
List
<
UserAccountDO
>
userAccountDOS
=
userServiceDao
.
listUserAccountByIds
(
ids
);
if
(!
CollectionUtils
.
isEmpty
(
userAccountDOS
)){
if
(!
CollectionUtils
.
isEmpty
(
userAccountDOS
))
{
List
<
UserAccountSimpleDTO
>
userAccountSimpleDTOS
=
userAccountDOS
.
stream
().
map
(
UserAccountDO:
:
buildUserAccountSimpleDTO
).
collect
(
Collectors
.
toList
());
List
<
UserAccountSimpleDTO
>
userAccountSimpleDTOS
=
userAccountDOS
.
stream
().
map
(
UserAccountDO:
:
buildUserAccountSimpleDTO
).
collect
(
Collectors
.
toList
());
//设置用户的渠道等级
//设置用户的渠道等级
buildCooperationTagVO
(
userAccountSimpleDTOS
);
buildCooperationTagVO
(
userAccountSimpleDTOS
);
...
@@ -278,7 +281,7 @@ public class UserAccountServiceImpl implements UserAccountService {
...
@@ -278,7 +281,7 @@ public class UserAccountServiceImpl implements UserAccountService {
@Override
@Override
public
List
<
UserAccountSimpleDTO
>
feignListRcdUserInfo
(
List
<
Integer
>
userIds
)
{
public
List
<
UserAccountSimpleDTO
>
feignListRcdUserInfo
(
List
<
Integer
>
userIds
)
{
List
<
UserAccountDO
>
userAccountDOS
=
userServiceDao
.
feignListRcdUserInfo
(
userIds
);
List
<
UserAccountDO
>
userAccountDOS
=
userServiceDao
.
feignListRcdUserInfo
(
userIds
);
if
(!
CollectionUtils
.
isEmpty
(
userAccountDOS
)){
if
(!
CollectionUtils
.
isEmpty
(
userAccountDOS
))
{
List
<
UserAccountSimpleDTO
>
userAccountSimpleDTOS
=
userAccountDOS
.
stream
().
map
(
UserAccountDO:
:
buildUserAccountSimpleDTO
).
collect
(
Collectors
.
toList
());
List
<
UserAccountSimpleDTO
>
userAccountSimpleDTOS
=
userAccountDOS
.
stream
().
map
(
UserAccountDO:
:
buildUserAccountSimpleDTO
).
collect
(
Collectors
.
toList
());
//设置用户的渠道等级
//设置用户的渠道等级
buildCooperationTagVO
(
userAccountSimpleDTOS
);
buildCooperationTagVO
(
userAccountSimpleDTOS
);
...
@@ -290,7 +293,7 @@ public class UserAccountServiceImpl implements UserAccountService {
...
@@ -290,7 +293,7 @@ public class UserAccountServiceImpl implements UserAccountService {
@Override
@Override
public
Integer
feignGetSuperiorRef
(
Integer
userAccountId
)
{
public
Integer
feignGetSuperiorRef
(
Integer
userAccountId
)
{
UserRcdDO
userRcdDO
=
userServiceDao
.
getUserRcdDO
(
userAccountId
);
UserRcdDO
userRcdDO
=
userServiceDao
.
getUserRcdDO
(
userAccountId
);
if
(
userRcdDO
!=
null
){
if
(
userRcdDO
!=
null
)
{
return
userRcdDO
.
getId
();
return
userRcdDO
.
getId
();
}
}
return
null
;
return
null
;
...
@@ -299,10 +302,10 @@ public class UserAccountServiceImpl implements UserAccountService {
...
@@ -299,10 +302,10 @@ public class UserAccountServiceImpl implements UserAccountService {
@Override
@Override
public
UserAccountSimpleDTO
feignGetUserRcdInfo
(
Integer
userAccountId
)
{
public
UserAccountSimpleDTO
feignGetUserRcdInfo
(
Integer
userAccountId
)
{
UserAccountDO
rcdAccountDO
=
userServiceDao
.
getUserRcdByAccountId
(
userAccountId
);
UserAccountDO
rcdAccountDO
=
userServiceDao
.
getUserRcdByAccountId
(
userAccountId
);
if
(
rcdAccountDO
!=
null
){
if
(
rcdAccountDO
!=
null
)
{
List
<
CooperationTagDO
>
cooperationTagDOS
=
cooperationDao
.
listUserCooperationTag
(
userAccountId
);
List
<
CooperationTagDO
>
cooperationTagDOS
=
cooperationDao
.
listUserCooperationTag
(
userAccountId
);
UserAccountSimpleDTO
userAccountSimpleDTO
=
rcdAccountDO
.
buildUserAccountSimpleDTO
();
UserAccountSimpleDTO
userAccountSimpleDTO
=
rcdAccountDO
.
buildUserAccountSimpleDTO
();
if
(!
CollectionUtils
.
isEmpty
(
cooperationTagDOS
)){
if
(!
CollectionUtils
.
isEmpty
(
cooperationTagDOS
))
{
List
<
CooperationTagVO
>
cooperationTagVOS
=
cooperationTagDOS
.
stream
().
map
(
CooperationTagDO:
:
buildCooperationTagVO
).
collect
(
Collectors
.
toList
());
List
<
CooperationTagVO
>
cooperationTagVOS
=
cooperationTagDOS
.
stream
().
map
(
CooperationTagDO:
:
buildCooperationTagVO
).
collect
(
Collectors
.
toList
());
userAccountSimpleDTO
.
setCooperationTagVOS
(
cooperationTagVOS
);
userAccountSimpleDTO
.
setCooperationTagVOS
(
cooperationTagVOS
);
}
}
...
@@ -314,7 +317,7 @@ public class UserAccountServiceImpl implements UserAccountService {
...
@@ -314,7 +317,7 @@ public class UserAccountServiceImpl implements UserAccountService {
@Override
@Override
public
ResultBody
listAppUser
(
UserAccountQO
param
)
{
public
ResultBody
listAppUser
(
UserAccountQO
param
)
{
int
count
=
userServiceDao
.
countListAppUser
(
param
);
int
count
=
userServiceDao
.
countListAppUser
(
param
);
if
(
count
==
0
){
if
(
count
==
0
)
{
return
ResultBody
.
success
(
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
));
return
ResultBody
.
success
(
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
));
}
}
int
pageNo
=
param
.
getPageNo
();
int
pageNo
=
param
.
getPageNo
();
...
@@ -327,7 +330,7 @@ public class UserAccountServiceImpl implements UserAccountService {
...
@@ -327,7 +330,7 @@ public class UserAccountServiceImpl implements UserAccountService {
List
<
UserAccountVO
>
userAccountVOS
=
res
.
stream
().
map
(
UserAccountDO:
:
buildUserAccountVO
).
collect
(
Collectors
.
toList
());
List
<
UserAccountVO
>
userAccountVOS
=
res
.
stream
().
map
(
UserAccountDO:
:
buildUserAccountVO
).
collect
(
Collectors
.
toList
());
for
(
UserAccountVO
userAccountVO
:
userAccountVOS
)
{
for
(
UserAccountVO
userAccountVO
:
userAccountVOS
)
{
List
<
CooperationTagDO
>
userCooperationTagDOS
=
userTagsMap
.
get
(
userAccountVO
.
getId
());
List
<
CooperationTagDO
>
userCooperationTagDOS
=
userTagsMap
.
get
(
userAccountVO
.
getId
());
if
(!
CollectionUtils
.
isEmpty
(
userCooperationTagDOS
)){
if
(!
CollectionUtils
.
isEmpty
(
userCooperationTagDOS
))
{
List
<
CooperationTagVO
>
cooperationTagVOS
=
userCooperationTagDOS
.
stream
().
map
(
CooperationTagDO:
:
buildCooperationTagVO
).
collect
(
Collectors
.
toList
());
List
<
CooperationTagVO
>
cooperationTagVOS
=
userCooperationTagDOS
.
stream
().
map
(
CooperationTagDO:
:
buildCooperationTagVO
).
collect
(
Collectors
.
toList
());
userAccountVO
.
setCooperationTagVOS
(
cooperationTagVOS
);
userAccountVO
.
setCooperationTagVOS
(
cooperationTagVOS
);
}
}
...
@@ -350,12 +353,18 @@ public class UserAccountServiceImpl implements UserAccountService {
...
@@ -350,12 +353,18 @@ public class UserAccountServiceImpl implements UserAccountService {
Map
<
Integer
,
CooperationTagDO
>
cooperationTagDOMap
=
cooperationTagDOS
.
stream
().
collect
(
Collectors
.
toMap
(
CooperationTagDO:
:
getId
,
d
->
d
,
(
k1
,
k2
)
->
k2
));
Map
<
Integer
,
CooperationTagDO
>
cooperationTagDOMap
=
cooperationTagDOS
.
stream
().
collect
(
Collectors
.
toMap
(
CooperationTagDO:
:
getId
,
d
->
d
,
(
k1
,
k2
)
->
k2
));
for
(
UserAccountDO
userAccountDO
:
userAccountDOList
)
{
for
(
UserAccountDO
userAccountDO
:
userAccountDOList
)
{
CooperationTagDO
cooperationTagDO
=
cooperationTagDOMap
.
get
(
userAccountDO
.
getCooperationTagId
());
CooperationTagDO
cooperationTagDO
=
cooperationTagDOMap
.
get
(
userAccountDO
.
getCooperationTagId
());
if
(
cooperationTagDO
!=
null
){
if
(
cooperationTagDO
!=
null
)
{
userAccountDO
.
setTagName
(
cooperationTagDO
.
getTagName
());
userAccountDO
.
setTagName
(
cooperationTagDO
.
getTagName
());
}
}
}
}
return
userAccountDOList
;
return
userAccountDOList
;
}
}
@Override
public
ResultBody
roleAccountList
(
Integer
id
)
{
List
<
UserAccountDO
>
roleInfoDOS
=
userServiceDao
.
roleAccountList
(
id
);
List
<
UserAccountSimpleDTO
>
accountSimpleDTOS
=
roleInfoDOS
.
stream
().
map
(
UserAccountDO:
:
buildUserAccountSimpleDTO
).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
accountSimpleDTOS
);
}
}
}
csm-service/cms-service-user/src/main/resources/mapper/RoleDao.xml
浏览文件 @
7bfe9737
...
@@ -65,8 +65,8 @@
...
@@ -65,8 +65,8 @@
<insert
id=
"insertRoleInfo"
useGeneratedKeys=
"true"
<insert
id=
"insertRoleInfo"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.mmc.iuav.user.entity.RoleInfoDO"
>
keyProperty=
"id"
parameterType=
"com.mmc.iuav.user.entity.RoleInfoDO"
>
insert into role_info(role_no, role_name, user_account_id, remark, create_time)
insert into role_info(role_no, role_name, user_account_id, remark, create_time
, update_time
)
values (#{roleNo}, #{roleName}, #{userAccountId}, #{remark}, NOW())
values (#{roleNo}, #{roleName}, #{userAccountId}, #{remark}, NOW()
, NOW()
)
</insert>
</insert>
...
@@ -90,13 +90,11 @@
...
@@ -90,13 +90,11 @@
where role_id = #{roleId}
where role_id = #{roleId}
</select>
</select>
<update
id=
"removeRoleInfo"
parameterType=
"int"
>
<delete
id=
"removeRoleInfo"
parameterType=
"java.lang.Integer"
>
UPDATE role_info
delete
<set>
from role_info
is_deleted = 1
</set>
where id = #{id}
where id = #{id}
</
upda
te>
</
dele
te>
<select
id=
"getRoleInfo"
resultMap=
"roleInfoResultMap"
<select
id=
"getRoleInfo"
resultMap=
"roleInfoResultMap"
parameterType=
"int"
>
parameterType=
"int"
>
...
@@ -157,16 +155,5 @@
...
@@ -157,16 +155,5 @@
AND ua.is_deleted = 0
AND ua.is_deleted = 0
</select>
</select>
<select
id=
"roleAccountList"
resultMap=
"userAccountResultMap"
>
SELECT urr.user_account_id,
ua.user_name,
ua.uid,
ua.phone_num,
ua.user_name,
ua.is_deleted
FROM user_role_rel urr
LEFT JOIN user_account ua ON ua.id = urr.user_account_id
WHERE urr.role_id = #{id}
AND ua.is_deleted = 0
</select>
</mapper>
</mapper>
csm-service/cms-service-user/src/main/resources/mapper/UserServiceDao.xml
浏览文件 @
7bfe9737
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论