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
32c461c8
Commit
32c461c8
authored
Mar 03, 2020
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
ac0a4c56
06655c46
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
770 additions
and
121 deletions
+770
-121
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+6
-4
IUserService.java
.../com/github/wxiaoqi/security/auth/feign/IUserService.java
+4
-2
AuthService.java
...com/github/wxiaoqi/security/auth/service/AuthService.java
+2
-2
AppAuthServiceImpl.java
...xiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
+4
-4
AuthServiceImpl.java
...b/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
+4
-4
AppUserManageDTO.java
...m/github/wxiaoqi/security/admin/dto/AppUserManageDTO.java
+9
-0
AppUserDetail.java
...m/github/wxiaoqi/security/admin/entity/AppUserDetail.java
+13
-3
AppUserManageVo.java
...com/github/wxiaoqi/security/admin/vo/AppUserManageVo.java
+12
-0
AppUserVo.java
.../java/com/github/wxiaoqi/security/admin/vo/AppUserVo.java
+87
-82
AppUsersManageController.java
...wxiaoqi/security/admin/rest/AppUsersManageController.java
+1
-1
AppUserRest.java
...va/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
+6
-4
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+5
-3
AppUserDetailMapper.xml
...e-admin/src/main/resources/mapper/AppUserDetailMapper.xml
+26
-12
AppVersionMark.java
...ain/java/com/xxfc/platform/app/entity/AppVersionMark.java
+82
-0
AppVersionMarkDTO.java
...a/com/xxfc/platform/app/entity/dto/AppVersionMarkDTO.java
+46
-0
AppVersionMarkQuery.java
...in/java/com/xxfc/platform/app/vo/AppVersionMarkQuery.java
+24
-0
AppVersionMarkBiz.java
...ain/java/com/xxfc/platform/app/biz/AppVersionMarkBiz.java
+189
-0
AppVersionMarkMapper.java
...va/com/xxfc/platform/app/mapper/AppVersionMarkMapper.java
+33
-0
AppVersionMarkController.java
.../com/xxfc/platform/app/rest/AppVersionMarkController.java
+147
-0
AppVersionMarkMapper.xml
...server/src/main/resources/mapper/AppVersionMarkMapper.xml
+70
-0
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
32c461c8
...
@@ -84,9 +84,10 @@ public class AuthController {
...
@@ -84,9 +84,10 @@ public class AuthController {
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
)
throws
Exception
{
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
,
@RequestParam
(
value
=
"registerSource"
,
defaultValue
=
""
)
String
registerSource
)
throws
Exception
{
log
.
info
(
username
+
"----require register..."
);
log
.
info
(
username
+
"----require register..."
);
JSONObject
data
=
appAuthService
.
register
(
username
,
mobilecode
,
password
,
code
,
channel
);
JSONObject
data
=
appAuthService
.
register
(
username
,
mobilecode
,
password
,
code
,
channel
,
registerSource
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JwtAuthenticationRequest
authenticationRequest
=
new
JwtAuthenticationRequest
();
JwtAuthenticationRequest
authenticationRequest
=
new
JwtAuthenticationRequest
();
authenticationRequest
.
setUsername
(
username
);
authenticationRequest
.
setUsername
(
username
);
...
@@ -108,11 +109,12 @@ public class AuthController {
...
@@ -108,11 +109,12 @@ public class AuthController {
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
value
=
"isQQ"
,
defaultValue
=
"0"
)
Integer
isQQ
,
@RequestParam
(
value
=
"isQQ"
,
defaultValue
=
"0"
)
Integer
isQQ
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
,
@RequestParam
(
value
=
"registerSource"
,
defaultValue
=
""
)
String
registerSource
)
throws
Exception
{
)
throws
Exception
{
log
.
info
(
username
+
"----require wxregister..."
);
log
.
info
(
username
+
"----require wxregister..."
);
JSONObject
data
=
appAuthService
.
wxregister
(
username
,
mobilecode
,
password
,
nickname
,
JSONObject
data
=
appAuthService
.
wxregister
(
username
,
mobilecode
,
password
,
nickname
,
headimgurl
,
openid
,
unionid
,
type
,
isQQ
,
code
,
channel
);
headimgurl
,
openid
,
unionid
,
type
,
isQQ
,
code
,
channel
,
registerSource
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
if
(
result
==
null
){
if
(
result
==
null
){
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/feign/IUserService.java
View file @
32c461c8
...
@@ -35,7 +35,8 @@ public interface IUserService {
...
@@ -35,7 +35,8 @@ public interface IUserService {
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"code"
)
String
code
,
@RequestParam
(
value
=
"code"
)
String
code
,
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
);
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
,
@RequestParam
(
value
=
"registerSource"
,
defaultValue
=
""
)
String
registerSource
);
@RequestMapping
(
value
=
"/api/app/user/wxregister"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/api/app/user/wxregister"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
wxregister
(
public
JSONObject
wxregister
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
...
@@ -43,7 +44,8 @@ public interface IUserService {
...
@@ -43,7 +44,8 @@ public interface IUserService {
@RequestParam
(
value
=
"headimgurl"
)
String
headimgurl
,
@RequestParam
(
value
=
"openid"
)
String
openid
,
@RequestParam
(
value
=
"headimgurl"
)
String
headimgurl
,
@RequestParam
(
value
=
"openid"
)
String
openid
,
@RequestParam
(
value
=
"unionid"
)
String
unionid
,
@RequestParam
(
value
=
"type"
)
Integer
type
,
@RequestParam
(
value
=
"unionid"
)
String
unionid
,
@RequestParam
(
value
=
"type"
)
Integer
type
,
@RequestParam
(
value
=
"isQQ"
)
Integer
isQQ
,
@RequestParam
(
value
=
"code"
)
String
code
,
@RequestParam
(
value
=
"isQQ"
)
Integer
isQQ
,
@RequestParam
(
value
=
"code"
)
String
code
,
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
);
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
,
@RequestParam
(
value
=
"registerSource"
,
defaultValue
=
""
)
String
registerSource
);
@RequestMapping
(
value
=
"/api/app/user/checkBindWechat"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/api/app/user/checkBindWechat"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
checkBindWechat
(
@RequestParam
(
value
=
"username"
)
String
username
);
public
JSONObject
checkBindWechat
(
@RequestParam
(
value
=
"username"
)
String
username
);
@RequestMapping
(
value
=
"/api/app/user/wxlogin"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/api/app/user/wxlogin"
,
method
=
RequestMethod
.
POST
)
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/AuthService.java
View file @
32c461c8
...
@@ -11,8 +11,8 @@ public interface AuthService {
...
@@ -11,8 +11,8 @@ public interface AuthService {
String
refresh
(
String
oldToken
)
throws
Exception
;
String
refresh
(
String
oldToken
)
throws
Exception
;
void
validate
(
String
token
)
throws
Exception
;
void
validate
(
String
token
)
throws
Exception
;
JSONObject
sendsms
(
String
username
,
Integer
type
,
String
pointList
)
throws
Exception
;
JSONObject
sendsms
(
String
username
,
Integer
type
,
String
pointList
)
throws
Exception
;
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
)
throws
Exception
;
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
,
String
registerSource
)
throws
Exception
;
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
,
Integer
channel
)
throws
Exception
;
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
,
Integer
channel
,
String
registerSource
)
throws
Exception
;
JSONObject
checkBindWechat
(
String
username
)
throws
Exception
;
JSONObject
checkBindWechat
(
String
username
)
throws
Exception
;
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
,
String
code
)
throws
Exception
;
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
,
String
code
)
throws
Exception
;
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
,
String
code
)
throws
Exception
;
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
,
String
code
)
throws
Exception
;
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
View file @
32c461c8
...
@@ -72,13 +72,13 @@ public class AppAuthServiceImpl implements AuthService {
...
@@ -72,13 +72,13 @@ public class AppAuthServiceImpl implements AuthService {
}
}
@Override
@Override
public
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
)
throws
Exception
{
public
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
,
String
registerSource
)
throws
Exception
{
return
userService
.
register
(
username
,
mobilecode
,
password
,
code
,
channel
);
return
userService
.
register
(
username
,
mobilecode
,
password
,
code
,
channel
,
registerSource
);
}
}
@Override
@Override
public
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
,
Integer
channel
)
throws
Exception
{
public
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
,
Integer
channel
,
String
registerSource
)
throws
Exception
{
return
userService
.
wxregister
(
username
,
mobilecode
,
password
,
nickname
,
headimgurl
,
openid
,
unionid
,
type
,
isQQ
,
code
,
channel
);
return
userService
.
wxregister
(
username
,
mobilecode
,
password
,
nickname
,
headimgurl
,
openid
,
unionid
,
type
,
isQQ
,
code
,
channel
,
registerSource
);
}
}
@Override
@Override
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
View file @
32c461c8
...
@@ -69,13 +69,13 @@ public class AuthServiceImpl implements AuthService {
...
@@ -69,13 +69,13 @@ public class AuthServiceImpl implements AuthService {
return
userService
.
sendsms
(
username
,
type
,
pointList
);
return
userService
.
sendsms
(
username
,
type
,
pointList
);
}
}
@Override
@Override
public
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
)
throws
Exception
{
public
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
,
Integer
channel
,
String
registerSource
)
throws
Exception
{
return
userService
.
register
(
username
,
mobilecode
,
password
,
code
,
channel
);
return
userService
.
register
(
username
,
mobilecode
,
password
,
code
,
channel
,
registerSource
);
}
}
@Override
@Override
public
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
,
Integer
channel
)
throws
Exception
{
public
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
,
Integer
channel
,
String
registerSource
)
throws
Exception
{
return
userService
.
wxregister
(
username
,
mobilecode
,
password
,
nickname
,
headimgurl
,
openid
,
unionid
,
type
,
isQQ
,
code
,
channel
);
return
userService
.
wxregister
(
username
,
mobilecode
,
password
,
nickname
,
headimgurl
,
openid
,
unionid
,
type
,
isQQ
,
code
,
channel
,
registerSource
);
}
}
@Override
@Override
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/AppUserManageDTO.java
View file @
32c461c8
...
@@ -75,6 +75,15 @@ public class AppUserManageDTO {
...
@@ -75,6 +75,15 @@ public class AppUserManageDTO {
private
String
realName
;
private
String
realName
;
/**
* 注册来源
*/
private
String
registerSource
;
/**
* 注册来源名称
*/
private
String
markName
;
// /**
// /**
// * 接收前台时间范围
// * 接收前台时间范围
// */
// */
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppUserDetail.java
View file @
32c461c8
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GeneratedValue
;
...
@@ -12,6 +14,8 @@ import javax.persistence.Table;
...
@@ -12,6 +14,8 @@ import javax.persistence.Table;
* 用户详情信息表
* 用户详情信息表
*/
*/
@Table
(
name
=
"app_user_detail"
)
@Table
(
name
=
"app_user_detail"
)
@AllArgsConstructor
@NoArgsConstructor
@Data
@Data
public
class
AppUserDetail
{
public
class
AppUserDetail
{
@Id
@Id
...
@@ -79,7 +83,13 @@ public class AppUserDetail {
...
@@ -79,7 +83,13 @@ public class AppUserDetail {
@Column
(
name
=
"inviter_account"
)
@Column
(
name
=
"inviter_account"
)
private
Integer
inviterAccount
;
private
Integer
inviterAccount
;
@ApiModelProperty
(
value
=
"1-新人用户;2-未激活;3-激活"
)
@ApiModelProperty
(
value
=
"1-新人用户;2-未激活;3-激活"
)
@Column
(
name
=
"state"
)
@Column
(
name
=
"state"
)
private
Integer
state
;
private
Integer
state
;
@ApiModelProperty
(
value
=
"注册来源"
)
@Column
(
name
=
"register_source"
)
private
String
registerSource
;
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/AppUserManageVo.java
View file @
32c461c8
...
@@ -21,6 +21,12 @@ public class AppUserManageVo {
...
@@ -21,6 +21,12 @@ public class AppUserManageVo {
@Column
(
name
=
"channel"
)
@Column
(
name
=
"channel"
)
private
String
channel
;
private
String
channel
;
/**
* 注册来源
*/
@Column
(
name
=
"register_source"
)
private
String
registerSource
;
/**
/**
* 是否是会员:0-不是;1-会员
* 是否是会员:0-不是;1-会员
*/
*/
...
@@ -186,4 +192,10 @@ public class AppUserManageVo {
...
@@ -186,4 +192,10 @@ public class AppUserManageVo {
* 上级手机号
* 上级手机号
*/
*/
private
String
superiorMobileNumber
;
private
String
superiorMobileNumber
;
/**
* 注册来源名称
*/
@Column
(
name
=
"mark_name"
)
private
String
markName
;
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/AppUserVo.java
View file @
32c461c8
...
@@ -14,90 +14,95 @@ import lombok.NoArgsConstructor;
...
@@ -14,90 +14,95 @@ import lombok.NoArgsConstructor;
public
class
AppUserVo
{
public
class
AppUserVo
{
private
Integer
id
;
private
Integer
id
;
//用户id
//用户id
private
Integer
userid
;
private
Integer
userid
;
//imid
//imid
private
Integer
imUserid
;
private
Integer
imUserid
;
///账号(手机号)
///账号(手机号)
private
String
username
;
private
String
username
;
//微信openid
//微信openid
private
String
wxOpenid
;
private
String
wxOpenid
;
//微信unionid
//微信unionid
private
String
unionid
;
private
String
unionid
;
//qq
//qq
private
String
openid
;
private
String
openid
;
//状态:0-启用,1-禁用
//状态:0-启用,1-禁用
private
Integer
status
;
private
Integer
status
;
//身份证号
//身份证号
private
String
idNumber
;
private
String
idNumber
;
//实名认证状态:0-未认证,1-已认证
//实名认证状态:0-未认证,1-已认证
private
Integer
certificationStatus
;
private
Integer
certificationStatus
;
//会员
//会员
private
Integer
isMember
;
private
Integer
isMember
;
//昵称
//昵称
private
String
nickname
;
private
String
nickname
;
private
String
wxNickname
;
private
String
wxNickname
;
private
String
aliPayNickName
;
private
String
aliPayNickName
;
private
String
qqNickname
;
private
String
qqNickname
;
//真实姓名
//真实姓名
private
String
realname
;
private
String
realname
;
//头像
//头像
private
String
headimgurl
;
private
String
headimgurl
;
//邮箱
//邮箱
private
String
email
;
private
String
email
;
//性别 0-女,1-男
//性别 0-女,1-男
private
Integer
sex
;
private
Integer
sex
;
//生日
//生日
private
String
birthday
;
private
String
birthday
;
//个性签名
//个性签名
private
String
personSign
;
private
String
personSign
;
//备注
//备注
private
String
remark
;
private
String
remark
;
//渠道来源;1-app;2-小程序
//渠道来源;1-app;2-小程序
private
Integer
channel
;
private
Integer
channel
;
/**
//注册来源
* 省份编号
private
String
registerSource
;
*/
//注册来源名称
private
Integer
provinceCode
;
private
String
markName
;
/**
/**
* 省份编号
* 市编号
*/
*/
private
Integer
provinceCode
;
private
Integer
cityCode
;
/**
/**
* 市编号
* 创建ip
*/
*/
private
Integer
cityCode
;
private
String
crtHost
;
/**
/**
* 更新ip
* 创建ip
*/
*/
private
String
updHost
;
private
String
crtHost
;
/**
* 更新ip
@ApiModelProperty
(
value
=
"用户职位"
)
*/
private
Integer
positionId
;
private
String
updHost
;
@ApiModelProperty
(
value
=
"用户来源:0-自来,1-用户邀请"
)
private
Integer
source
;
@ApiModelProperty
(
value
=
"用户职位"
)
private
Integer
positionId
;
@ApiModelProperty
(
value
=
"邀请码"
)
@ApiModelProperty
(
value
=
"用户来源:0-自来,1-用户邀请"
)
private
String
code
;
private
Integer
source
;
@ApiModelProperty
(
value
=
"邀请人id:"
)
private
Integer
inviterAccount
;
@ApiModelProperty
(
value
=
"邀请码"
)
private
String
code
;
@ApiModelProperty
(
value
=
"1-未激活;2-激活:"
)
private
Integer
state
;
@ApiModelProperty
(
value
=
"邀请人id:"
)
private
Integer
inviterAccount
;
@ApiModelProperty
(
value
=
"1-未激活;2-激活:"
)
private
Integer
state
;
@ApiModelProperty
(
value
=
"支付宝授权返回的code"
)
@ApiModelProperty
(
value
=
"支付宝授权返回的code"
)
private
String
aliCode
;
private
String
aliCode
;
@ApiModelProperty
(
value
=
"用户职位名称"
)
@ApiModelProperty
(
value
=
"用户职位名称"
)
private
String
jobTitle
;
private
String
jobTitle
;
@ApiModelProperty
(
value
=
"用户会员名称"
)
private
String
memberName
;
@ApiModelProperty
(
value
=
"用户会员名称"
)
private
String
memberName
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUsersManageController.java
View file @
32c461c8
...
@@ -72,7 +72,7 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap
...
@@ -72,7 +72,7 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap
User
user
=
(
User
)
objectRestResponse
.
getData
();
User
user
=
(
User
)
objectRestResponse
.
getData
();
if
(
user
==
null
){
if
(
user
==
null
){
throw
new
BaseException
(
"User error!"
);
throw
new
BaseException
(
"User error!"
);
}
}
if
(
ALL_PERMISSIONS
.
equals
(
user
.
getDataAll
()))
{
if
(
ALL_PERMISSIONS
.
equals
(
user
.
getDataAll
()))
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
findAllByQuery
(
appUserManageDTO
));
return
ObjectRestResponse
.
succ
(
baseBiz
.
findAllByQuery
(
appUserManageDTO
));
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
View file @
32c461c8
...
@@ -89,12 +89,13 @@ public class AppUserRest {
...
@@ -89,12 +89,13 @@ public class AppUserRest {
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
,
@RequestParam
(
value
=
"registerSource"
,
defaultValue
=
""
)
String
registerSource
){
){
//默认昵称
//默认昵称
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+(
int
)((
Math
.
random
()*
9
+
1
)*
100000
);
String
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+(
int
)((
Math
.
random
()*
9
+
1
)*
100000
);
return
appPermissionService
.
register
(
username
,
password
,
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
,
return
appPermissionService
.
register
(
username
,
password
,
SystemConfig
.
USER_HEADER_URL_DEFAULT
,
nickname
,
mobilecode
,
null
,
null
,
0
,
code
,
channel
);
mobilecode
,
null
,
null
,
0
,
code
,
channel
,
registerSource
);
}
}
...
@@ -123,7 +124,8 @@ public class AppUserRest {
...
@@ -123,7 +124,8 @@ public class AppUserRest {
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
value
=
"isQQ"
,
defaultValue
=
"0"
)
Integer
isQQ
,
@RequestParam
(
value
=
"isQQ"
,
defaultValue
=
"0"
)
Integer
isQQ
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
,
@RequestParam
(
value
=
"registerSource"
,
defaultValue
=
""
)
String
registerSource
){
){
if
(
StringUtils
.
isBlank
(
headimgurl
)){
if
(
StringUtils
.
isBlank
(
headimgurl
)){
headimgurl
=
SystemConfig
.
USER_HEADER_URL_DEFAULT
;
headimgurl
=
SystemConfig
.
USER_HEADER_URL_DEFAULT
;
...
@@ -131,7 +133,7 @@ public class AppUserRest {
...
@@ -131,7 +133,7 @@ public class AppUserRest {
if
(
StringUtils
.
isBlank
(
nickname
)){
if
(
StringUtils
.
isBlank
(
nickname
)){
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+(
int
)((
Math
.
random
()*
9
+
1
)*
100000
);
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+(
int
)((
Math
.
random
()*
9
+
1
)*
100000
);
}
}
return
appPermissionService
.
weCahtRegister
(
username
,
password
,
openid
,
unionid
,
nickname
,
headimgurl
,
type
,
mobilecode
,
isQQ
,
code
,
channel
);
return
appPermissionService
.
weCahtRegister
(
username
,
password
,
openid
,
unionid
,
nickname
,
headimgurl
,
type
,
mobilecode
,
isQQ
,
code
,
channel
,
registerSource
);
}
}
/**
/**
* 手机号码检测是否已绑定
* 手机号码检测是否已绑定
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
32c461c8
...
@@ -251,7 +251,7 @@ public class AppPermissionService {
...
@@ -251,7 +251,7 @@ public class AppPermissionService {
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
public
JSONObject
register
(
String
username
,
String
password
,
String
headimgurl
,
public
JSONObject
register
(
String
username
,
String
password
,
String
headimgurl
,
String
nickname
,
String
mobilecode
,
String
openId
,
String
unionid
,
Integer
type
,
String
code
,
Integer
channel
)
{
String
nickname
,
String
mobilecode
,
String
openId
,
String
unionid
,
Integer
type
,
String
code
,
Integer
channel
,
String
registerSource
)
{
log
.
info
(
"register------code====="
+
code
+
"----开始进入方法---time===="
+
System
.
currentTimeMillis
()/
1000L
);
log
.
info
(
"register------code====="
+
code
+
"----开始进入方法---time===="
+
System
.
currentTimeMillis
()/
1000L
);
String
activityCode
=
null
;
String
activityCode
=
null
;
// 判断参数和验证码
// 判断参数和验证码
...
@@ -348,6 +348,7 @@ public class AppPermissionService {
...
@@ -348,6 +348,7 @@ public class AppPermissionService {
log
.
info
(
"register------username====="
+
username
+
"----channel===="
+
channel
);
log
.
info
(
"register------username====="
+
username
+
"----channel===="
+
channel
);
channel
=-
1
;
channel
=-
1
;
rsUserDetail
.
setChannel
(
channel
);
rsUserDetail
.
setChannel
(
channel
);
rsUserDetail
.
setRegisterSource
(
registerSource
);
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
log
.
info
(
"注册:新增用户详情: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
log
.
info
(
"注册:新增用户详情: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
/* //绑定上下线关系
/* //绑定上下线关系
...
@@ -571,7 +572,7 @@ public class AppPermissionService {
...
@@ -571,7 +572,7 @@ public class AppPermissionService {
*/
*/
@Transactional
@Transactional
public
JSONObject
weCahtRegister
(
String
username
,
String
password
,
String
openId
,
public
JSONObject
weCahtRegister
(
String
username
,
String
password
,
String
openId
,
String
unionid
,
String
nickname
,
String
headimgurl
,
int
type
,
String
mobilecode
,
Integer
isQQ
,
String
code
,
Integer
channel
)
{
String
unionid
,
String
nickname
,
String
headimgurl
,
int
type
,
String
mobilecode
,
Integer
isQQ
,
String
code
,
Integer
channel
,
String
registerSource
)
{
// 校验参数和验证码
// 校验参数和验证码
if
(
StringUtils
.
isBlank
(
username
)
||
StringUtils
.
isBlank
(
mobilecode
))
{
if
(
StringUtils
.
isBlank
(
username
)
||
StringUtils
.
isBlank
(
mobilecode
))
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
...
@@ -631,6 +632,7 @@ public class AppPermissionService {
...
@@ -631,6 +632,7 @@ public class AppPermissionService {
userDetail
.
setIsdel
(
0
);
userDetail
.
setIsdel
(
0
);
userDetail
.
setCrtHost
(
getIp
());
userDetail
.
setCrtHost
(
getIp
());
userDetail
.
setChannel
(
channel
);
userDetail
.
setChannel
(
channel
);
userDetail
.
setRegisterSource
(
registerSource
);
//setCreateIPInfo(userDetail);
//setCreateIPInfo(userDetail);
appUserDetailBiz
.
insertSelective
(
userDetail
);
appUserDetailBiz
.
insertSelective
(
userDetail
);
...
@@ -664,7 +666,7 @@ public class AppPermissionService {
...
@@ -664,7 +666,7 @@ public class AppPermissionService {
}
}
}
else
if
(
type
==
2
)
{
// 新增
}
else
if
(
type
==
2
)
{
// 新增
JSONObject
register
=
register
(
username
,
password
,
headimgurl
,
nickname
,
mobilecode
,
JSONObject
register
=
register
(
username
,
password
,
headimgurl
,
nickname
,
mobilecode
,
openId
,
unionid
,
isQQ
,
code
,
channel
);
openId
,
unionid
,
isQQ
,
code
,
channel
,
registerSource
);
if
(
register
.
getInteger
(
"status"
)
!=
ResultCode
.
SUCCESS_CODE
)
{
if
(
register
.
getInteger
(
"status"
)
!=
ResultCode
.
SUCCESS_CODE
)
{
if
(
register
.
getInteger
(
"status"
)
==
ResultCode
.
EXIST_CODE
)
{
if
(
register
.
getInteger
(
"status"
)
==
ResultCode
.
EXIST_CODE
)
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
EXIST_CODE
,
"用户已存在"
);
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
EXIST_CODE
,
"用户已存在"
);
...
...
ace-modules/ace-admin/src/main/resources/mapper/AppUserDetailMapper.xml
View file @
32c461c8
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
<result
column=
"person_sign"
property=
"personSign"
/>
<result
column=
"person_sign"
property=
"personSign"
/>
<result
column=
"remark"
property=
"remark"
/>
<result
column=
"remark"
property=
"remark"
/>
<result
column=
"channel"
property=
"channel"
/>
<result
column=
"channel"
property=
"channel"
/>
<result
column=
"register_source"
property=
"registerSource"
/>
<result
column=
"mark_name"
property=
"markName"
/>
<result
column=
"province_code"
property=
"provinceCode"
/>
<result
column=
"province_code"
property=
"provinceCode"
/>
<result
column=
"city_code"
property=
"cityCode"
/>
<result
column=
"city_code"
property=
"cityCode"
/>
<result
column=
"crt_host"
property=
"crtHost"
/>
<result
column=
"crt_host"
property=
"crtHost"
/>
...
@@ -37,7 +39,6 @@
...
@@ -37,7 +39,6 @@
<result
column=
"memberName"
property=
"memberName"
/>
<result
column=
"memberName"
property=
"memberName"
/>
</resultMap>
</resultMap>
<!-- 获取用户信息 -->
<!-- 获取用户信息 -->
<select
id=
"getUserInfo"
resultMap=
"AppUserVoMap"
>
<select
id=
"getUserInfo"
resultMap=
"AppUserVoMap"
>
select l.im_userid,l.username,l.wx_openid,l.unionid,l.openid,l.status,l.id_number,l.certification_status,d.* from app_user_login l
select l.im_userid,l.username,l.wx_openid,l.unionid,l.openid,l.status,l.id_number,l.certification_status,d.* from app_user_login l
...
@@ -87,7 +88,9 @@
...
@@ -87,7 +88,9 @@
l.createtime,
l.createtime,
l.last_time AS lastTime,
l.last_time AS lastTime,
l. STATUS,
l. STATUS,
z.mark_name AS markName,
d.channel,
d.channel,
d.register_source,
d.is_member,
d.is_member,
d.realname,
d.realname,
d.nickname,
d.nickname,
...
@@ -113,6 +116,7 @@
...
@@ -113,6 +116,7 @@
LEFT JOIN app_user_detail d ON d.userid = l.id
LEFT JOIN app_user_detail d ON d.userid = l.id
LEFT JOIN app_user_login ul ON ul.id = d.inviter_account
LEFT JOIN app_user_login ul ON ul.id = d.inviter_account
LEFT JOIN base_user_member m ON d.userid = m.user_id
LEFT JOIN base_user_member m ON d.userid = m.user_id
LEFT JOIN xxfc_app.app_version_mark z ON z.mark = d.register_source
LEFT JOIN
LEFT JOIN
(
(
SELECT
SELECT
...
@@ -154,8 +158,10 @@
...
@@ -154,8 +158,10 @@
l.id AS userid,
l.id AS userid,
l.username,
l.username,
d.channel,
d.channel,
d.register_source,
d.source,
d.source,
d.realname,
d.realname,
z.mark_name AS markName,
ml. NAME AS memberName,
ml. NAME AS memberName,
aup. NAME AS positionName,
aup. NAME AS positionName,
m.crt_time AS timeOfMembership,
m.crt_time AS timeOfMembership,
...
@@ -187,7 +193,8 @@
...
@@ -187,7 +193,8 @@
is_del = 0
is_del = 0
) r ON l.id = r.user_id
) r ON l.id = r.user_id
LEFT JOIN app_user_login pl ON r.parent_id = pl.id
LEFT JOIN app_user_login pl ON r.parent_id = pl.id
LEFT JOIN app_user_detail pd ON pl.id = pd.userid
LEFT JOIN app_user_detail pd ON pl.id = pd.userid
LEFT JOIN xxfc_app.app_version_mark z ON z.mark = d.register_source
WHERE
WHERE
l.isdel = 0
l.isdel = 0
and
and
...
@@ -198,6 +205,9 @@
...
@@ -198,6 +205,9 @@
<if
test=
"channel !=null "
>
<if
test=
"channel !=null "
>
and d.channel=#{channel}
and d.channel=#{channel}
</if>
</if>
<if
test=
"registerSource !=null "
>
and binary d.register_source=#{registerSource}
</if>
<if
test=
"memberLevel !=null and memberLevel != -1"
>
<if
test=
"memberLevel !=null and memberLevel != -1"
>
and m.member_level = #{memberLevel}
and m.member_level = #{memberLevel}
</if>
</if>
...
@@ -267,23 +277,27 @@ from `app_user_detail` as `aud` left join `app_user_login` as `aul` on aul.id=
...
@@ -267,23 +277,27 @@ from `app_user_detail` as `aud` left join `app_user_login` as `aul` on aul.id=
<select
id=
"findAllStaffsByCompanyIdAndPostionId"
<select
id=
"findAllStaffsByCompanyIdAndPostionId"
resultType=
"com.github.wxiaoqi.security.admin.bo.UserStaffBo"
>
resultType=
"com.github.wxiaoqi.security.admin.bo.UserStaffBo"
>
select * from (select aud.userid as `userId`,aud.realname as `realName`,aud.nickname as `nickName`,aul.username as `phone`,aud.position_id
select * from (select aud.userid as `userId`,aud.realname as `realName`,aud.nickname as `nickName`,aul.username
as `postionId`,aup.name as `postionName`,aupt.company_id as `companyId`,aupt.company_name as `companyName` from `app_user_detail` as `aud`
as `phone`,aud.position_id
as `postionId`,aup.name as `postionName`,aupt.company_id as `companyId`,aupt.company_name as `companyName` from
`app_user_detail` as `aud`
left join `app_user_login` as `aul` on aul.id=aud.userid
left join `app_user_login` as `aul` on aul.id=aud.userid
left join (select * from `app_user_position_temp` where is_del=0) as `aupt` on aupt.user_id=aul.id
left join (select * from `app_user_position_temp` where is_del=0) as `aupt` on aupt.user_id=aul.id
left join `app_user_position` as `aup` on aup.id=aud.position_id where
<![CDATA[aud.position_id<>6]]>
and aud.isdel=0
left join `app_user_position` as `aup` on aup.id=aud.position_id where
<![CDATA[aud.position_id<>6]]>
and
<if
test=
"userPostionId!=null"
>
aud.isdel=0
and aud.`position_id`=#{userPostionId}
<if
test=
"userPostionId!=null"
>
</if>
and aud.`position_id`=#{userPostionId}
</if>
<if
test=
"companyId!=null"
>
<if
test=
"companyId!=null"
>
and
aupt.`company_id`=#{companyId}
and aupt.`company_id`=#{companyId}
</if>
</if>
<if
test=
"userIds!=null and userIds.size>0"
>
<if
test=
"userIds!=null and userIds.size>0"
>
and aud.userid in
and aud.userid in
<foreach
collection=
"userIds"
item=
"userId"
open=
"("
close=
")"
separator=
","
>
<foreach
collection=
"userIds"
item=
"userId"
open=
"("
close=
")"
separator=
","
>
#{userId}
#{userId}
</foreach>
</foreach>
</if>
) as `saff`
</if>
) as `saff`
left join (
left join (
select auswp.user_id, IFNULL(auswp.upIncome, 0) - IFNULL(auswd.dowIncome, 0) as `sellAmount`
select auswp.user_id, IFNULL(auswp.upIncome, 0) - IFNULL(auswd.dowIncome, 0) as `sellAmount`
from (select `user_id`, sum(commission / (extract/100.0)) as `upIncome`
from (select `user_id`, sum(commission / (extract/100.0)) as `upIncome`
...
@@ -291,7 +305,7 @@ from `app_user_detail` as `aud` left join `app_user_login` as `aul` on aul.id=
...
@@ -291,7 +305,7 @@ from `app_user_detail` as `aud` left join `app_user_login` as `aul` on aul.id=
where
<![CDATA[position_id<>6]]>
where
<![CDATA[position_id<>6]]>
and status = 0
and status = 0
<if
test=
"startDate!=null and endDate!=null"
>
<if
test=
"startDate!=null and endDate!=null"
>
and `crt_time` between #{startTime} and #{endTime}
and `crt_time` between #{startTime} and #{endTime}
</if>
</if>
<if
test=
"startDate!=null and endDate==null"
>
<if
test=
"startDate!=null and endDate==null"
>
and
<![CDATA[
and
<![CDATA[
...
...
xx-app/xx-app-api/src/main/java/com/xxfc/platform/app/entity/AppVersionMark.java
0 → 100644
View file @
32c461c8
package
com
.
xxfc
.
platform
.
app
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* Demo class
*
* @author zuoyh
* @date 2020/1/10
*/
@Data
@Table
(
name
=
"app_version_mark"
)
public
class
AppVersionMark
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* app版本标识信息表ID
*/
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"app版本信息表"
)
private
Integer
id
;
/**
* 标识
*/
@Column
(
name
=
"mark"
)
@ApiModelProperty
(
value
=
"标识"
)
private
String
mark
;
/**
* 标识名称
*/
@Column
(
name
=
"mark_name"
)
@ApiModelProperty
(
value
=
"标识名称"
)
private
String
markName
;
/**
* 标识描述
*/
@Column
(
name
=
"mark_remark"
)
@ApiModelProperty
(
value
=
"标识描述"
)
private
String
markRemark
;
/**
* 是否删除;0-正常;1-删除
*/
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
value
=
"是否删除;0-正常;1-删除"
)
private
Integer
isDel
;
/**
* 版本标识上传时间
*/
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
value
=
"版本上传时间"
,
hidden
=
true
)
private
Date
crtTime
;
/**
* 版本标识更新时间
*/
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
value
=
"版本标识更新时间"
,
hidden
=
true
)
private
Long
updTime
;
/**
* 版本标识来源类型
*/
@Column
(
name
=
"source_type"
)
@ApiModelProperty
(
value
=
"版本标识更新时间"
,
hidden
=
true
)
private
String
sourceType
;
}
xx-app/xx-app-api/src/main/java/com/xxfc/platform/app/entity/dto/AppVersionMarkDTO.java
0 → 100644
View file @
32c461c8
package
com
.
xxfc
.
platform
.
app
.
entity
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
import
java.sql.Timestamp
;
@Data
public
class
AppVersionMarkDTO
{
@ApiModelProperty
(
"app版本信息表"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"标识"
)
private
String
mark
;
@ApiModelProperty
(
value
=
"标识名称"
)
private
String
markName
;
@ApiModelProperty
(
value
=
"标识描述"
)
private
String
markRemark
;
@ApiModelProperty
(
value
=
"是否删除;0-正常;1-删除"
)
private
Integer
isDel
;
@ApiModelProperty
(
value
=
"版本上传时间"
,
hidden
=
true
)
private
Date
crtTime
;
@ApiModelProperty
(
value
=
"版本修改时间"
,
hidden
=
true
)
private
Long
updTime
;
@ApiModelProperty
(
value
=
"操作标识 1:新增 2:修改 3:删除"
)
private
int
changeMark
;
@ApiModelProperty
(
value
=
"版本标识更新时间"
)
private
String
sourceType
;
}
xx-app/xx-app-api/src/main/java/com/xxfc/platform/app/vo/AppVersionMarkQuery.java
0 → 100644
View file @
32c461c8
package
com
.
xxfc
.
platform
.
app
.
vo
;
import
lombok.Data
;
@Data
public
class
AppVersionMarkQuery
{
private
Integer
page
;
private
Integer
limit
;
/**
* 标识名称
*/
private
String
markName
;
/**
* 标识
*/
private
String
mark
;
/**
* 标识内容
*/
private
String
markRemark
;
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/biz/AppVersionMarkBiz.java
0 → 100644
View file @
32c461c8
package
com
.
xxfc
.
platform
.
app
.
biz
;
import
com.ace.cache.annotation.CacheClear
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.app.entity.AppVersionMark
;
import
com.xxfc.platform.app.entity.dto.AppVersionMarkDTO
;
import
com.xxfc.platform.app.mapper.AppVersionMarkMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.map.HashedMap
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Service
@Slf4j
/**
* @Author: zyh
* @Date: 2020/1/10
*/
public
class
AppVersionMarkBiz
extends
BaseBiz
<
AppVersionMarkMapper
,
AppVersionMark
>
{
private
static
final
int
RANDOM_TWO_LENGTH
=
2
;
private
static
final
int
CHANGE_UPD_APP_MARK
=
1
;
private
static
final
int
APP_MARK_IS_DEL
=
1
;
private
static
final
int
CHANGE_DELETE_APP_MARK
=
2
;
private
static
final
int
NO_RANDOM_REAPPEAR
=
50
;
public
static
final
int
IS_DEL_IOS_OR_ANDROID
=
1
;
public
static
final
int
SUCCESSFUL_OPERATION_CODE
=
1
;
public
static
final
int
FAIL_OPERATION_CODE
=
2
;
public
static
final
String
SUCCESSFUL_OPERATION
=
"操作成功"
;
public
static
final
String
FAIL_OPERATION
=
"安卓/苹果不可删除"
;
/**
* @Description: 新增APP版本标识
* @Param: AppVersionMarkDTO appVersionMarkDTO
* @return:
* @Author: zyh
* @Date: 2020/1/10
*/
@CacheClear
public
Map
<
Integer
,
String
>
addAppVersionMark
(
AppVersionMarkDTO
appVersionMarkDTO
)
{
Map
<
Integer
,
String
>
statusMap
=
new
HashedMap
<>();
if
(
StringUtils
.
isBlank
(
appVersionMarkDTO
.
getMarkName
())
||
StringUtils
.
isBlank
(
appVersionMarkDTO
.
getMarkRemark
())
||
StringUtils
.
isBlank
(
appVersionMarkDTO
.
getSourceType
())
||
StringUtils
.
isBlank
(
appVersionMarkDTO
.
getMark
()))
{
statusMap
.
put
(
FAIL_OPERATION_CODE
,
"参数不能为空"
);
return
statusMap
;
}
AppVersionMark
appVersionMark
=
new
AppVersionMark
();
String
markNoBlank
=
appVersionMarkDTO
.
getMark
().
replaceAll
(
" "
,
""
);
int
count
=
mapper
.
queryIsMark
(
markNoBlank
);
if
(
count
>
0
)
{
statusMap
.
put
(
FAIL_OPERATION_CODE
,
"标识已存在,请重新输入"
);
return
statusMap
;
}
try
{
Date
date
=
new
Date
();
//设置日期格式
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
nowTime
=
simpleDateFormat
.
format
(
date
);
Date
crtTime
=
simpleDateFormat
.
parse
(
nowTime
);
appVersionMark
.
setCrtTime
(
crtTime
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
appVersionMark
.
setMark
(
markNoBlank
);
appVersionMark
.
setSourceType
(
appVersionMarkDTO
.
getSourceType
());
appVersionMark
.
setMarkName
(
appVersionMarkDTO
.
getMarkName
());
appVersionMark
.
setMarkRemark
(
appVersionMarkDTO
.
getMarkRemark
());
appVersionMark
.
setIsDel
(
0
);
// insertSelective(appVersionMark);
mapper
.
insert
(
appVersionMark
);
statusMap
.
put
(
SUCCESSFUL_OPERATION_CODE
,
SUCCESSFUL_OPERATION
);
return
statusMap
;
}
/**
* @Description: 随机产生,判断数据库是否已经存在
* @return: 标识
* @Author: zyh
* @Date: 2020/1/10
*/
public
String
getMark
()
{
String
mark
=
""
;
for
(
int
i
=
0
;
i
<
NO_RANDOM_REAPPEAR
;
i
++)
{
mark
=
getCharAndNumr
(
RANDOM_TWO_LENGTH
);
int
count
=
mapper
.
queryIsMark
(
mark
);
if
(
count
==
0
)
{
break
;
}
}
return
mark
;
}
/**
* 生成随机数字和字母组合
*
* @param length
* @return
*/
public
static
String
getCharAndNumr
(
int
length
)
{
StringBuffer
valSb
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
// 输出字母还是数字
String
charOrNum
=
Math
.
round
(
Math
.
random
())
%
2
==
0
?
"char"
:
"num"
;
if
(
"char"
.
equalsIgnoreCase
(
charOrNum
))
{
// 字符串 取得大写字母还是小写字母
int
choice
=
Math
.
round
(
Math
.
random
())
%
2
==
0
?
65
:
97
;
valSb
.
append
((
char
)
(
choice
+
Math
.
round
(
Math
.
random
()
*
25
)));
}
else
if
(
"num"
.
equalsIgnoreCase
(
charOrNum
))
{
// 数字
valSb
.
append
(
String
.
valueOf
(
Math
.
round
(
Math
.
random
()
*
9
)));
}
}
return
valSb
.
toString
();
}
/**
* @Description: app版本标识 更新以及删除
* @Param: No such property: code for class: Script1
* @return:
* @Author: zyh
* @Date: 2020/1/10
*/
@CacheClear
public
Map
<
Integer
,
String
>
updAppVersionMark
(
AppVersionMarkDTO
appVersionMarkDTO
)
{
Map
<
Integer
,
String
>
statusMap
=
new
HashedMap
<>();
AppVersionMark
appVersionMark
=
new
AppVersionMark
();
BeanUtils
.
copyProperties
(
appVersionMarkDTO
,
appVersionMark
);
if
(
appVersionMarkDTO
.
getChangeMark
()
==
CHANGE_UPD_APP_MARK
)
{
if
(
StringUtils
.
isNotEmpty
(
appVersionMarkDTO
.
getMark
()))
{
String
markNoBlank
=
appVersionMarkDTO
.
getMark
().
replaceAll
(
" "
,
""
);
int
count
=
mapper
.
queryIsMark
(
markNoBlank
);
if
(
count
>
0
)
{
statusMap
.
put
(
FAIL_OPERATION_CODE
,
"标识已存在,请重新更改标识"
);
return
statusMap
;
}
appVersionMark
.
setMark
(
markNoBlank
);
}
updateSelectiveById
(
appVersionMark
);
}
else
if
(
appVersionMarkDTO
.
getChangeMark
()
==
CHANGE_DELETE_APP_MARK
)
{
Integer
count
=
mapper
.
findIosOrAndroidVersionAppMark
(
appVersionMarkDTO
.
getId
());
if
(
count
.
equals
(
IS_DEL_IOS_OR_ANDROID
))
{
statusMap
.
put
(
FAIL_OPERATION_CODE
,
FAIL_OPERATION
);
return
statusMap
;
}
appVersionMark
.
setIsDel
(
APP_MARK_IS_DEL
);
updateSelectiveById
(
appVersionMark
);
}
statusMap
.
put
(
SUCCESSFUL_OPERATION_CODE
,
SUCCESSFUL_OPERATION
);
return
statusMap
;
}
/**
* @Description: 查询页面展示
* @Param:
* @return: AppVersionMarkDTO appVersionMarkDTO
* @Author: zyh
* @Date: 2020/1/10
*/
public
List
<
AppVersionMarkDTO
>
findVersionAppMark
(
String
mark
)
{
List
list
=
mapper
.
findVersionAppMark
(
mark
);
return
list
;
}
/**
* @Description: 会员页面查询注册来源 下拉框接口
* @Param:
* @return: list(mark名称)
* @Author: zyh
* @Date: 2020/1/13
*/
public
List
<
AppVersionMarkDTO
>
findListVersionAppMark
()
{
List
list
=
mapper
.
findListVersionAppMark
();
return
list
;
}
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/mapper/AppVersionMarkMapper.java
0 → 100644
View file @
32c461c8
package
com
.
xxfc
.
platform
.
app
.
mapper
;
import
com.xxfc.platform.app.entity.AppVersionMark
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.sql.Timestamp
;
import
java.util.List
;
/**
* AppVersionMark Mapper
*
* @author zyh
* @date 2020/1/10
*/
public
interface
AppVersionMarkMapper
extends
Mapper
<
AppVersionMark
>
{
int
queryIsMark
(
@Param
(
"mark"
)
String
mark
);
int
queryIsMarkNew
(
@Param
(
"mark"
)
String
mark
);
void
updAppVersionMark
(
@Param
(
"markName"
)
String
markName
,
@Param
(
"markRemark"
)
String
markRemark
,
@Param
(
"isDel"
)
Integer
isDel
,
@Param
(
"id"
)
Integer
id
,
@Param
(
"updTime"
)
Timestamp
updTime
);
List
<
AppVersionMark
>
findVersionAppMark
(
@Param
(
"mark"
)
String
mark
);
int
findIosOrAndroidVersionAppMark
(
@Param
(
"id"
)
Integer
id
);
List
<
AppVersionMark
>
findListVersionAppMark
();
List
<
AppVersionMark
>
queryListForUserMember
();
}
xx-app/xx-app-server/src/main/java/com/xxfc/platform/app/rest/AppVersionMarkController.java
0 → 100644
View file @
32c461c8
package
com
.
xxfc
.
platform
.
app
.
rest
;
import
com.ace.cache.annotation.CacheClear
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.app.biz.AppVersionMarkBiz
;
import
com.xxfc.platform.app.entity.AppVersionMark
;
import
com.xxfc.platform.app.entity.dto.AppVersionMarkDTO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
xxfc
.
platform
.
app
.
biz
.
AppVersionMarkBiz
.
FAIL_OPERATION_CODE
;
import
static
com
.
xxfc
.
platform
.
app
.
biz
.
AppVersionMarkBiz
.
SUCCESSFUL_OPERATION_CODE
;
/**
* @program: ace-security
* @author: zyh
* @create: 2020-01-10 11:24
**/
@IgnoreUserToken
@RestController
@Slf4j
@RequestMapping
(
"version/mark"
)
public
class
AppVersionMarkController
extends
BaseController
<
AppVersionMarkBiz
,
AppVersionMark
>
{
@Autowired
private
AppVersionMarkBiz
appVersionMarkBiz
;
/**
* @Description: 新增APP版本标识
* @Param: AppVersionMarkDTO appVersionMarkDTO
* @return:
* @Author: zyh
* @Date: 2020/1/10
*/
@PostMapping
(
"/appMarkVersionAdd"
)
@CacheClear
public
ObjectRestResponse
addAppVersionMark
(
@RequestBody
AppVersionMarkDTO
appVersionMarkDTO
)
{
try
{
Integer
status
=
SUCCESSFUL_OPERATION_CODE
;
String
message
=
""
;
Map
<
Integer
,
String
>
mapStatus
=
appVersionMarkBiz
.
addAppVersionMark
(
appVersionMarkDTO
);
Iterator
<
Integer
>
iter
=
mapStatus
.
keySet
().
iterator
();
while
(
iter
.
hasNext
())
{
status
=
iter
.
next
();
message
=
mapStatus
.
get
(
status
);
}
if
(
status
.
equals
(
FAIL_OPERATION_CODE
))
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
message
);
}
return
ObjectRestResponse
.
succ
();
}
catch
(
Exception
e
)
{
log
.
error
(
"新增失败[{}]"
,
e
);
throw
new
BaseException
(
"新增失败"
);
}
}
/**
* @Description: app版本标识 更新以及删除
* @Author: zyh
* @Date: 2020/1/10
*/
@PostMapping
(
"updAppMark"
)
@CacheClear
public
ObjectRestResponse
updAppVersionMark
(
@RequestBody
AppVersionMarkDTO
appVersionMarkDTO
)
{
try
{
Map
<
Integer
,
String
>
map
=
appVersionMarkBiz
.
updAppVersionMark
(
appVersionMarkDTO
);
Iterator
<
Integer
>
iter
=
map
.
keySet
().
iterator
();
Integer
status
=
1
;
String
message
=
""
;
while
(
iter
.
hasNext
())
{
status
=
iter
.
next
();
message
=
map
.
get
(
status
);
}
if
(
status
.
equals
(
1
))
{
return
ObjectRestResponse
.
succ
();
}
else
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
message
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"更新失败[{}]"
,
e
);
throw
new
BaseException
(
"更新失败"
);
}
}
/**
* @Description: 页面展示
* @Param: AppVersionMarkQuery query 业务需求:暂时没有查询框
* @return: listJson
* @Author: zyh
* @Date: 2020/1/10
*/
@GetMapping
(
"/findAllByQuery"
)
public
ObjectRestResponse
findAllByQuery
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"limit"
,
defaultValue
=
"10"
)
Integer
limit
,
@RequestParam
(
value
=
"mark"
,
defaultValue
=
""
)
String
mark
)
{
Example
example
=
new
Example
(
AppVersionMark
.
class
);
if
(
StringUtils
.
isNotBlank
(
mark
))
{
example
.
createCriteria
().
andLike
(
"mark"
,
"%"
+
mark
+
"%"
);
}
example
.
createCriteria
().
andEqualTo
(
"isDel"
,
0
);
example
.
setOrderByClause
(
"`crt_time` desc"
);
PageHelper
.
startPage
(
page
,
limit
);
List
<
AppVersionMark
>
listPage
=
appVersionMarkBiz
.
selectByExample
(
example
);
return
ObjectRestResponse
.
succ
(
PageInfo
.
of
(
listPage
));
}
/**
* @Description: 單獨查詢,根据标识
* @Param: MARK標識
* @return: list
* @Author: zyh
* @Date: 2020/1/10
*/
@GetMapping
(
"/findVersionAppMark"
)
public
ObjectRestResponse
findAllByQuery
(
@RequestParam
(
"mark"
)
String
mark
)
{
return
ObjectRestResponse
.
succ
(
appVersionMarkBiz
.
findVersionAppMark
(
mark
));
}
/**
* @Description: 会员页面查询注册来源 下拉框接口
* @Param:
* @return: list(mark名称)
* @Author: zyh
* @Date: 2020/1/13
*/
@GetMapping
(
"/find/listMark"
)
public
ObjectRestResponse
findListVersionAppMark
()
{
return
ObjectRestResponse
.
succ
(
appVersionMarkBiz
.
findListVersionAppMark
());
}
}
xx-app/xx-app-server/src/main/resources/mapper/AppVersionMarkMapper.xml
0 → 100644
View file @
32c461c8
<?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.xxfc.platform.app.mapper.AppVersionMarkMapper"
>
<select
id=
"queryIsMark"
parameterType=
"java.lang.String"
resultType=
"java.lang.Integer"
>
SELECT
count(*)
FROM
`app_version_mark`
where
is_del=0
<if
test=
"mark!=null and mark!=''"
>
and binary mark like concat('%',#{mark},'%')
</if>
</select>
<select
id=
"queryIsMarkNew"
parameterType=
"java.lang.String"
resultType=
"java.lang.Integer"
>
SELECT
count(*)
FROM
`app_version_mark`
where
is_del=0
<if
test=
"mark!=null and mark!=''"
>
and binary mark=#{mark}
</if>
</select>
<select
id=
"findVersionAppMark"
resultType=
"com.xxfc.platform.app.entity.AppVersionMark"
>
select * from
`app_version_mark` a
where
is_del = 0
<if
test=
"mark!=null and mark!=''"
>
and binary mark like concat('%',#{mark},'%')
</if>
</select>
<select
id=
"findIosOrAndroidVersionAppMark"
resultType=
"java.lang.Integer"
>
select count(*) from
`app_version_mark` a
where
is_del = 0
<if
test=
"id!=null and id!=''"
>
and id= #{id}
</if>
and ( mark_name like concat('%','ios','%')
or mark_name like concat('%','安卓','%'))
</select>
<select
id=
"findListVersionAppMark"
resultType=
"com.xxfc.platform.app.entity.AppVersionMark"
>
select `mark_name`,`mark`
from
`app_version_mark` a
where
is_del = 0
</select>
<select
id=
"queryListForUserMember"
resultType=
"com.xxfc.platform.app.entity.AppVersionMark"
>
select `mark_name` as registerSource
from
`app_version_mark` a
where
is_del = 0
</select>
</mapper>
\ No newline at end of file
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