| | |
| | | package cc.mrbird.febs; |
| | | |
| | | import cc.mrbird.febs.mall.mapper.ChatUserMapper; |
| | | import cc.mrbird.febs.mall.service.IAgentService; |
| | | import cc.mrbird.febs.rabbit.producter.AgentProducer; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | // |
| | | @Autowired |
| | | private AgentProducer agentProducer; |
| | | // |
| | | @Autowired |
| | | private ChatUserMapper chatUserMapper; |
| | | //// |
| | | //// @Autowired |
| | | //// private IMemberProfitService memberProfitService; |
| | | //// |
| | | @Test |
| | | public void dynamicProfit() { |
| | | for(int i =0;i<400;i++){ |
| | | for(int i =0;i<75;i++){ |
| | | agentProducer.sendAddRobotMsg("32074345"); |
| | | } |
| | | // agentService.autoUpAgentLevel(640L); |
| | | } |
| | | // @Test |
| | | // public void agentProfit() { |
| | | // memberProfitService.agentProfit(null); |
| | | // } |
| | | @Test |
| | | public void agentProfit() { |
| | | |
| | | DateTime date = DateUtil.date(); |
| | | DateTime dateTime = DateUtil.offsetHour(date, -26); |
| | | System.out.println("dateTime:"+dateTime); |
| | | chatUserMapper.deleteMsgByCreateTime(dateTime); |
| | | List<Long> ids = chatUserMapper.selectChatRedBagByCreateTime(dateTime); |
| | | if(CollUtil.isNotEmpty(ids)){ |
| | | Long aLong = ids.get(0); |
| | | chatUserMapper.deleteChatRedBagById(aLong); |
| | | |
| | | List<Long> recordIds = chatUserMapper.selectChatRedBagRecordByRebBagId(aLong); |
| | | if(CollUtil.isNotEmpty(recordIds)){ |
| | | Long aLong1 = recordIds.get(0); |
| | | chatUserMapper.deleteChatRedBagRecordById(aLong1); |
| | | } |
| | | } |
| | | } |
| | | // |
| | | // |
| | | //// @Test |