From 95068cae88d908aafa1135caff23dfd7444081cd Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Sat, 15 May 2021 18:35:19 +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 |   65 +++++++++++++++++++++++++++++---
 1 files changed, 59 insertions(+), 6 deletions(-)

diff --git a/src/test/java/com/xcong/excoin/XchTest.java b/src/test/java/com/xcong/excoin/XchTest.java
index 1a70038..b3438a9 100644
--- a/src/test/java/com/xcong/excoin/XchTest.java
+++ b/src/test/java/com/xcong/excoin/XchTest.java
@@ -1,19 +1,32 @@
 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;
 import com.xcong.excoin.quartz.job.YdPowerJob;
 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.Date;
+import java.util.List;
+
 @SpringBootTest
 public class XchTest {
 
     @Autowired
     private XchProfitService xchProfitService;
+    @Autowired
+    private YdOrderDao ydOrderDao;
 
     @Test
     public void usdtReturnTest() {
@@ -28,20 +41,60 @@
     }
 
     @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(17L);
+    }
+//
+//    @Autowired
+//    private YdPowerJob ydPowerJob;
+//
+//    @Test
+//    public void ydPowerTest() {
+//        ydPowerJob.orderWork();
+//    }
+
+
+    @Test
+    public void orderTest() {
+        YdOrderEntity orderEntity = new YdOrderEntity();
+        orderEntity.setType(YdOrderEntity.AGENT_ORDER);
+        orderEntity.setMemberId(40L);
+        orderEntity.setAmount(BigDecimal.TEN);
+        ydOrderDao.insert(orderEntity);
+    }
+
+    @Test
+    public void xchProfitTest() {
+        xchProfitService.xchProfitDistributor(BigDecimal.valueOf(1));
     }
 
     @Autowired
-    private YdPowerJob ydPowerJob;
+    private CoinService coinService;
 
     @Test
-    public void ydPowerTest() {
-        ydPowerJob.orderWork();
+    public void coinTest() {
+        CoinInListDto coin = new CoinInListDto();
+        coin.setType(4);
+        coin.setPageNum(1);
+        coin.setPageSize(10);
+        coinService.coinInList(coin);
     }
 }

--
Gitblit v1.9.1