|
@@ -2,6 +2,9 @@ package com.fs.task;
|
|
|
|
|
|
|
|
|
import com.fs.FSAdminApplication;
|
|
|
+import com.fs.company.service.ICompanyService;
|
|
|
+import com.fs.company.vo.RedPacketMoneyVO;
|
|
|
+import com.fs.course.mapper.FsCourseRedPacketLogMapper;
|
|
|
import com.fs.course.service.IFsCourseWatchLogService;
|
|
|
import com.fs.statis.service.FsStatisSalerWatchService;
|
|
|
import org.junit.Test;
|
|
@@ -9,6 +12,8 @@ import org.junit.runner.RunWith;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
@RunWith(value = org.springframework.test.context.junit4.SpringRunner.class)
|
|
|
@SpringBootTest(classes = FSAdminApplication.class)
|
|
|
public class StoreTaskTest {
|
|
@@ -18,6 +23,12 @@ public class StoreTaskTest {
|
|
|
private FsCourseTask fsCourseTask;
|
|
|
@Autowired
|
|
|
private FsStatisSalerWatchService fsStatisSalerWatchService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FsCourseRedPacketLogMapper fsCourseRedPacketLogMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ICompanyService companyService;
|
|
|
@Test
|
|
|
public void addQwWatchLog() {
|
|
|
fsCourseWatchLogService.addCourseWatchLogDayNew();
|
|
@@ -31,4 +42,13 @@ public class StoreTaskTest {
|
|
|
public void testWriteData(){
|
|
|
fsStatisSalerWatchService.writeData();
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void redPacketSubMoney() throws Exception
|
|
|
+ {
|
|
|
+ List<RedPacketMoneyVO> redPacketMoneyVOS = fsCourseRedPacketLogMapper.selectFsCourseRedPacketLogByCompanyFix();
|
|
|
+ for (RedPacketMoneyVO redPacketMoneyVO : redPacketMoneyVOS) {
|
|
|
+ companyService.subtractCompanyMoney(redPacketMoneyVO.getMoney(),redPacketMoneyVO.getCompanyId());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|