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. 520
      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 +
'}';
}
} }

@ -2,307 +2,221 @@ package com.yipin.liuwanr.entity;
public class Student { public class Student {
//学生主键ID //学生主键ID
private Integer studentId; private Integer studentId;
//学生名称 //学生名称
private String studentName; private String studentName;
//学生学号 //学生学号
private String studentNumber; private String studentNumber;
//电话 //电话
private String phone; private String phone;
//邮箱 //邮箱
private String email; private String email;
//学生绑定角色ID //学生绑定角色ID
private Integer roleId; private Integer roleId;
//绑定学校ID //绑定学校ID
private Integer schoolId; private Integer schoolId;
//绑定专业ID //绑定专业ID
private Integer professionalId; private Integer professionalId;
//绑定年级ID //绑定年级ID
private Integer gradeId; private Integer gradeId;
//绑定班级ID //绑定班级ID
private Integer classId; private Integer classId;
//外部实体实验班级名称 //外部实体实验班级名称
private String experimentalClassName; private String experimentalClassName;
//外部实体实验班级ID //外部实体实验班级ID
private String experimentalClassId; private String experimentalClassId;
//是否考勤 //是否考勤
private Integer isAssess; private Integer isAssess;
//唯一标示性账号 //唯一标示性账号
private String uniqueIdentificationAccount; private String uniqueIdentificationAccount;
//搜索内容 //搜索内容
private String searchContent; private String searchContent;
//多个专业ID //多个专业ID
private String professionalIds; private String professionalIds;
//多个年级ID //多个年级ID
private String gradeIds; private String gradeIds;
//多个班级ID //多个班级ID
private String classIds; private String classIds;
//专业名称 //专业名称
private String professionalName; private String professionalName;
//年级名称 //年级名称
private String gradeName; private String gradeName;
//学生姓名和学号 //学生姓名和学号
private String studentNameNumber; private String studentNameNumber;
//int类型实验班级ID //int类型实验班级ID
private Integer intExperimentalClassId; private Integer intExperimentalClassId;
//绑定班级名称 //绑定班级名称
private String className; private String className;
//登陆次数 //登陆次数
private Integer loginNumber; private Integer loginNumber;
//最后一次登陆时间 //最后一次登陆时间
private String lastLoginTime; private String lastLoginTime;
//考勤统计 //考勤统计
private String attendance; private String attendance;
//学生专业组织架构名称 //学生专业组织架构名称
private String stuProfessionalArchitectureName; private String stuProfessionalArchitectureName;
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() {
return attendance;
public String getAttendance() { }
return attendance; public void setAttendance(String attendance) {
} this.attendance = attendance;
}
public void setAttendance(String attendance) { public Integer getLoginNumber() {
this.attendance = attendance; return loginNumber;
} }
public void setLoginNumber(Integer loginNumber) {
public Integer getLoginNumber() { this.loginNumber = loginNumber;
return loginNumber; }
} public String getLastLoginTime() {
return lastLoginTime;
public void setLoginNumber(Integer loginNumber) { }
this.loginNumber = loginNumber; public void setLastLoginTime(String lastLoginTime) {
} this.lastLoginTime = lastLoginTime;
}
public String getLastLoginTime() { public String getClassName() {
return lastLoginTime; return className;
} }
public void setClassName(String className) {
public void setLastLoginTime(String lastLoginTime) { this.className = className;
this.lastLoginTime = lastLoginTime; }
} public Integer getIntExperimentalClassId() {
return intExperimentalClassId;
public String getClassName() { }
return className; public void setIntExperimentalClassId(Integer intExperimentalClassId) {
} this.intExperimentalClassId = intExperimentalClassId;
}
public void setClassName(String className) { public String getStudentNameNumber() {
this.className = className; return studentNameNumber;
} }
public void setStudentNameNumber(String studentNameNumber) {
public Integer getIntExperimentalClassId() { this.studentNameNumber = studentNameNumber;
return intExperimentalClassId; }
} public String getProfessionalName() {
return professionalName;
public void setIntExperimentalClassId(Integer intExperimentalClassId) { }
this.intExperimentalClassId = intExperimentalClassId; public void setProfessionalName(String professionalName) {
} this.professionalName = professionalName;
}
public String getStudentNameNumber() { public String getGradeName() {
return studentNameNumber; return gradeName;
} }
public void setGradeName(String gradeName) {
public void setStudentNameNumber(String studentNameNumber) { this.gradeName = gradeName;
this.studentNameNumber = studentNameNumber; }
} public String getProfessionalIds() {
return professionalIds;
public String getProfessionalName() { }
return professionalName; public void setProfessionalIds(String professionalIds) {
} this.professionalIds = professionalIds;
}
public void setProfessionalName(String professionalName) { public String getGradeIds() {
this.professionalName = professionalName; return gradeIds;
} }
public void setGradeIds(String gradeIds) {
public String getGradeName() { this.gradeIds = gradeIds;
return gradeName; }
} public String getClassIds() {
return classIds;
public void setGradeName(String gradeName) { }
this.gradeName = gradeName; public void setClassIds(String classIds) {
} this.classIds = classIds;
}
public String getProfessionalIds() { public String getSearchContent() {
return professionalIds; return searchContent;
} }
public void setSearchContent(String searchContent) {
public void setProfessionalIds(String professionalIds) { this.searchContent = searchContent;
this.professionalIds = professionalIds; }
} public String getUniqueIdentificationAccount() {
return uniqueIdentificationAccount;
public String getGradeIds() { }
return gradeIds; public void setUniqueIdentificationAccount(String uniqueIdentificationAccount) {
} this.uniqueIdentificationAccount = uniqueIdentificationAccount;
}
public void setGradeIds(String gradeIds) { public Integer getStudentId() {
this.gradeIds = gradeIds; return studentId;
} }
public void setStudentId(Integer studentId) {
public String getClassIds() { this.studentId = studentId;
return classIds; }
} public String getStudentName() {
return studentName;
public void setClassIds(String classIds) { }
this.classIds = classIds; public void setStudentName(String studentName) {
} this.studentName = studentName;
}
public String getSearchContent() { public String getStudentNumber() {
return searchContent; return studentNumber;
} }
public void setStudentNumber(String studentNumber) {
public void setSearchContent(String searchContent) { this.studentNumber = studentNumber;
this.searchContent = searchContent; }
} public String getPhone() {
return phone;
public String getUniqueIdentificationAccount() { }
return uniqueIdentificationAccount; public void setPhone(String phone) {
} this.phone = phone;
}
public void setUniqueIdentificationAccount(String uniqueIdentificationAccount) { public String getEmail() {
this.uniqueIdentificationAccount = uniqueIdentificationAccount; return email;
} }
public void setEmail(String email) {
public Integer getStudentId() { this.email = email;
return studentId; }
} public Integer getRoleId() {
return roleId;
public void setStudentId(Integer studentId) { }
this.studentId = studentId; public void setRoleId(Integer roleId) {
} this.roleId = roleId;
}
public String getStudentName() { public Integer getSchoolId() {
return studentName; return schoolId;
} }
public void setSchoolId(Integer schoolId) {
public void setStudentName(String studentName) { this.schoolId = schoolId;
this.studentName = studentName; }
} public Integer getProfessionalId() {
return professionalId;
public String getStudentNumber() { }
return studentNumber; public void setProfessionalId(Integer professionalId) {
} this.professionalId = professionalId;
}
public void setStudentNumber(String studentNumber) { public Integer getGradeId() {
this.studentNumber = studentNumber; return gradeId;
} }
public void setGradeId(Integer gradeId) {
public String getPhone() { this.gradeId = gradeId;
return phone; }
} public Integer getClassId() {
return classId;
public void setPhone(String phone) { }
this.phone = phone; public void setClassId(Integer classId) {
} this.classId = classId;
}
public String getEmail() { public String getExperimentalClassName() {
return email; return experimentalClassName;
} }
public void setExperimentalClassName(String experimentalClassName) {
public void setEmail(String email) { this.experimentalClassName = experimentalClassName;
this.email = email; }
} public String getExperimentalClassId() {
return experimentalClassId;
public Integer getRoleId() { }
return roleId; public void setExperimentalClassId(String experimentalClassId) {
} this.experimentalClassId = experimentalClassId;
}
public void setRoleId(Integer roleId) { public Integer getIsAssess() {
this.roleId = roleId; return isAssess;
} }
public void setIsAssess(Integer isAssess) {
public Integer getSchoolId() { this.isAssess = isAssess;
return schoolId; }
}
public void setSchoolId(Integer schoolId) {
this.schoolId = schoolId;
}
public Integer getProfessionalId() {
return professionalId;
}
public void setProfessionalId(Integer professionalId) {
this.professionalId = professionalId;
}
public Integer getGradeId() {
return gradeId;
}
public void setGradeId(Integer gradeId) {
this.gradeId = gradeId;
}
public Integer getClassId() {
return classId;
}
public void setClassId(Integer classId) {
this.classId = classId;
}
public String getExperimentalClassName() {
return experimentalClassName;
}
public void setExperimentalClassName(String experimentalClassName) {
this.experimentalClassName = experimentalClassName;
}
public String getExperimentalClassId() {
return experimentalClassId;
}
public void setExperimentalClassId(String experimentalClassId) {
this.experimentalClassId = experimentalClassId;
}
public Integer getIsAssess() {
return isAssess;
}
public void setIsAssess(Integer 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