ExpOperationServiceImpl.java
2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package com.topdraw.business.process.service.impl;
import com.topdraw.business.module.exp.detail.domain.ExpDetail;
import com.topdraw.business.module.exp.detail.service.ExpDetailService;
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.process.service.ExpOperationService;
import com.topdraw.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Objects;
@Service
@Slf4j
public class ExpOperationServiceImpl implements ExpOperationService {
@Autowired
private MemberService memberService;
@Autowired
private ExpDetailService expDetailService;
public void asyncMemberExpAndLevel(Member resource) {
log.info("同步会员成长值和等级,参数 asyncMemberExpAndLevel# resource ==>> {}", resource);
String code = resource.getCode();
if (StringUtils.isBlank(code)) {
log.error("同步会员成长值和等级异常,asyncMemberExpAndLevel# message ==>> 会员code不得为空");
return;
}
MemberDTO memberDTO = this.memberService.findByCode(code);
log.info("同步会员成长值和等级,asyncMemberExpAndLevel# 通过code ==>> {},查询会员信息,结果集,memberDTO ==>> {}", code, memberDTO);
resource.setId(memberDTO.getId());
log.info("同步会员成长值和等级,asyncMemberExpAndLevel# 入库参数,resource ==>> {}", resource);
this.memberService.doUpdateMemberExpAndLevel(resource);
}
public void asyncExpDetail(ExpDetail resource) {
log.info("同步会员成长值详情,参数 asyncExpDetail# resource ==>> {}", resource);
String code = resource.getMemberCode();
if (StringUtils.isBlank(code)) {
log.error("同步会员成长值和等级异常,asyncExpDetail# message ==>> 会员code不得为空");
return;
}
MemberDTO memberDTO = this.memberService.findByCode(code);
log.info("同步会员成长值详情,asyncExpDetail# 通过code ==>> {},查询会员信息,结果集,memberDTO ==>> {}", code, memberDTO);
if (Objects.isNull(memberDTO.getId())) {
log.error("同步会员成长值详情,asyncExpDetail# message ==>> 会员");
return;
}
resource.setMemberId(memberDTO.getId());
log.info("同步会员成长值详情,asyncExpDetail# 入库参数,resource ==>> {}", resource);
this.expDetailService.create(resource);
}
}