server and school test with assesment attendance and courseService

master
river 4 years ago
parent 6e8e98e27a
commit 511cff2db2
  1. 1
      src/main/java/com/yipin/liuwanr/entity/Action.java
  2. 18
      src/main/java/com/yipin/liuwanr/entity/Attendance.java
  3. 9
      src/main/java/com/yipin/liuwanr/entity/PageResult.java
  4. 86
      src/main/java/com/yipin/liuwanr/entity/Student.java
  5. 4
      src/main/java/com/yipin/liuwanr/service/StaffService.java
  6. 290
      src/test/java/com/yipin/liuwanr/service/AssesmentServiceTest.java
  7. 70
      src/test/java/com/yipin/liuwanr/service/AttendanceServiceTest.java
  8. 229
      src/test/java/com/yipin/liuwanr/service/CourseServiceTest.java
  9. 0
      src/test/resources/.gitkeep

@ -52,5 +52,4 @@ public class Action {
this.move = move; this.move = move;
} }
} }

@ -87,4 +87,22 @@ public class Attendance {
public void setExperimentalClassId(Integer experimentalClassId) { public void setExperimentalClassId(Integer experimentalClassId) {
this.experimentalClassId = experimentalClassId; this.experimentalClassId = experimentalClassId;
} }
@Override
public String toString() {
return "Attendance{" +
"id=" + id +
", courseId=" + courseId +
", experimentId=" + experimentId +
", creationTime='" + creationTime + '\'' +
", signIn=" + signIn +
", studentId=" + studentId +
", experimentalClassId=" + experimentalClassId +
", count=" + count +
", studentName='" + studentName + '\'' +
", experimentName='" + experimentName + '\'' +
", absence=" + absence +
", signInNumber=" + signInNumber +
'}';
}
} }

@ -42,4 +42,13 @@ public class PageResult implements Serializable {
public void setRows(List<?> rows) { public void setRows(List<?> rows) {
this.rows = rows; this.rows = rows;
} }
@Override
public String toString() {
return "PageResult{" +
"total=" + total +
", rows=" + rows +
", totalPages=" + totalPages +
'}';
}
} }

