|
@@ -1,11 +1,10 @@
|
|
|
package com.qmth.distributed.print;
|
|
|
|
|
|
-import com.qmth.distributed.print.api.ExamDetailController;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.qmth.distributed.print.business.bean.result.TemplatePrintInfoResult;
|
|
|
import com.qmth.distributed.print.business.enums.MessageEnum;
|
|
|
import com.qmth.distributed.print.business.service.*;
|
|
|
import com.qmth.distributed.print.business.util.ConvertUtil;
|
|
|
-import com.qmth.distributed.print.business.util.OssUtil;
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
@@ -13,6 +12,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -31,22 +31,18 @@ public class ServiceTest {
|
|
|
@Resource
|
|
|
private ExamDetailService examDetailService;
|
|
|
@Resource
|
|
|
- private ExamDetailController examDetailController;
|
|
|
- @Resource
|
|
|
- OssUtil ossUtil;
|
|
|
- @Resource
|
|
|
private BasicMessageService basicMessageService;
|
|
|
@Resource
|
|
|
private BasicVerifyCodeService basicVerifyCodeService;
|
|
|
|
|
|
|
|
|
@Test
|
|
|
- public void printPlanTemplateDatasource(){
|
|
|
- examPrintPlanService.printPlanTemplateDatasource(1L,2L);
|
|
|
+ public void printPlanTemplateDatasource() {
|
|
|
+ examPrintPlanService.printPlanTemplateDatasource(1L, 2L);
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- public void mapper(){
|
|
|
+ public void mapper() {
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
ids.add(1L);
|
|
|
ids.add(9L);
|
|
@@ -57,16 +53,16 @@ public class ServiceTest {
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- public void readExcelTest(){
|
|
|
+ public void readExcelTest() {
|
|
|
examDetailService.findExaminationFields(101L);
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- public void date(){
|
|
|
+ public void date() {
|
|
|
Long startTime = 1618308000000L;
|
|
|
Long endTime = 1618315200000L;
|
|
|
|
|
|
- Map<String,Object> map = ConvertUtil.analyzeDateAndTime(startTime,endTime);
|
|
|
+ Map<String, Object> map = ConvertUtil.analyzeDateAndTime(startTime, endTime);
|
|
|
String date = String.valueOf(map.get("date"));
|
|
|
String time = String.valueOf(map.get("time"));
|
|
|
System.out.println("date = " + date);
|
|
@@ -75,27 +71,25 @@ public class ServiceTest {
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- public void uploadOss(){
|
|
|
-// String pdfDirName = "upload/2021/04/20/test1.pdf";
|
|
|
-// String pdfFilePath = "E:\\qiming\\qiming_dev\\distribution-print\\v2.0\\dev\\pdf-temp\\upload/2021/04/20/1eacef5479f74d72ab4a924468e80d73.pdf"
|
|
|
-// ossUtil.ossUpload(pdfDirName, pdfFile, BinaryUtil.toBase64String(HexUtils.decodeHex(fileMd5)));
|
|
|
- }
|
|
|
-
|
|
|
- @Test
|
|
|
- public void sendMessage(){
|
|
|
+ public void sendMessage() {
|
|
|
Long userId = 1L;
|
|
|
String mobileNumber = "18903719928";
|
|
|
Long businessId = 1L;
|
|
|
- String variableParams = "{\"code\":\"" + "123456" + "\"}";
|
|
|
+ Map<String, String> jsonMap = new HashMap<>();
|
|
|
+ jsonMap.put("name", "张三");
|
|
|
+ jsonMap.put("courseName", "数学");
|
|
|
+ jsonMap.put("paperNumber", "SX001");
|
|
|
+ String variableParams = JSON.toJSONString(jsonMap);
|
|
|
+// String variableParams = "{\"code\":\"" + "123456" + "\"}";
|
|
|
Long createId = 1L;
|
|
|
MessageEnum messageType = MessageEnum.NOTICE_OF_AUDIT_NOT_PASS;
|
|
|
|
|
|
- basicMessageService.saveMessageSendLog(userId,mobileNumber,businessId,variableParams,createId,messageType);
|
|
|
+ basicMessageService.saveMessageSendLog(userId, mobileNumber, businessId, variableParams, createId, messageType);
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- public void sendVerifyCode(){
|
|
|
- basicVerifyCodeService.sendVeirfyCode("18903719928",1L);
|
|
|
+ public void sendVerifyCode() {
|
|
|
+ basicVerifyCodeService.sendVeirfyCode("18903719928", 1L);
|
|
|
}
|
|
|
|
|
|
}
|