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
0bfe235d
...
0bfe235d29f87569287265c6dc6c7d478896d7ae
authored
2022-05-19 18:32:39 +0800
by
xianghan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.优化
1 parent
9ce6111e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
4 deletions
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/rest/UserOperationController.java
View file @
0bfe235
...
...
@@ -360,6 +360,16 @@ public class UserOperationController {
/******************************************************* IPTV ************************************/
@PostMapping
(
value
=
"/updateUserTv"
)
@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
);
}
@PostMapping
(
value
=
"/createTvUserAndMember"
)
@ApiOperation
(
"保存大屏账户同时创建会员信息"
)
@AnonymousAccess
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/UserOperationService.java
View file @
0bfe235
...
...
@@ -159,4 +159,11 @@ public interface UserOperationService {
* @param resources
*/
UserWeixinDTO
updateWeixin
(
UserWeixin
resources
);
/**
*
* @param resources
* @return
*/
UserTvDTO
updateUserTv
(
UserTv
resources
);
}
...
...
member-service-impl/src/main/java/com/topdraw/business/process/service/impl/UserOperationServiceImpl.java
View file @
0bfe235
...
...
@@ -36,6 +36,7 @@ import com.topdraw.config.RedisKeyUtil;
import
com.topdraw.exception.BadRequestException
;
import
com.topdraw.exception.EntityNotFoundException
;
import
com.topdraw.exception.GlobeExceptionMsg
;
import
com.topdraw.util.Base64Util
;
import
com.topdraw.util.TimestampUtil
;
import
com.topdraw.utils.QueryHelp
;
import
com.topdraw.utils.RedisUtils
;
...
...
@@ -51,6 +52,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
org.springframework.util.Base64Utils
;
import
org.springframework.util.CollectionUtils
;
import
java.util.*
;
...
...
@@ -120,17 +122,25 @@ public class UserOperationServiceImpl implements UserOperationService {
@Override
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
public
UserTvDTO
createTvUserAndMember
(
UserTv
resources
)
{
boolean
flag
=
false
;
// 大屏账户
String
platformAccount
=
resources
.
getPlatformAccount
();
UserTvDTO
userTvDTO
=
this
.
userTvService
.
findByPlatformAccount
(
platformAccount
);
// 无账号
if
(
Objects
.
isNull
(
userTvDTO
))
{
String
platformAccountEncode
=
platformAccount
;
if
(
flag
)
{
platformAccountEncode
=
Base64Utils
.
encodeToString
(
platformAccount
.
getBytes
());
}
// x_member
Member
member
=
MemberBuilder
.
build
(
LocalConstants
.
MEMBER_PLATFORM_TYPE_VIS
,
null
,
platformAccount
,
0
);
null
,
platformAccount
Encode
,
0
);
MemberDTO
memberDTO
=
this
.
createMember
(
member
);
if
(
Objects
.
nonNull
(
memberDTO
))
{
...
...
@@ -147,10 +157,37 @@ public class UserOperationServiceImpl implements UserOperationService {
throw
new
EntityNotFoundException
(
MemberDTO
.
class
,
"code"
,
GlobeExceptionMsg
.
MEMBER_ID_IS_NULL
);
// 有账号
}
else
{
Long
memberId
=
userTvDTO
.
getMemberId
();
// 有会员
if
(
Objects
.
nonNull
(
memberId
))
{
return
userTvDTO
;
}
throw
new
BadRequestException
(
GlobeExceptionMsg
.
ENTITY_ALREADY_EXISTS
);
// 无会员
Member
member
=
MemberBuilder
.
build
(
LocalConstants
.
MEMBER_PLATFORM_TYPE_VIS
,
null
,
platformAccount
,
0
);
MemberDTO
memberDTO
=
this
.
createMember
(
member
);
if
(
Objects
.
nonNull
(
memberDTO
))
{
userTvDTO
.
setMemberId
(
memberDTO
.
getId
());
userTvDTO
.
setMemberCode
(
memberDTO
.
getCode
());
UserTv
userTv
=
new
UserTv
();
BeanUtils
.
copyProperties
(
userTvDTO
,
userTv
);
UserTvDTO
userTvDTO1
=
this
.
updateUserTvUnsyncIptv
(
userTv
);
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncMemberAndUserTv4Iptv
(
new
MemberAndUserTvDTO
(
memberDTO
,
userTvDTO1
));
return
userTvDTO1
;
}
}
throw
new
BadRequestException
(
GlobeExceptionMsg
.
ENTITY_ALREADY_EXISTS
);
}
...
...
@@ -998,7 +1035,7 @@ public class UserOperationServiceImpl implements UserOperationService {
UserTv
userTv
=
new
UserTv
();
BeanUtils
.
copyProperties
(
userTvDTO
,
userTv
);
UserTvDTO
_userTvDTO
=
this
.
updateUserTv
(
userTv
);
UserTvDTO
_userTvDTO
=
this
.
updateUserTv
UnsyncIptv
(
userTv
);
return
_userTvDTO
;
}
...
...
@@ -1008,7 +1045,7 @@ public class UserOperationServiceImpl implements UserOperationService {
* @param userTv
* @return
*/
private
UserTvDTO
updateUserTv
(
UserTv
userTv
){
private
UserTvDTO
updateUserTv
UnsyncIptv
(
UserTv
userTv
){
return
this
.
userTvService
.
update
(
userTv
);
}
...
...
@@ -1303,4 +1340,17 @@ public class UserOperationServiceImpl implements UserOperationService {
return
userWeixinDTO
;
}
@Override
public
UserTvDTO
updateUserTv
(
UserTv
resources
)
{
UserTvDTO
userTvDTO
=
this
.
userTvService
.
update
(
resources
);
Long
memberId
=
userTvDTO
.
getMemberId
();
if
(
Objects
.
nonNull
(
memberId
))
{
MemberDTO
memberDTO
=
this
.
memberService
.
findById
(
memberId
);
resources
.
setMemberCode
(
memberDTO
.
getCode
());
}
// 同步至iptv
((
UserOperationServiceImpl
)
AopContext
.
currentProxy
()).
asyncUserTv
(
userTvDTO
);
return
userTvDTO
;
}
}
...
...
Please
register
or
sign in
to post a comment