Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张云鹏
/
uc-consumer
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
c2cb5d73
...
c2cb5d738328f4a624e2c51c28958f29fc401976
authored
2022-03-22 22:48:04 +0800
by
xianghan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.优惠
1 parent
837abe1b
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
87 additions
and
9 deletions
src/main/java/com/topdraw/business/module/member/address/domain/MemberAddress.java
src/main/java/com/topdraw/business/module/member/domain/Member.java
src/main/java/com/topdraw/business/module/member/profile/domain/MemberProfile.java
src/main/java/com/topdraw/business/module/member/relatedinfo/domain/MemberRelatedInfo.java
src/main/java/com/topdraw/business/module/member/service/impl/MemberServiceImpl.java
src/main/java/com/topdraw/business/module/member/viphistory/domain/MemberVipHistory.java
src/main/java/com/topdraw/business/module/user/iptv/domain/UserTv.java
src/main/java/com/topdraw/business/module/user/weixin/domain/UserWeixin.java
src/main/java/com/topdraw/business/process/service/UserOperationService.java
src/main/java/com/topdraw/business/process/service/impl/UserOperationServiceImpl.java
src/main/java/com/topdraw/business/module/member/address/domain/MemberAddress.java
View file @
c2cb5d7
...
...
@@ -26,7 +26,7 @@ public class MemberAddress extends AsyncMqModule implements Serializable {
/** 主键 */
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
SEQUENCE
)
@Column
(
name
=
"id"
)
private
Long
id
;
...
...
src/main/java/com/topdraw/business/module/member/domain/Member.java
View file @
c2cb5d7
...
...
@@ -35,7 +35,7 @@ public class Member implements Serializable {
/** 主键 */
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
SEQUENCE
)
@Column
(
name
=
"id"
)
@NotNull
(
message
=
"id can't be null!!"
,
groups
=
{
UpdateGroup
.
class
})
private
Long
id
;
...
...
src/main/java/com/topdraw/business/module/member/profile/domain/MemberProfile.java
View file @
c2cb5d7
...
...
@@ -37,7 +37,7 @@ public class MemberProfile implements Serializable {
/** 主键 */
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
SEQUENCE
)
@Column
(
name
=
"id"
)
@NotNull
(
message
=
"id not be null!!"
,
groups
=
UpdateGroup
.
class
)
private
Long
id
;
...
...
src/main/java/com/topdraw/business/module/member/relatedinfo/domain/MemberRelatedInfo.java
View file @
c2cb5d7
...
...
@@ -29,7 +29,7 @@ public class MemberRelatedInfo extends AsyncMqModule implements Serializable {
/** ID */
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
SEQUENCE
)
@Column
(
name
=
"id"
)
@NotNull
(
message
=
"id can't be null"
,
groups
=
{
UpdateGroup
.
class
})
private
Long
id
;
...
...
src/main/java/com/topdraw/business/module/member/service/impl/MemberServiceImpl.java
View file @
c2cb5d7
...
...
@@ -11,7 +11,6 @@ import com.topdraw.business.module.member.service.dto.MemberDTO;
import
com.topdraw.business.module.member.service.mapper.MemberMapper
;
import
com.topdraw.exception.BadRequestException
;
import
com.topdraw.exception.GlobeExceptionMsg
;
import
com.topdraw.utils.RedisUtils
;
import
com.topdraw.utils.ValidationUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -146,7 +145,6 @@ public class MemberServiceImpl implements MemberService {
}
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
Long
save
(
Member
member
){
this
.
memberRepository
.
save
(
member
);
return
member
.
getId
();
...
...
src/main/java/com/topdraw/business/module/member/viphistory/domain/MemberVipHistory.java
View file @
c2cb5d7
...
...
@@ -27,7 +27,7 @@ public class MemberVipHistory extends AsyncMqModule implements Serializable {
// 主键
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
SEQUENCE
)
@Column
(
name
=
"id"
)
private
Long
id
;
...
...
src/main/java/com/topdraw/business/module/user/iptv/domain/UserTv.java
View file @
c2cb5d7
...
...
@@ -37,7 +37,7 @@ public class UserTv extends AsyncMqModule implements Serializable {
/** ID */
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
SEQUENCE
)
@Column
(
name
=
"id"
)
private
Long
id
;
...
...
src/main/java/com/topdraw/business/module/user/weixin/domain/UserWeixin.java
View file @
c2cb5d7
...
...
@@ -29,7 +29,7 @@ public class UserWeixin extends AsyncMqModule implements Serializable {
/** ID */
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@GeneratedValue
(
strategy
=
GenerationType
.
SEQUENCE
)
@Column
(
name
=
"id"
)
private
Long
id
;
...
...
src/main/java/com/topdraw/business/process/service/UserOperationService.java
0 → 100644
View file @
c2cb5d7
package
com
.
topdraw
.
business
.
process
.
service
;
public
interface
UserOperationService
{
}
src/main/java/com/topdraw/business/process/service/impl/UserOperationServiceImpl.java
0 → 100644
View file @
c2cb5d7
package
com
.
topdraw
.
business
.
process
.
service
.
impl
;
import
com.topdraw.business.module.member.domain.Member
;
import
com.topdraw.business.module.member.service.MemberService
;
import
com.topdraw.business.module.member.service.dto.MemberDTO
;
import
com.topdraw.business.module.user.iptv.domain.UserTv
;
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.UserWeixinService
;
import
com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO
;
import
com.topdraw.business.process.service.UserOperationService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
@Service
@Slf4j
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
public
class
UserOperationServiceImpl
implements
UserOperationService
{
@Autowired
private
MemberService
memberService
;
@Autowired
private
UserTvService
userTvService
;
@Autowired
private
UserWeixinService
userWeixinService
;
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
public
void
asyncWeixinMemberAndUserWeixin4Iptv
(
MemberDTO
memberDTO
,
UserWeixinDTO
weixinDTO
)
{
this
.
saveMember
(
memberDTO
);
this
.
saveWeixin
(
weixinDTO
);
}
private
void
saveMember
(
MemberDTO
memberDTO
){
Member
member
=
new
Member
();
BeanUtils
.
copyProperties
(
memberDTO
,
member
);
this
.
memberService
.
create
(
member
);
}
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
public
void
asyncMemberAndUserTv4Iptv
(
MemberDTO
memberDTO
,
UserTvDTO
userTvDTO
)
{
this
.
saveMember
(
memberDTO
);
this
.
saveUserTv
(
userTvDTO
);
}
public
void
asyncWeixin
(
UserWeixinDTO
weixinDTO
)
{
this
.
saveWeixin
(
weixinDTO
);
}
private
void
saveWeixin
(
UserWeixinDTO
weixinDTO
){
UserWeixin
userWeixin
=
new
UserWeixin
();
BeanUtils
.
copyProperties
(
weixinDTO
,
userWeixin
);
this
.
userWeixinService
.
create
(
userWeixin
);
}
public
void
asyncUserTv
(
UserTvDTO
userTvDTO
)
{
this
.
saveUserTv
(
userTvDTO
);
}
private
void
saveUserTv
(
UserTvDTO
userTvDTO
){
UserTv
userTv
=
new
UserTv
();
BeanUtils
.
copyProperties
(
userTvDTO
,
userTv
);
this
.
userTvService
.
create
(
userTv
);
}
public
void
asyncMember
(
MemberDTO
memberDTO
)
{
this
.
saveMember
(
memberDTO
);
}
}
Please
register
or
sign in
to post a comment