From c5ac51a5525b261127845a38a1fec5a86c860441 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Fri, 14 May 2021 20:00:10 +0800 Subject: [PATCH] Merge branch 'yunding' of http://120.27.238.55:7000/r/exchange into yunding --- src/test/java/com/xcong/excoin/XchTest.java | 42 +++++++++++++++++++++++++++++++++++++----- 1 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/test/java/com/xcong/excoin/XchTest.java b/src/test/java/com/xcong/excoin/XchTest.java index 611af9d..39bd254 100644 --- a/src/test/java/com/xcong/excoin/XchTest.java +++ b/src/test/java/com/xcong/excoin/XchTest.java @@ -1,8 +1,13 @@ package com.xcong.excoin; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.xcong.excoin.modules.coin.parameter.dto.CoinInListDto; +import com.xcong.excoin.modules.coin.service.CoinService; import com.xcong.excoin.modules.yunding.dao.YdOrderDao; import com.xcong.excoin.modules.yunding.entity.YdOrderEntity; import com.xcong.excoin.modules.yunding.service.XchProfitService; @@ -12,12 +17,16 @@ import org.springframework.boot.test.context.SpringBootTest; import java.math.BigDecimal; +import java.util.Date; +import java.util.List; @SpringBootTest public class XchTest { @Autowired private XchProfitService xchProfitService; + @Autowired + private YdOrderDao ydOrderDao; @Test public void usdtReturnTest() { @@ -32,13 +41,26 @@ } @Test - public void becomeAgentTest() { - xchProfitService.autoBeAgent(40L); + public void orderWork() { + QueryWrapper<YdOrderEntity> objectQueryWrapper = new QueryWrapper<>(); + objectQueryWrapper.eq("state",YdOrderEntity.ORDER_STATE_READY); + objectQueryWrapper.eq("type",YdOrderEntity.PRODUCT_ORDER); + List<YdOrderEntity> ydOrderEntities = ydOrderDao.selectList(objectQueryWrapper); + Date date = new Date(); + if(CollUtil.isNotEmpty(ydOrderEntities)){ + for(YdOrderEntity ydOrderEntity : ydOrderEntities){ + Date workTime = ydOrderEntity.getWorkTime(); + if(ObjectUtil.isNotEmpty(workTime) && DateUtil.compare(date, workTime) > -1){ + Long id = ydOrderEntity.getId(); + ydOrderDao.UpdateByIdAndState(id,YdOrderEntity.ORDER_STATE_WORK); + } + } + } } @Test public void orderUsdtProfitTest() { - xchProfitService.usdtProfitDistributorByOrderId(7L); + xchProfitService.usdtProfitDistributorByOrderId(1L); } // // @Autowired @@ -49,8 +71,6 @@ // ydPowerJob.orderWork(); // } - @Autowired - private YdOrderDao ydOrderDao; @Test public void orderTest() { @@ -65,4 +85,16 @@ public void xchProfitTest() { xchProfitService.xchProfitDistributor(BigDecimal.valueOf(1)); } + + @Autowired + private CoinService coinService; + + @Test + public void coinTest() { + CoinInListDto coin = new CoinInListDto(); + coin.setType(4); + coin.setPageNum(1); + coin.setPageSize(10); + coinService.coinInList(coin); + } } -- Gitblit v1.9.1