Commit c2cb5d73 c2cb5d738328f4a624e2c51c28958f29fc401976 by xianghan

1.优惠

1 parent 837abe1b
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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();
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
package com.topdraw.business.process.service;
public interface UserOperationService {
}
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);
}
}