@ -60,249 +60,163 @@ public class Student {
public String getStuProfessionalArchitectureName() { public String getStuProfessionalArchitectureName() {
return stuProfessionalArchitectureName; return stuProfessionalArchitectureName;
} }
public void setStuProfessionalArchitectureName(String stuProfessionalArchitectureName) { public void setStuProfessionalArchitectureName(String stuProfessionalArchitectureName) {
this.stuProfessionalArchitectureName = stuProfessionalArchitectureName; this.stuProfessionalArchitectureName = stuProfessionalArchitectureName;
} }
public String getAttendance() { public String getAttendance() {
return attendance; return attendance;
} }
public void setAttendance(String attendance) { public void setAttendance(String attendance) {
this.attendance = attendance; this.attendance = attendance;
} }
public Integer getLoginNumber() { public Integer getLoginNumber() {
return loginNumber; return loginNumber;
} }
public void setLoginNumber(Integer loginNumber) { public void setLoginNumber(Integer loginNumber) {
this.loginNumber = loginNumber; this.loginNumber = loginNumber;
} }
public String getLastLoginTime() { public String getLastLoginTime() {
return lastLoginTime; return lastLoginTime;
} }
public void setLastLoginTime(String lastLoginTime) { public void setLastLoginTime(String lastLoginTime) {
this.lastLoginTime = lastLoginTime; this.lastLoginTime = lastLoginTime;
} }
public String getClassName() { public String getClassName() {
return className; return className;
} }
public void setClassName(String className) { public void setClassName(String className) {
this.className = className; this.className = className;
} }
public Integer getIntExperimentalClassId() { public Integer getIntExperimentalClassId() {
return intExperimentalClassId; return intExperimentalClassId;
} }
public void setIntExperimentalClassId(Integer intExperimentalClassId) { public void setIntExperimentalClassId(Integer intExperimentalClassId) {
this.intExperimentalClassId = intExperimentalClassId; this.intExperimentalClassId = intExperimentalClassId;
} }
public String getStudentNameNumber() { public String getStudentNameNumber() {
return studentNameNumber; return studentNameNumber;
} }
public void setStudentNameNumber(String studentNameNumber) { public void setStudentNameNumber(String studentNameNumber) {
this.studentNameNumber = studentNameNumber; this.studentNameNumber = studentNameNumber;
} }
public String getProfessionalName() { public String getProfessionalName() {
return professionalName; return professionalName;
} }
public void setProfessionalName(String professionalName) { public void setProfessionalName(String professionalName) {
this.professionalName = professionalName; this.professionalName = professionalName;
} }
public String getGradeName() { public String getGradeName() {
return gradeName; return gradeName;
} }
public void setGradeName(String gradeName) { public void setGradeName(String gradeName) {
this.gradeName = gradeName; this.gradeName = gradeName;
} }
public String getProfessionalIds() { public String getProfessionalIds() {
return professionalIds; return professionalIds;
} }
public void setProfessionalIds(String professionalIds) { public void setProfessionalIds(String professionalIds) {
this.professionalIds = professionalIds; this.professionalIds = professionalIds;
} }
public String getGradeIds() { public String getGradeIds() {
return gradeIds; return gradeIds;
} }
public void setGradeIds(String gradeIds) { public void setGradeIds(String gradeIds) {
this.gradeIds = gradeIds; this.gradeIds = gradeIds;
} }
public String getClassIds() { public String getClassIds() {
return classIds; return classIds;
} }
public void setClassIds(String classIds) { public void setClassIds(String classIds) {
this.classIds = classIds; this.classIds = classIds;
} }
public String getSearchContent() { public String getSearchContent() {
return searchContent; return searchContent;
} }
public void setSearchContent(String searchContent) { public void setSearchContent(String searchContent) {
this.searchContent = searchContent; this.searchContent = searchContent;
} }
public String getUniqueIdentificationAccount() { public String getUniqueIdentificationAccount() {
return uniqueIdentificationAccount; return uniqueIdentificationAccount;
} }
public void setUniqueIdentificationAccount(String uniqueIdentificationAccount) { public void setUniqueIdentificationAccount(String uniqueIdentificationAccount) {
this.uniqueIdentificationAccount = uniqueIdentificationAccount; this.uniqueIdentificationAccount = uniqueIdentificationAccount;
} }
public Integer getStudentId() { public Integer getStudentId() {
return studentId; return studentId;
} }
public void setStudentId(Integer studentId) { public void setStudentId(Integer studentId) {
this.studentId = studentId; this.studentId = studentId;
} }
public String getStudentName() { public String getStudentName() {
return studentName; return studentName;
} }
public void setStudentName(String studentName) { public void setStudentName(String studentName) {
this.studentName = studentName; this.studentName = studentName;
} }
public String getStudentNumber() { public String getStudentNumber() {
return studentNumber; return studentNumber;
} }
public void setStudentNumber(String studentNumber) { public void setStudentNumber(String studentNumber) {
this.studentNumber = studentNumber; this.studentNumber = studentNumber;
} }
public String getPhone() { public String getPhone() {
return phone; return phone;
} }
public void setPhone(String phone) { public void setPhone(String phone) {
this.phone = phone; this.phone = phone;
} }
public String getEmail() { public String getEmail() {
return email; return email;
} }
public void setEmail(String email) { public void setEmail(String email) {
this.email = email; this.email = email;
} }
public Integer getRoleId() { public Integer getRoleId() {
return roleId; return roleId;
} }
public void setRoleId(Integer roleId) { public void setRoleId(Integer roleId) {
this.roleId = roleId; this.roleId = roleId;
} }
public Integer getSchoolId() { public Integer getSchoolId() {
return schoolId; return schoolId;
} }
public void setSchoolId(Integer schoolId) { public void setSchoolId(Integer schoolId) {
this.schoolId = schoolId; this.schoolId = schoolId;
} }
public Integer getProfessionalId() { public Integer getProfessionalId() {
return professionalId; return professionalId;
} }
public void setProfessionalId(Integer professionalId) { public void setProfessionalId(Integer professionalId) {
this.professionalId = professionalId; this.professionalId = professionalId;
} }
public Integer getGradeId() { public Integer getGradeId() {
return gradeId; return gradeId;
} }
public void setGradeId(Integer gradeId) { public void setGradeId(Integer gradeId) {
this.gradeId = gradeId; this.gradeId = gradeId;
} }
public Integer getClassId() { public Integer getClassId() {
return classId; return classId;
} }
public void setClassId(Integer classId) { public void setClassId(Integer classId) {
this.classId = classId; this.classId = classId;
} }
public String getExperimentalClassName() { public String getExperimentalClassName() {
return experimentalClassName; return experimentalClassName;
} }
public void setExperimentalClassName(String experimentalClassName) { public void setExperimentalClassName(String experimentalClassName) {
this.experimentalClassName = experimentalClassName; this.experimentalClassName = experimentalClassName;
} }
public String getExperimentalClassId() { public String getExperimentalClassId() {
return experimentalClassId; return experimentalClassId;
} }
public void setExperimentalClassId(String experimentalClassId) { public void setExperimentalClassId(String experimentalClassId) {
this.experimentalClassId = experimentalClassId; this.experimentalClassId = experimentalClassId;
} }
public Integer getIsAssess() { public Integer getIsAssess() {
return isAssess; return isAssess;
} }
public void setIsAssess(Integer isAssess) { public void setIsAssess(Integer isAssess) {
this.isAssess = isAssess; this.isAssess = isAssess;
} }
@Override
public String toString() {
return "Student{" +
"studentId=" + studentId +
", studentName='" + studentName + '\'' +
", studentNumber='" + studentNumber + '\'' +
", phone='" + phone + '\'' +
", email='" + email + '\'' +
", roleId=" + roleId +
", schoolId=" + schoolId +
", professionalId=" + professionalId +
", gradeId=" + gradeId +
", classId=" + classId +
", experimentalClassName='" + experimentalClassName + '\'' +
", experimentalClassId='" + experimentalClassId + '\'' +
", isAssess=" + isAssess +
", uniqueIdentificationAccount='" + uniqueIdentificationAccount + '\'' +
", searchContent='" + searchContent + '\'' +
", professionalIds='" + professionalIds + '\'' +
", gradeIds='" + gradeIds + '\'' +
", classIds='" + classIds + '\'' +
", professionalName='" + professionalName + '\'' +
", gradeName='" + gradeName + '\'' +
", studentNameNumber='" + studentNameNumber + '\'' +
", intExperimentalClassId=" + intExperimentalClassId +
", className='" + className + '\'' +
", loginNumber=" + loginNumber +
", lastLoginTime='" + lastLoginTime + '\'' +
", attendance='" + attendance + '\'' +
", stuProfessionalArchitectureName='" + stuProfessionalArchitectureName + '\'' +
'}';
}
} }

