|
@@ -14,6 +14,7 @@ import com.qmth.exam.reserve.service.MaterialGenerateService;
|
|
|
import com.qmth.exam.reserve.util.DateUtil;
|
|
|
import com.qmth.exam.reserve.weixin.OauthAccessTokenRequest;
|
|
|
import com.qmth.exam.reserve.weixin.response.OauthAccessTokenResponseJson;
|
|
|
+import org.apache.commons.io.FileUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
@@ -24,7 +25,6 @@ import org.springframework.boot.test.context.SpringBootTest;
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
import java.io.File;
|
|
|
-import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -44,7 +44,7 @@ public class ServerTest {
|
|
|
@Autowired
|
|
|
private RedisClient redisClient;
|
|
|
|
|
|
- @Test
|
|
|
+ // @Test
|
|
|
public void testRedisQueue() {
|
|
|
RQueue<Object> queue = redisClient.getRedissonClient().getQueue("test", new JsonJacksonCodec());
|
|
|
for (int i = 0; i < 10; i++) {
|
|
@@ -56,12 +56,12 @@ public class ServerTest {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
+ // @Test
|
|
|
public void updateTeachingCapacity() {
|
|
|
categoryService.updateTeachingCapacity(5L);
|
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
+ // @Test
|
|
|
public void testTeaching() {
|
|
|
LambdaQueryWrapper<CategoryEntity> lm = new LambdaQueryWrapper<>();
|
|
|
lm.eq(CategoryEntity::getEnable, Boolean.TRUE);
|
|
@@ -71,7 +71,7 @@ public class ServerTest {
|
|
|
System.out.println(map);
|
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
+ // @Test
|
|
|
public void testTimePeriod() {
|
|
|
LambdaQueryWrapper<TimePeriodEntity> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(TimePeriodEntity::getApplyTaskId, 27);
|
|
@@ -85,7 +85,7 @@ public class ServerTest {
|
|
|
System.out.println(list.size());
|
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
+ // @Test
|
|
|
public void testNoFinish() {
|
|
|
OauthAccessTokenRequest request = new OauthAccessTokenRequest("1212121212121", "wxb501ca68bdeb52df",
|
|
|
"aca244f836a76bdfa498a26be93e30a1");
|
|
@@ -95,16 +95,18 @@ public class ServerTest {
|
|
|
System.out.println(response.getErrcode() + ":" + response.getErrmsg());
|
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
- public void testTask() {
|
|
|
+ // @Test
|
|
|
+ public void testTask() throws Exception {
|
|
|
MaterialTitleInfo title = new MaterialTitleInfo();
|
|
|
title.setTaskName("广东开放大学2024年6月期末考试");
|
|
|
title.setSiteName("东莞开放大学");
|
|
|
+ title.setRoomCode("A");
|
|
|
+ title.setRoomName("考场01");
|
|
|
title.setAddress("11栋301教室");
|
|
|
title.setTimePeriod("2024年6月1日8:00-11:30");
|
|
|
|
|
|
List<StudentApplyVO> studentList = new ArrayList<>();
|
|
|
- for (int i = 1; i <= 80; i++) {
|
|
|
+ for (int i = 1; i <= 200; i++) {
|
|
|
StudentApplyVO vo = new StudentApplyVO();
|
|
|
vo.setName("测试" + i);
|
|
|
vo.setStudentCode("12345678901234");
|
|
@@ -115,15 +117,18 @@ public class ServerTest {
|
|
|
if (!tempFolder.exists()) {
|
|
|
tempFolder.mkdir();
|
|
|
}
|
|
|
- generateService.generateSignInForm(title, studentList);
|
|
|
- }
|
|
|
-
|
|
|
- public static void main(String[] args) throws IOException {
|
|
|
- System.out.println(DateUtil.getLongTimeByDate("2024-10-23 09:00:00") + "**" + DateUtil.getLongTimeByDate("2024-10-23 12:00:00"));
|
|
|
- System.out.println(DateUtil.getLongTimeByDate("2024-10-23 13:00:00") + "**" + DateUtil.getLongTimeByDate("2024-10-23 17:00:00"));
|
|
|
- System.out.println(DateUtil.getLongTimeByDate("2024-10-24 09:00:00") + "**" + DateUtil.getLongTimeByDate("2024-10-24 12:00:00"));
|
|
|
- System.out.println(DateUtil.getLongTimeByDate("2024-10-24 13:00:00") + "**" + DateUtil.getLongTimeByDate("2024-10-24 17:00:00"));
|
|
|
|
|
|
+ File file = generateService.generateSignInForm(title, studentList);
|
|
|
+ File toFile = new File("temp/" + System.currentTimeMillis() + ".pdf");
|
|
|
+ System.out.println(file.getAbsolutePath() + " " + toFile.getAbsolutePath());
|
|
|
+ FileUtils.moveFile(file, toFile);
|
|
|
}
|
|
|
|
|
|
+ // public static void main(String[] args) throws IOException {
|
|
|
+ // System.out.println(DateUtil.getLongTimeByDate("2024-10-23 09:00:00") + "**" + DateUtil.getLongTimeByDate("2024-10-23 12:00:00"));
|
|
|
+ // System.out.println(DateUtil.getLongTimeByDate("2024-10-23 13:00:00") + "**" + DateUtil.getLongTimeByDate("2024-10-23 17:00:00"));
|
|
|
+ // System.out.println(DateUtil.getLongTimeByDate("2024-10-24 09:00:00") + "**" + DateUtil.getLongTimeByDate("2024-10-24 12:00:00"));
|
|
|
+ // System.out.println(DateUtil.getLongTimeByDate("2024-10-24 13:00:00") + "**" + DateUtil.getLongTimeByDate("2024-10-24 17:00:00"));
|
|
|
+ // }
|
|
|
+
|
|
|
}
|