parent
2f4a5627ea
commit
782775acdb
6 changed files with 212 additions and 151 deletions
@ -1,145 +1,145 @@ |
||||
package com.msdw.tms.service; |
||||
|
||||
import com.msdw.tms.common.utils.R; |
||||
import com.msdw.tms.dao.AchievementManagementDao; |
||||
import com.msdw.tms.entity.ProjectEntity; |
||||
import com.msdw.tms.entity.ProjectRecordEntity; |
||||
import com.msdw.tms.entity.request.AchievementImportRequest; |
||||
import com.msdw.tms.entity.vo.AchievementManagementVo; |
||||
import com.msdw.tms.entity.vo.SearchAchievementVo; |
||||
import org.junit.jupiter.api.Test; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.boot.test.context.SpringBootTest; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
@SpringBootTest |
||||
public class AchievementManagementTest { |
||||
|
||||
@Autowired |
||||
private AchievementManagementService achievementManagementService; |
||||
|
||||
@Autowired |
||||
private ProjectRecordService projectRecordService; |
||||
|
||||
@Autowired |
||||
AchievementManagementDao achievementManagementDao; |
||||
|
||||
//测试新增实验记录
|
||||
//package com.msdw.tms.service;
|
||||
//
|
||||
//import com.msdw.tms.common.utils.R;
|
||||
//import com.msdw.tms.dao.AchievementManagementDao;
|
||||
//import com.msdw.tms.entity.ProjectEntity;
|
||||
//import com.msdw.tms.entity.ProjectRecordEntity;
|
||||
//import com.msdw.tms.entity.request.AchievementImportRequest;
|
||||
//import com.msdw.tms.entity.vo.AchievementManagementVo;
|
||||
//import com.msdw.tms.entity.vo.SearchAchievementVo;
|
||||
//import org.junit.jupiter.api.Test;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.boot.test.context.SpringBootTest;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.Date;
|
||||
//import java.util.List;
|
||||
//
|
||||
//@SpringBootTest
|
||||
//public class AchievementManagementTest {
|
||||
//
|
||||
// @Autowired
|
||||
// private AchievementManagementService achievementManagementService;
|
||||
//
|
||||
// @Autowired
|
||||
// private ProjectRecordService projectRecordService;
|
||||
//
|
||||
// @Autowired
|
||||
// AchievementManagementDao achievementManagementDao;
|
||||
//
|
||||
// //测试新增实验记录
|
||||
//// @Test
|
||||
//// public void addReport(){
|
||||
//// AchievementManagementVo vo = new AchievementManagementVo();
|
||||
//// ProjectRecordEntity entity = new ProjectRecordEntity();
|
||||
//// Date date = new Date();
|
||||
//// //用户id
|
||||
//// Integer userId = 385;
|
||||
////
|
||||
//// entity.setUserid(userId)
|
||||
//// .setProjectid(368)
|
||||
//// .setScore(100)
|
||||
//// .setRecordstate(0)
|
||||
//// .setStartingtime(date)
|
||||
//// .setEndtime(date)
|
||||
//// .setSubmittime(date)
|
||||
//// .setTimeSum(0)
|
||||
//// .setIsdel(0);
|
||||
//// vo.setUserId(userId)
|
||||
//// .setEvaluationId(158)
|
||||
//// .setExperimentalGoal("目标2")
|
||||
//// .setPrinciple("原理2")
|
||||
//// .setStep("步骤2")
|
||||
//// .setAnalysis("实验分析2")
|
||||
//// .setSummarize("实验总结2")
|
||||
//// .setImprovement("实验建议2")
|
||||
//// .setCommentId(3)
|
||||
//// .setTeacherId(178)
|
||||
//// .setPeriod("学时")
|
||||
//// .setLaboratory("实验室名称2")
|
||||
//// .setIsSignature(0)
|
||||
//// .setSignatureId(4)
|
||||
//// .setIsdel(0);
|
||||
//// vo.setEntity(entity);
|
||||
//// R r = achievementManagementService.addReport(vo);
|
||||
//// System.out.println(r);
|
||||
//// }
|
||||
//
|
||||
// @Test
|
||||
// public void queryReport(){
|
||||
// Integer reportId = 4;
|
||||
// Integer recordId = 100;
|
||||
// R r = achievementManagementService.queryReport(reportId);
|
||||
// System.out.println(r);
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void updateScore(){
|
||||
// ProjectRecordEntity vo = new ProjectRecordEntity();
|
||||
// Integer recordId = 100;
|
||||
// Integer score = 99;
|
||||
// vo.setRecordid(recordId).setScore(score);
|
||||
// projectRecordService.updateScore(vo);
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void addReport(){
|
||||
// public void daleteReport(){
|
||||
// Integer reportId = 4;
|
||||
// Integer recordId = 100;
|
||||
// AchievementManagementVo vo = new AchievementManagementVo();
|
||||
// ProjectRecordEntity entity = new ProjectRecordEntity();
|
||||
// Date date = new Date();
|
||||
// //用户id
|
||||
// Integer userId = 385;
|
||||
//
|
||||
// entity.setUserid(userId)
|
||||
// .setProjectid(368)
|
||||
// .setScore(100)
|
||||
// .setRecordstate(0)
|
||||
// .setStartingtime(date)
|
||||
// .setEndtime(date)
|
||||
// .setSubmittime(date)
|
||||
// .setTimeSum(0)
|
||||
// .setIsdel(0);
|
||||
// vo.setUserId(userId)
|
||||
// .setEvaluationId(158)
|
||||
// .setExperimentalGoal("目标2")
|
||||
// .setPrinciple("原理2")
|
||||
// .setStep("步骤2")
|
||||
// .setAnalysis("实验分析2")
|
||||
// .setSummarize("实验总结2")
|
||||
// .setImprovement("实验建议2")
|
||||
// .setCommentId(3)
|
||||
// .setTeacherId(178)
|
||||
// .setPeriod("学时")
|
||||
// .setLaboratory("实验室名称2")
|
||||
// .setIsSignature(0)
|
||||
// .setSignatureId(4)
|
||||
// .setIsdel(0);
|
||||
// entity.setRecordid(recordId);
|
||||
// vo.setReportId(reportId);
|
||||
// vo.setEntity(entity);
|
||||
// R r = achievementManagementService.addReport(vo);
|
||||
// R r = achievementManagementService.deleteReport(reportId);
|
||||
// System.out.println(r);
|
||||
// }
|
||||
|
||||
@Test |
||||
public void queryReport(){ |
||||
Integer reportId = 4; |
||||
Integer recordId = 100; |
||||
R r = achievementManagementService.queryReport(reportId); |
||||
System.out.println(r); |
||||
} |
||||
|
||||
@Test |
||||
public void updateScore(){ |
||||
ProjectRecordEntity vo = new ProjectRecordEntity(); |
||||
Integer recordId = 100; |
||||
Integer score = 99; |
||||
vo.setRecordid(recordId).setScore(score); |
||||
projectRecordService.updateScore(vo); |
||||
} |
||||
|
||||
@Test |
||||
public void daleteReport(){ |
||||
Integer reportId = 4; |
||||
Integer recordId = 100; |
||||
AchievementManagementVo vo = new AchievementManagementVo(); |
||||
ProjectRecordEntity entity = new ProjectRecordEntity(); |
||||
entity.setRecordid(recordId); |
||||
vo.setReportId(reportId); |
||||
vo.setEntity(entity); |
||||
R r = achievementManagementService.deleteReport(reportId); |
||||
System.out.println(r); |
||||
} |
||||
|
||||
//测试查询班级实验成绩列表
|
||||
@Test |
||||
public void queryEvaluationReport(){ |
||||
String searchContant = "michonne"; |
||||
// String searchContant = "";
|
||||
Integer projectId = 368; |
||||
Integer page = 1; |
||||
Integer size = 2; |
||||
R r = achievementManagementService.queryEvaluationReport(searchContant,projectId,page,size); |
||||
System.out.println(r); |
||||
} |
||||
|
||||
//筛选查询-教学实验
|
||||
@Test |
||||
public void queryEvaluationReportByRecordId(){ |
||||
Integer month = 1; |
||||
Integer systemId = 1; |
||||
String searchContent= ""; |
||||
String staingTime = ""; |
||||
String endTime = ""; |
||||
List<Integer> list = achievementManagementDao.countEducationProjectId(); |
||||
List<AchievementManagementVo> result = achievementManagementDao.queryEducationRecord(systemId, searchContent, staingTime, endTime, month, list); |
||||
System.out.println(result); |
||||
} |
||||
//筛选查询-虚拟实验
|
||||
@Test |
||||
public void queryFictitiousReportByRecordId(){ |
||||
Integer month = null; |
||||
Integer systemId = 1; |
||||
String searchContent= ""; |
||||
String staingTime = ""; |
||||
String endTime = ""; |
||||
List<Integer> list = achievementManagementDao.countFictitiousProjectId(); |
||||
List<AchievementManagementVo> result = achievementManagementDao.queryFictitiousRecord(systemId, searchContent, staingTime, endTime, month, list); |
||||
System.out.println(result); |
||||
} |
||||
|
||||
@Test |
||||
public void testQuery(){ |
||||
// String str = "184,185";
|
||||
ArrayList<Integer> integers = new ArrayList<>(); |
||||
integers.add(184); |
||||
integers.add(185); |
||||
|
||||
List<AchievementImportRequest> achievementImportRequests = achievementManagementDao.queryAchievement(integers); |
||||
System.out.println(achievementImportRequests); |
||||
} |
||||
} |
||||
//
|
||||
// //测试查询班级实验成绩列表
|
||||
// @Test
|
||||
// public void queryEvaluationReport(){
|
||||
// String searchContant = "michonne";
|
||||
// // String searchContant = "";
|
||||
// Integer projectId = 368;
|
||||
// Integer page = 1;
|
||||
// Integer size = 2;
|
||||
// R r = achievementManagementService.queryEvaluationReport(searchContant,projectId,page,size);
|
||||
// System.out.println(r);
|
||||
//}
|
||||
//
|
||||
// //筛选查询-教学实验
|
||||
// @Test
|
||||
// public void queryEvaluationReportByRecordId(){
|
||||
// Integer month = 1;
|
||||
// Integer systemId = 1;
|
||||
// String searchContent= "";
|
||||
// String staingTime = "";
|
||||
// String endTime = "";
|
||||
// List<Integer> list = achievementManagementDao.countEducationProjectId();
|
||||
// List<AchievementManagementVo> result = achievementManagementDao.queryEducationRecord(systemId, searchContent, staingTime, endTime, month, list);
|
||||
// System.out.println(result);
|
||||
// }
|
||||
// //筛选查询-虚拟实验
|
||||
// @Test
|
||||
// public void queryFictitiousReportByRecordId(){
|
||||
// Integer month = null;
|
||||
// Integer systemId = 1;
|
||||
// String searchContent= "";
|
||||
// String staingTime = "";
|
||||
// String endTime = "";
|
||||
// List<Integer> list = achievementManagementDao.countFictitiousProjectId();
|
||||
// List<AchievementManagementVo> result = achievementManagementDao.queryFictitiousRecord(systemId, searchContent, staingTime, endTime, month, list);
|
||||
// System.out.println(result);
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testQuery(){
|
||||
//// String str = "184,185";
|
||||
// ArrayList<Integer> integers = new ArrayList<>();
|
||||
// integers.add(184);
|
||||
// integers.add(185);
|
||||
//
|
||||
// List<AchievementImportRequest> achievementImportRequests = achievementManagementDao.queryAchievement(integers);
|
||||
// System.out.println(achievementImportRequests);
|
||||
// }
|
||||
//}
|
||||
|
Loading…
Reference in new issue