1.优化
Showing
27 changed files
with
197 additions
and
239 deletions
| 1 | package com.topdraw.business.module.common.domain; | 1 | package com.topdraw.business.module.common.domain; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.module.common.validated.CreateGroup; | ||
| 4 | import com.topdraw.business.module.common.validated.UpdateGroup; | 3 | import com.topdraw.business.module.common.validated.UpdateGroup; |
| 5 | import lombok.Data; | 4 | import lombok.Data; |
| 6 | import lombok.experimental.Accessors; | 5 | import lombok.experimental.Accessors; | ... | ... |
| ... | @@ -4,10 +4,10 @@ import com.topdraw.annotation.AnonymousAccess; | ... | @@ -4,10 +4,10 @@ import com.topdraw.annotation.AnonymousAccess; |
| 4 | import com.topdraw.aop.log.Log; | 4 | import com.topdraw.aop.log.Log; |
| 5 | import com.topdraw.business.module.common.validated.CreateGroup; | 5 | import com.topdraw.business.module.common.validated.CreateGroup; |
| 6 | import com.topdraw.business.module.common.validated.UpdateGroup; | 6 | import com.topdraw.business.module.common.validated.UpdateGroup; |
| 7 | import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; | ||
| 7 | import com.topdraw.business.process.service.member.MemberAddressOperationService; | 8 | import com.topdraw.business.process.service.member.MemberAddressOperationService; |
| 8 | import com.topdraw.common.ResultInfo; | 9 | import com.topdraw.common.ResultInfo; |
| 9 | import com.topdraw.business.module.member.address.domain.MemberAddress; | 10 | import com.topdraw.business.module.member.address.domain.MemberAddress; |
| 10 | import com.topdraw.business.module.member.address.service.MemberAddressService; | ||
| 11 | import lombok.extern.slf4j.Slf4j; | 11 | import lombok.extern.slf4j.Slf4j; |
| 12 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | import org.springframework.validation.annotation.Validated; | 13 | import org.springframework.validation.annotation.Validated; |
| ... | @@ -20,7 +20,7 @@ import io.swagger.annotations.*; | ... | @@ -20,7 +20,7 @@ import io.swagger.annotations.*; |
| 20 | */ | 20 | */ |
| 21 | @Api(tags = "会员地址管理") | 21 | @Api(tags = "会员地址管理") |
| 22 | @RestController | 22 | @RestController |
| 23 | @RequestMapping("/ucEngine/api/memberAddress") | 23 | @RequestMapping("/ucEngine/memberAddress") |
| 24 | @CrossOrigin | 24 | @CrossOrigin |
| 25 | @Slf4j | 25 | @Slf4j |
| 26 | public class MemberAddressController { | 26 | public class MemberAddressController { |
| ... | @@ -34,9 +34,9 @@ public class MemberAddressController { | ... | @@ -34,9 +34,9 @@ public class MemberAddressController { |
| 34 | @AnonymousAccess | 34 | @AnonymousAccess |
| 35 | public ResultInfo create(@Validated(value = {CreateGroup.class}) @RequestBody MemberAddress resources) { | 35 | public ResultInfo create(@Validated(value = {CreateGroup.class}) @RequestBody MemberAddress resources) { |
| 36 | log.info("memberAddress ==>> create ==> param ==>> [{}]",resources); | 36 | log.info("memberAddress ==>> create ==> param ==>> [{}]",resources); |
| 37 | this.memberAddressOperationService.create(resources); | 37 | MemberAddressDTO memberAddressDTO = this.memberAddressOperationService.create(resources); |
| 38 | log.info("memberAddress ==>> create ==> result ==>> [{}]",resources); | 38 | log.info("memberAddress ==>> create ==> result ==>> [{}]",resources); |
| 39 | return ResultInfo.success(); | 39 | return ResultInfo.success(memberAddressDTO); |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | @Log("修改会员地址") | 42 | @Log("修改会员地址") |
| ... | @@ -45,9 +45,9 @@ public class MemberAddressController { | ... | @@ -45,9 +45,9 @@ public class MemberAddressController { |
| 45 | @AnonymousAccess | 45 | @AnonymousAccess |
| 46 | public ResultInfo update(@Validated(value = {UpdateGroup.class}) @RequestBody MemberAddress resources) { | 46 | public ResultInfo update(@Validated(value = {UpdateGroup.class}) @RequestBody MemberAddress resources) { |
| 47 | log.info("memberAddress ==>> update ==> param ==>> [{}]",resources); | 47 | log.info("memberAddress ==>> update ==> param ==>> [{}]",resources); |
| 48 | this.memberAddressOperationService.update(resources); | 48 | MemberAddressDTO memberAddressDTO = this.memberAddressOperationService.update(resources); |
| 49 | log.info("memberAddress ==>> update ==> result ==>> [{}]",resources); | 49 | log.info("memberAddress ==>> update ==> result ==>> [{}]",resources); |
| 50 | return ResultInfo.success(); | 50 | return ResultInfo.success(memberAddressDTO); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | @Log("删除会员地址") | 53 | @Log("删除会员地址") | ... | ... |
| ... | @@ -27,79 +27,80 @@ import java.io.Serializable; | ... | @@ -27,79 +27,80 @@ import java.io.Serializable; |
| 27 | @Table(name="uc_member_profile") | 27 | @Table(name="uc_member_profile") |
| 28 | public class MemberProfile implements Serializable { | 28 | public class MemberProfile implements Serializable { |
| 29 | 29 | ||
| 30 | /** 会员code */ | ||
| 30 | @Transient | 31 | @Transient |
| 31 | @NotNull(message = "memberCode not be null!!" , groups = {CreateGroup.class,UpdateGroup.class}) | 32 | @NotNull(message = "memberCode not be null!!" , groups = {CreateGroup.class,UpdateGroup.class}) |
| 32 | private String memberCode; | 33 | private String memberCode; |
| 33 | 34 | ||
| 34 | // 主键 | 35 | /** 头像 */ |
| 36 | @Transient | ||
| 37 | private String avatarUrl; | ||
| 38 | |||
| 39 | /** 主键 */ | ||
| 35 | @Id | 40 | @Id |
| 36 | @GeneratedValue(strategy = GenerationType.IDENTITY) | 41 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 37 | @Column(name = "id") | 42 | @Column(name = "id") |
| 38 | @NotNull(message = "id not be null!!" , groups = UpdateGroup.class) | 43 | @NotNull(message = "id not be null!!" , groups = UpdateGroup.class) |
| 39 | private Long id; | 44 | private Long id; |
| 40 | 45 | ||
| 41 | // 会员id | 46 | /** 会员id */ |
| 42 | @Column(name = "member_id", nullable = false) | 47 | @Column(name = "member_id", nullable = false) |
| 43 | private Long memberId; | 48 | private Long memberId; |
| 44 | 49 | ||
| 45 | // 姓名 | 50 | /** 姓名 */ |
| 46 | @Column(name = "realname") | 51 | @Column(name = "realname") |
| 47 | private String realname; | 52 | private String realname; |
| 48 | 53 | ||
| 49 | // 性别 0:女; 1:男 -1:未知 | 54 | /** 性别 0:女; 1:男 -1:未知 */ |
| 50 | @Column(name = "gender", nullable = false) | 55 | @Column(name = "gender", nullable = false) |
| 51 | private Integer gender; | 56 | private Integer gender; |
| 52 | 57 | ||
| 53 | // 生日 | 58 | /** 生日 */ |
| 54 | @Column(name = "birthday", nullable = false) | 59 | @Column(name = "birthday", nullable = false) |
| 55 | private String birthday; | 60 | private String birthday; |
| 56 | 61 | ||
| 57 | // 手机号 | 62 | /** 手机号 */ |
| 58 | @Column(name = "phone") | 63 | @Column(name = "phone") |
| 59 | private String phone; | 64 | private String phone; |
| 60 | 65 | ||
| 61 | // 星座 | 66 | /** 星座 */ |
| 62 | @Column(name = "constellation") | 67 | @Column(name = "constellation") |
| 63 | private String constellation; | 68 | private String constellation; |
| 64 | 69 | ||
| 65 | // 身份证 | 70 | /** 身份证 */ |
| 66 | @Column(name = "id_card", nullable = false) | 71 | @Column(name = "id_card", nullable = false) |
| 67 | private String idCard; | 72 | private String idCard; |
| 68 | 73 | ||
| 69 | // 电子邮件 | 74 | /** 电子邮件 */ |
| 70 | @Column(name = "email") | 75 | @Column(name = "email") |
| 71 | private String email; | 76 | private String email; |
| 72 | 77 | ||
| 73 | // 国家 | 78 | /** 国家 */ |
| 74 | @Column(name = "country") | 79 | @Column(name = "country") |
| 75 | private String country; | 80 | private String country; |
| 76 | 81 | ||
| 77 | // 省份 | 82 | /** 省份 */ |
| 78 | @Column(name = "province") | 83 | @Column(name = "province") |
| 79 | private String province; | 84 | private String province; |
| 80 | 85 | ||
| 81 | // 城市 | 86 | /** 城市 */ |
| 82 | @Column(name = "city") | 87 | @Column(name = "city") |
| 83 | private String city; | 88 | private String city; |
| 84 | 89 | ||
| 85 | // 区县 | 90 | /** 区县 */ |
| 86 | @Column(name = "district") | 91 | @Column(name = "district") |
| 87 | private String district; | 92 | private String district; |
| 88 | 93 | ||
| 89 | //头像 | 94 | /** 描述 */ |
| 90 | @Transient | ||
| 91 | private String avatarUrl; | ||
| 92 | |||
| 93 | // 描述 | ||
| 94 | @Column(name = "description") | 95 | @Column(name = "description") |
| 95 | private String description; | 96 | private String description; |
| 96 | 97 | ||
| 97 | // 创建时间 | 98 | /** 创建时间 */ |
| 98 | @CreatedDate | 99 | @CreatedDate |
| 99 | @Column(name = "create_time") | 100 | @Column(name = "create_time") |
| 100 | private Timestamp createTime; | 101 | private Timestamp createTime; |
| 101 | 102 | ||
| 102 | // 更新时间 | 103 | /** 更新时间 */ |
| 103 | @LastModifiedDate | 104 | @LastModifiedDate |
| 104 | @Column(name = "update_time") | 105 | @Column(name = "update_time") |
| 105 | private Timestamp updateTime; | 106 | private Timestamp updateTime; | ... | ... |
| ... | @@ -3,6 +3,7 @@ package com.topdraw.business.module.member.profile.rest; | ... | @@ -3,6 +3,7 @@ package com.topdraw.business.module.member.profile.rest; |
| 3 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.annotation.AnonymousAccess; |
| 4 | import com.topdraw.aop.log.Log; | 4 | import com.topdraw.aop.log.Log; |
| 5 | import com.topdraw.business.module.common.validated.UpdateGroup; | 5 | import com.topdraw.business.module.common.validated.UpdateGroup; |
| 6 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; | ||
| 6 | import com.topdraw.business.process.service.member.MemberProfileOperationService; | 7 | import com.topdraw.business.process.service.member.MemberProfileOperationService; |
| 7 | import com.topdraw.common.ResultInfo; | 8 | import com.topdraw.common.ResultInfo; |
| 8 | import com.topdraw.business.module.member.profile.domain.MemberProfile; | 9 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
| ... | @@ -19,7 +20,8 @@ import io.swagger.annotations.*; | ... | @@ -19,7 +20,8 @@ import io.swagger.annotations.*; |
| 19 | */ | 20 | */ |
| 20 | @Api(tags = "会员属性管理") | 21 | @Api(tags = "会员属性管理") |
| 21 | @RestController | 22 | @RestController |
| 22 | @RequestMapping("/ucEngine/api/memberProfile") | 23 | //@RequestMapping("/ucEngine/api/memberProfile") |
| 24 | @RequestMapping("/ucEngine/memberProfile") | ||
| 23 | @CrossOrigin | 25 | @CrossOrigin |
| 24 | @Slf4j | 26 | @Slf4j |
| 25 | public class MemberProfileController { | 27 | public class MemberProfileController { |
| ... | @@ -35,10 +37,10 @@ public class MemberProfileController { | ... | @@ -35,10 +37,10 @@ public class MemberProfileController { |
| 35 | public ResultInfo update(@Validated(value = {UpdateGroup.class}) @RequestBody MemberProfile resources) { | 37 | public ResultInfo update(@Validated(value = {UpdateGroup.class}) @RequestBody MemberProfile resources) { |
| 36 | 38 | ||
| 37 | log.info("memberProfile ==>> update ==>> resources ===>> [{}]",resources); | 39 | log.info("memberProfile ==>> update ==>> resources ===>> [{}]",resources); |
| 38 | this.memberProfileOperationService.update(resources); | 40 | MemberProfileDTO memberProfileDTO = this.memberProfileOperationService.update(resources); |
| 39 | log.info("memberProfile ==>> update ==>> result ===>> [{}]",resources); | 41 | log.info("memberProfile ==>> update ==>> result ===>> [{}]",memberProfileDTO); |
| 40 | 42 | ||
| 41 | return ResultInfo.success(); | 43 | return ResultInfo.success(memberProfileDTO); |
| 42 | } | 44 | } |
| 43 | 45 | ||
| 44 | @PutMapping | 46 | @PutMapping |
| ... | @@ -46,7 +48,7 @@ public class MemberProfileController { | ... | @@ -46,7 +48,7 @@ public class MemberProfileController { |
| 46 | @AnonymousAccess | 48 | @AnonymousAccess |
| 47 | public ResultInfo updateMemberProfileAndMember(@Validated @RequestBody MemberProfile resources) { | 49 | public ResultInfo updateMemberProfileAndMember(@Validated @RequestBody MemberProfile resources) { |
| 48 | log.info("MemberProfileServiceImpl ==>> update ==>> resources ===>> [{}]",resources); | 50 | log.info("MemberProfileServiceImpl ==>> update ==>> resources ===>> [{}]",resources); |
| 49 | this.memberProfileOperationService.updateMemberProfileAndMember(resources); | 51 | MemberProfileDTO memberProfileDTO = this.memberProfileOperationService.updateMemberProfileAndMember(resources); |
| 50 | return ResultInfo.success(); | 52 | return ResultInfo.success(memberProfileDTO); |
| 51 | } | 53 | } |
| 52 | } | 54 | } | ... | ... |
| ... | @@ -3,11 +3,7 @@ package com.topdraw.business.module.member.profile.service; | ... | @@ -3,11 +3,7 @@ package com.topdraw.business.module.member.profile.service; |
| 3 | import com.topdraw.business.module.member.domain.Member; | 3 | import com.topdraw.business.module.member.domain.Member; |
| 4 | import com.topdraw.business.module.member.profile.domain.MemberProfile; | 4 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
| 5 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; | 5 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; |
| 6 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileQueryCriteria; | ||
| 7 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 6 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 8 | import org.springframework.data.domain.Pageable; | ||
| 9 | import java.util.Map; | ||
| 10 | import java.util.List; | ||
| 11 | 7 | ||
| 12 | /** | 8 | /** |
| 13 | * @author XiangHan | 9 | * @author XiangHan |
| ... | @@ -80,5 +76,5 @@ public interface MemberProfileService { | ... | @@ -80,5 +76,5 @@ public interface MemberProfileService { |
| 80 | * 修改会员属性并同步会员信息 | 76 | * 修改会员属性并同步会员信息 |
| 81 | * @param resources | 77 | * @param resources |
| 82 | */ | 78 | */ |
| 83 | void updateMemberProfileAndMember(MemberProfile resources, MemberDTO memberDTO); | 79 | MemberProfileDTO updateMemberProfileAndMember(MemberProfile resources, MemberDTO memberDTO); |
| 84 | } | 80 | } | ... | ... |
| ... | @@ -12,60 +12,61 @@ import java.io.Serializable; | ... | @@ -12,60 +12,61 @@ import java.io.Serializable; |
| 12 | @Data | 12 | @Data |
| 13 | public class MemberProfileDTO implements Serializable { | 13 | public class MemberProfileDTO implements Serializable { |
| 14 | 14 | ||
| 15 | // 主键 | 15 | /** 主键 */ |
| 16 | private Long id; | 16 | private Long id; |
| 17 | 17 | ||
| 18 | // 会员id | 18 | /** 会员id */ |
| 19 | private Long memberId; | 19 | private Long memberId; |
| 20 | 20 | ||
| 21 | // 姓名 | 21 | /** 姓名 */ |
| 22 | private String realname; | 22 | private String realname; |
| 23 | 23 | ||
| 24 | private String nickname; | 24 | /** 性别 0:女; 1:男 -1:未知 */ |
| 25 | |||
| 26 | // 性别 0:女; 1:男 -1:未知 | ||
| 27 | private Integer gender; | 25 | private Integer gender; |
| 28 | 26 | ||
| 29 | // 生日 | 27 | /** 生日 */ |
| 30 | private String birthday; | 28 | private String birthday; |
| 31 | 29 | ||
| 32 | // vip | 30 | /** 电话 */ |
| 33 | private Integer vip; | 31 | private String phone; |
| 34 | 32 | ||
| 35 | // 星座 | 33 | /** 星座 */ |
| 36 | private String constellation; | 34 | private String constellation; |
| 37 | 35 | ||
| 38 | private Long vipExpireTime; | 36 | /** 身份证 */ |
| 39 | |||
| 40 | private String phone; | ||
| 41 | |||
| 42 | // 身份证 | ||
| 43 | private String idCard; | 37 | private String idCard; |
| 44 | 38 | ||
| 45 | // 电子邮件 | 39 | /** 电子邮件 */ |
| 46 | private String email; | 40 | private String email; |
| 47 | 41 | ||
| 48 | // 国家 | 42 | /** 国家 */ |
| 49 | private String country; | 43 | private String country; |
| 50 | 44 | ||
| 51 | // 省份 | 45 | /** 省份 */ |
| 52 | private String province; | 46 | private String province; |
| 53 | 47 | ||
| 54 | // 城市 | 48 | /** 城市 */ |
| 55 | private String city; | 49 | private String city; |
| 56 | 50 | ||
| 57 | // 头像 | 51 | /** 区县 */ |
| 58 | private String avatarUrl; | ||
| 59 | |||
| 60 | // 区县 | ||
| 61 | private String district; | 52 | private String district; |
| 62 | 53 | ||
| 63 | // 描述 | 54 | /** 描述 */ |
| 64 | private String description; | 55 | private String description; |
| 65 | 56 | ||
| 66 | // 创建时间 | 57 | /** 创建时间 */ |
| 67 | private Timestamp createTime; | 58 | private Timestamp createTime; |
| 68 | 59 | ||
| 69 | // 更新时间 | 60 | /** 更新时间 */ |
| 70 | private Timestamp updateTime; | 61 | private Timestamp updateTime; |
| 62 | |||
| 63 | |||
| 64 | /** vip */ | ||
| 65 | private Integer vip; | ||
| 66 | |||
| 67 | /** vip过期时间 */ | ||
| 68 | private Long vipExpireTime; | ||
| 69 | |||
| 70 | /** 头像 */ | ||
| 71 | private String avatarUrl; | ||
| 71 | } | 72 | } | ... | ... |
| 1 | package com.topdraw.business.module.member.profile.service.impl; | 1 | package com.topdraw.business.module.member.profile.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.aspect.AsyncMqSend; | ||
| 3 | import com.topdraw.business.module.member.domain.Member; | 4 | import com.topdraw.business.module.member.domain.Member; |
| 4 | import com.topdraw.business.module.member.profile.domain.MemberProfile; | 5 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
| 5 | import com.topdraw.business.module.member.profile.domain.MemberProfileBuilder; | 6 | import com.topdraw.business.module.member.profile.domain.MemberProfileBuilder; |
| ... | @@ -149,11 +150,12 @@ public class MemberProfileServiceImpl implements MemberProfileService { | ... | @@ -149,11 +150,12 @@ public class MemberProfileServiceImpl implements MemberProfileService { |
| 149 | 150 | ||
| 150 | @Override | 151 | @Override |
| 151 | @Transactional(rollbackFor = Exception.class) | 152 | @Transactional(rollbackFor = Exception.class) |
| 152 | public void updateMemberProfileAndMember(MemberProfile resources, MemberDTO memberDTO) { | 153 | public MemberProfileDTO updateMemberProfileAndMember(MemberProfile resources, MemberDTO memberDTO) { |
| 153 | log.info("MemberProfileServiceImpl ==>> updateMemberProfileAndMember ==>> resources ===>> [{}]",resources); | 154 | log.info("MemberProfileServiceImpl ==>> updateMemberProfileAndMember ==>> resources ===>> [{}]",resources); |
| 154 | this.update(resources); | 155 | MemberProfileDTO memberProfileDTO = this.update(resources); |
| 155 | // 同步会员信息 | 156 | // 同步会员信息 |
| 156 | this.synchronizedMemberData(resources, memberDTO); | 157 | this.synchronizedMemberData(resources, memberDTO); |
| 158 | return memberProfileDTO; | ||
| 157 | } | 159 | } |
| 158 | 160 | ||
| 159 | private void synchronizedMemberData(MemberProfile resources, MemberDTO memberDTO) { | 161 | private void synchronizedMemberData(MemberProfile resources, MemberDTO memberDTO) { | ... | ... |
| ... | @@ -11,10 +11,10 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | ... | @@ -11,10 +11,10 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| 11 | */ | 11 | */ |
| 12 | public interface MemberRelatedInfoRepository extends JpaRepository<MemberRelatedInfo, Long>, JpaSpecificationExecutor<MemberRelatedInfo> { | 12 | public interface MemberRelatedInfoRepository extends JpaRepository<MemberRelatedInfo, Long>, JpaSpecificationExecutor<MemberRelatedInfo> { |
| 13 | 13 | ||
| 14 | |||
| 15 | MemberRelatedInfo findByIdCard(String idCard); | 14 | MemberRelatedInfo findByIdCard(String idCard); |
| 16 | 15 | ||
| 17 | MemberRelatedInfo findByMemberIdAndIdCard(Long memberId , String idCard); | 16 | MemberRelatedInfo findByMemberIdAndIdCard(Long memberId , String idCard); |
| 18 | 17 | ||
| 19 | MemberRelatedInfo findByIdOrIdCard(Long id, String idCard); | 18 | MemberRelatedInfo findByIdOrIdCard(Long id, String idCard); |
| 19 | |||
| 20 | } | 20 | } | ... | ... |
| ... | @@ -55,20 +55,7 @@ public class MemberRelatedInfoController { | ... | @@ -55,20 +55,7 @@ public class MemberRelatedInfoController { |
| 55 | 55 | ||
| 56 | log.info("memberRelatedInfo ==>> update ==>> resources ===>> [{}]",resources); | 56 | log.info("memberRelatedInfo ==>> update ==>> resources ===>> [{}]",resources); |
| 57 | 57 | ||
| 58 | Long id = resources.getId(); | ||
| 59 | MemberRelatedInfoDTO memberRelatedInfoDTO = this.memberRelatedInfoOperationService.findById(id); | ||
| 60 | if (memberRelatedInfoDTO.getId() != null) { | ||
| 61 | Long memberId = memberRelatedInfoDTO.getMemberId(); | ||
| 62 | MemberDTO memberDTO = this.memberService.findById(memberId); | ||
| 63 | if (Objects.nonNull(memberDTO)) { | ||
| 64 | String code = memberDTO.getCode(); | ||
| 65 | Assert.notNull(code,"code can't be null"); | ||
| 66 | |||
| 67 | resources.setMemberCode(code); | ||
| 68 | this.memberRelatedInfoOperationService.update(resources); | 58 | this.memberRelatedInfoOperationService.update(resources); |
| 69 | } | ||
| 70 | } | ||
| 71 | |||
| 72 | return ResultInfo.success(); | 59 | return ResultInfo.success(); |
| 73 | } | 60 | } |
| 74 | 61 | ... | ... |
| ... | @@ -21,13 +21,13 @@ public interface MemberRelatedInfoService { | ... | @@ -21,13 +21,13 @@ public interface MemberRelatedInfoService { |
| 21 | * 新增 | 21 | * 新增 |
| 22 | * @param resources | 22 | * @param resources |
| 23 | */ | 23 | */ |
| 24 | void create(MemberRelatedInfo resources); | 24 | MemberRelatedInfoDTO create(MemberRelatedInfo resources); |
| 25 | 25 | ||
| 26 | /** | 26 | /** |
| 27 | * 修改 | 27 | * 修改 |
| 28 | * @param resources | 28 | * @param resources |
| 29 | */ | 29 | */ |
| 30 | void update(MemberRelatedInfo resources); | 30 | MemberRelatedInfoDTO update(MemberRelatedInfo resources); |
| 31 | 31 | ||
| 32 | /** | 32 | /** |
| 33 | * 删除 | 33 | * 删除 |
| ... | @@ -40,14 +40,14 @@ public interface MemberRelatedInfoService { | ... | @@ -40,14 +40,14 @@ public interface MemberRelatedInfoService { |
| 40 | * @param resources | 40 | * @param resources |
| 41 | * @return | 41 | * @return |
| 42 | */ | 42 | */ |
| 43 | MemberRelatedInfo findByIdCard(MemberRelatedInfo resources); | 43 | MemberRelatedInfoDTO findByIdCard(MemberRelatedInfo resources); |
| 44 | 44 | ||
| 45 | /** | 45 | /** |
| 46 | * 通过身份证查询 | 46 | * 通过身份证查询 |
| 47 | * @param idCard 身份证 | 47 | * @param idCard 身份证 |
| 48 | * @return | 48 | * @return |
| 49 | */ | 49 | */ |
| 50 | MemberRelatedInfo findByIdCard(String idCard); | 50 | MemberRelatedInfoDTO findByIdCard(String idCard); |
| 51 | 51 | ||
| 52 | /** | 52 | /** |
| 53 | * | 53 | * |
| ... | @@ -55,7 +55,7 @@ public interface MemberRelatedInfoService { | ... | @@ -55,7 +55,7 @@ public interface MemberRelatedInfoService { |
| 55 | * @param idCard | 55 | * @param idCard |
| 56 | * @return | 56 | * @return |
| 57 | */ | 57 | */ |
| 58 | MemberRelatedInfo findByMemberIdAndIdCard(Long memberId , String idCard); | 58 | MemberRelatedInfoDTO findByMemberIdAndIdCard(Long memberId , String idCard); |
| 59 | 59 | ||
| 60 | /** | 60 | /** |
| 61 | * | 61 | * |
| ... | @@ -63,14 +63,14 @@ public interface MemberRelatedInfoService { | ... | @@ -63,14 +63,14 @@ public interface MemberRelatedInfoService { |
| 63 | * @param idCard | 63 | * @param idCard |
| 64 | * @return | 64 | * @return |
| 65 | */ | 65 | */ |
| 66 | MemberRelatedInfo findByMemberCodeAndIdCard(String memberCode , String idCard); | 66 | MemberRelatedInfoDTO findByMemberCodeAndIdCard(String memberCode , String idCard); |
| 67 | 67 | ||
| 68 | /** | 68 | /** |
| 69 | * | 69 | * |
| 70 | * @param resources | 70 | * @param resources |
| 71 | * @return | 71 | * @return |
| 72 | */ | 72 | */ |
| 73 | MemberRelatedInfo findByMemberIdAndIdCard(MemberRelatedInfo resources); | 73 | MemberRelatedInfoDTO findByMemberIdAndIdCard(MemberRelatedInfo resources); |
| 74 | 74 | ||
| 75 | /** | 75 | /** |
| 76 | * | 76 | * |
| ... | @@ -78,5 +78,5 @@ public interface MemberRelatedInfoService { | ... | @@ -78,5 +78,5 @@ public interface MemberRelatedInfoService { |
| 78 | * @param resources | 78 | * @param resources |
| 79 | * @return | 79 | * @return |
| 80 | */ | 80 | */ |
| 81 | MemberRelatedInfo findByMemberIdAndIdCard(Member member , MemberRelatedInfo resources); | 81 | MemberRelatedInfoDTO findByMemberIdAndIdCard(Member member , MemberRelatedInfo resources); |
| 82 | } | 82 | } | ... | ... |
| ... | @@ -57,12 +57,12 @@ public class MemberRelatedInfoServiceImpl implements MemberRelatedInfoService { | ... | @@ -57,12 +57,12 @@ public class MemberRelatedInfoServiceImpl implements MemberRelatedInfoService { |
| 57 | 57 | ||
| 58 | @Override | 58 | @Override |
| 59 | @Transactional(rollbackFor = Exception.class) | 59 | @Transactional(rollbackFor = Exception.class) |
| 60 | public void create(MemberRelatedInfo resources) { | 60 | public MemberRelatedInfoDTO create(MemberRelatedInfo resources) { |
| 61 | log.info("MemberRelatedInfoServiceImpl ==>> create ==>> param ==>> [{}]",resources); | 61 | log.info("MemberRelatedInfoServiceImpl ==>> create ==>> param ==>> [{}]",resources); |
| 62 | String idCard = resources.getIdCard(); | 62 | String idCard = resources.getIdCard(); |
| 63 | Long memberId = resources.getMemberId(); | 63 | Long memberId = resources.getMemberId(); |
| 64 | if (Objects.nonNull(memberId) && StringUtils.isNotBlank(idCard) && !idCard.equalsIgnoreCase(DEFAULT_IDCARD) ) { | 64 | if (Objects.nonNull(memberId) && StringUtils.isNotBlank(idCard) && !idCard.equalsIgnoreCase(DEFAULT_IDCARD) ) { |
| 65 | MemberRelatedInfo memberRelatedInfo = this.findByMemberIdAndIdCard(resources); | 65 | MemberRelatedInfoDTO memberRelatedInfo = this.findByMemberIdAndIdCard(resources); |
| 66 | if (Objects.nonNull(memberRelatedInfo)) | 66 | if (Objects.nonNull(memberRelatedInfo)) |
| 67 | // 数据已存在 | 67 | // 数据已存在 |
| 68 | throw new BadRequestException(GlobeExceptionMsg.ENTITY_ALREADY_EXISTS); | 68 | throw new BadRequestException(GlobeExceptionMsg.ENTITY_ALREADY_EXISTS); |
| ... | @@ -73,6 +73,7 @@ public class MemberRelatedInfoServiceImpl implements MemberRelatedInfoService { | ... | @@ -73,6 +73,7 @@ public class MemberRelatedInfoServiceImpl implements MemberRelatedInfoService { |
| 73 | MemberRelatedInfo memberRelatedInfo = MemberRelatedInfoBuilder.build(resources); | 73 | MemberRelatedInfo memberRelatedInfo = MemberRelatedInfoBuilder.build(resources); |
| 74 | this.memberRelatedInfoRepository.save(memberRelatedInfo); | 74 | this.memberRelatedInfoRepository.save(memberRelatedInfo); |
| 75 | log.info("MemberRelatedInfoServiceImpl ==>> create ==>> result ==>> [{}]",memberRelatedInfo); | 75 | log.info("MemberRelatedInfoServiceImpl ==>> create ==>> result ==>> [{}]",memberRelatedInfo); |
| 76 | return this.memberRelatedInfoMapper.toDto(memberRelatedInfo); | ||
| 76 | } | 77 | } |
| 77 | 78 | ||
| 78 | /** | 79 | /** |
| ... | @@ -104,7 +105,7 @@ public class MemberRelatedInfoServiceImpl implements MemberRelatedInfoService { | ... | @@ -104,7 +105,7 @@ public class MemberRelatedInfoServiceImpl implements MemberRelatedInfoService { |
| 104 | 105 | ||
| 105 | @Override | 106 | @Override |
| 106 | @Transactional(rollbackFor = Exception.class) | 107 | @Transactional(rollbackFor = Exception.class) |
| 107 | public void update(MemberRelatedInfo resources) { | 108 | public MemberRelatedInfoDTO update(MemberRelatedInfo resources) { |
| 108 | log.info("MemberRelatedInfoServiceImpl ==>> update ==>> param ==>> [{}]",resources); | 109 | log.info("MemberRelatedInfoServiceImpl ==>> update ==>> param ==>> [{}]",resources); |
| 109 | this.redisUtils.doLock("memberRelatedInfo::update::id" + resources.getId()); | 110 | this.redisUtils.doLock("memberRelatedInfo::update::id" + resources.getId()); |
| 110 | try { | 111 | try { |
| ... | @@ -118,7 +119,7 @@ public class MemberRelatedInfoServiceImpl implements MemberRelatedInfoService { | ... | @@ -118,7 +119,7 @@ public class MemberRelatedInfoServiceImpl implements MemberRelatedInfoService { |
| 118 | this.memberRelatedInfoRepository.save(memberRelatedInfo); | 119 | this.memberRelatedInfoRepository.save(memberRelatedInfo); |
| 119 | 120 | ||
| 120 | log.info("MemberRelatedInfoServiceImpl ==>> update ==>> param ==>> [{}]", resources); | 121 | log.info("MemberRelatedInfoServiceImpl ==>> update ==>> param ==>> [{}]", resources); |
| 121 | 122 | return this.memberRelatedInfoMapper.toDto(memberRelatedInfo); | |
| 122 | } catch (Exception e) { | 123 | } catch (Exception e) { |
| 123 | e.printStackTrace(); | 124 | e.printStackTrace(); |
| 124 | throw e; | 125 | throw e; |
| ... | @@ -137,16 +138,16 @@ public class MemberRelatedInfoServiceImpl implements MemberRelatedInfoService { | ... | @@ -137,16 +138,16 @@ public class MemberRelatedInfoServiceImpl implements MemberRelatedInfoService { |
| 137 | } | 138 | } |
| 138 | 139 | ||
| 139 | @Override | 140 | @Override |
| 140 | public MemberRelatedInfo findByIdCard(MemberRelatedInfo resources){ | 141 | public MemberRelatedInfoDTO findByIdCard(MemberRelatedInfo resources){ |
| 141 | log.info("MemberRelatedInfoServiceImpl ==>> findByIdCard ==>> param ==>> [{}]",resources); | 142 | log.info("MemberRelatedInfoServiceImpl ==>> findByIdCard ==>> param ==>> [{}]",resources); |
| 142 | String idCard = resources.getIdCard(); | 143 | String idCard = resources.getIdCard(); |
| 143 | Assert.notNull(idCard,"idCard can't be null"); | 144 | Assert.notNull(idCard,"idCard can't be null"); |
| 144 | 145 | ||
| 145 | if (!idCard.equalsIgnoreCase(DEFAULT_IDCARD)) { | 146 | if (!idCard.equalsIgnoreCase(DEFAULT_IDCARD)) { |
| 146 | MemberRelatedInfo memberRelatedInfo = this.findByIdCard(idCard); | 147 | MemberRelatedInfoDTO memberRelatedInfoDTO = this.findByIdCard(idCard); |
| 147 | ValidationUtil.isNull(memberRelatedInfo.getId(),"MemberRelatedInfo","id",resources.getId()); | 148 | ValidationUtil.isNull(memberRelatedInfoDTO.getId(),"MemberRelatedInfo","id",resources.getId()); |
| 148 | log.info("MemberRelatedInfoServiceImpl ==>> findByIdCard ==>> result ==>> [{}]",memberRelatedInfo); | 149 | log.info("MemberRelatedInfoServiceImpl ==>> findByIdCard ==>> result ==>> [{}]",memberRelatedInfoDTO); |
| 149 | return memberRelatedInfo; | 150 | return memberRelatedInfoDTO; |
| 150 | } | 151 | } |
| 151 | 152 | ||
| 152 | return null; | 153 | return null; |
| ... | @@ -154,15 +155,15 @@ public class MemberRelatedInfoServiceImpl implements MemberRelatedInfoService { | ... | @@ -154,15 +155,15 @@ public class MemberRelatedInfoServiceImpl implements MemberRelatedInfoService { |
| 154 | } | 155 | } |
| 155 | 156 | ||
| 156 | @Override | 157 | @Override |
| 157 | public MemberRelatedInfo findByIdCard(String idCard) { | 158 | public MemberRelatedInfoDTO findByIdCard(String idCard) { |
| 158 | log.info("MemberRelatedInfoServiceImpl ==>> findByIdCard ==>> param ==>> [{}]",idCard); | 159 | log.info("MemberRelatedInfoServiceImpl ==>> findByIdCard ==>> param ==>> [{}]",idCard); |
| 159 | MemberRelatedInfo memberRelatedInfo = this.memberRelatedInfoRepository.findByIdCard(idCard); | 160 | MemberRelatedInfo memberRelatedInfo = this.memberRelatedInfoRepository.findByIdCard(idCard); |
| 160 | log.info("MemberRelatedInfoServiceImpl ==>> findByIdCard ==>> result ==>> [{}]",memberRelatedInfo); | 161 | log.info("MemberRelatedInfoServiceImpl ==>> findByIdCard ==>> result ==>> [{}]",memberRelatedInfo); |
| 161 | return memberRelatedInfo; | 162 | return this.memberRelatedInfoMapper.toDto(memberRelatedInfo); |
| 162 | } | 163 | } |
| 163 | 164 | ||
| 164 | @Override | 165 | @Override |
| 165 | public MemberRelatedInfo findByMemberCodeAndIdCard(String memberCode, String idCard) { | 166 | public MemberRelatedInfoDTO findByMemberCodeAndIdCard(String memberCode, String idCard) { |
| 166 | Assert.notNull(memberCode,"memberCode can't be null"); | 167 | Assert.notNull(memberCode,"memberCode can't be null"); |
| 167 | Assert.notNull(idCard,"idCard can't be null"); | 168 | Assert.notNull(idCard,"idCard can't be null"); |
| 168 | MemberDTO memberDTO = this.checkMember(null, memberCode); | 169 | MemberDTO memberDTO = this.checkMember(null, memberCode); |
| ... | @@ -170,22 +171,22 @@ public class MemberRelatedInfoServiceImpl implements MemberRelatedInfoService { | ... | @@ -170,22 +171,22 @@ public class MemberRelatedInfoServiceImpl implements MemberRelatedInfoService { |
| 170 | } | 171 | } |
| 171 | 172 | ||
| 172 | @Override | 173 | @Override |
| 173 | public MemberRelatedInfo findByMemberIdAndIdCard(Long memberId, String idCard) { | 174 | public MemberRelatedInfoDTO findByMemberIdAndIdCard(Long memberId, String idCard) { |
| 174 | log.info("MemberRelatedInfoServiceImpl ==>> findByMemberIdAndIdCard ==>> param ==>> [{}]",memberId+","+idCard); | 175 | log.info("MemberRelatedInfoServiceImpl ==>> findByMemberIdAndIdCard ==>> param ==>> [{}]",memberId+","+idCard); |
| 175 | MemberRelatedInfo memberRelatedInfo = this.memberRelatedInfoRepository.findByMemberIdAndIdCard(memberId, idCard); | 176 | MemberRelatedInfo memberRelatedInfo = this.memberRelatedInfoRepository.findByMemberIdAndIdCard(memberId, idCard); |
| 176 | log.info("MemberRelatedInfoServiceImpl ==>> findByMemberIdAndIdCard ==>> result ==>> [{}]",memberRelatedInfo); | 177 | log.info("MemberRelatedInfoServiceImpl ==>> findByMemberIdAndIdCard ==>> result ==>> [{}]",memberRelatedInfo); |
| 177 | return memberRelatedInfo; | 178 | return this.memberRelatedInfoMapper.toDto(memberRelatedInfo); |
| 178 | } | 179 | } |
| 179 | 180 | ||
| 180 | @Override | 181 | @Override |
| 181 | public MemberRelatedInfo findByMemberIdAndIdCard(MemberRelatedInfo resources) { | 182 | public MemberRelatedInfoDTO findByMemberIdAndIdCard(MemberRelatedInfo resources) { |
| 182 | Long memberId = resources.getMemberId(); | 183 | Long memberId = resources.getMemberId(); |
| 183 | String idCard = resources.getIdCard(); | 184 | String idCard = resources.getIdCard(); |
| 184 | return this.findByMemberIdAndIdCard(memberId,idCard); | 185 | return this.findByMemberIdAndIdCard(memberId,idCard); |
| 185 | } | 186 | } |
| 186 | 187 | ||
| 187 | @Override | 188 | @Override |
| 188 | public MemberRelatedInfo findByMemberIdAndIdCard(Member member, MemberRelatedInfo resources) { | 189 | public MemberRelatedInfoDTO findByMemberIdAndIdCard(Member member, MemberRelatedInfo resources) { |
| 189 | Long memberId = member.getId(); | 190 | Long memberId = member.getId(); |
| 190 | String idCard = resources.getIdCard(); | 191 | String idCard = resources.getIdCard(); |
| 191 | return this.findByMemberIdAndIdCard(memberId,idCard); | 192 | return this.findByMemberIdAndIdCard(memberId,idCard); | ... | ... |
| ... | @@ -26,7 +26,8 @@ import java.util.Objects; | ... | @@ -26,7 +26,8 @@ import java.util.Objects; |
| 26 | */ | 26 | */ |
| 27 | @Api(tags = "会员管理") | 27 | @Api(tags = "会员管理") |
| 28 | @RestController | 28 | @RestController |
| 29 | @RequestMapping("/ucEngine/api/member") | 29 | //@RequestMapping("/ucEngine/api/member") |
| 30 | @RequestMapping("/ucEngine/member") | ||
| 30 | @CrossOrigin | 31 | @CrossOrigin |
| 31 | @Slf4j | 32 | @Slf4j |
| 32 | public class MemberController { | 33 | public class MemberController { |
| ... | @@ -38,9 +39,9 @@ public class MemberController { | ... | @@ -38,9 +39,9 @@ public class MemberController { |
| 38 | 39 | ||
| 39 | 40 | ||
| 40 | @Log("为大屏账户创建会员") | 41 | @Log("为大屏账户创建会员") |
| 41 | @RequestMapping(value = "/createMemberByUs" + | 42 | @RequestMapping(value = "/createMemberByUserTv") |
| 42 | "@AnonymousAccesserTv") | ||
| 43 | @ApiOperation("为大屏账户创建会员") | 43 | @ApiOperation("为大屏账户创建会员") |
| 44 | @AnonymousAccess | ||
| 44 | @Deprecated | 45 | @Deprecated |
| 45 | public ResultInfo createMemberByUserTv(@Validated(value = {CreateGroup.class}) @RequestBody UserTv resources) { | 46 | public ResultInfo createMemberByUserTv(@Validated(value = {CreateGroup.class}) @RequestBody UserTv resources) { |
| 46 | // todo 此接口废弃,将移动至UserTvController中,AppEngine也要同步修改 | 47 | // todo 此接口废弃,将移动至UserTvController中,AppEngine也要同步修改 | ... | ... |
| ... | @@ -50,4 +50,5 @@ public interface MemberVipHistoryService { | ... | @@ -50,4 +50,5 @@ public interface MemberVipHistoryService { |
| 50 | * @return | 50 | * @return |
| 51 | */ | 51 | */ |
| 52 | MemberVipHistory findByTime(Long id, LocalDateTime nowTime); | 52 | MemberVipHistory findByTime(Long id, LocalDateTime nowTime); |
| 53 | |||
| 53 | } | 54 | } | ... | ... |
| 1 | package com.topdraw.business.process.rest; | 1 | package com.topdraw.business.process.rest; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.util.ObjectUtil; | ||
| 4 | import com.topdraw.annotation.AnonymousAccess; | 3 | import com.topdraw.annotation.AnonymousAccess; |
| 5 | import com.topdraw.aop.log.Log; | 4 | import com.topdraw.aop.log.Log; |
| 6 | import com.topdraw.business.module.common.validated.UpdateGroup; | 5 | import com.topdraw.business.module.common.validated.UpdateGroup; |
| 7 | import com.topdraw.business.module.member.domain.Member; | 6 | import com.topdraw.business.module.member.domain.Member; |
| 8 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; | 7 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; |
| 9 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 8 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 10 | import com.topdraw.business.module.member.viphistory.domain.MemberVipHistory; | ||
| 11 | import com.topdraw.business.module.member.viphistory.service.MemberVipHistoryService; | ||
| 12 | import com.topdraw.business.module.user.weixin.service.UserWeixinService; | ||
| 13 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO; | ||
| 14 | import com.topdraw.business.process.domian.weixin.BuyVipBean; | 9 | import com.topdraw.business.process.domian.weixin.BuyVipBean; |
| 15 | import com.topdraw.business.process.service.member.MemberOperationService; | 10 | import com.topdraw.business.process.service.member.MemberOperationService; |
| 16 | import com.topdraw.common.IResultInfo; | 11 | import com.topdraw.common.IResultInfo; |
| ... | @@ -23,7 +18,6 @@ import org.springframework.beans.factory.annotation.Autowired; | ... | @@ -23,7 +18,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
| 23 | import org.springframework.validation.annotation.Validated; | 18 | import org.springframework.validation.annotation.Validated; |
| 24 | import org.springframework.web.bind.annotation.*; | 19 | import org.springframework.web.bind.annotation.*; |
| 25 | 20 | ||
| 26 | import java.time.LocalDateTime; | ||
| 27 | import java.util.Objects; | 21 | import java.util.Objects; |
| 28 | 22 | ||
| 29 | @Api("会员处理") | 23 | @Api("会员处理") |
| ... | @@ -35,10 +29,6 @@ public class MemberOperationController { | ... | @@ -35,10 +29,6 @@ public class MemberOperationController { |
| 35 | 29 | ||
| 36 | @Autowired | 30 | @Autowired |
| 37 | private MemberOperationService memberOperationService; | 31 | private MemberOperationService memberOperationService; |
| 38 | @Autowired | ||
| 39 | private MemberVipHistoryService memberVipHistoryService; | ||
| 40 | @Autowired | ||
| 41 | private UserWeixinService userWeixinService; | ||
| 42 | 32 | ||
| 43 | @Log("手动修改vip") | 33 | @Log("手动修改vip") |
| 44 | @RequestMapping(value = "/doUpdateVipByCode") | 34 | @RequestMapping(value = "/doUpdateVipByCode") |
| ... | @@ -77,46 +67,9 @@ public class MemberOperationController { | ... | @@ -77,46 +67,9 @@ public class MemberOperationController { |
| 77 | if (Objects.isNull(vip) || vip <= 0) | 67 | if (Objects.isNull(vip) || vip <= 0) |
| 78 | throw new BadRequestException("vip 等级有误"); | 68 | throw new BadRequestException("vip 等级有误"); |
| 79 | 69 | ||
| 80 | MemberDTO memberDTO = memberOperationService.buyVip(buyVipBean); | 70 | MemberDTO memberDTO = this.memberOperationService.buyVip(buyVipBean); |
| 81 | |||
| 82 | LocalDateTime vipExpireTime = buyVipBean.getVipExpireTime(); | ||
| 83 | this.doInsertVipHistory(id,vip,vipExpireTime); | ||
| 84 | return ResultInfo.success(memberDTO); | 71 | return ResultInfo.success(memberDTO); |
| 85 | } | 72 | } |
| 86 | |||
| 87 | private void doInsertVipHistory(Long id,Integer vip,LocalDateTime vipExpireTime) { | ||
| 88 | |||
| 89 | UserWeixinDTO userWeixinDTO = this.userWeixinService.findById(id); | ||
| 90 | Long memberId = userWeixinDTO.getMemberId(); | ||
| 91 | |||
| 92 | MemberDTO member = this.memberOperationService.findById(memberId); | ||
| 93 | |||
| 94 | LocalDateTime now = LocalDateTime.now(); | ||
| 95 | |||
| 96 | MemberVipHistory memberVipHistory = new MemberVipHistory(); | ||
| 97 | if (ObjectUtil.isNull(vipExpireTime)) { | ||
| 98 | LocalDateTime localDateTime = now.plusYears(1L); | ||
| 99 | member.setVipExpireTime(localDateTime); | ||
| 100 | } else { | ||
| 101 | //购买过 判断当前时间有没有过vip过期时间,没有过,失效时间加一年; 过了,当前时间加一年 | ||
| 102 | //区分是当前vip续费 还是买新的vip | ||
| 103 | if (ObjectUtil.equal(vip, member.getVip())) { | ||
| 104 | if (now.isBefore(vipExpireTime)) { | ||
| 105 | LocalDateTime localDateTime = vipExpireTime.plusYears(1L); | ||
| 106 | member.setVipExpireTime(localDateTime); | ||
| 107 | } else { | ||
| 108 | LocalDateTime localDateTime = now.plusYears(1L); | ||
| 109 | member.setVipExpireTime(localDateTime); | ||
| 110 | } | ||
| 111 | } else { | ||
| 112 | LocalDateTime localDateTime = now.plusYears(1L); | ||
| 113 | member.setVipExpireTime(localDateTime); | ||
| 114 | } | ||
| 115 | } | ||
| 116 | |||
| 117 | memberVipHistory.setVipExpireTime(member.getVipExpireTime()); | ||
| 118 | memberVipHistoryService.create(memberVipHistory); | ||
| 119 | } | ||
| 120 | } | 73 | } |
| 121 | 74 | ||
| 122 | 75 | ... | ... |
| ... | @@ -12,8 +12,6 @@ import com.topdraw.business.process.service.member.MemberOperationService; | ... | @@ -12,8 +12,6 @@ import com.topdraw.business.process.service.member.MemberOperationService; |
| 12 | import com.topdraw.business.process.domian.TempCoupon; | 12 | import com.topdraw.business.process.domian.TempCoupon; |
| 13 | import com.topdraw.business.process.service.RightsOperationService; | 13 | import com.topdraw.business.process.service.RightsOperationService; |
| 14 | import com.topdraw.utils.RedisUtils; | 14 | import com.topdraw.utils.RedisUtils; |
| 15 | import org.slf4j.Logger; | ||
| 16 | import org.slf4j.LoggerFactory; | ||
| 17 | import org.springframework.beans.BeanUtils; | 15 | import org.springframework.beans.BeanUtils; |
| 18 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | 17 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| ... | @@ -27,8 +25,6 @@ import java.util.Objects; | ... | @@ -27,8 +25,6 @@ import java.util.Objects; |
| 27 | @Service | 25 | @Service |
| 28 | public class CouponOperationServiceImpl implements CouponOperationService { | 26 | public class CouponOperationServiceImpl implements CouponOperationService { |
| 29 | 27 | ||
| 30 | private static final Logger LOG = LoggerFactory.getLogger(CouponOperationServiceImpl.class); | ||
| 31 | |||
| 32 | @Autowired | 28 | @Autowired |
| 33 | CouponService couponService; | 29 | CouponService couponService; |
| 34 | @Autowired | 30 | @Autowired |
| ... | @@ -134,7 +130,7 @@ public class CouponOperationServiceImpl implements CouponOperationService { | ... | @@ -134,7 +130,7 @@ public class CouponOperationServiceImpl implements CouponOperationService { |
| 134 | member.setCouponAmount(currentCoupon); | 130 | member.setCouponAmount(currentCoupon); |
| 135 | member.setDueCouponAmount(expireSoonCouponCount); | 131 | member.setDueCouponAmount(expireSoonCouponCount); |
| 136 | member.setUpdateTime(LocalDateTime.now()); | 132 | member.setUpdateTime(LocalDateTime.now()); |
| 137 | this.memberOperationService.doUpdateMemberInfo(member); | 133 | this.memberOperationService.doUpdateMember(member); |
| 138 | } | 134 | } |
| 139 | 135 | ||
| 140 | private MemberDTO findMemberByMemberId(Long memberId) { | 136 | private MemberDTO findMemberByMemberId(Long memberId) { | ... | ... |
| ... | @@ -149,7 +149,7 @@ public class ExpOperationServiceImpl implements ExpOperationService { | ... | @@ -149,7 +149,7 @@ public class ExpOperationServiceImpl implements ExpOperationService { |
| 149 | member.setExp(totalExp); | 149 | member.setExp(totalExp); |
| 150 | member.setLevel(level); | 150 | member.setLevel(level); |
| 151 | member.setUpdateTime(LocalDateTime.now()); | 151 | member.setUpdateTime(LocalDateTime.now()); |
| 152 | this.memberOperationService.doUpdateMemberInfo(member); | 152 | this.memberOperationService.doUpdateMember(member); |
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | private MemberDTO findMemberByMemberId(Long memberId) { | 155 | private MemberDTO findMemberByMemberId(Long memberId) { | ... | ... |
| ... | @@ -41,7 +41,6 @@ public class MemberAddressOperationServiceImpl implements MemberAddressOperation | ... | @@ -41,7 +41,6 @@ public class MemberAddressOperationServiceImpl implements MemberAddressOperation |
| 41 | @AsyncMqSend | 41 | @AsyncMqSend |
| 42 | public MemberAddressDTO update(MemberAddress resources) { | 42 | public MemberAddressDTO update(MemberAddress resources) { |
| 43 | log.info("MemberAddressOperationServiceImpl ==>> update ==>> param ==>> [{}]",resources); | 43 | log.info("MemberAddressOperationServiceImpl ==>> update ==>> param ==>> [{}]",resources); |
| 44 | |||
| 45 | return this.memberAddressService.update(resources); | 44 | return this.memberAddressService.update(resources); |
| 46 | } | 45 | } |
| 47 | 46 | ... | ... |
| 1 | package com.topdraw.business.process.service.impl.member; | 1 | package com.topdraw.business.process.service.impl.member; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.util.ObjectUtil; | 3 | import cn.hutool.core.util.ObjectUtil; |
| 4 | import com.topdraw.aspect.AsyncMqSend; | ||
| 4 | import com.topdraw.business.module.member.domain.Member; | 5 | import com.topdraw.business.module.member.domain.Member; |
| 5 | import com.topdraw.business.module.member.profile.domain.MemberProfile; | 6 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
| 6 | import com.topdraw.business.module.member.profile.service.MemberProfileService; | 7 | import com.topdraw.business.module.member.profile.service.MemberProfileService; |
| ... | @@ -44,6 +45,7 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -44,6 +45,7 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
| 44 | @Autowired | 45 | @Autowired |
| 45 | private ThreadPoolTaskExecutor threadPoolTaskExecutor; | 46 | private ThreadPoolTaskExecutor threadPoolTaskExecutor; |
| 46 | 47 | ||
| 48 | @AsyncMqSend | ||
| 47 | @CachePut(key = "#resources.memberId") | 49 | @CachePut(key = "#resources.memberId") |
| 48 | @Override | 50 | @Override |
| 49 | public MemberDTO buyVip(BuyVipBean resources) { | 51 | public MemberDTO buyVip(BuyVipBean resources) { |
| ... | @@ -60,6 +62,7 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -60,6 +62,7 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
| 60 | 62 | ||
| 61 | // | 63 | // |
| 62 | MemberDTO memberDTO = this.findById(memberId); | 64 | MemberDTO memberDTO = this.findById(memberId); |
| 65 | String memberCode = memberDTO.getCode(); | ||
| 63 | Integer vip = memberDTO.getVip(); | 66 | Integer vip = memberDTO.getVip(); |
| 64 | 67 | ||
| 65 | // | 68 | // |
| ... | @@ -84,19 +87,27 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -84,19 +87,27 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
| 84 | 87 | ||
| 85 | Member member = new Member(); | 88 | Member member = new Member(); |
| 86 | BeanUtils.copyProperties(memberDTO,member); | 89 | BeanUtils.copyProperties(memberDTO,member); |
| 87 | this.memberService.create(member); | 90 | this.update(member); |
| 88 | 91 | ||
| 89 | MemberVipHistory memberVipHistory = new MemberVipHistory(); | 92 | MemberVipHistory memberVipHistory = new MemberVipHistory(); |
| 90 | memberVipHistory.setMemberId(memberId).setVip(vip1).setBeforeVip(vip); | 93 | memberVipHistory.setMemberId(memberId).setVip(vip1).setBeforeVip(vip); |
| 91 | if (ObjectUtil.equal(vip1,vip)) { | 94 | if (ObjectUtil.equal(vip1,vip)) { |
| 92 | memberVipHistory.setStatus(1); | 95 | memberVipHistory.setStatus(1); |
| 93 | } | 96 | } |
| 97 | memberVipHistory.setMemberCode(memberCode); | ||
| 94 | memberVipHistory.setVipExpireTime(member.getVipExpireTime()); | 98 | memberVipHistory.setVipExpireTime(member.getVipExpireTime()); |
| 95 | memberVipHistoryService.create(memberVipHistory); | 99 | this.createVipHistory(memberVipHistory); |
| 96 | 100 | ||
| 97 | return memberDTO; | 101 | return memberDTO; |
| 98 | } | 102 | } |
| 99 | 103 | ||
| 104 | @AsyncMqSend | ||
| 105 | @Override | ||
| 106 | public void createVipHistory(MemberVipHistory memberVipHistory){ | ||
| 107 | this.memberVipHistoryService.create(memberVipHistory); | ||
| 108 | } | ||
| 109 | |||
| 110 | @AsyncMqSend | ||
| 100 | @CachePut(key = "#resources.id") | 111 | @CachePut(key = "#resources.id") |
| 101 | @Override | 112 | @Override |
| 102 | public MemberDTO update(Member resources) { | 113 | public MemberDTO update(Member resources) { |
| ... | @@ -109,7 +120,6 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -109,7 +120,6 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
| 109 | return this.memberService.findByCode(code); | 120 | return this.memberService.findByCode(code); |
| 110 | } | 121 | } |
| 111 | 122 | ||
| 112 | |||
| 113 | private UserWeixinDTO findWeiXinById(Long id) { | 123 | private UserWeixinDTO findWeiXinById(Long id) { |
| 114 | UserWeixinDTO userWeixinDTO = this.userWeixinService.findById(id); | 124 | UserWeixinDTO userWeixinDTO = this.userWeixinService.findById(id); |
| 115 | if (Objects.isNull(userWeixinDTO)) { | 125 | if (Objects.isNull(userWeixinDTO)) { |
| ... | @@ -120,7 +130,7 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -120,7 +130,7 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
| 120 | } | 130 | } |
| 121 | 131 | ||
| 122 | @Override | 132 | @Override |
| 123 | public MemberDTO doUpdateMemberInfo(Member resources) { | 133 | public MemberDTO doUpdateMember(Member resources) { |
| 124 | Long id = resources.getId(); | 134 | Long id = resources.getId(); |
| 125 | Assert.notNull(id,"ERROR MSG: MemberOperationServiceImpl -> doUpdateMemberInfo -> id not be null!!"); | 135 | Assert.notNull(id,"ERROR MSG: MemberOperationServiceImpl -> doUpdateMemberInfo -> id not be null!!"); |
| 126 | return this.update(resources); | 136 | return this.update(resources); |
| ... | @@ -132,30 +142,31 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -132,30 +142,31 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
| 132 | return this.memberService.create(resources); | 142 | return this.memberService.create(resources); |
| 133 | } | 143 | } |
| 134 | 144 | ||
| 135 | @Cacheable(key = "#memberId") | ||
| 136 | @Override | 145 | @Override |
| 137 | public MemberDTO findById(Long memberId) { | 146 | public MemberDTO findById(Long memberId) { |
| 138 | MemberDTO memberDTO = this.memberService.findById(memberId); | 147 | MemberDTO memberDTO = this.memberService.findById(memberId); |
| 139 | return Objects.nonNull(memberId) ? memberDTO : null; | 148 | return Objects.nonNull(memberId) ? memberDTO : null; |
| 140 | } | 149 | } |
| 141 | 150 | ||
| 151 | @CachePut(key = "#resources.id") | ||
| 142 | @Override | 152 | @Override |
| 143 | public MemberDTO doUpdateMemberExp(Member member) { | 153 | public MemberDTO doUpdateMemberExp(Member resources) { |
| 144 | return this.update(member); | 154 | return this.update(resources); |
| 145 | } | 155 | } |
| 146 | 156 | ||
| 147 | |||
| 148 | @CachePut(key = "#resources.id") | 157 | @CachePut(key = "#resources.id") |
| 149 | @Override | 158 | @Override |
| 150 | public MemberDTO doUpdateMemberPoints(Member resources) { | 159 | public MemberDTO doUpdateMemberPoints(Member resources) { |
| 151 | return this.memberService.doUpdateMemberPoints(resources); | 160 | return this.memberService.doUpdateMemberPoints(resources); |
| 152 | } | 161 | } |
| 153 | 162 | ||
| 163 | @CachePut(key = "#resources.id") | ||
| 154 | @Override | 164 | @Override |
| 155 | public MemberDTO doUpdateMemberCoupon(Member member) { | 165 | public MemberDTO doUpdateMemberCoupon(Member member) { |
| 156 | return this.update(member); | 166 | return this.update(member); |
| 157 | } | 167 | } |
| 158 | 168 | ||
| 169 | @AsyncMqSend | ||
| 159 | @Override | 170 | @Override |
| 160 | public MemberProfileDTO getMemberProfileAndCheckVip(Long memberId, String appid) { | 171 | public MemberProfileDTO getMemberProfileAndCheckVip(Long memberId, String appid) { |
| 161 | 172 | ||
| ... | @@ -171,12 +182,7 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -171,12 +182,7 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
| 171 | return memberProfileDTO_1; | 182 | return memberProfileDTO_1; |
| 172 | } | 183 | } |
| 173 | 184 | ||
| 174 | /** | 185 | |
| 175 | * 配置会员信息 | ||
| 176 | * @param memberProfileDTO_0 | ||
| 177 | * @param memberDTO | ||
| 178 | * @return | ||
| 179 | */ | ||
| 180 | private MemberProfileDTO configMemberProfile(MemberProfileDTO memberProfileDTO_0, MemberDTO memberDTO, String appid) { | 186 | private MemberProfileDTO configMemberProfile(MemberProfileDTO memberProfileDTO_0, MemberDTO memberDTO, String appid) { |
| 181 | 187 | ||
| 182 | if (Objects.isNull(memberProfileDTO_0)) return memberProfileDTO_0; | 188 | if (Objects.isNull(memberProfileDTO_0)) return memberProfileDTO_0; | ... | ... |
| 1 | package com.topdraw.business.process.service.impl.member; | 1 | package com.topdraw.business.process.service.impl.member; |
| 2 | 2 | ||
| 3 | import com.topdraw.aspect.AsyncMqSend; | ||
| 3 | import com.topdraw.business.module.member.domain.Member; | 4 | import com.topdraw.business.module.member.domain.Member; |
| 4 | import com.topdraw.business.module.member.profile.domain.MemberProfile; | 5 | import com.topdraw.business.module.member.profile.domain.MemberProfile; |
| 5 | import com.topdraw.business.module.member.profile.service.MemberProfileService; | 6 | import com.topdraw.business.module.member.profile.service.MemberProfileService; |
| ... | @@ -56,6 +57,7 @@ public class MemberProfileOperationServiceImpl implements MemberProfileOperation | ... | @@ -56,6 +57,7 @@ public class MemberProfileOperationServiceImpl implements MemberProfileOperation |
| 56 | } | 57 | } |
| 57 | 58 | ||
| 58 | @Override | 59 | @Override |
| 60 | @AsyncMqSend | ||
| 59 | public MemberProfileDTO update(MemberProfile resources) { | 61 | public MemberProfileDTO update(MemberProfile resources) { |
| 60 | return this.memberProfileService.update(resources); | 62 | return this.memberProfileService.update(resources); |
| 61 | } | 63 | } |
| ... | @@ -76,7 +78,8 @@ public class MemberProfileOperationServiceImpl implements MemberProfileOperation | ... | @@ -76,7 +78,8 @@ public class MemberProfileOperationServiceImpl implements MemberProfileOperation |
| 76 | } | 78 | } |
| 77 | 79 | ||
| 78 | @Override | 80 | @Override |
| 79 | public void updateMemberProfileAndMember(MemberProfile resources) { | 81 | @AsyncMqSend |
| 82 | public MemberProfileDTO updateMemberProfileAndMember(MemberProfile resources) { | ||
| 80 | String memberCode = resources.getMemberCode(); | 83 | String memberCode = resources.getMemberCode(); |
| 81 | MemberDTO memberDTO = null; | 84 | MemberDTO memberDTO = null; |
| 82 | if (StringUtils.isEmpty(memberCode)) { | 85 | if (StringUtils.isEmpty(memberCode)) { |
| ... | @@ -85,6 +88,6 @@ public class MemberProfileOperationServiceImpl implements MemberProfileOperation | ... | @@ -85,6 +88,6 @@ public class MemberProfileOperationServiceImpl implements MemberProfileOperation |
| 85 | resources.setMemberCode(memberDTO.getCode()); | 88 | resources.setMemberCode(memberDTO.getCode()); |
| 86 | } | 89 | } |
| 87 | 90 | ||
| 88 | this.memberProfileService.updateMemberProfileAndMember(resources, memberDTO); | 91 | return this.memberProfileService.updateMemberProfileAndMember(resources, memberDTO); |
| 89 | } | 92 | } |
| 90 | } | 93 | } | ... | ... |
| ... | @@ -29,13 +29,13 @@ public class MemberRelatedInfoOperationServiceImpl implements MemberRelatedInfoO | ... | @@ -29,13 +29,13 @@ public class MemberRelatedInfoOperationServiceImpl implements MemberRelatedInfoO |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | @Override | 31 | @Override |
| 32 | public void create(MemberRelatedInfo resources) { | 32 | public MemberRelatedInfoDTO create(MemberRelatedInfo resources) { |
| 33 | this.memberRelatedInfoService.create(resources); | 33 | return this.memberRelatedInfoService.create(resources); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | @Override | 36 | @Override |
| 37 | public void update(MemberRelatedInfo resources) { | 37 | public MemberRelatedInfoDTO update(MemberRelatedInfo resources) { |
| 38 | this.memberRelatedInfoService.update(resources); | 38 | return this.memberRelatedInfoService.update(resources); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | @Override | 41 | @Override |
| ... | @@ -44,32 +44,32 @@ public class MemberRelatedInfoOperationServiceImpl implements MemberRelatedInfoO | ... | @@ -44,32 +44,32 @@ public class MemberRelatedInfoOperationServiceImpl implements MemberRelatedInfoO |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | @Override | 46 | @Override |
| 47 | public MemberRelatedInfo findByIdCard(MemberRelatedInfo resources) { | 47 | public MemberRelatedInfoDTO findByIdCard(MemberRelatedInfo resources) { |
| 48 | return this.memberRelatedInfoService.findByIdCard(resources); | 48 | return this.memberRelatedInfoService.findByIdCard(resources); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | @Override | 51 | @Override |
| 52 | public MemberRelatedInfo findByIdCard(String idCard) { | 52 | public MemberRelatedInfoDTO findByIdCard(String idCard) { |
| 53 | return this.memberRelatedInfoService.findByIdCard(idCard); | 53 | return this.memberRelatedInfoService.findByIdCard(idCard); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | @Override | 56 | @Override |
| 57 | public MemberRelatedInfo findByMemberIdAndIdCard(Long memberId, String idCard) { | 57 | public MemberRelatedInfoDTO findByMemberIdAndIdCard(Long memberId, String idCard) { |
| 58 | return this.memberRelatedInfoService.findByMemberIdAndIdCard(memberId, idCard); | 58 | return this.memberRelatedInfoService.findByMemberIdAndIdCard(memberId, idCard); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | @Override | 61 | @Override |
| 62 | public MemberRelatedInfo findByMemberCodeAndIdCard(String memberCode, String idCard) { | 62 | public MemberRelatedInfoDTO findByMemberCodeAndIdCard(String memberCode, String idCard) { |
| 63 | return this.memberRelatedInfoService.findByMemberCodeAndIdCard(memberCode, idCard); | 63 | return this.memberRelatedInfoService.findByMemberCodeAndIdCard(memberCode, idCard); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | @Override | 66 | @Override |
| 67 | public MemberRelatedInfo findByMemberIdAndIdCard(MemberRelatedInfo resources) { | 67 | public MemberRelatedInfoDTO findByMemberIdAndIdCard(MemberRelatedInfo resources) { |
| 68 | return this.memberRelatedInfoService.findByMemberIdAndIdCard(resources); | 68 | return this.memberRelatedInfoService.findByMemberIdAndIdCard(resources); |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | @Override | 71 | @Override |
| 72 | public MemberRelatedInfo findByMemberIdAndIdCard(Member member, MemberRelatedInfo resources) { | 72 | public MemberRelatedInfoDTO findByMemberIdAndIdCard(Member member, MemberRelatedInfo resources) { |
| 73 | return this.memberRelatedInfoService.findByMemberIdAndIdCard(member, resources); | 73 | return this.memberRelatedInfoService.findByMemberIdAndIdCard(member, resources); |
| 74 | } | 74 | } |
| 75 | } | 75 | } | ... | ... |
| 1 | package com.topdraw.business.process.service.member; | 1 | package com.topdraw.business.process.service.member; |
| 2 | 2 | ||
| 3 | import com.topdraw.business.module.member.domain.Member; | 3 | import com.topdraw.business.module.member.domain.Member; |
| 4 | import com.topdraw.business.module.member.profile.domain.MemberProfile; | ||
| 5 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; | 4 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; |
| 6 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 5 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 6 | import com.topdraw.business.module.member.viphistory.domain.MemberVipHistory; | ||
| 7 | import com.topdraw.business.process.domian.weixin.BuyVipBean; | 7 | import com.topdraw.business.process.domian.weixin.BuyVipBean; |
| 8 | 8 | ||
| 9 | public interface MemberOperationService { | 9 | public interface MemberOperationService { |
| 10 | 10 | ||
| 11 | /** | 11 | /** |
| 12 | * | 12 | * |
| 13 | * @param member | 13 | * @param memberId |
| 14 | * @return | ||
| 14 | */ | 15 | */ |
| 15 | MemberDTO doUpdateMemberInfo(Member member); | 16 | MemberDTO findById(Long memberId); |
| 16 | 17 | ||
| 17 | /** | 18 | /** |
| 18 | * | 19 | * |
| 19 | * @param member | 20 | * @param code |
| 21 | * @return | ||
| 20 | */ | 22 | */ |
| 21 | MemberDTO doInsertMember(Member member); | 23 | MemberDTO findByCode(String code); |
| 22 | 24 | ||
| 23 | /** | 25 | /** |
| 24 | * | 26 | * |
| 25 | * @param memberId | 27 | * @param memberId |
| 28 | * @param appid | ||
| 26 | * @return | 29 | * @return |
| 27 | */ | 30 | */ |
| 28 | MemberDTO findById(Long memberId); | 31 | MemberProfileDTO getMemberProfileAndCheckVip(Long memberId, String appid); |
| 29 | 32 | ||
| 30 | /** | 33 | /** |
| 31 | * | 34 | * |
| 32 | * @param member | 35 | * @param resources |
| 36 | * @return | ||
| 33 | */ | 37 | */ |
| 34 | MemberDTO doUpdateMemberExp(Member member); | 38 | MemberDTO buyVip(BuyVipBean resources); |
| 35 | 39 | ||
| 36 | /** | 40 | /** |
| 37 | * | 41 | * |
| 38 | * @param member | 42 | * @param memberVipHistory |
| 43 | */ | ||
| 44 | void createVipHistory(MemberVipHistory memberVipHistory); | ||
| 45 | |||
| 46 | /** | ||
| 47 | * 修改会员 | ||
| 48 | * @param resources | ||
| 39 | */ | 49 | */ |
| 40 | MemberDTO doUpdateMemberPoints(Member member); | 50 | MemberDTO update(Member resources); |
| 41 | 51 | ||
| 42 | /** | 52 | /** |
| 43 | * | 53 | * |
| 44 | * @param member | 54 | * @param resources |
| 45 | */ | 55 | */ |
| 46 | MemberDTO doUpdateMemberCoupon(Member member); | 56 | MemberDTO doUpdateMember(Member resources); |
| 47 | 57 | ||
| 48 | /** | 58 | /** |
| 49 | * | 59 | * |
| 50 | * @param memberId | 60 | * @param resources |
| 51 | * @param appid | ||
| 52 | * @return | ||
| 53 | */ | 61 | */ |
| 54 | MemberProfileDTO getMemberProfileAndCheckVip(Long memberId, String appid); | 62 | MemberDTO doInsertMember(Member resources); |
| 55 | 63 | ||
| 56 | /** | 64 | /** |
| 57 | * | 65 | * |
| 58 | * @param buyVipBean | 66 | * @param resources |
| 59 | * @return | ||
| 60 | */ | 67 | */ |
| 61 | MemberDTO buyVip(BuyVipBean buyVipBean); | 68 | MemberDTO doUpdateMemberExp(Member resources); |
| 62 | 69 | ||
| 63 | /** | 70 | /** |
| 64 | * 修改会员 | 71 | * |
| 65 | * @param resources | 72 | * @param resources |
| 66 | */ | 73 | */ |
| 67 | MemberDTO update(Member resources); | 74 | MemberDTO doUpdateMemberPoints(Member resources); |
| 68 | 75 | ||
| 69 | /** | 76 | /** |
| 70 | * | 77 | * |
| 71 | * @param code | 78 | * @param resources |
| 72 | * @return | ||
| 73 | */ | 79 | */ |
| 74 | MemberDTO findByCode(String code); | 80 | MemberDTO doUpdateMemberCoupon(Member resources); |
| 81 | |||
| 75 | } | 82 | } | ... | ... |
| ... | @@ -71,6 +71,6 @@ public interface MemberProfileOperationService { | ... | @@ -71,6 +71,6 @@ public interface MemberProfileOperationService { |
| 71 | * 修改会员属性并同步会员信息 | 71 | * 修改会员属性并同步会员信息 |
| 72 | * @param resources | 72 | * @param resources |
| 73 | */ | 73 | */ |
| 74 | void updateMemberProfileAndMember(MemberProfile resources); | 74 | MemberProfileDTO updateMemberProfileAndMember(MemberProfile resources); |
| 75 | 75 | ||
| 76 | } | 76 | } | ... | ... |
| ... | @@ -21,13 +21,13 @@ public interface MemberRelatedInfoOperationService { | ... | @@ -21,13 +21,13 @@ public interface MemberRelatedInfoOperationService { |
| 21 | * 新增 | 21 | * 新增 |
| 22 | * @param resources | 22 | * @param resources |
| 23 | */ | 23 | */ |
| 24 | void create(MemberRelatedInfo resources); | 24 | MemberRelatedInfoDTO create(MemberRelatedInfo resources); |
| 25 | 25 | ||
| 26 | /** | 26 | /** |
| 27 | * 修改 | 27 | * 修改 |
| 28 | * @param resources | 28 | * @param resources |
| 29 | */ | 29 | */ |
| 30 | void update(MemberRelatedInfo resources); | 30 | MemberRelatedInfoDTO update(MemberRelatedInfo resources); |
| 31 | 31 | ||
| 32 | /** | 32 | /** |
| 33 | * 删除 | 33 | * 删除 |
| ... | @@ -40,14 +40,14 @@ public interface MemberRelatedInfoOperationService { | ... | @@ -40,14 +40,14 @@ public interface MemberRelatedInfoOperationService { |
| 40 | * @param resources | 40 | * @param resources |
| 41 | * @return | 41 | * @return |
| 42 | */ | 42 | */ |
| 43 | MemberRelatedInfo findByIdCard(MemberRelatedInfo resources); | 43 | MemberRelatedInfoDTO findByIdCard(MemberRelatedInfo resources); |
| 44 | 44 | ||
| 45 | /** | 45 | /** |
| 46 | * 通过身份证查询 | 46 | * 通过身份证查询 |
| 47 | * @param idCard 身份证 | 47 | * @param idCard 身份证 |
| 48 | * @return | 48 | * @return |
| 49 | */ | 49 | */ |
| 50 | MemberRelatedInfo findByIdCard(String idCard); | 50 | MemberRelatedInfoDTO findByIdCard(String idCard); |
| 51 | 51 | ||
| 52 | /** | 52 | /** |
| 53 | * | 53 | * |
| ... | @@ -55,7 +55,7 @@ public interface MemberRelatedInfoOperationService { | ... | @@ -55,7 +55,7 @@ public interface MemberRelatedInfoOperationService { |
| 55 | * @param idCard | 55 | * @param idCard |
| 56 | * @return | 56 | * @return |
| 57 | */ | 57 | */ |
| 58 | MemberRelatedInfo findByMemberIdAndIdCard(Long memberId, String idCard); | 58 | MemberRelatedInfoDTO findByMemberIdAndIdCard(Long memberId, String idCard); |
| 59 | 59 | ||
| 60 | /** | 60 | /** |
| 61 | * | 61 | * |
| ... | @@ -63,14 +63,14 @@ public interface MemberRelatedInfoOperationService { | ... | @@ -63,14 +63,14 @@ public interface MemberRelatedInfoOperationService { |
| 63 | * @param idCard | 63 | * @param idCard |
| 64 | * @return | 64 | * @return |
| 65 | */ | 65 | */ |
| 66 | MemberRelatedInfo findByMemberCodeAndIdCard(String memberCode, String idCard); | 66 | MemberRelatedInfoDTO findByMemberCodeAndIdCard(String memberCode, String idCard); |
| 67 | 67 | ||
| 68 | /** | 68 | /** |
| 69 | * | 69 | * |
| 70 | * @param resources | 70 | * @param resources |
| 71 | * @return | 71 | * @return |
| 72 | */ | 72 | */ |
| 73 | MemberRelatedInfo findByMemberIdAndIdCard(MemberRelatedInfo resources); | 73 | MemberRelatedInfoDTO findByMemberIdAndIdCard(MemberRelatedInfo resources); |
| 74 | 74 | ||
| 75 | /** | 75 | /** |
| 76 | * | 76 | * |
| ... | @@ -78,5 +78,5 @@ public interface MemberRelatedInfoOperationService { | ... | @@ -78,5 +78,5 @@ public interface MemberRelatedInfoOperationService { |
| 78 | * @param resources | 78 | * @param resources |
| 79 | * @return | 79 | * @return |
| 80 | */ | 80 | */ |
| 81 | MemberRelatedInfo findByMemberIdAndIdCard(Member member, MemberRelatedInfo resources); | 81 | MemberRelatedInfoDTO findByMemberIdAndIdCard(Member member, MemberRelatedInfo resources); |
| 82 | } | 82 | } | ... | ... |
| ... | @@ -2,6 +2,7 @@ package com.topdraw.mq.config; | ... | @@ -2,6 +2,7 @@ package com.topdraw.mq.config; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | import org.springframework.amqp.core.*; | 4 | import org.springframework.amqp.core.*; |
| 5 | import org.springframework.beans.factory.annotation.Value; | ||
| 5 | import org.springframework.context.annotation.Bean; | 6 | import org.springframework.context.annotation.Bean; |
| 6 | import org.springframework.context.annotation.Configuration; | 7 | import org.springframework.context.annotation.Configuration; |
| 7 | 8 | ||
| ... | @@ -16,6 +17,8 @@ public class RabbitMqConfig { | ... | @@ -16,6 +17,8 @@ public class RabbitMqConfig { |
| 16 | public static final String UC_QUEUE_DIRECT_BBB = "uc.route.key.direct.event.bbb"; | 17 | public static final String UC_QUEUE_DIRECT_BBB = "uc.route.key.direct.event.bbb"; |
| 17 | public static final String UC_QUEUE_DIRECT_CCC = "uc.route.key.direct.event.ccc"; | 18 | public static final String UC_QUEUE_DIRECT_CCC = "uc.route.key.direct.event.ccc"; |
| 18 | 19 | ||
| 20 | public static final String ENGINE_TO_IPTV_CONSUMER_MEMBER_DIRECT = "engine.iptv.consumer.member.direct"; | ||
| 21 | |||
| 19 | /** 队列-- */ | 22 | /** 队列-- */ |
| 20 | public static final String UC_QUEUE_FANOUT_IPTV = "uc.fanout.iptv"; | 23 | public static final String UC_QUEUE_FANOUT_IPTV = "uc.fanout.iptv"; |
| 21 | public static final String UC_QUEUE_FANOUT_WEIXIN = "uc.fanout.weixin"; | 24 | public static final String UC_QUEUE_FANOUT_WEIXIN = "uc.fanout.weixin"; |
| ... | @@ -32,6 +35,9 @@ public class RabbitMqConfig { | ... | @@ -32,6 +35,9 @@ public class RabbitMqConfig { |
| 32 | } | 35 | } |
| 33 | 36 | ||
| 34 | @Bean | 37 | @Bean |
| 38 | Queue engine2IptvConsumerMember(){ return new Queue(ENGINE_TO_IPTV_CONSUMER_MEMBER_DIRECT); } | ||
| 39 | |||
| 40 | @Bean | ||
| 35 | Queue ucDirectQueueCCC(){ | 41 | Queue ucDirectQueueCCC(){ |
| 36 | return new Queue(UC_QUEUE_DIRECT_CCC); | 42 | return new Queue(UC_QUEUE_DIRECT_CCC); |
| 37 | } | 43 | } |
| ... | @@ -42,6 +48,13 @@ public class RabbitMqConfig { | ... | @@ -42,6 +48,13 @@ public class RabbitMqConfig { |
| 42 | } | 48 | } |
| 43 | 49 | ||
| 44 | @Bean | 50 | @Bean |
| 51 | Binding directExchangeBindingEngine2IptvConsumerMember(DirectExchange directExchange , Queue ucDirectQueueBBB) { | ||
| 52 | BindingBuilder.DirectExchangeRoutingKeyConfigurer directExchangeRoutingKeyConfigurer = | ||
| 53 | BindingBuilder.bind(ucDirectQueueBBB).to(directExchange); | ||
| 54 | return directExchangeRoutingKeyConfigurer.with(ENGINE_TO_IPTV_CONSUMER_MEMBER_DIRECT); | ||
| 55 | } | ||
| 56 | |||
| 57 | @Bean | ||
| 45 | Binding directExchangeBindingBBB(DirectExchange directExchange , Queue ucDirectQueueBBB) { | 58 | Binding directExchangeBindingBBB(DirectExchange directExchange , Queue ucDirectQueueBBB) { |
| 46 | BindingBuilder.DirectExchangeRoutingKeyConfigurer directExchangeRoutingKeyConfigurer = | 59 | BindingBuilder.DirectExchangeRoutingKeyConfigurer directExchangeRoutingKeyConfigurer = |
| 47 | BindingBuilder.bind(ucDirectQueueBBB).to(directExchange); | 60 | BindingBuilder.bind(ucDirectQueueBBB).to(directExchange); | ... | ... |
| ... | @@ -19,23 +19,24 @@ public class MessageProducer { | ... | @@ -19,23 +19,24 @@ public class MessageProducer { |
| 19 | private AmqpTemplate amqpTemplate; | 19 | private AmqpTemplate amqpTemplate; |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | @Value("${uc.service.platform}") | 22 | @Value("${engine.platform}") |
| 23 | private String platformType; | 23 | private String platform; |
| 24 | 24 | ||
| 25 | public void sendMessage(String msg,String exchangeName){ | 25 | public void sendMessage(String msg,String exchangeName){ |
| 26 | 26 | ||
| 27 | // 管理侧 | 27 | // 管理侧 |
| 28 | if (platformType.equalsIgnoreCase(LocalConstants.PLATFORM_TYPE_MANAGEMENT)) { | 28 | if (platform.equalsIgnoreCase(LocalConstants.PLATFORM_TYPE_MANAGEMENT)) { |
| 29 | if (StringUtils.isEmpty(exchangeName)) { | 29 | if (StringUtils.isEmpty(exchangeName)) { |
| 30 | exchangeName = RabbitMqConfig.UC_QUEUE_DIRECT_CCC; | 30 | exchangeName = RabbitMqConfig.UC_QUEUE_DIRECT_CCC; |
| 31 | } | 31 | } |
| 32 | this.sendDirectMessage(msg,exchangeName); | 32 | this.sendDirectMessage(msg,exchangeName); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | // 服务侧 | 35 | // 产品侧 |
| 36 | if (platformType.equalsIgnoreCase(LocalConstants.PLATFORM_TYPE_SERVICE)) { | 36 | if (platform.equalsIgnoreCase(LocalConstants.PLATFORM_TYPE_SERVICE)) { |
| 37 | if (StringUtils.isEmpty(exchangeName)) { | 37 | if (StringUtils.isEmpty(exchangeName)) { |
| 38 | exchangeName = RabbitMqConfig.UC_QUEUE_DIRECT_BBB; | 38 | // exchangeName = RabbitMqConfig.UC_QUEUE_DIRECT_BBB; |
| 39 | exchangeName = RabbitMqConfig.ENGINE_TO_IPTV_CONSUMER_MEMBER_DIRECT; | ||
| 39 | } | 40 | } |
| 40 | this.sendDirectMessage(msg,exchangeName); | 41 | this.sendDirectMessage(msg,exchangeName); |
| 41 | } | 42 | } | ... | ... |
| ... | @@ -47,7 +47,7 @@ public class MemberOperationServiceTest extends BaseTest { | ... | @@ -47,7 +47,7 @@ public class MemberOperationServiceTest extends BaseTest { |
| 47 | member.setUpdateTime(LocalDateTime.now()); | 47 | member.setUpdateTime(LocalDateTime.now()); |
| 48 | String s = JSONObject.toJSONString(member); | 48 | String s = JSONObject.toJSONString(member); |
| 49 | 49 | ||
| 50 | this.memberOperationService.doUpdateMemberInfo(member); | 50 | this.memberOperationService.doUpdateMember(member); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | @Test | 53 | @Test | ... | ... |
-
Please register or sign in to post a comment