Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
fc0e230d
Commit
fc0e230d
authored
Nov 06, 2020
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master-tiande' into master-tiande
parents
b117d683
9fd76c14
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
135 additions
and
9 deletions
+135
-9
UserMemberSaveDTO.java
.../github/wxiaoqi/security/admin/dto/UserMemberSaveDTO.java
+4
-0
BaseUserMemberExport.java
...b/wxiaoqi/security/admin/entity/BaseUserMemberExport.java
+6
-0
BaseUserMemberLevel.java
...ub/wxiaoqi/security/admin/entity/BaseUserMemberLevel.java
+15
-0
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+55
-1
BaseUserMemberExportBiz.java
...b/wxiaoqi/security/admin/biz/BaseUserMemberExportBiz.java
+8
-1
UserMemberLevelBiz.java
...github/wxiaoqi/security/admin/biz/UserMemberLevelBiz.java
+12
-0
MemberLevelController.java
...ub/wxiaoqi/security/admin/rest/MemberLevelController.java
+3
-2
AdminUserRelationController.java
...ecurity/admin/rest/admin/AdminUserRelationController.java
+0
-5
AppUserRest.java
...va/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
+9
-0
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+23
-0
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/UserMemberSaveDTO.java
View file @
fc0e230d
...
...
@@ -14,6 +14,10 @@ import org.springframework.util.StringUtils;
public
class
UserMemberSaveDTO
{
@ApiModelProperty
(
value
=
"会员导入Id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"手机号"
)
private
String
phone
;
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/BaseUserMemberExport.java
View file @
fc0e230d
...
...
@@ -3,6 +3,8 @@ package com.github.wxiaoqi.security.admin.entity;
import
lombok.*
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
...
...
@@ -20,6 +22,10 @@ import java.io.Serializable;
@ToString
public
class
BaseUserMemberExport
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
//此处加上注解
private
Integer
id
;
@Column
(
name
=
"user_id"
)
private
Integer
userId
;
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/BaseUserMemberLevel.java
View file @
fc0e230d
...
...
@@ -70,6 +70,21 @@ public class BaseUserMemberLevel implements Serializable {
@ApiModelProperty
(
value
=
"折扣"
)
private
Integer
discount
;
@Column
(
name
=
"share_amount"
)
@ApiModelProperty
(
value
=
"分红金额"
)
private
BigDecimal
shareAmount
;
@Column
(
name
=
"is_share"
)
@ApiModelProperty
(
value
=
"是否分红:0-否;1-是"
)
private
Integer
isShare
;
@Column
(
name
=
"is_show"
)
@ApiModelProperty
(
value
=
"是否显示:0-不显示;1-显示"
)
private
Integer
isShow
;
//是否删除;0-正常;1-删除
@Column
(
name
=
"isdel"
)
@ApiModelProperty
(
value
=
"是否删除;0-正常;1-删除"
)
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
fc0e230d
...
...
@@ -11,6 +11,7 @@ import com.github.wxiaoqi.security.admin.mapper.AppUserRelationMapper;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.vo.InviteMemberVo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
...
...
@@ -168,6 +169,8 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
staffUserDTO
.
setUid
(
relation
.
getUserId
());
staffUserBiz
.
addAppStaffUser
(
staffUserDTO
);
}
}
else
{
throw
new
BaseException
(
"该用户已有下线无法成为别人下线"
,
ResultCode
.
FAILED_CODE
);
}
}
catch
(
Exception
e
){
log
.
info
(
"网络异常==="
+
e
.
getMessage
());
...
...
@@ -175,6 +178,57 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
}
public
void
bindRelationV2
(
Integer
userId
,
Integer
parentId
,
Integer
type
){
if
(
userId
.
equals
(
parentId
)){
log
.
info
(
"----userId==="
+
userId
+
"----parentId===="
+
parentId
+
"----自己不能成为自己的上线"
);
throw
new
BaseException
(
"自己不能成为自己的上线"
,
ResultCode
.
FAILED_CODE
);
}
AppUserVo
appUserVo
=
userDetailBiz
.
getUserInfoById
(
parentId
);
if
(
appUserVo
==
null
){
log
.
info
(
"----userId==="
+
userId
+
"----parentId===="
+
parentId
+
"----"
);
throw
new
BaseException
(
"该上线用户不存在"
,
ResultCode
.
FAILED_CODE
);
}
AppUserRelation
relation
=
getMyBiz
().
getRelationByUserId
(
parentId
);
Long
time
=
System
.
currentTimeMillis
();
if
(
relation
==
null
){
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
parentId
);
relation
.
setBindType
(
type
);
insertSelective
(
relation
);
}
Long
bindTime
=
time
-
validTime
;
//判断用户是否有有效的下线
if
(
getCountByParentId
(
userId
,
bindTime
)==
0L
){
relation
=
getMyBiz
().
getRelationByUserId
(
userId
);
if
(
relation
==
null
){
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
userId
);
relation
.
setParentId
(
parentId
);
relation
.
setBindType
(
type
);
relation
.
setBindTime
(
time
);
insertSelective
(
relation
);
}
else
{
//判断用户是否有有效的上线
log
.
info
(
"----userId==="
+
userId
+
"----bindTime===="
+
bindTime
+
"----relation.getBindTime()==="
+
relation
.
getBindTime
());
if
(
relation
.
getParentId
()==
null
||
relation
.
getParentId
()==
0
||(
relation
.
getIsForever
()!=
1
&&
validTime
>
0
&&
relation
.
getBindTime
()<
bindTime
)){
relation
.
setParentId
(
parentId
);
relation
.
setBindType
(
type
);
relation
.
setBindTime
(
time
);
getMyBiz
().
updRelation
(
relation
);
}
}
if
(
relation
!=
null
){
AppStaffUserDTO
staffUserDTO
=
new
AppStaffUserDTO
();
staffUserDTO
.
setSuId
(
relation
.
getParentId
());
staffUserDTO
.
setUid
(
relation
.
getUserId
());
staffUserBiz
.
addAppStaffUser
(
staffUserDTO
);
}
}
else
{
throw
new
BaseException
(
"该用户已有下线无法成为别人下线"
,
ResultCode
.
FAILED_CODE
);
}
}
//首页关系绑定
public
ObjectRestResponse
appBindRelation
(
Integer
userId
,
String
code
)
{
Integer
parentId
=
0
;
...
...
@@ -204,7 +258,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"该上级不存在"
);
}
Integer
parentId
=
userLogin
.
getId
();
getMyBiz
().
bindRelation
(
userId
,
parentId
,
1
);
bindRelationV2
(
userId
,
parentId
,
1
);
return
ObjectRestResponse
.
succ
();
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/BaseUserMemberExportBiz.java
View file @
fc0e230d
...
...
@@ -99,7 +99,14 @@ public class BaseUserMemberExportBiz extends BaseBiz<BaseUserMemberExportMapper,
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"当前组装的数据:【{}】"
,
memberExport
);
}
Integer
id
=
userMemberSaveDTO
.
getId
()
==
null
?
0
:
userMemberSaveDTO
.
getId
();
if
(
id
==
0
){
mapper
.
insertSelective
(
memberExport
);
}
else
{
memberExport
.
setId
(
id
);
mapper
.
updateByPrimaryKeySelective
(
memberExport
);
}
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/UserMemberLevelBiz.java
View file @
fc0e230d
...
...
@@ -33,6 +33,18 @@ public class UserMemberLevelBiz extends BaseBiz<BaseUserMemberLevelMapper,BaseUs
return
mapper
.
selectByExample
(
example
);
}
@Transactional
public
List
<
BaseUserMemberLevel
>
getList
(
BaseUserMemberLevel
baseUserMemberLevel
)
{
Example
example
=
new
Example
(
BaseUserMemberLevel
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"isdel"
,
0
);
if
(
baseUserMemberLevel
.
getIsShow
()
!=
null
){
criteria
.
andEqualTo
(
"isShow"
,
baseUserMemberLevel
.
getIsShow
());
}
example
.
setOrderByClause
(
" level asc "
);
return
mapper
.
selectByExample
(
example
);
}
public
BaseUserMemberLevel
getLevel
(
Integer
level
)
{
Example
example
=
new
Example
(
BaseUserMemberLevel
.
class
);
example
.
createCriteria
().
andEqualTo
(
"isdel"
,
0
).
andEqualTo
(
"level"
,
level
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/MemberLevelController.java
View file @
fc0e230d
...
...
@@ -33,8 +33,9 @@ public class MemberLevelController extends BaseController<UserMemberLevelBiz, Ba
}
@RequestMapping
(
value
=
"/app/unauth/level/list"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
List
<
BaseUserMemberLevel
>>
list
()
throws
Exception
{
return
ObjectRestResponse
.
succ
(
memberBiz
.
getLevesls
());
public
ObjectRestResponse
<
List
<
BaseUserMemberLevel
>>
list
(
BaseUserMemberLevel
baseUserMemberLevel
)
throws
Exception
{
baseUserMemberLevel
.
setIsShow
(
1
);
return
ObjectRestResponse
.
succ
(
memberBiz
.
getList
(
baseUserMemberLevel
));
}
@RequestMapping
(
value
=
"/app/unauth/level/{type}"
,
method
=
RequestMethod
.
GET
)
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/admin/AdminUserRelationController.java
View file @
fc0e230d
...
...
@@ -17,12 +17,7 @@ public class AdminUserRelationController extends BaseController<AppUserRelationB
@RequestMapping
(
value
=
"/bind"
,
method
=
RequestMethod
.
POST
)
@ApiModelProperty
(
"后台绑定"
)
public
ObjectRestResponse
bind
(
@RequestBody
UserRelationDTO
relationDTO
){
try
{
return
baseBiz
.
adminBindRelation
(
relationDTO
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BaseException
(
e
);
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
View file @
fc0e230d
...
...
@@ -281,6 +281,15 @@ public class AppUserRest {
}
@ApiModelProperty
(
"注销"
)
@PostMapping
(
"cancelUsername"
)
public
ObjectRestResponse
updUsername
(
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
HttpServletRequest
request
)
throws
Exception
{
IJWTInfo
infoFromToken
=
authUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
return
appPermissionService
.
cancelUsername
(
Integer
.
parseInt
(
infoFromToken
.
getId
()),
mobilecode
);
}
/*@GetMapping("/app/unauth/test")
@IgnoreUserToken
public ObjectRestResponse test(){
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
fc0e230d
...
...
@@ -1258,6 +1258,29 @@ public class AppPermissionService {
}
//注销
public
ObjectRestResponse
cancelUsername
(
Integer
userId
,
String
mobileCode
){
if
(
StringUtils
.
isBlank
(
mobileCode
)
||
userId
==
0
||
userId
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数不能为空"
);
}
// 是否已存在
AppUserLogin
user
=
appUserLoginBiz
.
selectById
(
userId
);
if
(
user
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
EXIST_CODE
,
"用户不存在"
);
}
if
(
StringUtils
.
isBlank
(
checkCodeByUsername
(
user
.
getUsername
(),
mobileCode
))){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"验证码错误"
);
}
AppUserLogin
userLogin
=
new
AppUserLogin
();
userLogin
.
setId
(
userId
);
userLogin
.
setIsdel
(
1
);
userLogin
.
setUsername
(
user
.
getUsername
()+
user
.
getId
());
appUserLoginBiz
.
disable
(
userLogin
);
return
ObjectRestResponse
.
succ
();
}
/**
* 注册用户
*
...
...
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