Commit 1e30cfe4 1e30cfe40d8837ef08cbaae5506343088d996c3b by xianghan

1.去除消费任务时的部分查询,直接将消息传递至uce

1 parent 495bb3c6
......@@ -12,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import java.util.Objects;
/**
*
*/
......@@ -34,8 +36,10 @@ public class ExpOperationServiceImpl implements ExpOperationService {
public void asyncExpDetail(ExpDetail expDetail) {
String code = expDetail.getMemberCode();
MemberDTO memberDTO = this.memberService.findByCode(code);
if (Objects.nonNull(memberDTO.getId())) {
expDetail.setMemberId(memberDTO.getId());
this.expDetailService.create(expDetail);
}
}
}
......
......@@ -7,29 +7,18 @@ import com.topdraw.business.module.member.service.dto.MemberDTO;
import com.topdraw.business.module.points.available.domain.PointsAvailable;
import com.topdraw.business.module.points.available.service.PointsAvailableService;
import com.topdraw.business.module.points.available.service.dto.PointsAvailableDTO;
import com.topdraw.business.module.points.detail.detailhistory.service.PointsDetailHistoryService;
import com.topdraw.business.module.points.detail.domain.PointsDetail;
import com.topdraw.business.module.points.detail.service.PointsDetailService;
import com.topdraw.business.module.points.service.PointsService;
import com.topdraw.business.process.domian.TempPoints;
import com.topdraw.business.process.service.PointsOperationService;
import com.topdraw.business.process.service.member.MemberOperationService;
import com.topdraw.util.IdWorker;
import com.topdraw.util.TimestampUtil;
import com.topdraw.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
/**
*
......@@ -56,23 +45,29 @@ public class PointsOperationServiceImpl implements PointsOperationService {
return;
}
MemberDTO memberDTO = this.memberService.findByCode(code);
if (Objects.nonNull(memberDTO.getId())) {
member.setId(memberDTO.getId());
this.memberService.doUpdateMemberPoints(member);
}
}
public void asyncPointsAvailable(PointsAvailable pointsAvailable) {
String memberCode = pointsAvailable.getMemberCode();
MemberDTO memberDTO = this.memberService.findByCode(memberCode);
if (Objects.nonNull(memberDTO.getId())) {
pointsAvailable.setMemberId(memberDTO.getId());
this.pointsAvailableService.create4Custom(pointsAvailable);
}
}
public void asyncPointsDetail(PointsDetail pointsDetail) {
String memberCode = pointsDetail.getMemberCode();
MemberDTO memberDTO = this.memberService.findByCode(memberCode);
if (Objects.nonNull(memberDTO.getId())) {
pointsDetail.setMemberId(memberDTO.getId());
this.pointsDetailService.create4Custom(pointsDetail);
}
}
public void asyncDeletePointsAvailable(PointsAvailable pointsAvailable) {
String code = pointsAvailable.getCode();
......
package com.topdraw.config.redis;
package com.topdraw.config;
/**
* @author :
* @description:
* @function :
* @date :Created in 2022/6/18 17:22
* @date :Created in 2022/6/13 11:22
* @version: :
* @modified By:
* @since : modified in 2022/6/18 17:22
* @since : modified in 2022/6/13 11:22
*/
public class RedisKeyConstant {
public interface ResponseStatus {
Integer OK = 00000;
public static final String CACHE_PLATFROMACCOUNT_PLAYDURATION = "ucc::play::playduration::";
}
......
......@@ -28,23 +28,4 @@ public class DataSyncMsg implements Serializable {
// 消息体
private String msgData;
/**
* 消息体
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class MsgData {
private Long memberId; // 会员id
private String memberCode;
private Long orderId;
private Long activityId;
private Long mediaId;
private Long itemId;
private String description;
private String param;
private String platformAccount;
}
}
......
......@@ -18,11 +18,6 @@ public class RestTemplateTest extends BaseTest {
@Autowired
RestTemplateClient apiUtil;
@Test
public void t(){
JSONObject memberInfo = this.apiUtil.getMemberInfo(5L);
System.out.println(memberInfo);
}
@Test
public void error(){
......