Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
向汉
/
uc-engine
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
a5d2e0d5
...
a5d2e0d5d69e91b1d927c3b9734baee35c71d596
authored
2022-08-29 18:59:23 +0800
by
xianghan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.优化部分接口的返回值
2.添加全局密码解密方法
1 parent
f5ab3240
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
295 additions
and
313 deletions
member-service-impl/src/main/java/com/topdraw/business/RedisKeyConstants.java
member-service-impl/src/main/java/com/topdraw/business/module/user/app/rest/UserAppController.java
member-service-impl/src/main/java/com/topdraw/business/module/user/app/service/UserAppBindService.java
member-service-impl/src/main/java/com/topdraw/business/module/user/app/service/impl/UserAppBindServiceImpl.java
member-service-impl/src/main/java/com/topdraw/business/process/rest/UserOperationController.java
member-service-impl/src/main/java/com/topdraw/business/process/service/UserOperationService.java
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/UserOperationServiceImpl.java
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/member/MemberOperationServiceImpl.java
member-service-impl/src/main/java/com/topdraw/business/process/service/member/MemberOperationService.java
member-service-impl/src/main/java/com/topdraw/util/AESUtil.java
member-service-impl/src/main/java/com/topdraw/business/RedisKeyConstants.java
View file @
a5d2e0d
...
...
@@ -49,11 +49,13 @@ public interface RedisKeyConstants {
// 历史完成的任务数量
String
cacheTotalFinishTaskCount
=
"uce::totalCount::memberId"
;
// app账号信息
String
cacheAppById
=
"uce:appInfo:id"
;
String
CACHE_PLATFROMACCOUNT_PLAYDURATION
=
"uce::eventPlay::playduration"
;
String
CACHE_TODAY_FINISH_COUNT
=
"todayFinishCount"
;
String
CACHE_TOTAL_FINISH_COUNT
=
"totalFinishCount"
;
}
...
...
member-service-impl/src/main/java/com/topdraw/business/module/user/app/rest/UserAppController.java
View file @
a5d2e0d
...
...
@@ -194,7 +194,7 @@ public class UserAppController {
resources
.
setUserAppId
(
id
);
}
return
ResultInfo
.
success
(
this
.
userAppBindService
.
create
(
resources
)
);
return
this
.
userAppBindService
.
create
(
resources
);
}
@PostMapping
(
value
=
"/updateValidStatusAndUserAppIdAndNickname"
)
...
...
member-service-impl/src/main/java/com/topdraw/business/module/user/app/service/UserAppBindService.java
View file @
a5d2e0d
package
com
.
topdraw
.
business
.
module
.
user
.
app
.
service
;
import
com.topdraw.base.modules.common.ResultInfo
;
import
com.topdraw.business.module.user.app.domain.UserAppBind
;
import
com.topdraw.business.module.user.app.service.dto.UserAppBindDTO
;
...
...
@@ -22,7 +23,7 @@ public interface UserAppBindService {
*
* @param resources
*/
UserAppBindDTO
create
(
UserAppBind
resources
);
ResultInfo
create
(
UserAppBind
resources
);
/**
*
...
...
member-service-impl/src/main/java/com/topdraw/business/module/user/app/service/impl/UserAppBindServiceImpl.java
View file @
a5d2e0d
package
com
.
topdraw
.
business
.
module
.
user
.
app
.
service
.
impl
;
import
com.topdraw.base.modules.common.ResultInfo
;
import
com.topdraw.base.modules.utils.ValidationUtil
;
import
com.topdraw.business.module.user.app.domain.UserAppBind
;
import
com.topdraw.business.module.user.app.repository.UserAppBindRepository
;
import
com.topdraw.business.module.user.app.service.UserAppBindService
;
import
com.topdraw.business.module.user.app.service.dto.UserAppBindDTO
;
import
com.topdraw.business.module.user.app.service.mapper.UserAppBindMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
...
...
@@ -14,6 +16,7 @@ import org.springframework.dao.EmptyResultDataAccessException;
import
org.springframework.util.Assert
;
import
java.util.List
;
import
java.util.Objects
;
/**
* @author XiangHan
...
...
@@ -21,6 +24,7 @@ import java.util.List;
*/
@Service
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
@Slf4j
public
class
UserAppBindServiceImpl
implements
UserAppBindService
{
@Autowired
...
...
@@ -38,9 +42,15 @@ public class UserAppBindServiceImpl implements UserAppBindService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
UserAppBindDTO
create
(
UserAppBind
resources
)
{
public
ResultInfo
create
(
UserAppBind
resources
)
{
UserAppBindDTO
userAppBindDTO
=
this
.
findFirstByAccountAndAccountType
(
resources
.
getAccount
(),
resources
.
getAccountType
());
if
(
Objects
.
nonNull
(
userAppBindDTO
.
getId
()))
{
log
.
warn
(
"保存第三方账号失败, saveThirdAccount# messgage ==>> 第三方账号已存在 | appBind ==>> {}"
,
resources
);
return
ResultInfo
.
failure
(
"保存第三方账号失败, 第三方账号已存在"
);
}
UserAppBind
userAppBind
=
this
.
userAppBindRepository
.
save
(
resources
);
return
this
.
userAppBindMapper
.
toDto
(
userAppBind
);
return
ResultInfo
.
success
(
this
.
userAppBindMapper
.
toDto
(
userAppBind
)
);
}
@Override
...
...
member-service-impl/src/main/java/com/topdraw/business/process/rest/UserOperationController.java
View file @
a5d2e0d
...
...
@@ -7,7 +7,6 @@ import com.alibaba.fastjson.JSONObject;
import
com.topdraw.base.modules.annotation.AnonymousAccess
;
import
com.topdraw.base.modules.common.ResultInfo
;
import
com.topdraw.base.modules.exception.BadRequestException
;
import
com.topdraw.base.modules.exception.EntityNotFoundException
;
import
com.topdraw.base.modules.utils.RedisUtils
;
import
com.topdraw.business.module.common.validated.CreateGroup
;
import
com.topdraw.business.module.common.validated.UpdateGroup
;
...
...
@@ -20,7 +19,6 @@ import com.topdraw.business.module.user.app.service.dto.UserAppSimpleDTO;
import
com.topdraw.business.module.user.iptv.domain.UserTv
;
import
com.topdraw.business.module.user.iptv.growreport.domain.GrowthReport
;
import
com.topdraw.business.module.user.iptv.growreport.service.dto.GrowthReportRequest
;
import
com.topdraw.business.module.user.iptv.service.UserTvService
;
import
com.topdraw.business.module.user.iptv.service.dto.UserTvDTO
;
import
com.topdraw.business.module.user.weixin.domain.UserWeixin
;
import
com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO
;
...
...
@@ -28,12 +26,10 @@ import com.topdraw.business.process.domian.member.MemberOperationBean;
import
com.topdraw.business.process.domian.weixin.*
;
import
com.topdraw.business.process.service.UserOperationService
;
import
com.topdraw.business.process.service.member.MemberOperationService
;
import
com.topdraw.util.
RedisKeyUtil
;
import
com.topdraw.util.
*
;
import
com.topdraw.config.WechatConfig
;
import
com.topdraw.exception.GlobeExceptionMsg
;
import
com.topdraw.resttemplate.RestTemplateClient
;
import
com.topdraw.util.Base64Util
;
import
com.topdraw.util.JSONUtil
;
import
com.topdraw.weixin.service.WeChatConstants
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -47,7 +43,6 @@ import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.*
;
import
javax.naming.ConfigurationException
;
import
java.io.IOException
;
import
java.net.URLDecoder
;
import
java.sql.Timestamp
;
import
java.util.*
;
...
...
@@ -65,8 +60,6 @@ public class UserOperationController {
private
UserOperationService
userOperationService
;
@Autowired
private
MemberOperationService
memberOperationService
;
@Autowired
private
UserTvService
userTvService
;
@Autowired
private
RedisUtils
redisUtils
;
...
...
@@ -90,12 +83,14 @@ public class UserOperationController {
@ApiOperation
(
"app账号退出登录"
)
@AnonymousAccess
public
ResultInfo
appSignOut
(
@Validated
@RequestBody
UserApp
userApp
)
{
log
.
info
(
"app账号退出登录,参数
==>> [appSignOut#{}]"
,
userApp
.
getId
()
);
log
.
info
(
"app账号退出登录,参数
appSignOut# userApp ==>> {} "
,
userApp
);
if
(
Objects
.
isNull
(
userApp
.
getId
()))
{
log
.
error
(
"app账号退出登录失败,参数错误,
id不得为空,[appSignOut#]
"
);
log
.
error
(
"app账号退出登录失败,参数错误,
appSignOut# message ==>> id不得为空
"
);
return
ResultInfo
.
failure
(
"app账号退出登录失败,参数错误,id不得为空"
);
}
// TODO 2.2.0 版本之前无具体业务,后续等业务方确定具体业务后在进行拓展
return
ResultInfo
.
success
(
true
);
}
...
...
@@ -108,23 +103,21 @@ public class UserOperationController {
@ApiOperation
(
"注销app账号"
)
@AnonymousAccess
public
ResultInfo
appCancellation
(
@Validated
@RequestBody
UserApp
userApp
)
{
log
.
info
(
"注销app账号,参数
==>> [appCancellation#{}]"
,
userApp
.
getId
()
);
log
.
info
(
"注销app账号,参数
appCancellation# resources ==>> {}"
,
userApp
);
if
(
Objects
.
isNull
(
userApp
.
getId
()))
{
log
.
error
(
"注销app账号
失败,参数错误,id不得为空,[appCancellation#]
"
);
return
ResultInfo
.
failure
(
""
);
log
.
error
(
"注销app账号
异常,appCancellation# message ==>> app账号id不的为空
"
);
return
ResultInfo
.
failure
(
"
app账号id不的为空
"
);
}
boolean
result
=
this
.
userOperationService
.
appCancellation
(
userApp
);
return
ResultInfo
.
success
(
result
);
return
ResultInfo
.
success
(
this
.
userOperationService
.
appCancellation
(
userApp
));
}
@PostMapping
(
value
=
"/updateAppInfo"
)
@ApiOperation
(
"修改app账号信息"
)
@AnonymousAccess
public
ResultInfo
updateAppInfo
(
@Validated
@RequestBody
UserApp
resources
)
{
log
.
info
(
"修改app账号信息,参数
==>> [updateAppInfo#{}]
"
,
resources
);
log
.
info
(
"修改app账号信息,参数
updateAppInfo# resources ==>> {}
"
,
resources
);
Long
id
=
resources
.
getId
();
if
(
Objects
.
isNull
(
id
))
{
log
.
error
(
"修改app账号密码,参数错误,id不得为空,[updateAppInfo#{}]"
,
resources
);
...
...
@@ -147,32 +140,48 @@ public class UserOperationController {
@ApiOperation
(
"app注册"
)
@AnonymousAccess
public
ResultInfo
appRegister
(
@Validated
@RequestBody
UserApp
resources
)
{
log
.
info
(
"app注册
==>> param ==>> [appRegister#{}]
"
,
resources
);
log
.
info
(
"app注册
, 参数 appRegister# resouces ==>> {}
"
,
resources
);
String
username
=
resources
.
getUsername
();
if
(
StringUtils
.
isBlank
(
username
))
{
log
.
error
(
"app注册,参数错误,账号不得为空 "
);
log
.
error
(
"app注册,参数错误,
appRegister# message ==>>
账号不得为空 "
);
return
ResultInfo
.
failure
(
"app注册,参数错误,账号不得为空"
);
}
Integer
type
=
resources
.
getType
();
if
(
Objects
.
isNull
(
type
))
{
log
.
error
(
"app注册,参数错误,账号类型不得为空 "
);
log
.
error
(
"app注册,参数错误,
appRegister# message ==>>
账号类型不得为空 "
);
return
ResultInfo
.
failure
(
"app注册,参数错误,账号类型不得为空"
);
}
String
account
=
resources
.
getAccount
();
if
(
StringUtils
.
isNotBlank
(
account
))
{
if
(
Objects
.
isNull
(
resources
.
getAccountType
()))
{
log
.
error
(
"app注册,参数错误,第三方账号类型不得为空"
);
log
.
error
(
"app注册,参数错误,
appRegister# message ==>>
第三方账号类型不得为空"
);
return
ResultInfo
.
failure
(
"app注册,参数错误,第三方账号类型不得为空"
);
}
}
if
(
StringUtils
.
isBlank
(
resources
.
getNickname
()))
{
// 昵称不存在时,默认使用手机号作为昵称
resources
.
setNickname
(
Base64Utils
.
encodeToString
(
username
.
getBytes
()));
}
if
(
StringUtils
.
isNotBlank
(
resources
.
getPassword
()))
{
String
clientPassword
=
AESUtil
.
decrypt
(
resources
.
getPassword
(),
"f8681b9ce7c8fb6b"
);
if
(
clientPassword
==
null
||
clientPassword
.
length
()
<=
16
)
{
log
.
error
(
"修改app账号密码失败,参数错误,密码格式不正确,[updateAppPasswordByOldPassword# clientPassword ==>> {}]"
,
clientPassword
);
return
ResultInfo
.
failure
(
"密码必须包含大小写字母和数字的组合,不能使用特殊字符,长度在 8-25 之间"
);
}
String
resultClientPassword
=
clientPassword
.
substring
(
16
);
if
(!
RegexUtil
.
appPasswordRegex
(
resultClientPassword
))
{
log
.
error
(
"app注册异常,appRegister# {} message ==>> 密码格式不正确"
,
resultClientPassword
);
return
ResultInfo
.
failure
(
"密码必须包含大小写字母和数字的组合,不能使用特殊字符,长度在 8-25 之间"
);
}
resources
.
setPassword
(
AESUtil
.
decodePassword
(
resources
.
getPassword
()));
}
UserAppDTO
userAppDTO
=
this
.
userOperationService
.
appRegister
(
resources
);
return
ResultInfo
.
success
(
userAppDTO
);
}
...
...
@@ -181,18 +190,18 @@ public class UserOperationController {
@ApiOperation
(
"app账号绑定第三方账号"
)
@AnonymousAccess
public
ResultInfo
appBindThirdAccount
(
@Validated
@RequestBody
UserAppBind
resources
)
{
log
.
info
(
"app账号绑定第三方账号,参数
==>> [appBindThirdAccount#{}]
"
,
resources
);
log
.
info
(
"app账号绑定第三方账号,参数
appBindThirdAccount# message ==>> {}
"
,
resources
);
String
username
=
resources
.
getUsername
();
if
(
StringUtils
.
isBlank
(
username
))
{
log
.
error
(
"app账号绑定第三方账号,参数错误,账号不得为空 "
);
log
.
error
(
"app账号绑定第三方账号,参数错误,
appBindThirdAccount# message ==>>
账号不得为空 "
);
return
ResultInfo
.
failure
(
"app账号绑定第三方账号,参数错误,账号不得为空"
);
}
String
account
=
resources
.
getAccount
();
if
(
StringUtils
.
isNotBlank
(
account
))
{
if
(
Objects
.
isNull
(
resources
.
getAccountType
()))
{
log
.
error
(
"app账号绑定第三方账号,参数错误,第三方账号不得为空"
);
log
.
error
(
"app账号绑定第三方账号,参数错误,
appBindThirdAccount# message ==>>
第三方账号不得为空"
);
return
ResultInfo
.
failure
(
"app账号绑定第三方账号,参数错误,第三方账号不得为空"
);
}
}
...
...
@@ -200,7 +209,7 @@ public class UserOperationController {
// 第三方账号类型 3:微信;4:QQ;5:微博;6:苹果账号
Integer
accountType
=
resources
.
getAccountType
();
if
(
Objects
.
isNull
(
accountType
))
{
log
.
error
(
"app账号绑定第三方账号,参数错误,第三方账号类型不得为空"
);
log
.
error
(
"app账号绑定第三方账号,参数错误,
appBindThirdAccount# message ==>>
第三方账号类型不得为空"
);
return
ResultInfo
.
failure
(
"app账号绑定第三方账号,参数错误,第三方账号类型不得为空"
);
}
...
...
@@ -211,7 +220,7 @@ public class UserOperationController {
@ApiOperation
(
"取消关联第三方账号"
)
@AnonymousAccess
public
ResultInfo
cancelUserAppBind
(
@Validated
@RequestBody
UserAppBind
resources
)
{
log
.
info
(
"取消关联第三方账号, 参数
==>> [cancelUserAppBind#{}]
"
,
resources
);
log
.
info
(
"取消关联第三方账号, 参数
cancelUserAppBind# resource ==>> {}
"
,
resources
);
String
account
=
resources
.
getAccount
();
if
(
StringUtils
.
isBlank
(
account
))
{
...
...
@@ -287,11 +296,11 @@ public class UserOperationController {
}
@PutMapping
(
value
=
"/updateWeixin"
)
@ApiOperation
(
"修改
UserWeixin
"
)
@ApiOperation
(
"修改
微信信息
"
)
@AnonymousAccess
public
ResultInfo
updateWeixin
(
@Validated
@RequestBody
UserWeixin
resources
)
{
userOperationService
.
updateWeixin
(
resources
);
return
ResultInfo
.
success
();
log
.
info
(
"修改微信信息, 参数 updateWeixin# resources ==>> {}"
,
resources
);
return
ResultInfo
.
success
(
this
.
userOperationService
.
updateWeixin
(
resources
)
);
}
@RequestMapping
(
value
=
"/updateVipByUserId"
)
...
...
@@ -299,23 +308,30 @@ public class UserOperationController {
@AnonymousAccess
public
ResultInfo
updateVipByUserId
(
@Validated
(
value
=
{
UpdateGroup
.
class
})
@RequestBody
UserOperationBean
resources
)
{
log
.
info
(
"
userOperation ==>> updateVipByUserId ==>> param ==>> [{}]
"
,
resources
);
log
.
info
(
"
通过账号id修改vip, 参数 updateVipByUserId# resources ==>> {}
"
,
resources
);
Integer
vip
=
resources
.
getVip
();
if
(
Objects
.
isNull
(
vip
)
||
vip
<
1
)
{
return
ResultInfo
.
failure
(
"手动修改vip异常,参数错误,vip为空或者小于1"
);
}
Timestamp
vipExpireTime
=
resources
.
getVipExpireTime
();
// 微信账号id
Long
userId
=
resources
.
getUserId
();
if
(
Objects
.
isNull
(
userId
))
{
return
ResultInfo
.
failure
(
"手动修改vip异常,参数错误,小屏账号id为空"
);
log
.
error
(
"通过账号id修改vip异常,updateVipByUserId# message ==>> 小屏账号id不的为空"
);
return
ResultInfo
.
failure
(
"小屏账号id不的为空"
);
}
UserWeixinDTO
userWeixinDTO
=
this
.
userOperationService
.
findById
(
userId
);
Long
memberId
=
userWeixinDTO
.
getMemberId
();
MemberDTO
memberDTO
=
this
.
memberService
.
findById
(
memberId
);
if
(
Objects
.
isNull
(
memberDTO
.
getId
()))
{
log
.
error
(
"通过账号id修改vip异常,updateVipByUserId# message ==>> 会员信息不存在"
);
return
ResultInfo
.
failure
(
"会员信息不存在"
);
}
MemberOperationBean
memberOperationBean
=
new
MemberOperationBean
();
memberOperationBean
.
setMemberCode
(
memberDTO
.
getCode
());
if
(
vip
<
memberDTO
.
getVip
())
{
...
...
@@ -325,68 +341,58 @@ public class UserOperationController {
}
memberOperationBean
.
setVip
(
vip
);
MemberDTO
memberDTO1
=
this
.
memberOperationService
.
doUpdateVipByMemberCode
(
memberOperationBean
);
return
ResultInfo
.
success
(
memberDTO1
);
return
ResultInfo
.
success
(
this
.
memberOperationService
.
doUpdateVipByMemberCode
(
memberOperationBean
));
}
@PostMapping
(
value
=
"/createWeixinUserAndCreateMember"
)
@ApiOperation
(
"新增小屏账户同时创建会员信息"
)
@AnonymousAccess
public
ResultInfo
createWeixinUserAndMember
(
@Validated
(
value
=
{
CreateGroup
.
class
})
@RequestBody
UserWeixin
resources
)
{
log
.
info
(
"UserOperationController ==> createWeixinUserAndMember ==> param ==> [{}]"
,
resources
);
UserWeixinDTO
result
=
this
.
userOperationService
.
createWeixinUserAndMember
(
resources
);
return
ResultInfo
.
success
(
result
);
log
.
info
(
"新增小屏账户同时创建会员信息, 参数 createWeixinUserAndMember# resources ==>> {}"
,
resources
);
return
this
.
userOperationService
.
createWeixinUserAndMember
(
resources
);
}
@PostMapping
(
"/serviceLogin"
)
@ApiOperation
(
"微信服务号(H5)登录"
)
@AnonymousAccess
public
ResultInfo
serviceLogin
(
@Validated
(
value
=
{
CreateGroup
.
class
})
@RequestBody
UserWeixin
resources
)
{
log
.
info
(
"UserOperationController ==> serviceLogin ==>> param ==> [{}]"
,
resources
);
UserWeixinDTO
result
=
this
.
userOperationService
.
serviceLogin
(
resources
);
return
ResultInfo
.
success
(
result
);
log
.
info
(
"微信服务号(H5)登录, 参数 serviceLogin# resources ==>> {}"
,
resources
);
return
ResultInfo
.
success
(
this
.
userOperationService
.
serviceLogin
(
resources
));
}
@PostMapping
(
"/appletLogin"
)
@ApiOperation
(
"微信小程序登录"
)
@AnonymousAccess
public
ResultInfo
appletLogin
(
@Validated
(
value
=
{
CreateGroup
.
class
})
@RequestBody
UserWeixin
resources
)
{
log
.
info
(
"UserOperationController ==> appletLogin ==>> param ==> [{}]"
,
resources
);
UserWeixinDTO
result
=
this
.
userOperationService
.
appletLogin
(
resources
);
return
ResultInfo
.
success
(
result
);
log
.
info
(
"微信小程序登录, 参数 appletLogin# resource ==>> {}"
,
resources
);
return
ResultInfo
.
success
(
this
.
userOperationService
.
appletLogin
(
resources
));
}
@PostMapping
(
"/subscribe"
)
@ApiOperation
(
"微信公众号关注"
)
@AnonymousAccess
public
ResultInfo
subscribe
(
@Validated
@RequestBody
SubscribeBeanEvent
data
)
throws
Exception
{
log
.
info
(
"
UserOperationController ==> subscribe ==>> param ==> [{}]"
,
data
);
public
ResultInfo
subscribe
(
@Validated
@RequestBody
SubscribeBeanEvent
resource
)
throws
Exception
{
log
.
info
(
"
微信公众号关注, 参数 subscribe# resource ==> {}"
,
resource
);
SubscribeBean
subscribeBean
=
JSONUtil
.
parseMsg2Object
(
data
.
getContent
(),
SubscribeBean
.
class
);
SubscribeBean
subscribeBean
=
JSONUtil
.
parseMsg2Object
(
resource
.
getContent
(),
SubscribeBean
.
class
);
// 解析参数
this
.
parseSubscribe
(
subscribeBean
);
boolean
subscribe
=
this
.
userOperationService
.
subscribe
(
subscribeBean
);
if
(
subscribe
)
{
if
(
this
.
userOperationService
.
subscribe
(
subscribeBean
)
)
{
return
ResultInfo
.
success
(
"关注成功"
);
}
else
{
return
ResultInfo
.
failure
(
"关注失败"
);
}
return
ResultInfo
.
failure
(
"关注失败"
);
}
/**
*
* @param subscribeBean
* @throws IOException
*/
private
void
parseSubscribe
(
SubscribeBean
subscribeBean
)
throws
Exception
{
// appId
String
appId
=
subscribeBean
.
getAppid
();
// Assert.notNull(appId, GlobeExceptionMsg.APP_ID_IS_NULL);
// openId
String
openId
=
subscribeBean
.
getOpenid
();
Assert
.
notNull
(
openId
,
GlobeExceptionMsg
.
OPEN_ID_IS_NULL
);
...
...
@@ -400,15 +406,15 @@ public class UserOperationController {
// 程序类型
String
appType
=
wxInfoMap
.
get
(
"appType"
);
// 非订阅号,暂不处理。返回暂不支持
if
(
ObjectUtil
.
notEqual
(
appType
,
WeChatConstants
.
WX_SUBSCRIPTION
))
if
(
ObjectUtil
.
notEqual
(
appType
,
WeChatConstants
.
WX_SUBSCRIPTION
))
{
throw
new
BadRequestException
(
"非订阅号"
);
}
// 大屏账户信息
JSONObject
redisInfo
=
null
;
// 缓存的大屏信息,使用unionid即可
String
content
=
(
String
)
this
.
redisUtils
.
get
(
RedisKeyUtil
.
genSeSuSubscribeKey
(
unionId
));
log
.
info
(
"获取redis中存储的数据,[subscribe#{}]"
,
content
);
if
(
StringUtils
.
isNotBlank
(
content
))
{
// 大屏信息
redisInfo
=
JSONObject
.
parseObject
(
content
);
...
...
@@ -418,8 +424,6 @@ public class UserOperationController {
if
(
Objects
.
nonNull
(
redisInfo
))
{
subscribeBean
.
setIptvUserInfo
(
redisInfo
);
// 关注来源信息
log
.
info
(
"关注来源信息,[subscribe#{}]"
,
redisInfo
);
subscribeBean
.
setSourceInfo
(
redisInfo
);
String
nickname
=
redisInfo
.
get
(
"nickname"
).
toString
();
...
...
@@ -430,7 +434,6 @@ public class UserOperationController {
}
String
headimgurl
=
redisInfo
.
get
(
"headimgurl"
).
toString
();
log
.
info
(
"parseSubscribe ==>> headimgurl ==>> {}"
,
headimgurl
);
if
(
StringUtils
.
isNotBlank
(
headimgurl
))
{
String
headimgurlDecode
=
URLDecoder
.
decode
(
headimgurl
,
"UTF-8"
);
if
(
StringUtils
.
isNotBlank
(
headimgurlDecode
))
{
...
...
@@ -459,7 +462,6 @@ public class UserOperationController {
/**
* 获取配置的微信应用列表
* @param appid 应用Id
* @return
* @throws ConfigurationException
*/
private
Map
<
String
,
String
>
getWeixinInfoByAppid
(
String
appid
)
throws
ConfigurationException
{
...
...
@@ -477,10 +479,10 @@ public class UserOperationController {
@PostMapping
(
"/unsubscribe"
)
@ApiOperation
(
"微信公众号取关"
)
@AnonymousAccess
public
ResultInfo
unsubscribe
(
@Validated
@RequestBody
SubscribeBeanEvent
data
)
{
log
.
info
(
"
UserOperationController ==> unsubscribe ==>> param ==> [{}]"
,
data
);
public
ResultInfo
unsubscribe
(
@Validated
@RequestBody
SubscribeBeanEvent
resource
)
{
log
.
info
(
"
微信公众号取关, 参数 unsubscribe# resource ==> {}"
,
resource
);
SubscribeBean
subscribeBean
=
JSONUtil
.
parseMsg2Object
(
data
.
getContent
(),
SubscribeBean
.
class
);
SubscribeBean
subscribeBean
=
JSONUtil
.
parseMsg2Object
(
resource
.
getContent
(),
SubscribeBean
.
class
);
String
appId
=
subscribeBean
.
getAppid
();
Assert
.
notNull
(
appId
,
GlobeExceptionMsg
.
APP_ID_IS_NULL
);
...
...
@@ -491,40 +493,40 @@ public class UserOperationController {
subscribeBean
.
setAppid
(
appId
);
subscribeBean
.
setOpenid
(
openId
);
boolean
result
=
this
.
userOperationService
.
unsubscribe
(
subscribeBean
);
return
ResultInfo
.
success
(
result
);
return
ResultInfo
.
success
(
this
.
userOperationService
.
unsubscribe
(
subscribeBean
));
}
@PostMapping
(
"/minaBind"
)
@ApiOperation
(
"微信小程序绑定大屏"
)
@AnonymousAccess
public
ResultInfo
minaBind
(
@Validated
(
value
=
{
BindGroup
.
class
})
@RequestBody
BindBean
resources
)
{
log
.
info
(
"
UserOperationController ==> appletBind ==>> param ==> [{}]"
,
resources
);
log
.
info
(
"
微信小程序绑定大屏, 参数 minaBind# resources ==>> {}"
,
resources
);
Long
memberId
=
resources
.
getMemberId
();
if
(
Objects
.
isNull
(
memberId
))
{
return
ResultInfo
.
failure
(
"参数错误,memberId 不存在"
);
log
.
error
(
"微信小程序绑定大屏异常,参数错误,minaBind# message ==>> memberId不的为空"
);
return
ResultInfo
.
failure
(
"参数错误,会员id不的为空"
);
}
String
platformAccount
=
resources
.
getPlatformAccount
();
if
(
StringUtils
.
isBlank
(
platformAccount
))
{
return
ResultInfo
.
failure
(
"参数错误,大屏账号不存在"
);
log
.
error
(
"微信小程序绑定大屏异常,参数错误,minaBind# message ==>> 大屏账号不的为空"
);
return
ResultInfo
.
failure
(
"参数错误,大屏账号不的为空"
);
}
boolean
result
=
this
.
userOperationService
.
minaBind
(
resources
);
return
ResultInfo
.
success
(
result
);
return
ResultInfo
.
success
(
this
.
userOperationService
.
minaBind
(
resources
));
}
@PostMapping
(
"/minaUnbind"
)
@ApiOperation
(
"小屏解绑"
)
@AnonymousAccess
public
ResultInfo
minaUnbind
(
@Validated
(
value
=
{
UnbindGroup
.
class
})
@RequestBody
WeixinUnBindBean
weixinUnBindBean
)
{
log
.
info
(
"小屏解绑,参数
==> [minaUnbind#{}]
"
,
weixinUnBindBean
);
log
.
info
(
"小屏解绑,参数
minaUnbind# resource ==>> {}
"
,
weixinUnBindBean
);
Long
memberId
=
weixinUnBindBean
.
getMemberId
();
if
(
Objects
.
isNull
(
memberId
))
{
log
.
error
(
"小屏解绑失败,参数错误,memberId不存在"
);
return
ResultInfo
.
failure
(
"参数错误,
无会员id
"
);
log
.
error
(
"小屏解绑失败,参数错误,m
inaUnbind# message ==>> m
emberId不存在"
);
return
ResultInfo
.
failure
(
"参数错误,
会员id不的为空
"
);
}
return
this
.
userOperationService
.
minaUnbind
(
weixinUnBindBean
);
...
...
@@ -535,29 +537,25 @@ public class UserOperationController {
* 1.未关注、未绑定
* 2.已绑定、未关注
* 3.已关注、未绑定
* @param data
* @return
*/
@PostMapping
(
value
=
"/memberPreprocess"
)
@ApiOperation
(
"暂存大小屏信息并检查关注与绑定状态"
)
@AnonymousAccess
public
ResultInfo
memberPreprocess
(
@RequestBody
String
data
)
{
log
.
info
(
"暂存大小屏信息并检查关注与绑定状态,参数 memberPreprocess# resource ==>> {}"
,
data
);
log
.
info
(
"UserOperationController ==> saveUserInfo ==>> param ==>> [{}]"
,
data
);
if
(
StringUtils
.
isBlank
(
data
))
{
log
.
error
(
"预存大小屏账号信息
失败,
无参数"
);
return
ResultInfo
.
failure
(
"参数错误"
);
log
.
error
(
"预存大小屏账号信息
异常,memberPreprocess# message ==>>
无参数"
);
return
ResultInfo
.
failure
(
"参数错误
,无参数
"
);
}
JSONObject
json
=
JSONObject
.
parseObject
(
data
);
String
unionid
=
json
.
getString
(
"unionid"
);
if
(
StringUtils
.
isBlank
(
unionid
))
{
log
.
error
(
"预存大小屏账号信息
失败,参数错误,unionid不存在
"
);
return
ResultInfo
.
failure
(
"参数错误,unionid不
存在
"
);
log
.
error
(
"预存大小屏账号信息
异常,memberPreprocess# message ==>> unionid不的为空
"
);
return
ResultInfo
.
failure
(
"参数错误,unionid不
的为空
"
);
}
List
<
Object
>
resultList
=
new
ArrayList
<>();
// 大屏侧通过返回值来展示对应的小程序页面
String
result
=
SUBSCRIBE
;
...
...
@@ -572,7 +570,6 @@ public class UserOperationController {
result
=
UNSUBSCRIBE
;
resultList
.
add
(
result
);
resultList
.
add
(
platformAccount1
);
log
.
info
(
"saveUserInfo ==>> result ==>> [{}]"
,
resultList
);
return
ResultInfo
.
success
(
resultList
);
}
else
{
...
...
@@ -597,8 +594,8 @@ public class UserOperationController {
}
else
{
// 数据异常,没有会员
log
.
info
(
"userWeixinDTO ==>> [{}]"
,
userWeixinDTO
);
throw
new
EntityNotFoundException
(
MemberDTO
.
class
,
"code"
,
"member is null !!
"
);
log
.
error
(
"预存大小屏账号信息异常,memberPreprocess# message ==>> 会员不存在"
);
return
ResultInfo
.
failure
(
"会员不存在
"
);
}
...
...
@@ -612,23 +609,21 @@ public class UserOperationController {
String
content
=
(
String
)
this
.
redisUtils
.
get
(
RedisKeyUtil
.
genSeSuSubscribeKey
(
unionid
));
JSONObject
iptvUserInfo
=
JSONObject
.
parseObject
(
content
);
// redis中的大小屏信息
log
.
info
(
"
saveUserInfo ==> redis content iptvUserInfo ==> [{}]"
,
iptvUserInfo
);
log
.
info
(
"
预存大小屏账号信息,保存在redis中的信息,memberPreprocess# message ==> {}"
,
iptvUserInfo
);
// 大屏账户
String
platformAccount
=
iptvUserInfo
.
getString
(
"platformAccount"
);
if
(
StringUtils
.
isBlank
(
platformAccount
))
{
log
.
warn
(
"绑定失败,platformAccount is null
"
);
log
.
error
(
"预存大小屏账号信息警告,memberPreprocess# message ==> 大屏账号不存在
"
);
return
ResultInfo
.
failure
(
"绑定失败"
);
}
// 保存昵称和头像,头像需要进行本地化
try
{
String
headimgurl
=
iptvUserInfo
.
get
(
"headimgurl"
).
toString
();
log
.
info
(
"headimgurl ==>> {}"
,
headimgurl
);
String
nickname
=
iptvUserInfo
.
get
(
"nickname"
).
toString
();
if
(
StringUtils
.
isNotBlank
(
nickname
))
{
String
nicknameDecode
=
URLDecoder
.
decode
(
nickname
,
"UTF-8"
);
String
nicknameEncode
=
Base64Util
.
encode
(
nicknameDecode
);
...
...
@@ -636,14 +631,11 @@ public class UserOperationController {
}
if
(
StringUtils
.
isNotBlank
(
headimgurl
))
{
if
(
headimgurl
.
contains
(
"https"
)||
headimgurl
.
contains
(
"http"
))
{
String
headimgurlDecode
=
URLDecoder
.
decode
(
headimgurl
,
"UTF-8"
);
// String imageEncode = Base64Util.encode(headimgurlDecode);
String
image
=
RestTemplateClient
.
netImage
(
headimgurlDecode
);
memberDTO
.
setAvatarUrl
(
StringUtils
.
isNotBlank
(
image
)
?
image:
headimgurlDecode
);
}
}
}
catch
(
Exception
e
)
{
...
...
@@ -665,12 +657,7 @@ public class UserOperationController {
resultList
.
add
(
result
);
resultList
.
add
(
platformAccount1
);
// return ["subscribe","platform_account"]
ResultInfo
<
Object
>
success
=
ResultInfo
.
success
(
resultList
);
log
.
info
(
"saveUserInfo ==> ResultInfo ==> [{}]"
,
success
);
return
success
;
return
ResultInfo
.
success
(
resultList
);
}
private
String
downloadWeixinImge
(
String
headimgurl
){
...
...
@@ -693,20 +680,18 @@ public class UserOperationController {
@ApiOperation
(
"修改大屏账号"
)
@AnonymousAccess
public
ResultInfo
updateUserTv
(
@Validated
(
value
=
{
UpdateGroup
.
class
})
@RequestBody
UserTv
resources
)
{
log
.
info
(
"UserOperationController ==> updateUserTv ==>> param ==> [{}]"
,
resources
);
UserTvDTO
result
=
this
.
userOperationService
.
updateUserTv
(
resources
);
return
ResultInfo
.
success
(
result
);
log
.
info
(
"修改大屏账号,参数 updateUserTv# resources ==>> {}"
,
resources
);
return
ResultInfo
.
success
(
this
.
userOperationService
.
updateUserTv
(
resources
));
}
@PostMapping
(
value
=
"/createTvUserAndMember"
)
@ApiOperation
(
"保存大屏账户同时创建会员信息"
)
@AnonymousAccess
public
ResultInfo
createTvUserAndMember
(
@Validated
(
value
=
{
CreateGroup
.
class
})
@RequestBody
UserTv
resources
)
{
log
.
info
(
"保存大屏账户同时创建会员信息, 参数 createTvUserAndMember#
resources ==> {}"
,
resources
);
log
.
info
(
"保存大屏账户同时创建会员信息, 参数 createTvUserAndMember# resources ==> {}"
,
resources
);
String
platformAccount
=
resources
.
getPlatformAccount
();
if
(
StringUtils
.
isBlank
(
platformAccount
))
{
log
.
error
(
"保存大屏账户同时创建会员信息异常,
参数错误,
大屏账号不存在"
);
log
.
error
(
"保存大屏账户同时创建会员信息异常,
createTvUserAndMember# message ==>>
大屏账号不存在"
);
return
ResultInfo
.
failure
(
"参数错误,大屏账号不存在"
);
}
return
this
.
userOperationService
.
createTvUserAndMember
(
resources
);
...
...
@@ -716,94 +701,84 @@ public class UserOperationController {
@ApiOperation
(
"大屏解绑"
)
@AnonymousAccess
public
ResultInfo
tvUnbind
(
@Validated
(
value
=
{
UpdateGroup
.
class
})
@RequestBody
TvUnBindBean
resources
)
{
log
.
info
(
"
UserOperationController ==> unbind ==>> param ==> [{}]"
,
resources
);
log
.
info
(
"
大屏解绑, 参数 tvUnbind# resources ==> {}"
,
resources
);
String
memberCode
=
resources
.
getMemberCode
();
log
.
info
(
"大屏解绑,前端参数,需要解绑的会员code,memberCode ==>> {}"
,
memberCode
);
if
(
StringUtils
.
isBlank
(
memberCode
))
{
throw
new
BadRequestException
(
GlobeExceptionMsg
.
MEMBER_CODE_IS_NULL
);
log
.
error
(
"大屏解绑异常,tvUnbind# message ==>> 会员code不的为空"
);
return
ResultInfo
.
failure
(
"会员code不的为空"
);
}
String
platformAccount
=
resources
.
getPlatformAccount
();
log
.
info
(
"大屏解绑,前端参数,大屏账号,platformAccount ==>> {}"
,
platformAccount
);
if
(
StringUtils
.
isBlank
(
platformAccount
))
{
throw
new
BadRequestException
(
GlobeExceptionMsg
.
IPTV_PLATFORM_ACCOUNT_IS_NULL
);
log
.
error
(
"大屏解绑异常,tvUnbind# message ==>> 大屏账号不得为空"
);
return
ResultInfo
.
failure
(
"大屏账号不的为空"
);
}
boolean
b
=
this
.
userOperationService
.
tvUnbind
(
resources
);
if
(
b
)
{
if
(
this
.
userOperationService
.
tvUnbind
(
resources
))
{
return
ResultInfo
.
success
(
"解绑成功"
);
}
else
return
ResultInfo
.
failure
(
"解绑失败"
);
}
return
ResultInfo
.
failure
(
"解绑失败"
);
}
@RequestMapping
(
value
=
"/changeMainAccount"
)
@ApiOperation
(
"大屏更换主账号"
)
@AnonymousAccess
public
ResultInfo
changeMainAccount
(
@Validated
(
value
=
{
UpdateGroup
.
class
})
@RequestBody
BindBean
resources
)
{
log
.
info
(
"大屏更换主账号,参数
[changeMainAccount# ==> {}]"
,
resources
);
log
.
info
(
"大屏更换主账号,参数
changeMainAccount# resources ==>> {}"
,
resources
);
// Long memberId = resources.getMemberId();
String
memberCode
=
resources
.
getMemberCode
();
/* if (StringUtils.isBlank(memberCode) && Objects.nonNull(memberId)) {
memberCode = this.memberService.findCodeById(memberId);
} else if (StringUtils.isNotBlank(memberCode) && Objects.isNull(memberId)) {
MemberDTO memberDTO = this.memberService.findByCode(memberCode);
memberCode = memberDTO.getCode();
}*/
if
(
StringUtils
.
isBlank
(
memberCode
))
return
ResultInfo
.
failure
(
"会员code不得为空"
);
if
(
StringUtils
.
isBlank
(
memberCode
))
{
log
.
error
(
"大屏更换主账号异常,changeMainAccount# message ==>> 会员code不的为空"
);
return
ResultInfo
.
failure
(
"会员code不的为空"
);
}
MemberDTO
memberDTO
=
this
.
memberService
.
findByCode
(
memberCode
);
if
(
Objects
.
isNull
(
memberDTO
.
getId
()))
{
log
.
error
(
"大屏更换主账号
失败,会员信息不存在, changeMainAccount# ==
> {}"
,
memberCode
);
log
.
error
(
"大屏更换主账号
异常,changeMainAccount# message ==>> 会员信息不存在 | memberCode ==>
> {}"
,
memberCode
);
return
ResultInfo
.
failure
(
"会员信息不存在"
);
}
String
platformAccount
=
resources
.
getPlatformAccount
();
if
(
StringUtils
.
isBlank
(
platformAccount
))
throw
new
BadRequestException
(
GlobeExceptionMsg
.
IPTV_PLATFORM_ACCOUNT_IS_NULL
);
if
(
StringUtils
.
isBlank
(
platformAccount
))
{
log
.
error
(
"大屏更换主账号异常,changeMainAccount# message ==>> 大屏账号不存在 | platformAccount ==>> {}"
,
memberCode
);
return
ResultInfo
.
failure
(
"大屏账号不存在"
);
}
UserTv
userTv
=
new
UserTv
();
userTv
.
setMemberCode
(
memberCode
);
userTv
.
setPlatformAccount
(
platformAccount
);
boolean
b
=
this
.
userOperationService
.
changeMainAccount
(
userTv
);
return
ResultInfo
.
success
(
b
);
return
ResultInfo
.
success
(
this
.
userOperationService
.
changeMainAccount
(
userTv
));
}
@PostMapping
(
value
=
"/deleteAllCollection"
)
@ApiOperation
(
"删除全部收藏"
)
@AnonymousAccess
public
ResultInfo
deleteAllCollection
(
@RequestBody
String
content
)
{
log
.
info
(
"UserOperationController ==> deleteAllCollection ==> param ==> [{}]"
,
content
);
boolean
result
=
this
.
userOperationService
.
deleteAllCollection
(
content
);
return
ResultInfo
.
success
(
result
);
log
.
info
(
"删除全部收藏,参数 deleteAllCollection# resources ==> {}"
,
content
);
return
ResultInfo
.
success
(
this
.
userOperationService
.
deleteAllCollection
(
content
));
}
@PostMapping
(
value
=
"/deleteCollection"
)
@ApiOperation
(
"删除收藏"
)
@AnonymousAccess
public
ResultInfo
deleteCollection
(
@RequestBody
String
content
)
{
log
.
info
(
"UserOperationController ==> deleteCollection ==> param ==> [{}]"
,
content
);
boolean
result
=
this
.
userOperationService
.
deleteCollection
(
content
);
return
ResultInfo
.
success
(
result
);
log
.
info
(
"删除收藏,参数 deleteCollection# resources ==> {}"
,
content
);
return
ResultInfo
.
success
(
this
.
userOperationService
.
deleteCollection
(
content
));
}
@PostMapping
(
value
=
"/addCollection"
)
@ApiOperation
(
"添加收藏"
)
@AnonymousAccess
public
ResultInfo
addCollection
(
@RequestBody
String
content
)
{
log
.
info
(
"
UserOperationController ==> addCollection ==>> param ==> [{}]"
,
content
);
log
.
info
(
"
添加收藏,参数 addCollection# ==>> {}"
,
content
);
if
(
StringUtils
.
isNotBlank
(
content
))
{
boolean
result
=
this
.
userOperationService
.
addCollection
(
content
);
return
ResultInfo
.
success
(
result
);
return
ResultInfo
.
success
(
this
.
userOperationService
.
addCollection
(
content
));
}
return
ResultInfo
.
success
();
}
return
ResultInfo
.
failure
(
"无参数"
);
}
}
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/UserOperationService.java
View file @
a5d2e0d
...
...
@@ -31,14 +31,14 @@ public interface UserOperationService {
* @param resources
* @return
*/
UserWeixinDTO
createWeixinUserAndMember
(
UserWeixin
resources
);
ResultInfo
createWeixinUserAndMember
(
UserWeixin
resources
);
/**
* 保存小屏账户并创建会员
* @param resources
* @return
*/
UserWeixinDTO
createWeixinUserAndMember
(
UserWeixin
resources
,
Integer
vip
);
ResultInfo
createWeixinUserAndMember
(
UserWeixin
resources
,
Integer
vip
);
/**
* 服务号(H5)登录
...
...
@@ -205,18 +205,15 @@ public interface UserOperationService {
/**
*
* @param
resources
* @param
growthReport
* @return
*/
boolean
updatePasswordById
(
UserApp
resources
);
ResultInfo
saveGrowthReport
(
GrowthReport
growthReport
);
/**
*
* @param
growthReport
* @param
userApp
* @return
*/
ResultInfo
saveGrowthReport
(
GrowthReport
growthReport
);
boolean
appCancellation
(
UserApp
userApp
);
}
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/UserOperationServiceImpl.java
View file @
a5d2e0d
...
...
@@ -128,18 +128,16 @@ public class UserOperationServiceImpl implements UserOperationService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
UserAppDTO
appRegister
(
UserApp
resources
)
{
// 只查询有效或者禁止状态的
UserAppDTO
userAppDTO
=
this
.
userAppService
.
findByUsername
(
resources
.
getUsername
());
if
(
Objects
.
isNull
(
userAppDTO
.
getId
()))
{
// 先创建会员
Member
member
=
MemberBuilder
.
build
(
MemberTypeConstant
.
app
,
resources
.
getHeadimgurl
(),
resources
.
getNickname
(),
0
);
MemberDTO
memberDTO
=
this
.
memberService
.
create
(
member
);
// 无app账号
if
(
Objects
.
isNull
(
userAppDTO
.
getId
()))
{
// 先创建会员,缓存至redis
MemberDTO
memberDTO
=
this
.
createMember
(
MemberBuilder
.
build
(
MemberTypeConstant
.
app
,
resources
.
getHeadimgurl
(),
resources
.
getNickname
(),
0
));
if
(
Objects
.
nonNull
(
memberDTO
.
getId
()))
{
// 保存app账号
UserAppDTO
_userAppDTO
=
this
.
userAppService
.
create
(
UserAppBuilder
.
build
(
memberDTO
.
getId
(),
resources
));
if
(
Objects
.
nonNull
(
_userAppDTO
.
getId
())
&&
StringUtils
.
isNotBlank
(
resources
.
getAccount
()))
{
UserAppBindDTO
userAppBindDTO
=
this
.
userAppBindService
.
findFirstByAccount
(
resources
.
getAccount
());
if
(
Objects
.
isNull
(
userAppBindDTO
.
getId
()))
{
...
...
@@ -152,18 +150,27 @@ public class UserOperationServiceImpl implements UserOperationService {
}
}
// 同步至大屏侧
AppRegisterDTO
appRegisterDTO
=
new
AppRegisterDTO
();
appRegisterDTO
.
setMemberDTO
(
memberDTO
);
appRegisterDTO
.
setUserAppDTO
(
_userAppDTO
);
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncAppRegister
(
appRegisterDTO
);
return
_userAppDTO
;
try
{
Map
<
Object
,
Object
>
appCache
=
new
HashMap
<>();
appCache
.
put
(
"id"
,
_userAppDTO
.
getId
());
appCache
.
put
(
"memberId"
,
_userAppDTO
.
getMemberId
());
boolean
appCacheResult
=
this
.
redisUtils
.
set
(
RedisKeyConstants
.
cacheAppById
+
":"
+
_userAppDTO
.
getId
(),
appCache
);
log
.
info
(
"app注册时,缓存app账号信息,appRegister# appCacheResult ==>> "
+
appCacheResult
);
}
catch
(
Exception
e
)
{
log
.
error
(
"app注册时,缓存app账号信息异常,appRegister# message ==>> {}"
,
e
.
getMessage
());
}
return
_userAppDTO
;
}
}
// app账号存在的话直接返回
return
userAppDTO
;
}
...
...
@@ -176,16 +183,18 @@ public class UserOperationServiceImpl implements UserOperationService {
if
(
Objects
.
nonNull
(
userAppBindDTO
.
getUserAppId
()))
{
UserAppDTO
userAppDTO
=
this
.
userAppService
.
findById
(
userAppBindDTO
.
getUserAppId
());
if
(
Objects
.
isNull
(
userAppDTO
.
getId
()))
{
log
.
error
(
"解绑第三方账号失败异常,cancelUserAppBind# message ==>> app账号不存在"
);
return
ResultInfo
.
failure
(
"app账号不存在"
);
}
}
boolean
b
=
this
.
userAppBindService
.
cancelUserAppBind
(
account
,
accountType
);
if
(
b
)
{
if
(
this
.
userAppBindService
.
cancelUserAppBind
(
account
,
accountType
)
)
{
return
ResultInfo
.
success
(
true
);
}
}
return
ResultInfo
.
failure
(
"取消绑定失败"
);
log
.
error
(
"解绑第三方账号失败异常,cancelUserAppBind# message ==>> 无第三方账号"
);
return
ResultInfo
.
failure
(
"解绑第三方账号失败,无第三方账号"
);
}
...
...
@@ -197,7 +206,7 @@ public class UserOperationServiceImpl implements UserOperationService {
String
nickname
=
resources
.
getNickname
();
UserAppDTO
userAppDTO
=
this
.
userAppService
.
findByUsername
(
username
);
log
.
info
(
"
通过app账号查询app信息是否存在,[appBindThirdAccount#{}]
"
,
userAppDTO
);
log
.
info
(
"
查询app信息,appBindThirdAccount# userAppDTO ==>> {}
"
,
userAppDTO
);
if
(
Objects
.
isNull
(
userAppDTO
.
getId
()))
{
return
ResultInfo
.
failure
(
"app账号不存在"
);
}
...
...
@@ -236,7 +245,7 @@ public class UserOperationServiceImpl implements UserOperationService {
}
}
userApp
.
setNickname
(
nickname
);
log
.
info
(
"
同步app账号的昵称、头像,[appBindThirdAccount#{}]"
,
userAppDTO
);
log
.
info
(
"
修改数据库,修改app账号的昵称、头像,appBindThirdAccount# userApp ==>> {}"
,
userApp
);
boolean
result
=
this
.
userAppService
.
updateAppLastActiveTimeAndNicknameAndHeadImg
(
userApp
);
if
(
result
)
{
UserAppDTO
userAppDTO1
=
new
UserAppDTO
();
...
...
@@ -247,6 +256,7 @@ public class UserOperationServiceImpl implements UserOperationService {
if
(
Objects
.
nonNull
(
userAppBindDTO
.
getId
()))
{
resources
.
setUserAppId
(
userAppDTO
.
getId
());
log
.
info
(
"修改数据库,修改绑定关系的昵称、头像,updateValidStatusAndUserAppIdAndNickname# resources ==>> {}"
,
resources
);
boolean
result
=
this
.
userAppBindService
.
updateValidStatusAndUserAppIdAndNickname
(
resources
);
if
(
result
)
{
UserAppDTO
userAppDTO1
=
new
UserAppDTO
();
...
...
@@ -259,7 +269,7 @@ public class UserOperationServiceImpl implements UserOperationService {
}
else
{
resources
.
setUserAppId
(
userAppDTO
.
getId
());
resources
.
setStatus
(
1
);
log
.
info
(
"
第三方账号不存在,新增关联关系[appBindThirdAccount#{}]
"
,
resources
);
log
.
info
(
"
保存关联关系,updateValidStatusAndUserAppIdAndNickname# resources ==>> {}
"
,
resources
);
this
.
userAppBindService
.
create
(
resources
);
UserAppDTO
userAppDTO1
=
new
UserAppDTO
();
...
...
@@ -273,7 +283,7 @@ public class UserOperationServiceImpl implements UserOperationService {
@Override
public
UserAppSimpleDTO
updateAppInfo
(
UserApp
resources
)
{
log
.
info
(
"修改app信息,updateValidStatusAndUserAppIdAndNickname# resources ==>> {}"
,
resources
);
UserAppSimpleDTO
userAppSimpleDTO
=
this
.
userAppService
.
updateAppInfo
(
resources
);
if
(
Objects
.
nonNull
(
userAppSimpleDTO
.
getId
()))
{
UserAppDTO
userAppDTO
=
new
UserAppDTO
();
...
...
@@ -281,26 +291,10 @@ public class UserOperationServiceImpl implements UserOperationService {
userAppDTO
.
setUsername
(
userAppSimpleDTO
.
getUsername
());
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncUpdateAppInfo
(
userAppDTO
);
}
return
userAppSimpleDTO
;
}
@Override
public
boolean
updatePasswordById
(
UserApp
resources
)
{
UserAppDTO
userAppDTO
=
this
.
userAppService
.
findById
(
resources
.
getId
());
if
(
Objects
.
nonNull
(
userAppDTO
.
getId
()))
{
if
(
this
.
userAppService
.
updatePasswordById
(
resources
))
{
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncUpdatePasswordByUsername
(
userAppDTO
);
return
true
;
}
}
return
false
;
return
userAppSimpleDTO
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResultInfo
saveGrowthReport
(
GrowthReport
growthReport
)
{
...
...
@@ -308,7 +302,7 @@ public class UserOperationServiceImpl implements UserOperationService {
UserTvDTO
userTvDTO
=
this
.
userTvService
.
findByPlatformAccount
(
platformAccount
);
if
(
Objects
.
isNull
(
userTvDTO
.
getId
()))
{
log
.
error
(
"保存成长报告
失败,大屏信息不存在[saveGrowthReport#]"
);
log
.
error
(
"保存成长报告
异常,saveGrowthReport# message ==>> 大屏信息不存在 | platformAccount ==>> {}"
,
platformAccount
);
return
ResultInfo
.
failure
(
"保存成长报告失败,大屏信息不存在"
);
}
...
...
@@ -322,10 +316,10 @@ public class UserOperationServiceImpl implements UserOperationService {
growthReport
.
setMemberId
(
memberId
);
growthReport
.
setStartDate
(
weekFirstDay
);
growthReport
.
setEndDate
(
weekLastDay
);
log
.
info
(
"保存成长报告,
参数[saveGrowthReport#{}]
"
,
growthReport
);
log
.
info
(
"保存成长报告,
saveGrowthReport# message ==>> {}
"
,
growthReport
);
this
.
growthReportService
.
create
(
growthReport
);
}
else
{
log
.
info
(
"修改成长报告,
参数[saveGrowthReport#{}]
"
,
growthReport
);
log
.
info
(
"修改成长报告,
saveGrowthReport# message ==>> {}
"
,
growthReport
);
this
.
growthReportService
.
updateGrowthReportData
(
growthReportDTO
.
getId
(),
growthReport
.
getData
());
}
...
...
@@ -338,12 +332,11 @@ public class UserOperationServiceImpl implements UserOperationService {
public
boolean
appCancellation
(
UserApp
userApp
)
{
UserAppDTO
userAppDTO
=
this
.
userAppService
.
findById
(
userApp
.
getId
());
if
(
Objects
.
nonNull
(
userAppDTO
.
getId
())){
boolean
b
=
this
.
userAppService
.
appCancellation
(
userApp
.
getId
());
if
(
b
)
{
if
(
this
.
userAppService
.
appCancellation
(
userApp
.
getId
()))
{
List
<
UserAppBindDTO
>
userAppBindDTOS
=
this
.
userAppBindService
.
findByUserAppId
(
userAppDTO
.
getId
());
if
(!
CollectionUtils
.
isEmpty
(
userAppBindDTOS
))
{
List
<
Long
>
ids
=
userAppBindDTOS
.
stream
().
map
(
UserAppBindDTO:
:
getId
).
collect
(
Collectors
.
toList
());
this
.
userAppBindService
.
appCancellation
(
ids
);
return
this
.
userAppBindService
.
appCancellation
(
ids
);
}
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncAppCancellation
(
userAppDTO
);
...
...
@@ -351,7 +344,7 @@ public class UserOperationServiceImpl implements UserOperationService {
}
return
tru
e
;
return
fals
e
;
}
/**
...
...
@@ -368,30 +361,22 @@ public class UserOperationServiceImpl implements UserOperationService {
String
platformAccount
=
resources
.
getPlatformAccount
();
UserTvDTO
userTvDTO
=
this
.
userTvService
.
findByPlatformAccount
(
platformAccount
);
// 无账号
if
(
Objects
.
isNull
(
userTvDTO
.
getId
()))
{
// 会员昵称默认采用大屏账号,昵称通过base64加密与小屏保持一致
String
platformAccountEncode
=
Base64Utils
.
encodeToString
(
platformAccount
.
getBytes
());
// x_member
MemberDTO
memberDTO
=
this
.
createMember
(
MemberBuilder
.
build
(
LocalConstants
.
MEMBER_PLATFORM_TYPE_VIS
,
null
,
platformAccountEncode
,
0
));
if
(
Objects
.
nonNull
(
memberDTO
))
{
UserTv
userTv
=
UserTvBuilder
.
build
(
memberDTO
.
getId
(),
memberDTO
.
getCode
(),
resources
);
// 创建大屏账户
UserTvDTO
_tvUserDTO
=
this
.
createTvUser
(
userTv
,
memberDTO
.
getId
(),
memberDTO
.
getCode
());
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncMemberAndUserTv4Iptv
(
new
MemberAndUserTvDTO
(
memberDTO
,
_tvUserDTO
));
return
ResultInfo
.
success
(
_tvUserDTO
);
}
log
.
error
(
"保存大屏账号信息异常,
无法创建大屏账号对应的会员,createTvUserAndMember# ==> {}"
,
platformAccount
);
log
.
error
(
"保存大屏账号信息异常,
createTvUserAndMember# message ==> 会员创建失败"
);
return
ResultInfo
.
failure
(
GlobeExceptionMsg
.
MEMBER_ID_IS_NULL
);
// 有账号
...
...
@@ -433,12 +418,17 @@ public class UserOperationServiceImpl implements UserOperationService {
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
UserWeixinDTO
createWeixinUserAndMember
(
UserWeixin
resources
)
{
public
ResultInfo
createWeixinUserAndMember
(
UserWeixin
resources
)
{
return
this
.
createWeixinUserAndMember
(
resources
,
0
);
}
@Override
public
UserWeixinDTO
createWeixinUserAndMember
(
UserWeixin
resources
,
Integer
vip
)
{
public
ResultInfo
createWeixinUserAndMember
(
UserWeixin
resources
,
Integer
vip
)
{
UserWeixinDTO
userWeixinDTO
=
this
.
createWeixinAndMember
(
resources
,
vip
);
return
ResultInfo
.
success
(
userWeixinDTO
);
}
private
UserWeixinDTO
createWeixinAndMember
(
UserWeixin
resources
,
Integer
vip
){
String
appId
=
resources
.
getAppid
();
String
openId
=
resources
.
getOpenid
();
String
unionId
=
resources
.
getUnionid
();
...
...
@@ -449,8 +439,8 @@ public class UserOperationServiceImpl implements UserOperationService {
// 小屏账号
UserWeixinDTO
userWeixinDTO
=
this
.
findFirstByAppIdAndOpenId
(
appId
,
openId
);
if
(
Objects
.
nonNull
(
userWeixinDTO
.
getId
())
&&
Objects
.
nonNull
(
userWeixinDTO
.
getMemberId
()))
{
log
.
error
(
"createWeixinUserAndMember ==>> result ==>> [{}]
"
,
userWeixinDTO
);
throw
new
BadRequestException
(
GlobeExceptionMsg
.
OPERATION_FORBID
+
"==>> "
+
GlobeExceptionMsg
.
ENTITY_ALREADY_EXISTS
)
;
log
.
warn
(
"创建微信账号时异常,createWeixinUserAndMember# message ==>> 微信账号已存在 | userWeixinDTO ==>> {}
"
,
userWeixinDTO
);
return
userWeixinDTO
;
}
// 账号存在但无会员
...
...
@@ -476,10 +466,8 @@ public class UserOperationServiceImpl implements UserOperationService {
}
else
{
// 有其他账号但都无会员,新建会员并将此账号绑定新建的这个会员
Member
member
=
MemberBuilder
.
build
(
LocalConstants
.
MEMBER_PLATFORM_TYPE_WEIXIN
,
headimgurl
,
nickname
,
vip
,
sex
);
MemberDTO
memberDTO
=
this
.
createMember
(
member
);
MemberDTO
memberDTO
=
this
.
createMember
(
MemberBuilder
.
build
(
LocalConstants
.
MEMBER_PLATFORM_TYPE_WEIXIN
,
headimgurl
,
nickname
,
vip
,
sex
));
if
(
Objects
.
nonNull
(
memberDTO
))
{
userWeixinDTO
.
setMemberId
(
memberDTO
.
getId
());
...
...
@@ -493,16 +481,15 @@ public class UserOperationServiceImpl implements UserOperationService {
}
throw
new
RuntimeException
(
"系统错误,保存微信账号失败,创建会员信息失败"
);
}
}
else
{
// 该账号存在但无其他账号,新建会员
Member
member
=
MemberBuilder
.
build
(
LocalConstants
.
MEMBER_PLATFORM_TYPE_WEIXIN
,
headimgurl
,
nickname
,
vip
,
sex
);
MemberDTO
memberDTO
=
this
.
createMember
(
member
);
MemberDTO
memberDTO
=
this
.
createMember
(
MemberBuilder
.
build
(
LocalConstants
.
MEMBER_PLATFORM_TYPE_WEIXIN
,
headimgurl
,
nickname
,
vip
,
sex
));
if
(
Objects
.
nonNull
(
memberDTO
))
{
userWeixinDTO
.
setMemberId
(
memberDTO
.
getId
());
...
...
@@ -516,6 +503,8 @@ public class UserOperationServiceImpl implements UserOperationService {
}
throw
new
RuntimeException
(
"系统错误,保存微信账号失败,创建会员信息失败"
);
}
}
...
...
@@ -568,15 +557,11 @@ public class UserOperationServiceImpl implements UserOperationService {
}
else
{
// 新建会员
Member
_member
=
MemberBuilder
.
build
(
LocalConstants
.
MEMBER_PLATFORM_TYPE_WEIXIN
,
headimgurl
,
nickname
,
vip
,
sex
);
MemberDTO
memberDTO
=
this
.
createMember
(
_member
);
MemberDTO
memberDTO
=
this
.
createMember
(
MemberBuilder
.
build
(
LocalConstants
.
MEMBER_PLATFORM_TYPE_WEIXIN
,
headimgurl
,
nickname
,
vip
,
sex
));
if
(
Objects
.
nonNull
(
memberDTO
))
{
UserWeixin
userWeixin
=
UserWeixinBuilder
.
build
(
memberDTO
.
getId
(),
resources
);
UserWeixinDTO
_userWeixinDTO1
=
this
.
createWeixinUser
(
userWeixin
,
memberDTO
.
getId
(),
memberDTO
.
getCode
());
UserWeixinDTO
_userWeixinDTO1
=
this
.
createWeixinUser
(
UserWeixinBuilder
.
build
(
memberDTO
.
getId
(),
resources
),
memberDTO
.
getId
(),
memberDTO
.
getCode
());
// 同步至iptv
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
...
...
@@ -585,7 +570,7 @@ public class UserOperationServiceImpl implements UserOperationService {
return
_userWeixinDTO1
;
}
throw
new
EntityNotFoundException
(
MemberDTO
.
class
,
"code"
,
GlobeExceptionMsg
.
MEMBER_CODE_IS_NULL
);
throw
new
RuntimeException
(
"系统错误,保存微信账号失败,创建会员信息失败"
);
}
...
...
@@ -603,7 +588,7 @@ public class UserOperationServiceImpl implements UserOperationService {
public
UserWeixinDTO
serviceLogin
(
UserWeixin
resources
)
{
// 创建小屏账户同时创建会员
UserWeixinDTO
userWeixinDTO
=
this
.
createWeixin
UserAndMember
(
resources
);
UserWeixinDTO
userWeixinDTO
=
this
.
createWeixin
AndMember
(
resources
,
0
);
// 为了保证返回的同一用户
return
this
.
getFirstId
(
userWeixinDTO
);
...
...
@@ -619,8 +604,7 @@ public class UserOperationServiceImpl implements UserOperationService {
public
UserWeixinDTO
appletLogin
(
UserWeixin
resources
)
{
// 创建小屏账户同时创建会员
UserWeixinDTO
userWeixinDTO
=
this
.
createWeixinUserAndMember
(
resources
);
UserWeixinDTO
userWeixinDTO
=
this
.
createWeixinAndMember
(
resources
,
0
);
// 为了保证返回的同一用户
return
this
.
getFirstId
(
userWeixinDTO
);
}
...
...
@@ -659,7 +643,7 @@ public class UserOperationServiceImpl implements UserOperationService {
userWeixin
.
setHeadimgurl
(
headImgUrl
);
// 创建小屏账户同时创建会员
userWeixinDTO
=
this
.
createWeixin
User
AndMember
(
userWeixin
,
1
);
userWeixinDTO
=
this
.
createWeixinAndMember
(
userWeixin
,
1
);
Long
memberId
=
userWeixinDTO
.
getMemberId
();
memberDTO
=
this
.
memberService
.
findById
(
memberId
);
...
...
@@ -669,6 +653,7 @@ public class UserOperationServiceImpl implements UserOperationService {
UserWeixin
userWeixin
=
new
UserWeixin
();
userWeixin
.
setId
(
userWeixinDTO
.
getId
());
userWeixin
.
setStatus
(
SUBSCRIBE_STATUS
);
log
.
info
(
"修改微信信息status状态应改为1, subscribe# userWeixin ==>> {}"
,
userWeixin
);
userWeixinDTO
=
this
.
userWeixinService
.
doUpdateWeixinStatus
(
userWeixin
);
// 小屏会员
memberDTO
=
this
.
memberService
.
findById
(
userWeixinDTO
.
getMemberId
());
...
...
@@ -688,14 +673,14 @@ public class UserOperationServiceImpl implements UserOperationService {
}
}
// 修改会员信息
log
.
info
(
"修改会员信息vip以及vip过期时间, subscribe# member ==>> {}"
,
member
);
memberDTO
=
this
.
memberService
.
doUpdateMemberVipAndVipExpireTime
(
member
);
log
.
info
(
"发送关注消息至大屏侧,发送的账号信息 ==>> {} || 会员信息 ==>> {}"
,
userWeixinDTO
,
memberDTO
);
// 同步大屏侧
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncSubscribe
(
new
MemberAndWeixinUserDTO
(
memberDTO
,
userWeixinDTO
));
// 大屏信息
JSONObject
visUserInfo
=
resources
.
getIptvUserInfo
();
log
.
info
(
"
存储的大小屏账号信息 iptv
UserInfo ==>> {}"
,
visUserInfo
);
log
.
info
(
"
关注时大屏信息, subscribe# vis
UserInfo ==>> {}"
,
visUserInfo
);
if
(
Objects
.
nonNull
(
visUserInfo
))
{
// 大屏账户
String
platformAccount
=
visUserInfo
.
getString
(
"platformAccount"
);
...
...
@@ -709,20 +694,19 @@ public class UserOperationServiceImpl implements UserOperationService {
}
if
(
StringUtils
.
isBlank
(
platformAccount
))
{
log
.
error
(
"关注后绑定
失败,platformAccount is null
"
);
log
.
error
(
"关注后绑定
异常,subscribe# message ==>> 无大屏账号
"
);
return
false
;
}
}
log
.
info
(
"存储的大屏账号信息 platformAccount ==>> {}"
,
platformAccount
);
// 绑定
log
.
info
(
"关注后绑定,绑定信息 subscribe# memberDTO ==>> {} | platformAccount ==>> {}"
,
memberDTO
,
platformAccount
);
this
.
bind
(
memberDTO
,
platformAccount
);
log
.
info
(
"绑定结束"
);
}
// 保存关注记录
JSONObject
sourceInfo
=
resources
.
getSourceInfo
();
log
.
info
(
"保存关注记录,
数据 [subscribe#{}]
"
,
sourceInfo
);
log
.
info
(
"保存关注记录,
subscribe# sourceInfo ==>> {}
"
,
sourceInfo
);
this
.
saveWechatSubscribeRecord
(
memberDTO
,
sourceInfo
,
1
);
return
true
;
...
...
@@ -797,12 +781,12 @@ public class UserOperationServiceImpl implements UserOperationService {
UserWeixinDTO
userWeixinDTO
=
this
.
userWeixinService
.
findFirstByAppIdAndOpenId
(
appId
,
openId
);
if
(
Objects
.
isNull
(
userWeixinDTO
.
getId
()))
{
log
.
error
(
"取关失败,通过appid ==>> {} 和 openId ==>> {} 无法查询到指定的微信账号"
,
appId
,
openId
);
log
.
error
(
"取关失败,
unsubscribe# message ==>>
通过appid ==>> {} 和 openId ==>> {} 无法查询到指定的微信账号"
,
appId
,
openId
);
return
false
;
}
if
(
Objects
.
isNull
(
userWeixinDTO
.
getMemberId
()))
{
log
.
error
(
"取关失败,
该微信账号无会员id
==>> {}"
,
userWeixinDTO
);
log
.
error
(
"取关失败,
unsubscribe# message ==>> 该微信账号无会员 userWeixinDTO
==>> {}"
,
userWeixinDTO
);
return
false
;
}
...
...
@@ -859,8 +843,6 @@ public class UserOperationServiceImpl implements UserOperationService {
@Override
public
UserWeixinDTO
saveUserInfo
(
String
data
)
{
log
.
info
(
"result ====>> [{}]"
,
data
);
JSONObject
json
=
JSONObject
.
parseObject
(
data
);
String
unionId
=
json
.
getString
(
"unionid"
);
// 订阅号appid
...
...
@@ -889,7 +871,6 @@ public class UserOperationServiceImpl implements UserOperationService {
this
.
redisUtils
.
set
(
RedisKeyUtil
.
genSeSuSubscribeKey
(
unionId
),
data
,
300
);
Object
o
=
this
.
redisUtils
.
get
(
RedisKeyUtil
.
genSeSuSubscribeKey
(
unionId
));
String
contentJsonStr
=
JSON
.
toJSONString
(
o
);
log
.
info
(
"H5 save in redis contentJsonStr ====>> [{}]"
,
contentJsonStr
);
// 若未传dyAppId。不走下面的流程
if
(
StrUtil
.
isNotBlank
(
appId
))
{
...
...
@@ -917,8 +898,9 @@ public class UserOperationServiceImpl implements UserOperationService {
String
platformAccount
=
resources
.
getPlatformAccount
();
UserTvDTO
userTvDTO
=
this
.
userTvService
.
findByPlatformAccount
(
platformAccount
);
if
(
Objects
.
nonNull
(
userTvDTO
))
{
if
(
StringUtils
.
isNotBlank
(
userTvDTO
.
getPriorityMemberCode
())
&&
userTvDTO
.
getPriorityMemberCode
().
equalsIgnoreCase
(
memberCode
))
if
(
StringUtils
.
isNotBlank
(
userTvDTO
.
getPriorityMemberCode
())
&&
userTvDTO
.
getPriorityMemberCode
().
equalsIgnoreCase
(
memberCode
))
{
throw
new
BadRequestException
(
"会员已是主账户"
);
}
}
else
{
throw
new
EntityNotFoundException
(
UserTvDTO
.
class
,
"platformAccount"
,
GlobeExceptionMsg
.
IPTV_IS_NULL
);
}
...
...
@@ -957,16 +939,16 @@ public class UserOperationServiceImpl implements UserOperationService {
String
memberCode
=
resources
.
getMemberCode
();
UserTvDTO
userTvDTO
=
this
.
userTvService
.
findByPlatformAccount
(
platformAccount
);
log
.
info
(
"大屏解绑,通过大屏账号查询大屏账号信息,结果 userTvDTO ==>> {}"
,
userTvDTO
);
log
.
info
(
"大屏解绑,通过大屏账号查询大屏账号信息,结果
tvUnbind#
userTvDTO ==>> {}"
,
userTvDTO
);
if
(
Objects
.
isNull
(
userTvDTO
.
getId
()))
{
log
.
error
(
"大屏解绑
失败,无对应的大屏账号信息,
platformAccount ==>> {}"
,
platformAccount
);
return
false
;
log
.
error
(
"大屏解绑
异常,tvUnbind# message ==>>无对应的大屏账号信息 |
platformAccount ==>> {}"
,
platformAccount
);
throw
new
EntityNotFoundException
(
UserTvDTO
.
class
,
"platformAccount"
,
GlobeExceptionMsg
.
IPTV_IS_NULL
)
;
}
MemberDTO
memberDTO
=
this
.
memberService
.
findByCode
(
memberCode
);
log
.
info
(
"大屏解绑,通过会员code查询会员信息,
结果memberDTO==>>
{}"
,
memberDTO
);
log
.
info
(
"大屏解绑,通过会员code查询会员信息,
tvUnbind# memberDTO ==>>
{}"
,
memberDTO
);
if
(
Objects
.
isNull
(
memberDTO
.
getId
()))
{
log
.
error
(
"大屏解绑
失败,无对应的会员信息, memberCode ==>> {}"
,
memberCode
);
log
.
error
(
"大屏解绑
异常,tvUnbind# message ==>> 无对应的会员信息"
);
return
false
;
}
...
...
@@ -977,9 +959,8 @@ public class UserOperationServiceImpl implements UserOperationService {
member
.
setBindIptvTime
(
null
);
member
.
setUserIptvId
(
null
);
member
.
setBindIptvPlatformType
(
null
);
log
.
info
(
"置空会员绑定的大屏信息, member ==>> {}"
,
member
);
log
.
info
(
"置空会员绑定的大屏信息,
参数 tvUnbind#
member ==>> {}"
,
member
);
memberDTO
=
this
.
memberService
.
doUpdateMemberUserIptvIdAndBindIptvPlatformAndBindIptvTime
(
member
);
log
.
info
(
"会员信息置空大屏的结果,memberDTO ==>> {}"
,
memberDTO
);
memberDTO
.
setPlatformAccount
(
platformAccount
);
if
(
StringUtils
.
isBlank
(
bindMemberCode
))
{
...
...
@@ -991,7 +972,6 @@ public class UserOperationServiceImpl implements UserOperationService {
UserTvDTO
_userTvDTO
=
new
UserTvDTO
();
_userTvDTO
.
setPlatformAccount
(
platformAccount
);
_userTvDTO
.
setPriorityMemberCode
(
null
);
log
.
info
(
"大屏账号置空主会员的结果,userTvDTO ==>> {}"
,
_userTvDTO
);
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncUnbind
(
new
MemberAndUserTvDTO
(
memberDTO
,
_userTvDTO
));
UserTvSimpleDTO
userTvSimpleDTO
=
this
.
userTvService
.
findSimpleByPlatformAccount
(
platformAccount
);
...
...
@@ -1012,7 +992,6 @@ public class UserOperationServiceImpl implements UserOperationService {
UserTvDTO
_userTvDTO
=
new
UserTvDTO
();
_userTvDTO
.
setPlatformAccount
(
platformAccount
);
_userTvDTO
.
setPriorityMemberCode
(
bindMemberCode
);
log
.
info
(
"大屏账号置空主会员的结果,userTvDTO ==>> {}"
,
userTvDTO
);
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncUnbind
(
new
MemberAndUserTvDTO
(
memberDTO
,
_userTvDTO
));
UserTvSimpleDTO
userTvSimpleDTO
=
this
.
userTvService
.
findSimpleByPlatformAccount
(
platformAccount
);
...
...
@@ -1173,9 +1152,7 @@ public class UserOperationServiceImpl implements UserOperationService {
}
for
(
UserCollectionMq
collectionMq
:
value
)
{
UserCollectionDetail
userCollectionDetail
=
collectionMq2DetailMapper
.
toEntity
(
collectionMq
);
List
<
UserCollectionDetail
>
userCollectionDetailOptional
=
userCollectionDetailRepository
.
findByDetailIdAndDetailTypeAndUserCollectionId
(
userCollectionDetail
.
getDetailId
(),
userCollectionDetail
.
getDetailType
(),
userCollection
.
getId
());
...
...
@@ -1220,39 +1197,38 @@ public class UserOperationServiceImpl implements UserOperationService {
public
boolean
minaBind
(
BindBean
resources
)
{
Long
memberId
=
resources
.
getMemberId
();
String
platformAccount
=
resources
.
getPlatformAccount
();
// 大屏账户
UserTvDTO
userTvDTO
=
this
.
userTvService
.
findByPlatformAccount
(
platformAccount
);
log
.
info
(
"
查询大屏账号信息,
userTvDTO ==>> {}"
,
userTvDTO
);
log
.
info
(
"
小程序绑定,查询大屏账号信息 minaBind#
userTvDTO ==>> {}"
,
userTvDTO
);
// 账户是否存在
if
(
Objects
.
isNull
(
userTvDTO
.
getId
()))
{
log
.
error
(
"
大屏账号信息不存在,platformAccount ==> {}"
,
platformAccount
);
log
.
error
(
"
小程序绑定异常,minaBind# message ==>> 大屏账号信息不存在"
);
return
false
;
}
// 微信账户
if
(
Objects
.
nonNull
(
memberId
))
{
UserWeixinDTO
userWeixinDTO
=
this
.
userWeixinService
.
findFirstByMemberId
(
memberId
);
log
.
info
(
"检查小屏账号
是否存在,
userWeixinDTO ==>> {}"
,
userWeixinDTO
);
log
.
info
(
"检查小屏账号
,minaBind#
userWeixinDTO ==>> {}"
,
userWeixinDTO
);
// 账户是否存在
if
(
Objects
.
isNull
(
userWeixinDTO
.
getId
()))
{
log
.
error
(
"
通过会员id无法找到对应的微信账号,memberId ==
> {}"
,
memberId
);
log
.
error
(
"
小程序绑定大屏异常,minaBind# message ==> 微信账号不存在 | memberId ==>
> {}"
,
memberId
);
return
false
;
}
}
MemberDTO
memberDTO
=
this
.
memberService
.
findById
(
memberId
);
log
.
info
(
"
检查会员是否存在,
memberDTO ==>> {}"
,
memberDTO
);
log
.
info
(
"
查询会员信息,minaBind#
memberDTO ==>> {}"
,
memberDTO
);
if
(
Objects
.
nonNull
(
memberDTO
.
getId
()))
{
Long
userIptvId
=
memberDTO
.
getUserIptvId
();
if
(
Objects
.
nonNull
(
userIptvId
))
{
log
.
error
(
"
该会员已绑定,大屏id ==
> {}"
,
userIptvId
);
log
.
error
(
"
小程序绑定大屏异常,minaBind# message ==> 当前账号信息绑定了其他大屏 | 绑定的大屏id ==>
> {}"
,
userIptvId
);
throw
new
BadRequestException
(
GlobeExceptionMsg
.
ALREADY_BIND
);
}
}
else
{
log
.
error
(
"
会员信息不存在,请检查数据,
memberId ==>> {}"
,
memberId
);
log
.
error
(
"
小程序绑定大屏异常,minaBind# message ==> 会员信息不存在 |
memberId ==>> {}"
,
memberId
);
return
false
;
}
...
...
@@ -1261,11 +1237,11 @@ public class UserOperationServiceImpl implements UserOperationService {
if
(
StringUtils
.
isBlank
(
priorityMemberCode
))
{
priorityMemberCode
=
memberDTO
.
getCode
();
log
.
info
(
"大屏账号为绑定主账号,开始设置主会员 priorityMemberCode ==>> {}"
,
priorityMemberCode
);
UserTv
userTv
=
new
UserTv
();
userTv
.
setId
(
userTvDTO
.
getId
());
userTv
.
setPriorityMemberCode
(
priorityMemberCode
);
// 更新大屏账户
log
.
info
(
"设置主会员,minaBind# userTv ==>> {}"
,
userTv
);
this
.
userTvService
.
doUpdatePriorityMemberCode
(
userTv
);
userTvDTO
.
setPriorityMemberCode
(
memberDTO
.
getCode
());
...
...
@@ -1292,12 +1268,13 @@ public class UserOperationServiceImpl implements UserOperationService {
member
.
setUserIptvId
(
userTvDTO
.
getId
());
member
.
setBindIptvTime
(
TimestampUtil
.
now
());
member
.
setBindIptvPlatformType
(
bindIptvPlatformType
);
log
.
info
(
"修改小屏会员对应的绑定关系,member ==>> {}"
,
member
);
log
.
info
(
"修改小屏会员对应的绑定关系,minaBind# member ==>> {}"
,
member
);
// 修改会员信息
this
.
memberService
.
doUpdateMemberUserIptvIdAndBindIptvPlatformAndBindIptvTime
(
member
);
memberDTO
.
setPlatformAccount
(
platformAccount
);
log
.
info
(
"发送绑定消息至大屏,memberDTO ==>> {} || userTvDTO ==>> {}"
,
memberDTO
,
userTvDTO
);
log
.
info
(
"发送绑定消息至大屏,m
inaBind# m
emberDTO ==>> {} || userTvDTO ==>> {}"
,
memberDTO
,
userTvDTO
);
// 同步至iptv
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
())
.
asyncMinaBind
(
new
MemberAndUserTvDTO
(
memberDTO
,
userTvDTO
));
...
...
@@ -1315,7 +1292,6 @@ public class UserOperationServiceImpl implements UserOperationService {
@Override
public
ResultInfo
appBind
(
BindBean
resources
)
{
Long
memberId
=
resources
.
getMemberId
();
String
platformAccount
=
resources
.
getPlatformAccount
();
// 大屏账户
...
...
@@ -1343,7 +1319,7 @@ public class UserOperationServiceImpl implements UserOperationService {
if
(
Objects
.
nonNull
(
memberDTO
.
getId
()))
{
Long
userIptvId
=
memberDTO
.
getUserIptvId
();
if
(
Objects
.
nonNull
(
userIptvId
))
{
log
.
error
(
"该会员已绑定,appBind# 会员id ==> {} | 绑定的大屏账号id ==>> "
,
memberDTO
.
getId
(),
userIptvId
);
log
.
error
(
"该会员已绑定,appBind# 会员id ==> {} | 绑定的大屏账号id ==>>
{}
"
,
memberDTO
.
getId
(),
userIptvId
);
return
ResultInfo
.
failure
(
GlobeExceptionMsg
.
ALREADY_BIND
);
}
}
else
{
...
...
@@ -1356,11 +1332,11 @@ public class UserOperationServiceImpl implements UserOperationService {
if
(
StringUtils
.
isBlank
(
priorityMemberCode
))
{
priorityMemberCode
=
memberDTO
.
getCode
();
log
.
info
(
"大屏账号为绑定主账号,开始设置主会员 priorityMemberCode ==>> {}"
,
priorityMemberCode
);
UserTv
userTv
=
new
UserTv
();
userTv
.
setId
(
userTvDTO
.
getId
());
userTv
.
setPriorityMemberCode
(
priorityMemberCode
);
// 更新大屏账户
log
.
info
(
"设置主会员,appBind# userTv ==>> {}"
,
userTv
);
this
.
userTvService
.
doUpdatePriorityMemberCode
(
userTv
);
userTvDTO
.
setPriorityMemberCode
(
memberDTO
.
getCode
());
...
...
@@ -1387,12 +1363,12 @@ public class UserOperationServiceImpl implements UserOperationService {
member
.
setUserIptvId
(
userTvDTO
.
getId
());
member
.
setBindIptvTime
(
TimestampUtil
.
now
());
member
.
setBindIptvPlatformType
(
bindIptvPlatformType
);
log
.
info
(
"修改小屏会员对应的绑定关系,member ==>> {}"
,
member
);
log
.
info
(
"修改小屏会员对应的绑定关系,
appBind#
member ==>> {}"
,
member
);
// 修改会员信息
this
.
memberService
.
doUpdateMemberUserIptvIdAndBindIptvPlatformAndBindIptvTime
(
member
);
memberDTO
.
setPlatformAccount
(
platformAccount
);
log
.
info
(
"发送绑定消息至大屏,memberDTO ==>> {} || userTvDTO ==>> {}"
,
memberDTO
,
userTvDTO
);
log
.
info
(
"发送绑定消息至大屏,
appBind#
memberDTO ==>> {} || userTvDTO ==>> {}"
,
memberDTO
,
userTvDTO
);
// 同步至iptv
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
())
.
asyncMinaBind
(
new
MemberAndUserTvDTO
(
memberDTO
,
userTvDTO
));
...
...
@@ -1415,16 +1391,15 @@ public class UserOperationServiceImpl implements UserOperationService {
*/
@Override
public
UserTvDTO
bind
(
MemberDTO
resource
,
String
platformAccount
)
{
log
.
info
(
"bind start"
);
MemberDTO
memberDTO
=
this
.
memberService
.
findByCode
(
resource
.
getCode
());
log
.
info
(
"查询会员信息 ==>> {}"
,
memberDTO
);
log
.
info
(
"查询会员信息
,bind# memberDTO
==>> {}"
,
memberDTO
);
if
(
Objects
.
nonNull
(
memberDTO
.
getUserIptvId
()))
{
return
this
.
userTvService
.
findById
(
memberDTO
.
getUserIptvId
());
}
// 大屏账户
UserTvDTO
userTvDTO
=
this
.
userTvService
.
findByPlatformAccount
(
platformAccount
);
log
.
info
(
"查询大屏账号信息 ==>> {}"
,
userTvDTO
);
log
.
info
(
"查询大屏账号信息
,bind# userTvDTO
==>> {}"
,
userTvDTO
);
if
(
Objects
.
isNull
(
userTvDTO
))
{
throw
new
BadRequestException
(
GlobeExceptionMsg
.
IPTV_IS_NULL
);
}
...
...
@@ -1436,6 +1411,7 @@ public class UserOperationServiceImpl implements UserOperationService {
userTv
.
setId
(
userTvDTO
.
getId
());
userTv
.
setPriorityMemberCode
(
memberDTO
.
getCode
());
log
.
info
(
"修改大屏对应的主会员,bind# userTv ==>> {}"
,
userTv
);
this
.
userTvService
.
doUpdatePriorityMemberCode
(
userTv
);
userTvDTO
.
setPriorityMemberCode
(
memberDTO
.
getCode
());
...
...
@@ -1465,11 +1441,12 @@ public class UserOperationServiceImpl implements UserOperationService {
member
.
setPlatformAccount
(
platformAccount
);
// 修改会员
log
.
info
(
"修改会员对应的绑定关系,bind# member ==>> {}"
,
member
);
this
.
memberService
.
doUpdateMemberUserIptvIdAndBindIptvPlatformAndBindIptvTime
(
member
);
memberDTO
.
setPlatformAccount
(
platformAccount
);
log
.
info
(
"发送绑定消息至大屏侧,
会员信息 ==>> {} || 账号信息
==>> {}"
,
memberDTO
,
userTvDTO
);
log
.
info
(
"发送绑定消息至大屏侧,
bind# memberDTO ==>> {} || userTvDTO
==>> {}"
,
memberDTO
,
userTvDTO
);
// 同步至大屏侧
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncMinaBind
(
new
MemberAndUserTvDTO
(
memberDTO
,
userTvDTO
));
...
...
@@ -1502,7 +1479,6 @@ public class UserOperationServiceImpl implements UserOperationService {
return
this
.
memberService
.
findById
(
memberId
);
}
/**
*
* @param unionId 身份标识
...
...
@@ -1580,7 +1556,11 @@ public class UserOperationServiceImpl implements UserOperationService {
if
(
Objects
.
nonNull
(
memberDTO
.
getId
()))
{
MemberSimpleDTO
memberSimpleDTO
=
new
MemberSimpleDTO
();
BeanUtils
.
copyProperties
(
memberDTO
,
memberSimpleDTO
);
this
.
redisUtils
.
set
(
RedisKeyConstants
.
cacheMemberSimpleById
+
"::"
+
memberDTO
.
getId
(),
memberSimpleDTO
);
try
{
this
.
redisUtils
.
set
(
RedisKeyConstants
.
cacheMemberSimpleById
+
"::"
+
memberDTO
.
getId
(),
memberSimpleDTO
);
}
catch
(
Exception
e
)
{
log
.
error
(
"创建会员时,缓存会员信息异常, createMember# message ==>> {}"
,
e
.
getMessage
());
}
}
return
memberDTO
;
}
...
...
@@ -1601,7 +1581,7 @@ public class UserOperationServiceImpl implements UserOperationService {
map
.
put
(
"platformAccount"
,
resources
.
getPlatformAccount
());
map
.
put
(
"id"
,
resources
.
getId
());
boolean
redisResult
=
this
.
redisUtils
.
set
(
"uus::visUser::"
+
userTvDTO
.
getPlatformAccount
(),
map
);
log
.
info
(
"保存大屏账号redis结果 createTvUser# ==>> {}"
,
redisResult
);
log
.
info
(
"保存大屏账号redis结果 createTvUser#
redisResult
==>> {}"
,
redisResult
);
}
return
userTvDTO
;
}
...
...
@@ -1651,19 +1631,19 @@ public class UserOperationServiceImpl implements UserOperationService {
MemberDTO
memberDTO
=
this
.
memberService
.
findById
(
memberId
);
if
(
Objects
.
isNull
(
memberDTO
.
getId
()))
{
log
.
error
(
"小屏解绑
失败,会员信息不存在, minaUnbind#
==>> {}"
,
memberId
);
log
.
error
(
"小屏解绑
异常,minaUnbind# message ==>> 当前会员信息不存在 | memberId
==>> {}"
,
memberId
);
return
ResultInfo
.
failure
(
"小屏解绑失败,当前会员信息不存在"
);
}
if
(
Objects
.
isNull
(
memberDTO
.
getUserIptvId
()))
{
log
.
error
(
"小屏解绑
失败,无绑定的大屏,
memberId ==>> {}"
,
memberId
);
log
.
error
(
"小屏解绑
异常,minaUnbind# message ==>> 无绑定的大屏 |
memberId ==>> {}"
,
memberId
);
return
ResultInfo
.
failure
(
"小屏解绑失败,无绑定的大屏"
);
}
UserTvDTO
userTvDTO
=
this
.
userTvService
.
findById
(
memberDTO
.
getUserIptvId
());
if
(
Objects
.
isNull
(
userTvDTO
.
getPlatformAccount
()))
{
log
.
info
(
"小屏解绑
失败,绑定的大屏账号不存在 minaUnbind# ==>> userIptvId ==>> {}"
,
memberDTO
.
getUserIptv
Id
());
return
ResultInfo
.
failure
(
"小屏解绑失败,大屏信息不存在
请联系客服
"
);
log
.
info
(
"小屏解绑
异常,minaUnbind# message ==>> 当前会员绑定的大屏账号不存在 | memberId ==>> {}"
,
memberDTO
.
get
Id
());
return
ResultInfo
.
failure
(
"小屏解绑失败,大屏信息不存在"
);
}
// 解绑(置空大屏信息)
...
...
@@ -1673,19 +1653,17 @@ public class UserOperationServiceImpl implements UserOperationService {
member
.
setBindIptvTime
(
null
);
member
.
setUserIptvId
(
null
);
member
.
setBindIptvPlatformType
(
null
);
log
.
info
(
"置空会员绑定的大屏信息
,
member ==>> {}"
,
member
);
log
.
info
(
"置空会员绑定的大屏信息
,minaUnbind#
member ==>> {}"
,
member
);
this
.
memberService
.
doUpdateMemberUserIptvIdAndBindIptvPlatformAndBindIptvTime
(
member
);
log
.
info
(
"会员信息置空大屏的结果,memberDTO ==>> {}"
,
memberDTO
);
// 有其他绑定的小程序会员,排除自己
List
<
MemberDTO
>
memberDTOS
=
this
.
memberService
.
findByUserIptvId
(
userTvDTO
.
getId
());
log
.
info
(
"
后台指定一个默认主会员,通过大屏id查询到的绑定的小屏会员
memberDTOList ==>> {}"
,
memberDTOS
);
log
.
info
(
"
通过大屏id查询到的绑定的小屏会员,minaUnbind#
memberDTOList ==>> {}"
,
memberDTOS
);
if
(!
CollectionUtils
.
isEmpty
(
memberDTOS
))
{
String
oldMemberCode
=
memberDTO
.
getCode
();
List
<
MemberDTO
>
collect
=
memberDTOS
.
stream
().
filter
(
memberDTO_
->
!
memberDTO_
.
getCode
().
equalsIgnoreCase
(
oldMemberCode
)).
collect
(
Collectors
.
toList
());
log
.
info
(
"过滤掉当前会员 ==>> {}"
,
collect
);
if
(!
CollectionUtils
.
isEmpty
(
collect
))
{
...
...
@@ -1696,12 +1674,14 @@ public class UserOperationServiceImpl implements UserOperationService {
userTv
.
setId
(
userTvDTO
.
getId
());
userTv
.
setPlatform
(
userTvDTO
.
getPlatformAccount
());
userTv
.
setPriorityMemberCode
(
collect
.
get
(
0
).
getCode
());
log
.
info
(
"设置主会员,minaUnbind# userTv ==>> {}"
,
userTv
);
this
.
userTvService
.
doUpdatePriorityMemberCode
(
userTv
);
UserTvDTO
_userTvDTO
=
new
UserTvDTO
();
_userTvDTO
.
setPlatformAccount
(
userTvDTO
.
getPlatformAccount
());
_userTvDTO
.
setPriorityMemberCode
(
userTv
.
getPriorityMemberCode
());
log
.
info
(
"同步
绑定信息至大屏侧, 参数 ==>> {}
"
,
new
MemberAndUserTvDTO
(
memberDTO
,
_userTvDTO
));
log
.
info
(
"同步
信息至大屏侧,minaUnbind# MemberAndUserTvDTO ==>> {}
"
,
new
MemberAndUserTvDTO
(
memberDTO
,
_userTvDTO
));
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncUnbind
(
new
MemberAndUserTvDTO
(
memberDTO
,
_userTvDTO
));
UserTvSimpleDTO
userTvSimpleDTO
=
this
.
userTvService
.
findSimpleByPlatformAccount
(
userTvDTO
.
getPlatformAccount
());
...
...
@@ -1713,17 +1693,18 @@ public class UserOperationServiceImpl implements UserOperationService {
}
}
else
{
log
.
info
(
"无其他绑定的小屏会员信息 "
);
// 绑定新的主账号
UserTv
userTv
=
new
UserTv
();
userTv
.
setId
(
userTvDTO
.
getId
());
userTv
.
setPriorityMemberCode
(
null
);
log
.
info
(
"无其他绑定的小屏会员信息,置空主会员 minaUnbind# userTv ==>> {}"
,
userTv
);
this
.
userTvService
.
doUpdatePriorityMemberCode
(
userTv
);
UserTvDTO
_userTvDTO
=
new
UserTvDTO
();
_userTvDTO
.
setPlatformAccount
(
userTvDTO
.
getPlatformAccount
());
_userTvDTO
.
setPriorityMemberCode
(
null
);
log
.
info
(
"同步
绑定信息至大屏侧, 参数
==>> {}"
,
new
MemberAndUserTvDTO
(
memberDTO
,
_userTvDTO
));
log
.
info
(
"同步
信息至大屏侧,minaUnbind# MemberAndUserTvDTO
==>> {}"
,
new
MemberAndUserTvDTO
(
memberDTO
,
_userTvDTO
));
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncUnbind
(
new
MemberAndUserTvDTO
(
memberDTO
,
_userTvDTO
));
UserTvSimpleDTO
userTvSimpleDTO
=
this
.
userTvService
.
findSimpleByPlatformAccount
(
userTvDTO
.
getPlatformAccount
());
...
...
@@ -1778,10 +1759,6 @@ public class UserOperationServiceImpl implements UserOperationService {
@AsyncMqSend
public
void
asyncUpdateAppLastActiveTimeAndNicknameAndHeadImg
(
UserAppDTO
userAppDTO
)
{
}
@AsyncMqSend
public
void
asyncCancelUserAppBind
(
UserAppBindDTO
userAppBindDTO
)
{}
@AsyncMqSend
public
void
asyncUpdatePasswordByUsername
(
UserAppDTO
userAppDTO
)
{}
@AsyncMqSend
public
void
asyncUpdateAppInfo
(
UserAppDTO
userAppDTO
)
{}
@AsyncMqSend
public
void
asyncAppCancellation
(
UserAppDTO
userAppDTO
)
{}
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/member/MemberOperationServiceImpl.java
View file @
a5d2e0d
...
...
@@ -42,23 +42,11 @@ public class MemberOperationServiceImpl implements MemberOperationService {
@Autowired
private
MemberProfileService
memberProfileService
;
@Autowired
private
MemberVipHistoryService
memberVipHistoryService
;
@Autowired
private
MemberAddressService
memberAddressService
;
@AsyncMqSend
public
void
asyncUpdateMemberVipAndVipExpireTime
(
MemberDTO
memberDTO
)
{}
@AsyncMqSend
public
void
asyncCreateMemberVipHistory
(
MemberVipHistoryDTO
memberVipHistoryDTO
)
{}
@AsyncMqSend
public
void
asyncDoUpdateGroupsBatch
(
List
<
Member
>
resources
)
{}
@Autowired
private
MemberVipHistoryService
memberVipHistoryService
;
@AsyncMqSend
@Override
public
MemberDTO
update
(
Member
resources
)
{
return
this
.
memberService
.
update
(
resources
);
}
@Override
public
MemberDTO
findByCode
(
String
code
)
{
...
...
@@ -285,4 +273,18 @@ public class MemberOperationServiceImpl implements MemberOperationService {
private
MemberProfileDTO
findMemberProfileByMemberId
(
Long
memberId
)
{
return
this
.
memberProfileService
.
findByMemberId
(
memberId
);
}
@AsyncMqSend
public
void
asyncUpdateMemberVipAndVipExpireTime
(
MemberDTO
memberDTO
)
{}
@AsyncMqSend
public
void
asyncCreateMemberVipHistory
(
MemberVipHistoryDTO
memberVipHistoryDTO
)
{}
@AsyncMqSend
public
void
asyncDoUpdateGroupsBatch
(
List
<
Member
>
resources
)
{}
@AsyncMqSend
@Override
public
MemberDTO
update
(
Member
resources
)
{
return
this
.
memberService
.
update
(
resources
);
}
}
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/member/MemberOperationService.java
View file @
a5d2e0d
...
...
@@ -4,9 +4,7 @@ import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO;
import
com.topdraw.business.module.member.domain.Member
;
import
com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO
;
import
com.topdraw.business.module.member.service.dto.MemberDTO
;
import
com.topdraw.business.module.member.viphistory.domain.MemberVipHistory
;
import
com.topdraw.business.process.domian.member.MemberOperationBean
;
import
com.topdraw.business.process.domian.weixin.BuyVipBean
;
import
java.util.List
;
...
...
@@ -76,8 +74,17 @@ public interface MemberOperationService {
*/
MemberDTO
doUpdateVipByMemberCode
(
MemberOperationBean
resources
);
/**
*
* @param resources
* @return
*/
Integer
doUpdateGroupsBatch
(
List
<
Member
>
resources
);
/**
*
* @param memberId
* @return
*/
MemberAddressDTO
updateDefaultMemberAddressById
(
Long
memberId
);
}
...
...
member-service-impl/src/main/java/com/topdraw/util/AESUtil.java
View file @
a5d2e0d
package
com
.
topdraw
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
com.topdraw.base.modules.utils.MD5Util
;
import
lombok.extern.slf4j.Slf4j
;
import
org.bouncycastle.jce.provider.BouncyCastleProvider
;
...
...
@@ -17,6 +18,16 @@ import java.util.Arrays;
@Slf4j
public
class
AESUtil
{
public
static
String
decodePassword
(
String
password
)
{
String
decrypt
=
AESUtil
.
decrypt
(
password
,
"f8681b9ce7c8fb6b"
);
String
substring
=
decrypt
.
substring
(
16
);
String
s
=
MD5Util
.
encodePassword
(
substring
);
log
.
info
(
"加密前的密码:==>> {} || 解密后的密码:==>> {} | md5之后的密码: ==>> {}"
,
decrypt
,
substring
,
s
);
return
s
;
}
public
static
String
encrypt
(
String
data
,
String
key
)
{
String
strResult
=
null
;
try
{
...
...
Please
register
or
sign in
to post a comment