From 2d88839407045d9f483cf2ab4aed149a59e22df4 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 17 六月 2022 18:38:27 +0800
Subject: [PATCH] bug修改(后台管理页面)

---
 app/src/test/java/test/goldcorn/GoldCornTest.java |   58 ++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 46 insertions(+), 12 deletions(-)

diff --git a/app/src/test/java/test/goldcorn/GoldCornTest.java b/app/src/test/java/test/goldcorn/GoldCornTest.java
index e88aa81..4297026 100644
--- a/app/src/test/java/test/goldcorn/GoldCornTest.java
+++ b/app/src/test/java/test/goldcorn/GoldCornTest.java
@@ -1,19 +1,19 @@
 package test.goldcorn;
 
+import com.ks.lib.common.exception.ParamsException;
 import com.yeshi.makemoney.app.Application;
-import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetRecord;
-import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType;
-import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetFrequencyConfigException;
-import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetPriceException;
-import com.yeshi.makemoney.app.exception.goldcorn.GoldCornGetRecordException;
-import com.yeshi.makemoney.app.exception.goldcorn.GoldCornMakeException;
+import com.yeshi.makemoney.app.entity.SystemEnum;
+import com.yeshi.makemoney.app.entity.goldcorn.*;
+import com.yeshi.makemoney.app.exception.goldcorn.*;
 import com.yeshi.makemoney.app.exception.user.UserInfoException;
-import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornGetRecordService;
-import com.yeshi.makemoney.app.service.inter.goldcorn.GoldCornMakeService;
+import com.yeshi.makemoney.app.service.inter.goldcorn.*;
+import com.yeshi.makemoney.app.service.query.goldcorn.GoldCornConsumeRecordQuery;
 import org.junit.jupiter.api.Test;
 import org.springframework.boot.test.context.SpringBootTest;
 
 import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 
@@ -30,7 +30,16 @@
     private GoldCornGetRecordService goldCornGetRecordService;
 
     @Resource
+    private GoldCornConsumeRecordService goldCornConsumeRecordService;
+
+    @Resource
     private GoldCornMakeService goldCornMakeService;
+
+    @Resource
+    private GoldCornSettleService goldCornSettleService;
+
+    @Resource
+    private GoldCornSettleRecordService goldCornSettleRecordService;
 
     @Test
     public void addGoldRecord() throws GoldCornGetRecordException {
@@ -40,12 +49,13 @@
         record.setType(GoldCornGetType.readNovel);
         record.setLevel(GoldCornGetRecord.LEVEL_OWN);
         record.setDay("2022-04-07");
+        record.setEventCount(1L);
         goldCornGetRecordService.add(record);
     }
 
     @Test
     public void statistic() {
-        Long count = goldCornGetRecordService.getGoldCornByDay(null, "2022-04-07");
+        Long count = goldCornGetRecordService.getGoldCornByDay(null, new Date());
         System.out.println(count);
 
         count = goldCornGetRecordService.countUidsByDay("2022-04-07");
@@ -70,11 +80,9 @@
     @Test
     public void makeGoldCorn() {
         try {
-            goldCornMakeService.addGoldCorn(22380L, GoldCornGetType.watchVideo,false,new Date());
+            goldCornMakeService.addGoldCorn(22384L, GoldCornGetType.watchVideo, false, new Date(), null, 1L);
 //            goldCornMakeService.addGoldCorn(22380L,GoldCornGetType.readNovel,new Date());
         } catch (UserInfoException e) {
-            e.printStackTrace();
-        } catch (GoldCornGetPriceException e) {
             e.printStackTrace();
         } catch (GoldCornGetFrequencyConfigException e) {
             e.printStackTrace();
@@ -83,5 +91,31 @@
         }
     }
 
+    @Test
+    public void settle() {
+//        goldCornSettleService.startSettle(new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 1L));
+    }
+
+
+    @Resource
+    private GoldCornGetFrequencyConfigService goldCornGetFrequencyConfigService;
+
+    public void getFrequencys() {
+        List<GoldCornGetFrequencyConfig> list = goldCornGetFrequencyConfigService.listByTypes(Arrays.asList(new GoldCornGetType[]{GoldCornGetType.watchVideo, GoldCornGetType.readNovel, GoldCornGetType.scanNews}), SystemEnum.svmm, new Date());
+    }
+
+    @Test
+    public void addSettle() throws GoldCornSettleRecordException, ParamsException {
+        GoldCornSettleRecord record = new GoldCornSettleRecord();
+        goldCornSettleRecordService.add(record);
+    }
+
+    @Test
+    public void sumMoney() {
+        GoldCornConsumeRecordQuery query = new GoldCornConsumeRecordQuery();
+        query.setType(GoldCornConsumeType.changeMoney);
+        BigDecimal money = goldCornConsumeRecordService.sumMoney(query);
+        System.out.println(money);
+    }
 
 }

--
Gitblit v1.8.0