@ -44,8 +44,8 @@ public class StaffService {
try { try {
//读取excel文件中的员工信息 //读取excel文件中的员工信息
List<Staff> staffs=ExcelImportHelper.readStaff(file); List<Staff> staffs = ExcelImportHelper.readStaff(file);
List<UserM> users=new ArrayList<UserM>(); List<UserM> users = new ArrayList<UserM>();
//循环员工信息,将员工信息与用户信息进行对比 //循环员工信息,将员工信息与用户信息进行对比
for (int i = 0; i < staffs.size(); i++) { for (int i = 0; i < staffs.size(); i++) {
Staff staff=staffs.get(i); Staff staff=staffs.get(i);

@ -0,0 +1,290 @@
package com.yipin.liuwanr.service;
import com.yipin.liuwanr.entity.Assesment;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* @auther River
* @date 2020/8/11 15:44
*/
@SpringBootTest
@RunWith(SpringRunner.class)
public class AssesmentServiceTest {
@Autowired
private AssesmentService assesmentService;
/**
* 考核管理列表
*/
@Test
@Transactional
public void queryAssesmentConditionTest(){
Assesment assesment = new Assesment();
assesment.setStaffId(123);
assesment.setCourseId(77);
Integer pageNO = 1;
Integer pageSize = 10;
HashMap<String, Object> condition = assesmentService.queryAssesmentCondition(assesment, pageNO, pageSize);
for (String s : condition.keySet()) {
System.out.println("key:" + s + "," + "value:" + condition.get(s));
}
}
/**
* 新建考核管理
*/
@Test
@Transactional
public void addAssesmentTest(){
Assesment assesment = new Assesment();
assesment.setAssesmentName("新建考核测试");
assesment.setClassId("14");
assesment.setCourseId(77);
assesment.setExperimentId(334);
assesment.setReleaseType(0);
assesment.setStaffId(123);
assesment.setTimesum("3600000");
List<Integer> studentIds = new ArrayList<>();
studentIds.add(67);
HashMap<String, Object> assesment1 = assesmentService.addAssesment(assesment, studentIds);
for (String s : assesment1.keySet()) {
System.out.println("key:" + s + "," + "value:" + assesment1.get(s));
}
}
/**
* 查询选中的学生有哪些正在参与考核
*/
@Test
@Transactional
public void queryStudentisAssessTest(){
List<Integer> studentIds = new ArrayList<>();
studentIds.add(67);
studentIds.add(65);
HashMap<String, Object> student = assesmentService.queryStudentisAssess(studentIds);
for (String s : student.keySet()) {
System.out.println("key:" + s + "," + "value:" + student.get(s));
}
}
/**
* 根据id查询考核的信息
*/
@Test
@Transactional
public void queryGetByIdTest(){
Integer id = 78;
HashMap<String, Object> assesment = assesmentService.queryGetById(id);
for (String s : assesment.keySet()) {
System.out.println("key:" + s + "," + "value:" + assesment.get(s));
}
}
/**
* 修改考核管理
*/
@Test
@Transactional
public void updateAssesmentTest(){
Assesment assesment = new Assesment();
List<Integer> studentIds = new ArrayList<>();
assesment.setAssesmentName("新建考核测试");
assesment.setClassId("14");
assesment.setCourseId(77);
assesment.setExperimentId(334);
assesment.setReleaseType(0);
assesment.setStaffId(123);
assesment.setTimesum("3600000");
studentIds.add(67);
HashMap<String, Object> assesment1 = assesmentService.updateAssesment(assesment, studentIds);
for (String s : assesment1.keySet()) {
System.out.println("key:" + s + "," + "value:" + assesment1.get(s));
}
}
/**
* 启动考核前的判断
*/
@Test
@Transactional
public void assessmentJudgmentTest(){
Integer assesmentId = 78;
HashMap<String, Object> assessmentJudgment = assesmentService.assessmentJudgment(assesmentId);
for (String s : assessmentJudgment.keySet()) {
System.out.println("key:" + s + "," + "value:" + assessmentJudgment.get(s));
}
}
/**
* 修改考核状态
*/
@Test
@Transactional
public void updateStateTest(){
Assesment assesment = new Assesment();
assesment.setId(79);
assesment.setAssesmentState(2);
assesment.setReleaseType(0);
assesment.setEndTime("1597214647000");
assesment.setTimesum("17167000");
HashMap<String, Object> state = assesmentService.updateState(assesment);
for (String s : state.keySet()) {
System.out.println("key:" + s + "," + "value:" + state.get(s));
}
}
/**
* 查询实验班级一级栏目
* 查询实验班级名称以及班级一下的学生
*/
@Test
@Transactional
public void queryCretionTimeTest(){
Integer staffId = 2043;
Integer schoolId = 123;
String cretionTime = null;
HashMap<String, Object> cretionTime1 = assesmentService.queryCretionTime(staffId, schoolId);
for (String s : cretionTime1.keySet()) {
System.out.println("key:" + s + "," + "value:" + cretionTime1.get(s));
}
HashMap<String, Object> cretionTime2 = assesmentService.queryCretionTime(cretionTime, staffId, schoolId);
for (String s : cretionTime1.keySet()) {
System.out.println("key:" + s + "," + "value:" + cretionTime2.get(s));
}
}
/**
* 考核信息展示
*/
@Test
@Transactional
public void queryAssesmentTest(){
Integer assesmentId = 79;
HashMap<String, Object> assesment = assesmentService.queryAssesment(assesmentId);
for (String s : assesment.keySet()) {
System.out.println("key:" + s + "," + "value:" + assesment.get(s));
}
}
/**
* 班级筛选
*/
@Test
@Transactional
public void getByclassTest(){
Integer assesmentId = 78;
HashMap<String, Object> byclass = assesmentService.getByclass(assesmentId);
for (String s : byclass.keySet()) {
System.out.println("key:" + s + "," + "value:" + byclass.get(s));
}
}
/**
* 成绩概况
*/
@Test
@Transactional
public void queryScoreTest(){
Integer assesmentId = 78;
Integer experimentalClassId = 0;
Integer classId = 14;
HashMap<String, Object> score = assesmentService.queryScore(assesmentId, experimentalClassId, classId);
for (String s : score.keySet()) {
System.out.println("key:" + s + "," + "value:" + score.get(s));
}
}
/**
* 成绩柱状图
*/
@Test
@Transactional
public void queryHistogramTest(){
Integer assesmentId = 78;
Integer experimentalClassId = 0;
Integer classId = 14;
HashMap<String, Object> histogram = assesmentService.queryHistogram(assesmentId, experimentalClassId, classId);
for (String s : histogram.keySet()) {
System.out.println("key:" + s + "," + "value:" + histogram.get(s));
}
}
/**
* 错误分布折线图
*/
@Test
@Transactional
public void getLinechartTest(){
Integer assesmentId = 78;
Integer experimentalClassId = 0;
Integer classId = 14;
HashMap<String, Object> linechart = assesmentService.getLinechart(assesmentId, experimentalClassId, classId);
for (String s : linechart.keySet()) {
System.out.println("key:" + s + "," + "value:" + linechart.get(s));
}
}
/**
* 成绩明细
*/
@Test
@Transactional
public void queryAssesmentScoreTest(){
Integer assesmentId = 78;
Integer experimentalClassId = 0;
Integer classId = 14;
HashMap<String, Object> assesmentScore = assesmentService.queryAssesmentScore(assesmentId, experimentalClassId, classId);
for (String s : assesmentScore.keySet()) {
System.out.println("key:" + s + "," + "value:" + assesmentScore.get(s));
}
}
/**
* 开启考核
*/
@Test
@Transactional
public void releaseAssesmentTest(){
Integer courseId = 14;
HashMap<String, Object> releaseAssesment = assesmentService.releaseAssesment(courseId);
for (String s : releaseAssesment.keySet()) {
System.out.println("key:" + s + "," + "value:" + releaseAssesment.get(s));
}
}
/**
* 删除考核项目
*/
@Test
@Transactional
public void deleteAssesmentTest(){
Integer assesmentId = 78;
HashMap<String, Object> assesment = assesmentService.deleteAssesment(assesmentId);
for (String s : assesment.keySet()) {
System.out.println("key:" + s + "," + "value:" + assesment.get(s));
}
}
/**
* 判断名称是否存在
*/
@Test
@Transactional
public void isNameExistisTest(){
String assesmentName = "随意";
HashMap<String, Object> existis = assesmentService.isNameExistis(assesmentName);
for (String s : existis.keySet()) {
System.out.println("key:" + s + "," + "value:" + existis.get(s));
}
}
}

@ -0,0 +1,70 @@
package com.yipin.liuwanr.service;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
/**
* @auther River
* @date 2020/8/13 9:59
*/
@SpringBootTest
@RunWith(SpringRunner.class)
public class AttendanceServiceTest {
@Autowired
private AttendanceService attendanceService;
/**
* 查询考勤记录
*/
@Test
@Transactional
public void queryAttendanceDetailedTest(){
Integer studentId = 77;
Integer courseId = 64;
Integer pageNo = 1;
Integer pageSize = 5;
HashMap<String, Object> detailed = attendanceService.queryAttendanceDetailed(studentId, courseId, pageNo, pageSize);
for (String s : detailed.keySet()) {
System.out.println("key:" + s + "," + "value:" + detailed.get(s));
}
}
/**
* 导出考勤记录
*/
@Test
@Transactional
public void exportPracticeTest(){
MockHttpServletResponse response = new MockHttpServletResponse();
Integer studentId = 64;
Integer courseId = 77;
String[] title = {"序号","项目名称","实验项目","考勤记录","签到时间"};
HashMap<String, Object> exportPractice = attendanceService.exportPractice(response, studentId, courseId, title);
if (exportPractice == null){
System.out.println("--------------------------Unit tests pass--------------------------");
}
}
/**
* 考勤个人信息展示
*/
@Test
@Transactional
public void queryAttendanceTest(){
Integer studentId = 67;
Integer courseId = 77;
HashMap<String, Object> attendance = attendanceService.queryAttendance(studentId, courseId);
for (String s : attendance.keySet()) {
System.out.println("key:" + s + "," + "value:" + attendance.get(s));
}
}
}

@ -0,0 +1,229 @@
package com.yipin.liuwanr.service;
import com.yipin.liuwanr.entity.Course;
import com.yipin.liuwanr.entity.CourseLink;
import com.yipin.liuwanr.entity.ServiceConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* @auther River
* @date 2020/8/14 9:26
*/
@SpringBootTest
@RunWith(SpringRunner.class)
public class CourseServiceTest {
@Autowired
private CourseService courseService;
/**
* 添加课程
*/
@Test
@Transactional
public void addCourseTest(){
Course course = new Course();
course.setCourseHours(1);
course.setCourseIntroduction("这是一个课程简介");
course.setCourseName("测试课程");
course.setCourseType(2);
course.setDisciplineId(2);
course.setMarketPrice(1);
course.setProfessionalClassId(5);
course.setProfessionalId(24);
course.setSystemId("1");
course.setTeachingGoal("这是一个教学目标");
HashMap<String, Object> addCourse = courseService.addCourse(course);
for (String s : addCourse.keySet()) {
System.out.println("key:" + s + "," + "value:" + addCourse.get(s));
}
}
/**
* 添加实训配置
*/
@Test
@Transactional
public void addCoursePCTest(){
List<ServiceConfig> serviceConfigList = new ArrayList<>();
ServiceConfig serviceConfig = new ServiceConfig();
serviceConfig.setCourseId(85);
serviceConfig.setProjectId(289);
serviceConfig.setProjectName("练习项目二:基础语法训练——初阶(数据转换与拼接)");
serviceConfig.setSystemId(1);
serviceConfig.setSystemName("Python程序设计实训系统");
serviceConfig.setIsShow(0);
serviceConfigList.add(serviceConfig);
HashMap<String, Object> coursePC = courseService.addCoursePC(serviceConfigList);
for (String s : coursePC.keySet()) {
System.out.println("key:" + s + "," + "value:" + coursePC.get(s));
}
}
/**
* 添加项目环节
*/
@Test
@Transactional
public void addCourseLinkTest(){
List<CourseLink> courseLinkList = new ArrayList<>();
CourseLink courseLink = new CourseLink();
courseLink.setCourseId(85);
courseLink.setLinkId(87);
courseLink.setFileLink("http://liuwanr.oss-cn-shenzhen.aliyuncs.com/py/20200814/1597370762315.py");
courseLink.setLinkName("测试环节");
courseLink.setProjectId(292);
courseLinkList.add(courseLink);
HashMap<String, Object> addCourseLink = courseService.addCourseLink(courseLinkList);
for (String s : addCourseLink.keySet()) {
System.out.println("key:" + s + "," + "value:" + addCourseLink.get(s));
}
}
/**
* 查询课程
*/
@Test
@Transactional
public void queryCourseTest(){
Course course = new Course();
Integer pageNo = 1;
Integer pageSize = 10;
HashMap<String, Object> queryCourse = courseService.queryCourse(course, pageNo, pageSize);
for (String s : queryCourse.keySet()) {
System.out.println("key:" + s + "," + "value:" + queryCourse.get(s));
}
}
/**
* 查询课程详情
*/
@Test
@Transactional
public void queryCourseDetailsTest(){
Integer courseId = 85;
HashMap<String, Object> courseDetails = courseService.queryCourseDetails(courseId);
for (String s : courseDetails.keySet()) {
System.out.println("key:" + s + "," + "value:" + courseDetails.get(s));
}
}
/**
* 查询课程名称是否存在
*/
@Test
@Transactional
public void queryCourseNameIsExists(){
String courseName = "测试课程";
HashMap<String, Object> isExists = courseService.queryCourseNameIsExists(courseName);
for (String s : isExists.keySet()) {
System.out.println("key:" + s + "," + "value:" + isExists.get(s));
}
}
/**
* 查询课程详情课程权限
*/
@Test
@Transactional
public void queryCourseDetailsTCTest(){
Integer courseId = 85;
Integer pageNo = 1;
Integer pageSize = 10;
HashMap<String, Object> detailsTC = courseService.queryCourseDetailsTC(courseId, pageNo, pageSize);
for (String s : detailsTC.keySet()) {
System.out.println("key:" + s + "," + "value:" + detailsTC.get(s));
}
}
/**
* 删除课程
*/
@Test
@Transactional
public void deleteCourseTest(){
List<Integer> courseIds = new ArrayList<>();
courseIds.add(85);
HashMap<String, Object> deleteCourse = courseService.deleteCourse(courseIds);
for (String s : deleteCourse.keySet()) {
System.out.println("key:" + s + "," + "value:" + deleteCourse.get(s));
}
}
/**
* 更新课程
*/
@Test
@Transactional
public void updateCourseTest(){
Course course = new Course();
course.setCourseId(87);
course.setCourseHours(1);
course.setCourseIntroduction("简介");
course.setCourseName("呵呵");
course.setCourseType(1);
course.setDisciplineId(1);
course.setMarketPrice(2);
course.setProfessionalClassId(1);
course.setProfessionalId(1);
course.setSystemId("1");
course.setTeachingGoal("目标");
HashMap<String, Object> updateCourse = courseService.updateCourse(course);
for (String s : updateCourse.keySet()) {
System.out.println("key:" + s + "," + "value:" + updateCourse.get(s));
}
}
/**
* 修改课程实训配置
*/
@Test
@Transactional
public void updateCoursePCTest(){
ServiceConfig serviceConfig = new ServiceConfig();
serviceConfig.setCourseId(85);
serviceConfig.setProjectId(289);
serviceConfig.setProjectName("练习项目二:基础语法训练——初阶(数据转换与拼接)");
serviceConfig.setSystemId(1);
serviceConfig.setSystemName("Python程序设计实训系统");
serviceConfig.setIsShow(0);
HashMap<String, Object> coursePC = courseService.updateCoursePC(serviceConfig);
for (String s : coursePC.keySet()) {
System.out.println("key:" + s + "," + "value:" + coursePC.get(s));
}
}
/**
* 删除课程实训配置
*/
@Test
@Transactional
public void deleteCoursePCTest(){
Integer courseId = 85;
HashMap<String, Object> coursePC = courseService.deleteCoursePC(courseId);
for (String s : coursePC.keySet()) {
System.out.println("key:" + s + "," + "value:" + coursePC.get(s));
}
}
/**
* 查看学科类别
*/
@Test
@Transactional
public void queryCourseDisciplineTest(){
HashMap<String, Object> discipline = courseService.queryCourseDiscipline();
for (String s : discipline.keySet()) {
System.out.println("key:" + s + "," + "value:" + discipline.get(s));
}
}
}
Loading…
Cancel
Save