Merge branch 'hongloumeng' of http://120.27.238.55:7000/r/xc-mall into hongloumeng
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("mall_mq_record") |
| | | public class MallMqRecord { |
| | |
| | | |
| | | private Integer retryTimes; |
| | | |
| | | private Date createTime; |
| | | |
| | | } |
| | |
| | | * 补贴消息--重试 |
| | | * 一个小时运行一次 |
| | | */ |
| | | @Scheduled(cron = "0 0 * * * ?") |
| | | @Scheduled(cron = "0 /5 * * * ? ") |
| | | public void mqPerkRetryJob() { |
| | | memberProfitService.mqPerkRetryJob(); |
| | | } |
| | |
| | | if(ObjectUtil.isEmpty(mallOrderInfo)){ |
| | | return; |
| | | } |
| | | if(2 != mallOrderInfo.getStatus()){ |
| | | return; |
| | | } |
| | | // if(2 != mallOrderInfo.getStatus()){ |
| | | // return; |
| | | // } |
| | | /** |
| | | * 分享补贴 直推消费额10% |
| | | */ |
| | |
| | | mallMqRecord.setOrderId(orderInfo.getId()); |
| | | mallMqRecord.setState(2); |
| | | mallMqRecord.setRetryTimes(2); |
| | | mallMqRecord.setCreateTime(orderInfo.getPayTime()); |
| | | mallMqRecordMapper.insert(mallMqRecord); |
| | | //发送补贴消息 |
| | | agentProducer.sendPerkMoneyMsg(orderInfo.getId()); |
| | |
| | | if(CollUtil.isEmpty(mallMqRecords)){ |
| | | return; |
| | | } |
| | | DateTime dateTime = DateUtil.offsetMinute(new Date(), -5); |
| | | for(MallMqRecord mallMqRecord : mallMqRecords){ |
| | | if(DateUtil.compare(dateTime,mallMqRecord.getCreateTime()) <= 0){ |
| | | continue; |
| | | } |
| | | Integer retryTimes = mallMqRecord.getRetryTimes(); |
| | | if(retryTimes <= 0){ |
| | | continue; |
| | |
| | | |
| | | @Test |
| | | public void dynamicProfit() { |
| | | agentService.perkMoneyConsumer(Long.parseLong("712")); |
| | | agentService.perkMoneyConsumer(Long.parseLong("796")); |
| | | // memberProfitService.dynamicProfit(Long.parseLong("709")); |
| | | // memberProfitService.scoreRecordReleaseJob(); |
| | | // memberProfitService.achieveReleaseJob(); |