Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/yipin/liuwanr/mapper/ExperimentalClassMapper.java
#	src/main/java/com/yipin/liuwanr/service/ExperimentalClassService.java
#	src/test/java/com/yipin/liuwanr/ExperimentalClassServiceTest.java
master
zhiyong.ning 4 years ago
commit a8d7762779
  1. 485
      src/main/java/com/yipin/liuwanr/controller/CustomerController.java
  2. 259
      src/main/java/com/yipin/liuwanr/entity/ExperimentalClass.java
  3. 15
      src/main/java/com/yipin/liuwanr/entity/Project_Management.java
  4. 23
      src/main/java/com/yipin/liuwanr/entity/Staff.java
  5. 33
      src/main/java/com/yipin/liuwanr/entity/Student.java
  6. 12
      src/main/java/com/yipin/liuwanr/mapper/ExperimentalClassMapper.java
  7. 207
      src/main/java/com/yipin/liuwanr/mapper/OrderMapper.java
  8. 39
      src/main/java/com/yipin/liuwanr/mapper/ServiceConfigMapper.java
  9. 20
      src/main/java/com/yipin/liuwanr/service/ExperimentalClassService.java
  10. 573
      src/main/java/com/yipin/liuwanr/service/OrderService.java
  11. 181
      src/main/java/com/yipin/liuwanr/service/ServiceConfigService.java
  12. 12
      src/test/java/com/yipin/liuwanr/ExperimentalClassServiceTest.java
  13. 217
      src/test/java/com/yipin/liuwanr/OrderServiceTest.java
  14. 83
      src/test/java/com/yipin/liuwanr/ServiceConfigServiceTest.java
  15. 165
      src/test/java/com/yipin/liuwanr/service/MakeuplistServiceTest.java
  16. 120
      src/test/java/com/yipin/liuwanr/service/ProjectAndCourseServiceTest.java
  17. 101
      src/test/java/com/yipin/liuwanr/service/SchoolServiceTest.java
  18. 93
      src/test/java/com/yipin/liuwanr/service/StaffGradServiceTest.java
  19. 194
      src/test/java/com/yipin/liuwanr/service/StaffServiceTest.java
  20. 258
      src/test/java/com/yipin/liuwanr/service/StuProfessionalArchitectureServiceTest.java

@ -1,268 +1,263 @@
package com.yipin.liuwanr.controller; package com.yipin.liuwanr.controller;
import java.util.HashMap;
import com.yipin.liuwanr.entity.School;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.yipin.liuwanr.entity.Customer; import com.yipin.liuwanr.entity.Customer;
import com.yipin.liuwanr.entity.Response; import com.yipin.liuwanr.entity.Response;
import com.yipin.liuwanr.entity.School;
import com.yipin.liuwanr.entity.UserM; import com.yipin.liuwanr.entity.UserM;
import com.yipin.liuwanr.helper.RedisHelper; import com.yipin.liuwanr.helper.RedisHelper;
import com.yipin.liuwanr.service.CustomerService; import com.yipin.liuwanr.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
@RestController @RestController
@RequestMapping("/customer") @RequestMapping("/customer")
@CrossOrigin @CrossOrigin
public class CustomerController { public class CustomerController {
@Autowired @Autowired
private CustomerService customerService; private CustomerService customerService;
@Autowired @Autowired
RedisHelper redisHelper; RedisHelper redisHelper;
/** /**
* 添加客户 * 添加客户
*/ */
@PostMapping("/addCustomer") @PostMapping("/addCustomer")
Response addCustomer(@RequestBody Customer customer) { Response addCustomer(@RequestBody Customer customer) {
Response resp = new Response(); Response resp = new Response();
UserM userm = new UserM(); UserM userm = new UserM();
Integer provinceId = customer.getProvinceId(); Integer provinceId = customer.getProvinceId();
Integer cityId = customer.getCityId(); Integer cityId = customer.getCityId();
String countries = customer.getCountries(); String countries = customer.getCountries();
String phone = customer.getAdminPhone(); String phone = customer.getAdminPhone();
String email = customer.getEmail(); String email = customer.getEmail();
String name = customer.getAdminName(); String name = customer.getAdminName();
Integer schoolId = customer.getSchoolId(); Integer schoolId = customer.getSchoolId();
userm.setSchoolId(schoolId); userm.setSchoolId(schoolId);
userm.setCityId(cityId); userm.setCityId(cityId);
userm.setCountries(countries); userm.setCountries(countries);
userm.setProvinceId(provinceId); userm.setProvinceId(provinceId);
userm.setPhone(phone); userm.setPhone(phone);
userm.setEmail(email); userm.setEmail(email);
userm.setName(name); userm.setName(name);
userm.setPassword("huoran123"); userm.setPassword("huoran123");
if (email==null||email==""){ if (email == null || email == "") {
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("邮箱不能为空!"); resp.setErrmessage("邮箱不能为空!");
}if (phone==null||phone==""){ }
resp.setStatus(300); if (phone == null || phone == "") {
resp.setErrmessage("电话不能为空!"); resp.setStatus(300);
}else if (name==null||name==""){ resp.setErrmessage("电话不能为空!");
resp.setStatus(300); } else if (name == null || name == "") {
resp.setErrmessage("姓名不能为空!"); resp.setStatus(300);
}else if (schoolId==null){ resp.setErrmessage("姓名不能为空!");
resp.setStatus(300); } else if (schoolId == null) {
resp.setErrmessage("学校不能为空!"); resp.setStatus(300);
}else if (provinceId==null){ resp.setErrmessage("学校不能为空!");
resp.setStatus(300); } else if (provinceId == null) {
resp.setErrmessage("省份不能为空!"); resp.setStatus(300);
}else if (cityId==null) { resp.setErrmessage("省份不能为空!");
resp.setStatus(300); } else if (cityId == null) {
resp.setErrmessage("城市不能为空!"); resp.setStatus(300);
} else { resp.setErrmessage("城市不能为空!");
HashMap<String, Object> ret = customerService.addCustomer(customer); } else {
HashMap<String, Object> ret1 = customerService.addAdmin(userm); HashMap<String, Object> ret = customerService.addCustomer(customer);
int status = (int) ret.get("retcode"); HashMap<String, Object> ret1 = customerService.addAdmin(userm);
if (200 == status) { int status = (int) ret.get("retcode");
resp.setStatus(status); if (200 == status) {
resp.setMessage(ret.get("retvalue")); resp.setStatus(status);
} else { resp.setMessage(ret.get("retvalue"));
resp.setStatus(status); } else {
resp.setErrmessage(ret.get("retvalue").toString()); resp.setStatus(status);
} resp.setErrmessage(ret.get("retvalue").toString());
} }
return resp; }
} return resp;
}
/** /**
* 查询客户 * 查询客户
*/ */
@GetMapping("/queryCustomer") @GetMapping("/queryCustomer")
Response queryCustomer(@RequestParam String countries,Integer provinceId,Integer cityId,Integer pageNo,Integer pageSize,String searchContent) { Response queryCustomer(@RequestParam String countries, Integer provinceId, Integer cityId, Integer pageNo, Integer pageSize, String searchContent) {
Response resp = new Response(); Response resp = new Response();
Customer customer = new Customer(); Customer customer = new Customer();
if (searchContent!=null&&searchContent!="") { if (searchContent != null && searchContent != "") {
customer.setSearchContent(searchContent); customer.setSearchContent(searchContent);
} }
if (countries!=null&&countries!="") { if (countries != null && countries != "") {
customer.setCountries(countries); customer.setCountries(countries);
} }
if (provinceId!=null) { if (provinceId != null) {
customer.setProvinceId(provinceId); customer.setProvinceId(provinceId);
} }
if (cityId!=null) { if (cityId != null) {
customer.setCityId(cityId); customer.setCityId(cityId);
} }
HashMap<String, Object> ret = customerService.queryCustomer(customer,pageNo,pageSize); HashMap<String, Object> ret = customerService.queryCustomer(customer, pageNo, pageSize);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
resp.setMessage(ret.get("retvalue")); resp.setMessage(ret.get("retvalue"));
} else { } else {
resp.setStatus(status); resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString()); resp.setErrmessage(ret.get("retvalue").toString());
} }
return resp; return resp;
} }
/** /**
* 查询客户详情 * 查询客户详情
*/ */
@GetMapping("/queryCustomerDetails") @GetMapping("/queryCustomerDetails")
Response queryCustomerDetails(@RequestParam Integer customerId) { Response queryCustomerDetails(@RequestParam Integer customerId) {
Response resp = new Response(); Response resp = new Response();
if (customerId==null) { if (customerId == null) {
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("Parameter Invalid"); resp.setErrmessage("Parameter Invalid");
}else { } else {
HashMap<String, Object> ret = customerService.queryCustomerDetails(customerId); HashMap<String, Object> ret = customerService.queryCustomerDetails(customerId);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
resp.setMessage(ret.get("retvalue")); resp.setMessage(ret.get("retvalue"));
} else { } else {
resp.setStatus(status); resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString()); resp.setErrmessage(ret.get("retvalue").toString());
} }
} }
return resp; return resp;
} }
/** /**
* 删除客户 * 删除客户
*/ */
@PostMapping("/deleteCustomer") @PostMapping("/deleteCustomer")
Response deleteCustomer(@RequestBody Customer customer) { Response deleteCustomer(@RequestBody Customer customer) {
Response resp = new Response(); Response resp = new Response();
if (customer.getCustomer().isEmpty()) { if (customer.getCustomer().isEmpty()) {
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("客户不能为空!"); resp.setErrmessage("客户不能为空!");
} else { } else {
HashMap<String, Object> ret = customerService.deleteCustomer(customer); HashMap<String, Object> ret = customerService.deleteCustomer(customer);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
resp.setMessage(ret.get("retvalue")); resp.setMessage(ret.get("retvalue"));
} else { } else {
resp.setStatus(status); resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString()); resp.setErrmessage(ret.get("retvalue").toString());
} }
} }
return resp; return resp;
} }
/** /**
* 更新客户 * 更新客户
*/ */
@PostMapping("/updateCustomer") @PostMapping("/updateCustomer")
Response updateCustomer(@RequestBody Customer customer) { Response updateCustomer(@RequestBody Customer customer) {
Response resp = new Response(); Response resp = new Response();
if (customer.getCustomerId()==null) { if (customer.getCustomerId() == null) {
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("客户不能为空!"); resp.setErrmessage("客户不能为空!");
} else { } else {
HashMap<String, Object> ret = customerService.updateCustomer(customer); HashMap<String, Object> ret = customerService.updateCustomer(customer);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
resp.setMessage(ret.get("retvalue")); resp.setMessage(ret.get("retvalue"));
} else { } else {
resp.setStatus(status); resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString()); resp.setErrmessage(ret.get("retvalue").toString());
} }
} }
return resp; return resp;
} }
/** /**
* 查询客户是否存在 * 查询客户是否存在
*/ */
@GetMapping("/queryCustomerIsExists") @GetMapping("/queryCustomerIsExists")
Response queryCustomerIsExists(@RequestParam Integer schoolId) { Response queryCustomerIsExists(@RequestParam Integer schoolId) {
Response resp = new Response(); Response resp = new Response();
if (schoolId==null) { if (schoolId == null) {
resp.setStatus(300); resp.setStatus(300);
resp.setErrmessage("学校不能为空!"); resp.setErrmessage("学校不能为空!");
}else { } else {
HashMap<String, Object> ret = customerService.queryCustomerIsExists(schoolId); HashMap<String, Object> ret = customerService.queryCustomerIsExists(schoolId);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
resp.setMessage(ret.get("retvalue")); resp.setMessage(ret.get("retvalue"));
} else { } else {
resp.setStatus(status); resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString()); resp.setErrmessage(ret.get("retvalue").toString());
} }
} }
return resp; return resp;
} }
/**
* 查询行业类 /**
*/ * 查询行业类
@GetMapping("/queryCustomerIndustryClass") */
Response queryCustomerIndustryClass() { @GetMapping("/queryCustomerIndustryClass")
Response resp = new Response(); Response queryCustomerIndustryClass() {
HashMap<String, Object> ret = customerService.queryCustomerIndustryClass(); Response resp = new Response();
int status = (int) ret.get("retcode"); HashMap<String, Object> ret = customerService.queryCustomerIndustryClass();
if (200 == status) { int status = (int) ret.get("retcode");
resp.setStatus(status); if (200 == status) {
resp.setMessage(ret.get("retvalue")); resp.setStatus(status);
} else { resp.setMessage(ret.get("retvalue"));
resp.setStatus(status); } else {
resp.setErrmessage(ret.get("retvalue").toString()); resp.setStatus(status);
} resp.setErrmessage(ret.get("retvalue").toString());
return resp; }
} return resp;
}
/** /**
* 查询行业 * 查询行业
*/ */
@GetMapping("/queryCustomerIndustry") @GetMapping("/queryCustomerIndustry")
Response queryCustomerIndustry(@RequestParam Integer industryClassId) { Response queryCustomerIndustry(@RequestParam Integer industryClassId) {
Response resp = new Response(); Response resp = new Response();
HashMap<String, Object> ret = customerService.queryCustomerIndustry(industryClassId); HashMap<String, Object> ret = customerService.queryCustomerIndustry(industryClassId);
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
resp.setMessage(ret.get("retvalue")); resp.setMessage(ret.get("retvalue"));
} else { } else {
resp.setStatus(status); resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString()); resp.setErrmessage(ret.get("retvalue").toString());
} }
return resp; return resp;
} }
/** /**
* 查询学校 * 查询学校
*/ */
@GetMapping("/querySchool") @GetMapping("/querySchool")
Response querySchool(@RequestParam String schoolName) { Response querySchool(@RequestParam String schoolName) {
Response resp = new Response(); Response resp = new Response();
School school = new School(); School school = new School();
if (schoolName!=null||schoolName!=""){ if (schoolName != null || schoolName != "") {
school.setSchoolName(schoolName); school.setSchoolName(schoolName);
} }
HashMap<String, Object> ret = customerService.querySchool(school); HashMap<String, Object> ret = customerService.querySchool(school);
resp.setStatus(200); resp.setStatus(200);
resp.setErrmessage("Parameter effective"); resp.setErrmessage("Parameter effective");
int status = (int) ret.get("retcode"); int status = (int) ret.get("retcode");
if (200 == status) { if (200 == status) {
resp.setStatus(status); resp.setStatus(status);
resp.setMessage(ret.get("retvalue")); resp.setMessage(ret.get("retvalue"));
} else { } else {
resp.setStatus(status); resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString()); resp.setErrmessage(ret.get("retvalue").toString());
} }
return resp; return resp;
} }
} }

@ -6,128 +6,145 @@ import java.util.List;
* 实验班级信息 * 实验班级信息
* *
* @author 全承珠 * @author 全承珠
*
*/ */
public class ExperimentalClass { public class ExperimentalClass {
//实验班级主键ID //实验班级主键ID
private Integer experimentalClassId; private Integer experimentalClassId;
//实验班级名称 //实验班级名称
private String experimentalClassName; private String experimentalClassName;
//班级大小 //班级大小
private Integer classSize; private Integer classSize;
//练习次数 //练习次数
private Integer practiceNumber; private Integer practiceNumber;
//考核次数 //考核次数
private Integer inspectionNumber; private Integer inspectionNumber;
//课程进度 //课程进度
private String courseSchedule; private String courseSchedule;
//创建时间 //创建时间
private String creationTime; private String creationTime;
//创建人 //创建人
private String founder; private String founder;
//绑定课程Id //绑定课程Id
private Integer courseId; private Integer courseId;
//绑定学校id //绑定学校id
private Integer schoolId; private Integer schoolId;
//绑定用户Id //绑定用户Id
private Integer userId; private Integer userId;
private List<Student> students; private List<Student> students;
public List<Student> getStudents() { public List<Student> getStudents() {
return students; return students;
} }
public void setStudents(List<Student> students) { public void setStudents(List<Student> students) {
this.students = students; this.students = students;
} }
public Integer getUserId() { public Integer getUserId() {
return userId; return userId;
} }
public void setUserId(Integer userId) { public void setUserId(Integer userId) {
this.userId = userId; this.userId = userId;
} }
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 getExperimentalClassId() { public Integer getExperimentalClassId() {
return experimentalClassId; return experimentalClassId;
} }
public void setExperimentalClassId(Integer experimentalClassId) { public void setExperimentalClassId(Integer experimentalClassId) {
this.experimentalClassId = experimentalClassId; this.experimentalClassId = experimentalClassId;
} }
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 Integer getClassSize() { public Integer getClassSize() {
return classSize; return classSize;
} }
public void setClassSize(Integer classSize) { public void setClassSize(Integer classSize) {
this.classSize = classSize; this.classSize = classSize;
} }
public Integer getPracticeNumber() { public Integer getPracticeNumber() {
return practiceNumber; return practiceNumber;
} }
public void setPracticeNumber(Integer practiceNumber) { public void setPracticeNumber(Integer practiceNumber) {
this.practiceNumber = practiceNumber; this.practiceNumber = practiceNumber;
} }
public Integer getInspectionNumber() { public Integer getInspectionNumber() {
return inspectionNumber; return inspectionNumber;
} }
public void setInspectionNumber(Integer inspectionNumber) { public void setInspectionNumber(Integer inspectionNumber) {
this.inspectionNumber = inspectionNumber; this.inspectionNumber = inspectionNumber;
} }
public String getCourseSchedule() { public String getCourseSchedule() {
return courseSchedule; return courseSchedule;
} }
public void setCourseSchedule(String courseSchedule) { public void setCourseSchedule(String courseSchedule) {
this.courseSchedule = courseSchedule; this.courseSchedule = courseSchedule;
} }
public String getCreationTime() { public String getCreationTime() {
return creationTime; return creationTime;
} }
public void setCreationTime(String creationTime) { public void setCreationTime(String creationTime) {
this.creationTime = creationTime; this.creationTime = creationTime;
} }
public String getFounder() { public String getFounder() {
return founder; return founder;
} }
public void setFounder(String founder) { public void setFounder(String founder) {
this.founder = founder; this.founder = founder;
} }
public Integer getCourseId() { public Integer getCourseId() {
return courseId; return courseId;
} }
public void setCourseId(Integer courseId) { public void setCourseId(Integer courseId) {
this.courseId = courseId; this.courseId = courseId;
} }
@Override
public String toString() {
return "ExperimentalClass{" +
"experimentalClassId=" + experimentalClassId +
", experimentalClassName='" + experimentalClassName + '\'' +
", classSize=" + classSize +
", practiceNumber=" + practiceNumber +
", inspectionNumber=" + inspectionNumber +
", courseSchedule='" + courseSchedule + '\'' +
", creationTime='" + creationTime + '\'' +
", founder='" + founder + '\'' +
", courseId=" + courseId +
", schoolId=" + schoolId +
", userId=" + userId +
", students=" + students +
'}';
}
} }

@ -30,6 +30,21 @@ public class Project_Management {
private Integer isAttendance; private Integer isAttendance;
private Integer signin;//是否签到 private Integer signin;//是否签到
public Project_Management(){
}
public Project_Management(Integer isOpenProject,Integer projectId){
this.isOpenProject = isOpenProject;
this.projectId = projectId;
}
public Project_Management(Integer projectId,Integer isAttendance,Integer founder){
this.projectId = projectId;
this.isAttendance = isAttendance;
this.founder = founder;
}
private List<CourseLink> courseLinks; private List<CourseLink> courseLinks;
public List<CourseLink> getCourseLinks() { public List<CourseLink> getCourseLinks() {

@ -148,4 +148,27 @@ public class Staff {
public void setStaffProfessionalArchitectureId(Integer staffProfessionalArchitectureId) { public void setStaffProfessionalArchitectureId(Integer staffProfessionalArchitectureId) {
this.staffProfessionalArchitectureId = staffProfessionalArchitectureId; this.staffProfessionalArchitectureId = staffProfessionalArchitectureId;
} }
@Override
public String toString() {
return "Staff{" +
"staffId=" + staffId +
", staffName='" + staffName + '\'' +
", staffWorkNumber='" + staffWorkNumber + '\'' +
", phone='" + phone + '\'' +
", email='" + email + '\'' +
", logNumber=" + logNumber +
", lastTimeOfLanding='" + lastTimeOfLanding + '\'' +
", staffGradeId=" + staffGradeId +
", staffProfessionalArchitectureId=" + staffProfessionalArchitectureId +
", staffProfessionalArchitectureName='" + staffProfessionalArchitectureName + '\'' +
", nameAndNumber='" + nameAndNumber + '\'' +
", roleId=" + roleId +
", staffGradeName='" + staffGradeName + '\'' +
", uniqueIdentificationAccount='" + uniqueIdentificationAccount + '\'' +
", staffGradeIds='" + staffGradeIds + '\'' +
", staffProfessionalArchitectureIds='" + staffProfessionalArchitectureIds + '\'' +
", schoolId=" + schoolId +
'}';
}
} }

@ -229,4 +229,37 @@ public class Student {
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 + '\'' +
'}';
}
} }

@ -31,12 +31,11 @@ public interface ExperimentalClassMapper {
@Options(useGeneratedKeys=true, keyProperty="experimentalClassId", keyColumn="experimentalClassId") @Options(useGeneratedKeys=true, keyProperty="experimentalClassId", keyColumn="experimentalClassId")
void addExperimentalClass(ExperimentalClass experimentalClass); void addExperimentalClass(ExperimentalClass experimentalClass);
//查询实验班级
@Select({"<script>", @Select({"<script>",
"SELECT experimentalClassId,experimentalClassName,classSize,creationTime,founder,courseId,userId,schoolId " "SELECT experimentalClassId,experimentalClassName,classSize,creationTime,founder,courseId,userId,schoolId "
+ "from experimental_class_ning where isdel = 0 and schoolId = #{schoolId} and courseId=#{courseId} and userId = #{userId}", + "from experimental_class_ning where isdel = 0 and schoolId = #{schoolId} and courseId=#{courseId}",
"</script> "}) "</script> "})
List<ExperimentalClass> queryExperimentalClass(Integer schoolId,Integer courseId,Integer userId); List<ExperimentalClass> queryExperimentalClass(Integer schoolId,Integer courseId);
//查询实验班级学生专业 //查询实验班级学生专业
@Select({"<script>", @Select({"<script>",
@ -50,7 +49,6 @@ public interface ExperimentalClassMapper {
"</script> "}) "</script> "})
List<Student> queryStudentClass(Integer experimentalClassId); List<Student> queryStudentClass(Integer experimentalClassId);
//查询实验班级详情
@Select({"<script>", @Select({"<script>",
"SELECT stu.*,pro.professionalName,gra.gradeName from student stu,experimental_class_ning exp,grade gra,professional pro WHERE stu.experimentalClassId = exp.experimentalClassId and stu.gradeId = gra.gradeId and FIND_IN_SET(exp.experimentalClassId,#{experimentalClassId}) ", "SELECT stu.*,pro.professionalName,gra.gradeName from student stu,experimental_class_ning exp,grade gra,professional pro WHERE stu.experimentalClassId = exp.experimentalClassId and stu.gradeId = gra.gradeId and FIND_IN_SET(exp.experimentalClassId,#{experimentalClassId}) ",
" <if test='professionalId!=null'>and stu.professionalId = #{professionalId} </if>", " <if test='professionalId!=null'>and stu.professionalId = #{professionalId} </if>",
@ -60,21 +58,17 @@ public interface ExperimentalClassMapper {
"</script> "}) "</script> "})
List<Student> queryExperimentalClassDetails(Student student); List<Student> queryExperimentalClassDetails(Student student);
//查询实验班级详情1
@Select({"<script>", @Select({"<script>",
"SELECT n.* from experimental_class_ning n where n.experimentalClassId = #{experimentalClassId}", "SELECT n.* from experimental_class_ning n where n.experimentalClassId = #{experimentalClassId}",
"</script> "}) "</script> "})
List<ExperimentalClass> queryExperimentalClassDetails1(Integer experimentalClassId); List<ExperimentalClass> queryExperimentalClassDetails1(Integer experimentalClassId);
//删除实验班级
@Update("UPDATE experimental_class_ning SET isdel = 1 where experimentalClassId = #{experimentalClassId}") @Update("UPDATE experimental_class_ning SET isdel = 1 where experimentalClassId = #{experimentalClassId}")
void deleteExperimentalClass(Integer experimentalClassId); void deleteExperimentalClass(Integer experimentalClassId);
//删除实验班级学生
@Delete("Delete from experimental_class_student where experimentalClassId = #{experimentalClassId}") @Delete("Delete from experimental_class_student where experimentalClassId = #{experimentalClassId}")
void deleteExperimentalClassStu(Integer experimentalClassId); void deleteExperimentalClassStu(Integer experimentalClassId);
//修改实验班级
@Update("UPDATE experimental_class_ning SET experimentalClassName = #{experimentalClassName},classSize = #{classSize},practiceNumber = #{practiceNumber},inspectionNumber = #{inspectionNumber},courseSchedule = #{courseSchedule},founder = #{founder},courseId = #{courseId} where experimentalClassId = #{experimentalClassId}") @Update("UPDATE experimental_class_ning SET experimentalClassName = #{experimentalClassName},classSize = #{classSize},practiceNumber = #{practiceNumber},inspectionNumber = #{inspectionNumber},courseSchedule = #{courseSchedule},founder = #{founder},courseId = #{courseId} where experimentalClassId = #{experimentalClassId}")
void updateExperimentalClass(ExperimentalClass experimentalClass); void updateExperimentalClass(ExperimentalClass experimentalClass);
@ -107,7 +101,7 @@ public interface ExperimentalClassMapper {
@Select("select s.studentId,studentName from student s left join experimental_class_student exs on s.studentId=exs.studentId " + @Select("select s.studentId,studentName from student s left join experimental_class_student exs on s.studentId=exs.studentId " +
" where exs.experimentalClassId=#{experimentalClassId} GROUP BY s.studentId") " where exs.experimentalClassId=#{experimentalClassId} GROUP BY s.studentId")
List<Student> queryStudent(Integer experimentalClassId); List<Student> querystudent(Integer experimentalClassId);
/** /**

@ -1,7 +1,6 @@
package com.yipin.liuwanr.mapper; package com.yipin.liuwanr.mapper;
import java.util.List; import com.yipin.liuwanr.entity.*;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import com.yipin.liuwanr.entity.ApplicationPermissions; import com.yipin.liuwanr.entity.ApplicationPermissions;
@ -12,6 +11,8 @@ import com.yipin.liuwanr.entity.Customer;
import com.yipin.liuwanr.entity.Order; import com.yipin.liuwanr.entity.Order;
import com.yipin.liuwanr.vo.OrderVo; import com.yipin.liuwanr.vo.OrderVo;
import java.util.List;
public interface OrderMapper { public interface OrderMapper {
//添加订单 //添加订单
@ -32,106 +33,106 @@ public interface OrderMapper {
//添加课程权限 //添加课程权限
@Insert({"<script>", @Insert({"<script>",
// "INSERT INTO hr_course_permissions(courseId,usePeriod,marketPrice,transactionPrice,discount,portAddressId,isDeliverGoods,isdel,orderId,expirationTime) VALUES" // "INSERT INTO hr_course_permissions(courseId,usePeriod,marketPrice,transactionPrice,discount,portAddressId,isDeliverGoods,isdel,orderId,expirationTime) VALUES"
//缺少个过期时间 //缺少个过期时间
"INSERT INTO hr_course_permissions(courseId,usePeriod,marketPrice,transactionPrice,discount,portAddressId,isDeliverGoods,isdel,orderId) VALUES" "INSERT INTO hr_course_permissions(courseId,usePeriod,marketPrice,transactionPrice,discount,portAddressId,isDeliverGoods,isdel,orderId) VALUES"
+ "<foreach collection = 'coursePermissionss' item='c' separator=','>" + "<foreach collection = 'coursePermissionss' item='c' separator=','>"
+ " (#{c.courseId},#{c.usePeriod},#{c.marketPrice},#{c.transactionPrice},#{c.discount},#{c.portAddressId},#{c.isDeliverGoods},0,#{c.orderId})" + " (#{c.courseId},#{c.usePeriod},#{c.marketPrice},#{c.transactionPrice},#{c.discount},#{c.portAddressId},#{c.isDeliverGoods},0,#{c.orderId})"
+ "</foreach>", + "</foreach>",
"</script> "}) "</script> "})
void addCoursePermissionss(@Param("coursePermissionss")List<CoursePermissions> coursePermissionss); void addCoursePermissionss(@Param("coursePermissionss") List<CoursePermissions> coursePermissionss);
@Insert("INSERT INTO hr_application_permissions(systemId,isdel,orderId" @Insert("INSERT INTO hr_application_permissions(systemId,isdel,orderId"
+ ") VALUES(#{systemId},0,#{orderId})") + ") VALUES(#{systemId},0,#{orderId})")
void bindingApplicationPermissions(ApplicationPermissions applicationPermissions); void bindingApplicationPermissions(ApplicationPermissions applicationPermissions);
@Select("SELECT c.courseId,c.courseName,c.marketPrice from course c where c.isdel = 0 and FIND_IN_SET(c.courseId,#{courseId})") @Select("SELECT c.courseId,c.courseName,c.marketPrice from course c where c.isdel = 0 and FIND_IN_SET(c.courseId,#{courseId})")
List<Course> queryCoursePermissions(String courseId); List<Course> queryCoursePermissions(String courseId);
@Select({"<script>", @Select({"<script>",
"SELECT o.orderId,o.orderNumber,o.orderName,o.orderAmount,o.orderDate,o.orderType,o.orderStatus,o.orderNature,o.provinceId,o.cityId,o.orderContact,o.phone,o.email,o.customerId,c.customerName from orders o,customer c where o.isdel=0 and c.customerId = o.customerId", "SELECT o.orderId,o.orderNumber,o.orderName,o.orderAmount,o.orderDate,o.orderType,o.orderStatus,o.orderNature,o.provinceId,o.cityId,o.orderContact,o.phone,o.email,o.customerId,c.customerName from orders o,customer c where o.isdel=0 and c.customerId = o.customerId",
" <if test='provinceId !=null'>and o.provinceId = #{provinceId} </if>", " <if test='provinceId !=null'>and o.provinceId = #{provinceId} </if>",
" <if test='cityId !=null'>and o.cityId = #{cityId} </if>", " <if test='cityId !=null'>and o.cityId = #{cityId} </if>",
" <if test='orderType !=null'>and o.orderType = #{orderType} </if>", " <if test='orderType !=null'>and o.orderType = #{orderType} </if>",
" <if test='orderStatus !=null'>and o.orderStatus = #{orderStatus} </if>", " <if test='orderStatus !=null'>and o.orderStatus = #{orderStatus} </if>",
" <if test='searchContent!=null'> and o.orderNumber like CONCAT('%',#{searchContent},'%') or c.customerName like CONCAT('%',#{searchContent},'%')</if>", " <if test='searchContent!=null'> and o.orderNumber like CONCAT('%',#{searchContent},'%') or c.customerName like CONCAT('%',#{searchContent},'%')</if>",
"order by o.orderDate desc", "order by o.orderDate desc",
"</script> "}) "</script> "})
List<Order> queryOrder(Order order); List<Order> queryOrder(Order order);
@Select( @Select(
"SELECT o.* from orders o where o.isdel = 0 and o.orderId = #{orderId} ") "SELECT o.* from orders o where o.isdel = 0 and o.orderId = #{orderId} ")
@Results({ @Results({
@Result(property = "orders", column = "orderId",one = @One(select = "com.yipin.liuwanr.mapper.OrderMapper.queryOrderDetailsO")), @Result(property = "orders", column = "orderId", one = @One(select = "com.yipin.liuwanr.mapper.OrderMapper.queryOrderDetailsO")),
@Result(property = "contractInformations", column = "orderId",one = @One(select = "com.yipin.liuwanr.mapper.OrderMapper.queryOrderDetailsCI")), @Result(property = "contractInformations", column = "orderId", one = @One(select = "com.yipin.liuwanr.mapper.OrderMapper.queryOrderDetailsCI")),
@Result(property = "coursePermissionss", column = "orderId",many = @Many(select = "com.yipin.liuwanr.mapper.OrderMapper.queryOrderDetailsCP")) @Result(property = "coursePermissionss", column = "orderId", many = @Many(select = "com.yipin.liuwanr.mapper.OrderMapper.queryOrderDetailsCP"))
}) })
List<OrderVo> queryOrderDetails(Integer orderId); List<OrderVo> queryOrderDetails(Integer orderId);
@Select({"<script>", @Select({"<script>",
"SELECT o.orderId,o.orderNumber,o.orderName,o.orderAmount,o.orderDate,o.orderType,o.orderStatus,o.orderNature,o.provinceId,o.cityId,o.orderContact,o.phone,o.email,o.customerId,(SELECT c.customerName from customer c WHERE c.customerId = o.customerId) as customerName from orders o where o.isdel=0 and o.orderId = #{orderId} ", "SELECT o.orderId,o.orderNumber,o.orderName,o.orderAmount,o.orderDate,o.orderType,o.orderStatus,o.orderNature,o.provinceId,o.cityId,o.orderContact,o.phone,o.email,o.customerId,(SELECT c.customerName from customer c WHERE c.customerId = o.customerId) as customerName from orders o where o.isdel=0 and o.orderId = #{orderId} ",
"</script> "}) "</script> "})
Order queryOrderDetailsO(Integer orderId); Order queryOrderDetailsO(Integer orderId);
@Select({"<script>", @Select({"<script>",
"SELECT cp.*,c.courseName FROM hr_course_permissions cp,course c where cp.courseId = c.courseId and cp.orderId = #{orderId}", "SELECT cp.*,c.courseName FROM hr_course_permissions cp,course c where cp.courseId = c.courseId and cp.orderId = #{orderId}",
"</script> "}) "</script> "})
List<CoursePermissions>queryOrderDetailsCP(Integer orderId); List<CoursePermissions> queryOrderDetailsCP(Integer orderId);
@Select({"<script>", @Select({"<script>",
"SELECT ci.* from hr_contract_information ci where ci.orderId = #{orderId}", "SELECT ci.* from hr_contract_information ci where ci.orderId = #{orderId}",
"</script> "}) "</script> "})
ContractInformation queryOrderDetailsCI(Integer orderId); ContractInformation queryOrderDetailsCI(Integer orderId);
@Update({"<script>", @Update({"<script>",
"UPDATE orders SET isdel = 1 where orderId in " "UPDATE orders SET isdel = 1 where orderId in "
+ "<foreach collection = 'orderId' item='c' open='(' separator=',' close=')'>" + "<foreach collection = 'orderId' item='c' open='(' separator=',' close=')'>"
+ " #{c}" + " #{c}"
+ "</foreach>", + "</foreach>",
"</script> "}) "</script> "})
void deleteOrder(@Param("orderId")List<Integer> orderId); void deleteOrder(@Param("orderId") List<Integer> orderId);
@Update("UPDATE orders SET customerName = #{customerName},orderName = #{orderName},orderAmount = #{orderAmount},orderType = #{orderType},provinceId = #{provinceId},cityId = #{cityId},orderContact = #{orderContact},phone = #{phone},email = #{email},customerId = #{customerId} where orderId = #{orderId}") @Update("UPDATE orders SET customerName = #{customerName},orderName = #{orderName},orderAmount = #{orderAmount},orderType = #{orderType},provinceId = #{provinceId},cityId = #{cityId},orderContact = #{orderContact},phone = #{phone},email = #{email},customerId = #{customerId} where orderId = #{orderId}")
void updateOrder(Order order); void updateOrder(Order order);
@Delete("Delete from hr_course_permissions WHERE orderId = #{orderId}") @Delete("Delete from hr_course_permissions WHERE orderId = #{orderId}")
void deleteCoursePermissions(Integer orderId); void deleteCoursePermissions(Integer orderId);
//缺少个过期时间 //缺少个过期时间
@Update("INSERT INTO hr_course_permissions(courseId,usePeriod,marketPrice,transactionPrice,discount,portAddressId,isDeliverGoods,orderId) VALUES (#{courseId},#{usePeriod},#{marketPrice},#{transactionPrice},#{discount},#{portAddressId},#{isDeliverGoods},#{orderId})") @Update("INSERT INTO hr_course_permissions(courseId,usePeriod,marketPrice,transactionPrice,discount,portAddressId,isDeliverGoods,orderId) VALUES (#{courseId},#{usePeriod},#{marketPrice},#{transactionPrice},#{discount},#{portAddressId},#{isDeliverGoods},#{orderId})")
void updateCoursePermissions(CoursePermissions coursePermissions); void updateCoursePermissions(CoursePermissions coursePermissions);
@Update("UPDATE hr_contract_information SET contractInformationName = #{contractInformationName},contractInformationNumber = #{contractInformationNumber},contractInformationSum = #{contractInformationSum},contractInformationLink = #{contractInformationLink} where contractInformationId = #{contractInformationId}") @Update("UPDATE hr_contract_information SET contractInformationName = #{contractInformationName},contractInformationNumber = #{contractInformationNumber},contractInformationSum = #{contractInformationSum},contractInformationLink = #{contractInformationLink} where contractInformationId = #{contractInformationId}")
void updateContractInformation(ContractInformation contractInformation); void updateContractInformation(ContractInformation contractInformation);
@Update({"<script>", @Update({"<script>",
"UPDATE hr_course_permissions SET" "UPDATE hr_course_permissions SET"
+ "<if test='isDeliverGoods==1'> isDeliverGoods = 1 </if>" + "<if test='isDeliverGoods==1'> isDeliverGoods = 1 </if>"
+ "<if test='isDeliverGoods==0'> isDeliverGoods = 0 </if>" + "<if test='isDeliverGoods==0'> isDeliverGoods = 0 </if>"
+ "where coursePermissionsId = #{coursePermissionsId}", + "where coursePermissionsId = #{coursePermissionsId}",
"</script> "}) "</script> "})
void isDeliverGoods(CoursePermissions coursePermissions); void isDeliverGoods(CoursePermissions coursePermissions);
@Select({"<script>", @Select({"<script>",
"SELECT customerId,customerName FROM customer where isdel = 0", "SELECT customerId,customerName FROM customer where isdel = 0",
" <if test='provinceId !=null'>and provinceId = #{provinceId} </if>", " <if test='provinceId !=null'>and provinceId = #{provinceId} </if>",
" <if test='cityId !=null'>and cityId = #{cityId} </if>", " <if test='cityId !=null'>and cityId = #{cityId} </if>",
"</script> "}) "</script> "})
List<Customer> queryOrderCustomer(Integer cityId,Integer provinceId); List<Customer> queryOrderCustomer(Integer cityId, Integer provinceId);
@Select({"<script>", @Select({"<script>",
"SELECT customerId,adminName,adminPhone,email FROM customer where isdel = 0 and customerId = #{customerId}", "SELECT customerId,adminName,adminPhone,email FROM customer where isdel = 0 and customerId = #{customerId}",
"</script> "}) "</script> "})
List<Customer> queryOrderCustomerContact(Integer customerId); List<Customer> queryOrderCustomerContact(Integer customerId);
//查询订单课程列表 //查询订单课程列表
@Select({"<script>", @Select({"<script>",
"SELECT c.courseId,c.courseName,c.courseType,c.disciplineId,c.professionalClassId,c.professionalId,c.courseHours,c.marketPrice,c.courseIntroduction,c.teachingGoal,c.systemId,c.isShelves from course c where c.isdel = 0 ", "SELECT c.courseId,c.courseName,c.courseType,c.disciplineId,c.professionalClassId,c.professionalId,c.courseHours,c.marketPrice,c.courseIntroduction,c.teachingGoal,c.systemId,c.isShelves from course c where c.isdel = 0 ",
" <if test='searchContent !=null and searchContent!=\"\" '> and c.courseName like CONCAT('%',#{searchContent},'%')</if>", " <if test='searchContent !=null and searchContent!=\"\" '> and c.courseName like CONCAT('%',#{searchContent},'%')</if>",
" <if test='courseId!=null'>" " <if test='courseId!=null'>"
+ "<foreach collection='courseId' item='id' open='and c.courseId not in (' separator=',' close=')'> #{id}" + "<foreach collection='courseId' item='id' open='and c.courseId not in (' separator=',' close=')'> #{id}"
+"</foreach>" + "</foreach>"
+ "</if>", + "</if>",
"</script> "}) "</script> "})
List<Course> queryCourseList(String searchContent,@Param("courseId")List<Integer> courseId); List<Course> queryCourseList(String searchContent, @Param("courseId") List<Integer> courseId);
} }

@ -1,34 +1,33 @@
package com.yipin.liuwanr.mapper; package com.yipin.liuwanr.mapper;
import java.util.List; import com.yipin.liuwanr.entity.ServiceConfig;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
import com.yipin.liuwanr.entity.ServiceConfig; import java.util.List;
public interface ServiceConfigMapper { public interface ServiceConfigMapper {
@Insert("INSERT INTO service_config(systemName,systemType,systemAttribution,systemStatus,isdel) VALUES(#{systemName},#{systemType},#{systemAttribution},#{systemStatus},0)") @Insert("INSERT INTO service_config(systemName,systemType,systemAttribution,systemStatus,isdel) VALUES(#{systemName},#{systemType},#{systemAttribution},#{systemStatus},0)")
void addServiceConfig(ServiceConfig serviceConfig); void addServiceConfig(ServiceConfig serviceConfig);
@Select({"<script>", @Select({"<script>",
"SELECT systemId,systemName,systemType,systemAttribution,systemStatus,projectSystemAddress,markPointsAddress from service_config where isdel = 0 ", "SELECT systemId,systemName,systemType,systemAttribution,systemStatus,projectSystemAddress,markPointsAddress from service_config where isdel = 0 ",
" <if test='systemAttribution !=null'>and systemAttribution = #{systemAttribution} </if>", " <if test='systemAttribution !=null'>and systemAttribution = #{systemAttribution} </if>",
" <if test='systemType !=null'>and systemType = #{systemType} </if>", " <if test='systemType !=null'>and systemType = #{systemType} </if>",
" <if test='searchContent!=null'> and systemName like CONCAT('%',#{searchContent},'%')</if>", " <if test='searchContent!=null'> and systemName like CONCAT('%',#{searchContent},'%')</if>",
"</script> "}) "</script> "})
List<ServiceConfig> queryServiceConfig(ServiceConfig serviceConfig); List<ServiceConfig> queryServiceConfig(ServiceConfig serviceConfig);
@Select({"<script>", @Select({"<script>",
"SELECT systemId,systemName,systemType,systemAttribution,systemStatus,projectSystemAddress,markPointsAddress from service_config where systemId = #{systemId} ", "SELECT systemId,systemName,systemType,systemAttribution,systemStatus,projectSystemAddress,markPointsAddress from service_config where systemId = #{systemId} ",
"</script> "}) "</script> "})
List<ServiceConfig> queryServiceConfigDetails(Integer systemId); List<ServiceConfig> queryServiceConfigDetails(Integer systemId);
@Update("UPDATE service_config SET isdel = 1 where systemId = #{systemId}") @Update("UPDATE service_config SET isdel = 1 where systemId = #{systemId}")
void deleteServiceConfig(ServiceConfig serviceConfig); void deleteServiceConfig(ServiceConfig serviceConfig);
@Update("UPDATE service_config SET systemName = #{systemName},systemType = #{systemType},systemAttribution = #{systemAttribution},systemStatus = #{systemStatus} where systemId = #{systemId}") @Update("UPDATE service_config SET systemName = #{systemName},systemType = #{systemType},systemAttribution = #{systemAttribution},systemStatus = #{systemStatus} where systemId = #{systemId}")
void updateServiceConfig(ServiceConfig serviceConfig); void updateServiceConfig(ServiceConfig serviceConfig);
} }

@ -1,9 +1,7 @@
package com.yipin.liuwanr.service; package com.yipin.liuwanr.service;
import java.util.ArrayList; import com.yipin.liuwanr.mapper.ExperimentalClassMapper;
import java.util.HashMap; import com.yipin.liuwanr.mapper.TeacherProjectAndCourseMapper;
import java.util.List;
import org.jboss.logging.Logger; import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -13,11 +11,11 @@ import com.yipin.liuwanr.entity.Professional;
import com.yipin.liuwanr.entity.Project_Management; import com.yipin.liuwanr.entity.Project_Management;
import com.yipin.liuwanr.entity.StuProfessionalArchitecture; import com.yipin.liuwanr.entity.StuProfessionalArchitecture;
import com.yipin.liuwanr.entity.Student; import com.yipin.liuwanr.entity.Student;
import com.yipin.liuwanr.mapper.ExperimentalClassMapper;
import com.yipin.liuwanr.mapper.TeacherProjectAndCourseMapper;
import com.yipin.liuwanr.vo.ExperimentalClassVo;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
@Service @Service
public class ExperimentalClassService { public class ExperimentalClassService {
@ -98,11 +96,11 @@ public class ExperimentalClassService {
return resp; return resp;
} }
public HashMap<String, Object> queryExperimentalClass(Integer schoolId,Integer courseId,Integer userId) { public HashMap<String, Object> queryExperimentalClass(Integer schoolId,Integer courseId) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
if(!StringUtils.isEmpty(courseId)){ if(!StringUtils.isEmpty(courseId)){
resp.put("retvalue", experimentalClassMapper.queryExperimentalClass(schoolId,courseId,userId)); resp.put("retvalue", experimentalClassMapper.queryExperimentalClass(schoolId,courseId));
resp.put("retcode", 200); resp.put("retcode", 200);
} }
} catch (RuntimeException e) { } catch (RuntimeException e) {
@ -179,12 +177,12 @@ public class ExperimentalClassService {
//新增学生显示数据 //新增学生显示数据
public HashMap<String, Object> queryExperimentalClass(Integer experimentalClassId) { public HashMap<String, Object> queryexperimentalClass(Integer experimentalClassId) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
HashMap<String, Object> obj = new HashMap<String, Object>(); HashMap<String, Object> obj = new HashMap<String, Object>();
try { try {
List<ExperimentalClass> classes = experimentalClassMapper.queryExperimentalClassDetails1(experimentalClassId); List<ExperimentalClass> classes = experimentalClassMapper.queryExperimentalClassDetails1(experimentalClassId);
List<Student> students = experimentalClassMapper.queryStudent(experimentalClassId); List<Student> students = experimentalClassMapper.querystudent(experimentalClassId);
obj.put("experimentalClass", classes); obj.put("experimentalClass", classes);
obj.put("students", students); obj.put("students", students);

@ -1,319 +1,312 @@
package com.yipin.liuwanr.service; package com.yipin.liuwanr.service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yipin.liuwanr.entity.*;
import com.yipin.liuwanr.mapper.OrderMapper;
import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yipin.liuwanr.entity.ApplicationPermissions;
import com.yipin.liuwanr.entity.ContractInformation;
import com.yipin.liuwanr.entity.Course;
import com.yipin.liuwanr.entity.CoursePermissions;
import com.yipin.liuwanr.entity.Order;
import com.yipin.liuwanr.entity.PageResult;
import com.yipin.liuwanr.mapper.OrderMapper;
@Service @Service
public class OrderService { public class OrderService {
private static Logger logger = Logger.getLogger(OrderService.class); private static Logger logger = Logger.getLogger(OrderService.class);
@Autowired
private OrderMapper orderMapper;
//添加合同信息 @Autowired
public HashMap<String, Object> addOrder(Order order){ private OrderMapper orderMapper;
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
long timeStamp = new Date().getTime();//获取时间戳
String orderNumber = String.valueOf(timeStamp);//long转String
order.setOrderNumber(orderNumber);
orderMapper.addOrder(order);
resp.put("orderId", order.getOrderId());
resp.put("retcode", 200);
orderMapper.updateOrderCustomer(order);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "添加订单失败!");
return resp;
}
return resp;
}
public HashMap<String, Object> addContractInformation(ContractInformation contractInformation){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
orderMapper.addContractInformation(contractInformation);
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "添加信息合同失败!");
return resp;
}
return resp;
}
//添加课程权限 //添加合同信息
public HashMap<String, Object> addCoursePermissionss(List<CoursePermissions> coursePermissionss) throws ParseException{ public HashMap<String, Object> addOrder(Order order) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
Integer size = coursePermissionss.size(); long timeStamp = new Date().getTime();//获取时间戳
for (int i = 0; i < size; i++) { String orderNumber = String.valueOf(timeStamp);//long转String
CoursePermissions coursePermissionssList = coursePermissionss.get(i); order.setOrderNumber(orderNumber);
Integer usePeriod = coursePermissionssList.getUsePeriod(); orderMapper.addOrder(order);
Integer usePeriod1 = usePeriod*1000*(60*60*24); resp.put("orderId", order.getOrderId());
long DQSJC = System.currentTimeMillis(); resp.put("retcode", 200);
long expireSJC = usePeriod1 + DQSJC; orderMapper.updateOrderCustomer(order);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); } catch (RuntimeException e) {
long lt = new Long(expireSJC); logger.error(e.getMessage());
Date date = new Date(lt); resp.put("retcode", 500);
String time = simpleDateFormat.format(date); resp.put("retvalue", "添加订单失败!");
coursePermissionss.get(i).setExpirationTime(time); return resp;
} }
orderMapper.addCoursePermissionss(coursePermissionss); return resp;
resp.put("retcode", 200); }
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "添加课程权限失败!");
return resp;
}
return resp;
}
//绑定应用权限 public HashMap<String, Object> addContractInformation(ContractInformation contractInformation) {
public HashMap<String, Object> bindingApplicationPermissions(ApplicationPermissions applicationPermissions){ HashMap<String, Object> resp = new HashMap<String, Object>();
HashMap<String, Object> resp = new HashMap<String, Object>(); try {
try { orderMapper.addContractInformation(contractInformation);
orderMapper.bindingApplicationPermissions(applicationPermissions); resp.put("retcode", 200);
resp.put("retcode", 200); } catch (RuntimeException e) {
} catch (RuntimeException e) { logger.error(e.getMessage());
logger.error(e.getMessage()); resp.put("retcode", 500);
resp.put("retcode", 500); resp.put("retvalue", "添加信息合同失败!");
resp.put("retvalue", "Inquiry Failed"); return resp;
return resp; }
} return resp;
return resp; }
}
public HashMap<String, Object> queryCoursePermissions(String courseId){ //添加课程权限
HashMap<String, Object> resp = new HashMap<String, Object>(); public HashMap<String, Object> addCoursePermissionss(List<CoursePermissions> coursePermissionss) throws ParseException {
try { HashMap<String, Object> resp = new HashMap<String, Object>();
List<Course> list = orderMapper.queryCoursePermissions(courseId); try {
resp.put("retvalue", list); Integer size = coursePermissionss.size();
resp.put("retcode", 200); for (int i = 0; i < size; i++) {
} catch (RuntimeException e) { CoursePermissions coursePermissionssList = coursePermissionss.get(i);
logger.error(e.getMessage()); Integer usePeriod = coursePermissionssList.getUsePeriod();
resp.put("retcode", 500); Integer usePeriod1 = usePeriod * 1000 * (60 * 60 * 24);
resp.put("retvalue", "Inquiry Failed"); long DQSJC = System.currentTimeMillis();
return resp; long expireSJC = usePeriod1 + DQSJC;
} SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return resp; long lt = new Long(expireSJC);
} Date date = new Date(lt);
String time = simpleDateFormat.format(date);
coursePermissionss.get(i).setExpirationTime(time);
}
orderMapper.addCoursePermissionss(coursePermissionss);
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "添加课程权限失败!");
return resp;
}
return resp;
}
//绑定应用权限
public HashMap<String, Object> bindingApplicationPermissions(ApplicationPermissions applicationPermissions) {
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
orderMapper.bindingApplicationPermissions(applicationPermissions);
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed");
return resp;
}
return resp;
}
public HashMap<String, Object> queryOrder(Order order,Integer pageNo,Integer pageSize){ public HashMap<String, Object> queryCoursePermissions(String courseId) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
if(pageNo!=null&&pageSize!=null) { List<Course> list = orderMapper.queryCoursePermissions(courseId);
PageHelper.startPage(pageNo, pageSize); resp.put("retvalue", list);
List<Order> list = orderMapper.queryOrder(order); resp.put("retcode", 200);
PageInfo<Order> info=new PageInfo<Order>(list); } catch (RuntimeException e) {
int total1 = (int) info.getTotal(); logger.error(e.getMessage());
int totalPages; resp.put("retcode", 500);
totalPages = total1 / pageSize; resp.put("retvalue", "Inquiry Failed");
if (total1 % pageSize != 0){ return resp;
totalPages ++; }
} return resp;
long total = total1; }
resp.put("retvalue", new PageResult(total, list,totalPages));
resp.put("retcode", 200);
}else {
List<Order> list = orderMapper.queryOrder(order);
resp.put("retvalue", list);
resp.put("retcode", 200);
}
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed");
return resp;
}
return resp;
}
public HashMap<String, Object> queryOrderDetails(Integer orderId){ public HashMap<String, Object> queryOrder(Order order, Integer pageNo, Integer pageSize) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
resp.put("retvalue", orderMapper.queryOrderDetails(orderId)); if (pageNo != null && pageSize != null) {
resp.put("retcode", 200); PageHelper.startPage(pageNo, pageSize);
} catch (RuntimeException e) { List<Order> list = orderMapper.queryOrder(order);
logger.error(e.getMessage()); PageInfo<Order> info = new PageInfo<Order>(list);
resp.put("retcode", 500); int total1 = (int) info.getTotal();
resp.put("retvalue", "Inquiry Failed"); int totalPages;
return resp; totalPages = total1 / pageSize;
} if (total1 % pageSize != 0) {
return resp; totalPages++;
} }
long total = total1;
resp.put("retvalue", new PageResult(total, list, totalPages));
resp.put("retcode", 200);
} else {
List<Order> list = orderMapper.queryOrder(order);
resp.put("retvalue", list);
resp.put("retcode", 200);
}
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed");
return resp;
}
return resp;
}
public HashMap<String, Object> deleteOrder(List<Integer> orderId){ public HashMap<String, Object> queryOrderDetails(Integer orderId) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
orderMapper.deleteOrder(orderId); resp.put("retvalue", orderMapper.queryOrderDetails(orderId));
resp.put("retcode", 200); resp.put("retcode", 200);
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "Inquiry Failed");
return resp; return resp;
} }
return resp; return resp;
} }
public HashMap<String, Object> updateOrder(Order order){ public HashMap<String, Object> deleteOrder(List<Integer> orderId) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
orderMapper.updateOrder(order); orderMapper.deleteOrder(orderId);
resp.put("retcode", 200); resp.put("retcode", 200);
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "Inquiry Failed");
return resp; return resp;
} }
return resp; return resp;
} }
public HashMap<String, Object> deleteCoursePermissions(Integer orderId){ public HashMap<String, Object> updateOrder(Order order) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
orderMapper.deleteCoursePermissions(orderId); orderMapper.updateOrder(order);
resp.put("retcode", 200); resp.put("retcode", 200);
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "Inquiry Failed");
return resp; return resp;
} }
return resp; return resp;
} }
public HashMap<String, Object> updateCoursePermissions(List<CoursePermissions> coursePermissionss){ public HashMap<String, Object> deleteCoursePermissions(Integer orderId) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
int size = coursePermissionss.size(); try {
if (coursePermissionss.isEmpty()) { orderMapper.deleteCoursePermissions(orderId);
resp.put("retcode", 200); resp.put("retcode", 200);
}else { } catch (RuntimeException e) {
try { logger.error(e.getMessage());
for (int i = 0; i < size; i++) { resp.put("retcode", 500);
CoursePermissions coursePermissions = coursePermissionss.get(i); resp.put("retvalue", "Inquiry Failed");
orderMapper.updateCoursePermissions(coursePermissions); return resp;
} }
resp.put("retcode", 200); return resp;
} catch (RuntimeException e) { }
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed");
return resp;
}
}
return resp;
}
public HashMap<String, Object> updateContractInformation(ContractInformation contractInformation){ public HashMap<String, Object> updateCoursePermissions(List<CoursePermissions> coursePermissionss) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { int size = coursePermissionss.size();
orderMapper.updateContractInformation(contractInformation); if (coursePermissionss.isEmpty()) {
resp.put("retcode", 200); resp.put("retcode", 200);
} catch (RuntimeException e) { } else {
logger.error(e.getMessage()); try {
resp.put("retcode", 500); for (int i = 0; i < size; i++) {
resp.put("retvalue", "Inquiry Failed"); CoursePermissions coursePermissions = coursePermissionss.get(i);
return resp; orderMapper.updateCoursePermissions(coursePermissions);
} }
return resp; resp.put("retcode", 200);
} } catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed");
return resp;
}
}
return resp;
}
//绑定应用权限 public HashMap<String, Object> updateContractInformation(ContractInformation contractInformation) {
public HashMap<String, Object> isDeliverGoods(CoursePermissions coursePermissions){ HashMap<String, Object> resp = new HashMap<String, Object>();
HashMap<String, Object> resp = new HashMap<String, Object>(); try {
try { orderMapper.updateContractInformation(contractInformation);
orderMapper.isDeliverGoods(coursePermissions); resp.put("retcode", 200);
resp.put("retcode", 200); } catch (RuntimeException e) {
} catch (RuntimeException e) { logger.error(e.getMessage());
logger.error(e.getMessage()); resp.put("retcode", 500);
resp.put("retcode", 500); resp.put("retvalue", "Inquiry Failed");
resp.put("retvalue", "Inquiry Failed"); return resp;
return resp; }
} return resp;
return resp; }
}
public HashMap<String, Object> queryOrderCustomer(Integer cityId,Integer provinceId){ //绑定应用权限
HashMap<String, Object> resp = new HashMap<String, Object>(); public HashMap<String, Object> isDeliverGoods(CoursePermissions coursePermissions) {
try { HashMap<String, Object> resp = new HashMap<String, Object>();
resp.put("retvalue", orderMapper.queryOrderCustomer(cityId,provinceId)); try {
resp.put("retcode", 200); orderMapper.isDeliverGoods(coursePermissions);
} catch (RuntimeException e) { resp.put("retcode", 200);
logger.error(e.getMessage()); } catch (RuntimeException e) {
resp.put("retcode", 500); logger.error(e.getMessage());
resp.put("retvalue", "Inquiry Failed"); resp.put("retcode", 500);
return resp; resp.put("retvalue", "Inquiry Failed");
} return resp;
return resp; }
} return resp;
}
public HashMap<String, Object> queryOrderCustomer(Integer cityId, Integer provinceId) {
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", orderMapper.queryOrderCustomer(cityId, provinceId));
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed");
return resp;
}
return resp;
}
public HashMap<String, Object> queryOrderCustomerContact(Integer customerId){ public HashMap<String, Object> queryOrderCustomerContact(Integer customerId) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
resp.put("retvalue", orderMapper.queryOrderCustomerContact(customerId)); resp.put("retvalue", orderMapper.queryOrderCustomerContact(customerId));
resp.put("retcode", 200); resp.put("retcode", 200);
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "Inquiry Failed");
return resp; return resp;
} }
return resp; return resp;
} }
//查询订单课程列表 //查询订单课程列表
public HashMap<String, Object> queryCourseList(String searchContent,List<Integer> courseId,Integer pageNo,Integer pageSize){ public HashMap<String, Object> queryCourseList(String searchContent, List<Integer> courseId, Integer pageNo, Integer pageSize) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
if(pageNo!=null&&pageSize!=null) { if (pageNo != null && pageSize != null) {
PageHelper.startPage(pageNo, pageSize); PageHelper.startPage(pageNo, pageSize);
List<Course> list = orderMapper.queryCourseList(searchContent,courseId); List<Course> list = orderMapper.queryCourseList(searchContent, courseId);
PageInfo<Course> info=new PageInfo<Course>(list); PageInfo<Course> info = new PageInfo<Course>(list);
int total1 = (int) info.getTotal(); int total1 = (int) info.getTotal();
int totalPages; int totalPages;
totalPages = total1 / pageSize; totalPages = total1 / pageSize;
if (total1 % pageSize != 0){ if (total1 % pageSize != 0) {
totalPages ++; totalPages++;
} }
long total = total1; long total = total1;
resp.put("retvalue", new PageResult(total, list,totalPages)); resp.put("retvalue", new PageResult(total, list, totalPages));
resp.put("retcode", 200); resp.put("retcode", 200);
}else { } else {
List<Course> list = orderMapper.queryCourseList(searchContent,courseId); List<Course> list = orderMapper.queryCourseList(searchContent, courseId);
resp.put("retvalue", list); resp.put("retvalue", list);
resp.put("retcode", 200); resp.put("retcode", 200);
} }
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "Inquiry Failed");
return resp; return resp;
} }
return resp; return resp;
} }
} }

@ -1,110 +1,109 @@
package com.yipin.liuwanr.service; package com.yipin.liuwanr.service;
import java.util.HashMap;
import java.util.List;
import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yipin.liuwanr.entity.PageResult; import com.yipin.liuwanr.entity.PageResult;
import com.yipin.liuwanr.entity.ServiceConfig; import com.yipin.liuwanr.entity.ServiceConfig;
import com.yipin.liuwanr.mapper.ServiceConfigMapper; import com.yipin.liuwanr.mapper.ServiceConfigMapper;
import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
@Service @Service
public class ServiceConfigService { public class ServiceConfigService {
private static Logger logger = Logger.getLogger(ServiceConfigService.class); private static Logger logger = Logger.getLogger(ServiceConfigService.class);
@Autowired @Autowired
private ServiceConfigMapper serviceConfigMapper; private ServiceConfigMapper serviceConfigMapper;
public HashMap<String, Object> addServiceConfig(ServiceConfig serviceConfig){ public HashMap<String, Object> addServiceConfig(ServiceConfig serviceConfig) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
serviceConfigMapper.addServiceConfig(serviceConfig); serviceConfigMapper.addServiceConfig(serviceConfig);
resp.put("retcode", 200); resp.put("retcode", 200);
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "Inquiry Failed");
return resp; return resp;
} }
return resp; return resp;
} }
public HashMap<String, Object> queryServiceConfig(ServiceConfig serviceConfig,Integer pageNo,Integer pageSize){ public HashMap<String, Object> queryServiceConfig(ServiceConfig serviceConfig, Integer pageNo, Integer pageSize) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
if(pageNo!=null&&pageSize!=null) { if (pageNo != null && pageSize != null) {
PageHelper.startPage(pageNo, pageSize); PageHelper.startPage(pageNo, pageSize);
List<ServiceConfig> list = serviceConfigMapper.queryServiceConfig(serviceConfig); List<ServiceConfig> list = serviceConfigMapper.queryServiceConfig(serviceConfig);
PageInfo<ServiceConfig> info=new PageInfo<ServiceConfig>(list); PageInfo<ServiceConfig> info = new PageInfo<ServiceConfig>(list);
int total1 = (int) info.getTotal(); int total1 = (int) info.getTotal();
int totalPages; int totalPages;
totalPages = total1 / pageSize; totalPages = total1 / pageSize;
if (total1 % pageSize != 0){ if (total1 % pageSize != 0) {
totalPages ++; totalPages++;
} }
long total = total1; long total = total1;
resp.put("retvalue", new PageResult(total, list,totalPages)); resp.put("retvalue", new PageResult(total, list, totalPages));
resp.put("retcode", 200); resp.put("retcode", 200);
}else { } else {
List<ServiceConfig> list = serviceConfigMapper.queryServiceConfig(serviceConfig); List<ServiceConfig> list = serviceConfigMapper.queryServiceConfig(serviceConfig);
resp.put("retvalue", list); resp.put("retvalue", list);
resp.put("retcode", 200); resp.put("retcode", 200);
} }
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "Inquiry Failed");
return resp; return resp;
} }
return resp; return resp;
} }
public HashMap<String, Object> queryServiceConfigDetails(Integer systemId){ public HashMap<String, Object> queryServiceConfigDetails(Integer systemId) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
resp.put("retvalue", serviceConfigMapper.queryServiceConfigDetails(systemId)); resp.put("retvalue", serviceConfigMapper.queryServiceConfigDetails(systemId));
resp.put("retcode", 200); resp.put("retcode", 200);
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "Inquiry Failed");
return resp; return resp;
} }
return resp; return resp;
} }
public HashMap<String, Object> deleteServiceConfig(ServiceConfig serviceConfig){ public HashMap<String, Object> deleteServiceConfig(ServiceConfig serviceConfig) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
serviceConfigMapper.deleteServiceConfig(serviceConfig); serviceConfigMapper.deleteServiceConfig(serviceConfig);
resp.put("retcode", 200); resp.put("retcode", 200);
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "Inquiry Failed");
return resp; return resp;
} }
return resp; return resp;
} }
public HashMap<String, Object> updateServiceConfig(ServiceConfig serviceConfig){ public HashMap<String, Object> updateServiceConfig(ServiceConfig serviceConfig) {
HashMap<String, Object> resp = new HashMap<String, Object>(); HashMap<String, Object> resp = new HashMap<String, Object>();
try { try {
serviceConfigMapper.updateServiceConfig(serviceConfig); serviceConfigMapper.updateServiceConfig(serviceConfig);
resp.put("retcode", 200); resp.put("retcode", 200);
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
resp.put("retcode", 500); resp.put("retcode", 500);
resp.put("retvalue", "Inquiry Failed"); resp.put("retvalue", "Inquiry Failed");
return resp; return resp;
} }
return resp; return resp;
} }
} }

@ -52,19 +52,19 @@ public class ExperimentalClassServiceTest {
public void addExperimentalClass() { public void addExperimentalClass() {
ExperimentalClass experimentalClass = new ExperimentalClass(); ExperimentalClass experimentalClass = new ExperimentalClass();
experimentalClass.setExperimentalClassName("测试"); experimentalClass.setExperimentalClassName("测试");
experimentalClass.setClassSize(12); experimentalClass.setClassSize(120);
experimentalClass.setFounder("测试"); experimentalClass.setFounder("测试");
experimentalClass.setCourseId(2); experimentalClass.setCourseId(77);
experimentalClass.setUserId(2); experimentalClass.setUserId(452);
experimentalClass.setSchoolId(2); experimentalClass.setSchoolId(2043);
HashMap<String, Object> map = experimentalClassService.addExperimentalClass(experimentalClass); HashMap<String, Object> map = experimentalClassService.addExperimentalClass(experimentalClass);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
} }
@Test @Test
public void queryExperimentalClass() { public void queryExperimentalClass() {
Integer schoolId = 1; Integer schoolId = 2043;
Integer courseId = 2; Integer courseId = 77;
Integer userId = 1; Integer userId = 1;
HashMap<String, Object> map = experimentalClassService.queryExperimentalClass(schoolId, courseId,userId); HashMap<String, Object> map = experimentalClassService.queryExperimentalClass(schoolId, courseId,userId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString())); map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));

@ -0,0 +1,217 @@
package com.yipin.liuwanr;
import com.yipin.liuwanr.entity.*;
import com.yipin.liuwanr.service.OrderService;
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.text.ParseException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest
public class OrderServiceTest {
@Autowired
private OrderService orderService;
//添加合同信息
@Test
@Transactional
public void addOrder() {
Order order = new Order();
order.setOrderNumber("1596424017647");
order.setCustomerName("测试");
order.setOrderName("测试");
order.setOrderAmount("120");
order.setOrderType(1);
order.setProvinceId(1);
order.setCityId(1);
order.setOrderContact("张三");
order.setPhone("15267668899");
order.setEmail("123@qq.com");
order.setCustomerId(126);
HashMap<String, Object> map = orderService.addOrder(order);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
@Transactional
public void addContractInformation() {
ContractInformation contractInformation = new ContractInformation();
contractInformation.setContractInformationName("1");
contractInformation.setContractInformationNumber("1");
contractInformation.setContractInformationSum("1");
contractInformation.setContractInformationLink("1");
contractInformation.setOrderId(20);
HashMap<String, Object> map = orderService.addContractInformation(contractInformation);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//添加课程权限
@Test
@Transactional
public void addCoursePermissionss() throws ParseException {
List<CoursePermissions> coursePermissionss = new ArrayList<>();
CoursePermissions coursePermissions = new CoursePermissions();
coursePermissions.setCourseId(77);
coursePermissions.setUsePeriod(30);
coursePermissions.setMarketPrice(12.8);
coursePermissions.setTransactionPrice(1);
coursePermissions.setDiscount(7);
coursePermissions.setPortAddressId(1);
coursePermissions.setIsDeliverGoods(1);
coursePermissions.setOrderId(118);
coursePermissionss.add(coursePermissions);
HashMap<String, Object> map = orderService.addCoursePermissionss(coursePermissionss);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//绑定应用权限
@Test
@Transactional
public void bindingApplicationPermissions() {
ApplicationPermissions applicationPermissions = new ApplicationPermissions();
applicationPermissions.setSystemId("2");
applicationPermissions.setOrderId(2);
HashMap<String, Object> map = orderService.bindingApplicationPermissions(applicationPermissions);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
@Transactional
public void queryCoursePermissions() {
String courseId = "1";
HashMap<String, Object> map = orderService.queryCoursePermissions(courseId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
@Transactional
public void queryOrder() {
Order order = new Order();
Integer pageNo = 1;
Integer pageSize = 10;
HashMap<String, Object> map = orderService.queryOrder(order, pageNo, pageSize);
Integer retcode = (Integer) map.get("retcode");
System.out.println(retcode);
if (retcode == 200) {
PageResult pageResult = (PageResult) map.get("retvalue");
Long total = pageResult.getTotal();
System.out.println("total = " + total);
List<Order> rows = (List<Order>) pageResult.getRows();
rows.forEach(item -> System.out.println(item.toString()));
} else {
String msg = (String) map.get("retvalue");
System.out.println(msg);
}
}
@Test
@Transactional
public void queryOrderDetails() {
Integer orderId = 1;
HashMap<String, Object> map = orderService.queryOrderDetails(orderId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
@Transactional
public void deleteOrder() {
List<Integer> orderId = new ArrayList<>();
orderId.add(1);
orderId.add(2);
orderId.add(3);
HashMap<String, Object> map = orderService.deleteOrder(orderId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
@Transactional
public void updateOrder() {
Order order = new Order();
HashMap<String, Object> map = orderService.updateOrder(order);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
@Transactional
public void deleteCoursePermissions() {
Integer orderId = 1;
HashMap<String, Object> map = orderService.deleteCoursePermissions(orderId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
@Transactional
public void updateCoursePermissions() {
List<CoursePermissions> coursePermissionss = new ArrayList<>();
CoursePermissions coursePermissions = new CoursePermissions();
coursePermissionss.add(coursePermissions);
HashMap<String, Object> map = orderService.updateCoursePermissions(coursePermissionss);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
@Transactional
public void updateContractInformation() {
ContractInformation contractInformation = new ContractInformation();
HashMap<String, Object> map = orderService.updateContractInformation(contractInformation);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//绑定应用权限
@Test
@Transactional
public void isDeliverGoods() {
CoursePermissions coursePermissions = new CoursePermissions();
HashMap<String, Object> map = orderService.isDeliverGoods(coursePermissions);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
@Transactional
public void queryOrderCustomer() {
Integer cityId = 1;
Integer provinceId = 1;
HashMap<String, Object> map = orderService.queryOrderCustomer(cityId, provinceId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
@Transactional
public void queryOrderCustomerContact() {
Integer customerId = 1;
HashMap<String, Object> map = orderService.queryOrderCustomerContact(customerId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
//查询订单课程列表
@Test
@Transactional
public void queryCourseList() {
String searchContent = "";
List<Integer> courseId = new ArrayList<>();
Integer pageNo = 1;
Integer pageSize = 10;
HashMap<String, Object> map = orderService.queryCourseList(searchContent, courseId, pageNo, pageSize);
Integer retcode = (Integer) map.get("retcode");
System.out.println(retcode);
if (retcode == 200) {
PageResult pageResult = (PageResult) map.get("retvalue");
Long total = pageResult.getTotal();
System.out.println("total = " + total);
List<Course> rows = (List<Course>) pageResult.getRows();
rows.forEach(item -> System.out.println(item.toString()));
} else {
String msg = (String) map.get("retvalue");
System.out.println(msg);
}
}
}

@ -0,0 +1,83 @@
package com.yipin.liuwanr;
import com.yipin.liuwanr.entity.PageResult;
import com.yipin.liuwanr.entity.ServiceConfig;
import com.yipin.liuwanr.service.ServiceConfigService;
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.HashMap;
import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest
public class ServiceConfigServiceTest {
@Autowired
private ServiceConfigService serviceConfigService;
@Test
@Transactional
public void addServiceConfig() {
ServiceConfig serviceConfig = new ServiceConfig();
serviceConfig.setSystemName("测试");
serviceConfig.setSystemType(2);
serviceConfig.setSystemAttribution(2);
serviceConfig.setSystemStatus(1);
HashMap<String, Object> map = serviceConfigService.addServiceConfig(serviceConfig);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
public void queryServiceConfig() {
ServiceConfig serviceConfig = new ServiceConfig();
Integer pageNo = 1;
Integer pageSize = 10;
HashMap<String, Object> map = serviceConfigService.queryServiceConfig(serviceConfig, pageNo, pageSize);
Integer retcode = (Integer) map.get("retcode");
System.out.println(retcode);
if (retcode == 200) {
PageResult pageResult = (PageResult) map.get("retvalue");
Long total = pageResult.getTotal();
System.out.println("total = " + total);
List<ServiceConfig> rows = (List<ServiceConfig>) pageResult.getRows();
rows.forEach(item -> System.out.println(item.toString()));
} else {
String msg = (String) map.get("retvalue");
System.out.println(msg);
}
}
@Test
public void queryServiceConfigDetails() {
Integer systemId = 1;
HashMap<String, Object> map = serviceConfigService.queryServiceConfigDetails(systemId);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
@Transactional
public void deleteServiceConfig() {
ServiceConfig serviceConfig = new ServiceConfig();
serviceConfig.setSystemId(1);
HashMap<String, Object> map = serviceConfigService.deleteServiceConfig(serviceConfig);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
@Test
@Transactional
public void updateServiceConfig() {
ServiceConfig serviceConfig = new ServiceConfig();
serviceConfig.setSystemName("测试");
serviceConfig.setSystemType(2);
serviceConfig.setSystemAttribution(2);
serviceConfig.setSystemStatus(1);
serviceConfig.setSystemId(1);
HashMap<String, Object> map = serviceConfigService.updateServiceConfig(serviceConfig);
map.forEach((key, value) -> System.out.println("key = " + key + " ===> value = " + value.toString()));
}
}

@ -0,0 +1,165 @@
package com.yipin.liuwanr.service;
import org.apache.commons.io.IOUtils;
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.lang.Nullable;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.HashMap;
/**
* @auther River
* @date 2020/8/19 9:39
*/
@SpringBootTest
@RunWith(SpringRunner.class)
public class MakeuplistServiceTest {
@Autowired
private MakeuplistService makeuplistService;
/**
* 查询数据
*/
@Test
@Transactional
public void queryAllMakeuplistTest(){
Integer staffId = 1;
long uploadTime = 0L;
Integer uploadType = 1;
Integer schoolId = 5;
String time = "2020-07-24 18:51";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
try {
uploadTime = sdf.parse(time).getTime() / 1000;
} catch (ParseException e) {
e.printStackTrace();
}
HashMap<String, Object> queryAllMakeuplist = makeuplistService.queryAllMakeuplist(staffId, uploadTime, uploadType, schoolId);
for (String s : queryAllMakeuplist.keySet()) {
System.out.println("key:" + s + "," + "value:" + queryAllMakeuplist.get(s));
}
}
/**
* 获取学生信息
*/
@Test
@Transactional
public void getStudentTest(){
Integer staffId = 1;
long uploadTime = 0L;
Integer uploadType = 1;
Integer schoolId = 5;
String time = "2020-07-24 18:51";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
try {
uploadTime = sdf.parse(time).getTime() / 1000;
} catch (ParseException e) {
e.printStackTrace();
}
HashMap<String, Object> student = makeuplistService.getStudent(staffId, uploadTime, uploadType, schoolId);
for (String s : student.keySet()) {
System.out.println("key:" + s + "," + "value:" + student.get(s));
}
}
/**
* 获取补考信息
*/
@Test
@Transactional
public void getByMakeuplistTest(){
Integer staffId = 1;
long uploadTime = 0L;
Integer uploadType = 1;
Integer schoolId = 5;
String time = "2020-07-24 18:51";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
try {
uploadTime = sdf.parse(time).getTime() / 1000;
} catch (ParseException e) {
e.printStackTrace();
}
HashMap<String, Object> makeuplist = makeuplistService.getByMakeuplist(staffId, uploadTime, uploadType, schoolId);
for (String s : makeuplist.keySet()) {
System.out.println("key:" + s + "," + "value:" + makeuplist.get(s));
}
}
/**
* 导入数据
*/
@Test
@Transactional
public void addMakeuplistTest(){
MultipartFile file = new MultipartFile() {
@Override
public String getName() {
return null;
}
@Nullable
@Override
public String getOriginalFilename() {
return null;
}
@Nullable
@Override
public String getContentType() {
return null;
}
@Override
public boolean isEmpty() {
return false;
}
@Override
public long getSize() {
return 0;
}
@Override
public byte[] getBytes() throws IOException {
return new byte[0];
}
@Override
public InputStream getInputStream() throws IOException {
return null;
}
@Override
public void transferTo(File dest) throws IOException, IllegalStateException {
}
};
Integer schoolId = 5;
Integer staffId = 1;
long uploadTime = 0L;
String time = "2020-07-24 18:51";
File file1 = new File("C:\\Users\\Hello\\Desktop\\aaaa.xlsx");
try {
//将file类型文件转换为MultipartFile类型文件
FileInputStream input = new FileInputStream(file1);
file = new MockMultipartFile("file", file1.getName(), "text/plain", IOUtils.toByteArray(input));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
try {
uploadTime = sdf.parse(time).getTime() / 1000;
} catch (ParseException e) {
e.printStackTrace();
}
HashMap<String, Object> makeuplist = makeuplistService.addMakeuplist(file, schoolId, staffId, uploadTime);
for (String s : makeuplist.keySet()) {
System.out.println("key:" + s + "," + "value:" + makeuplist.get(s));
}
}
}

@ -0,0 +1,120 @@
package com.yipin.liuwanr.service;
import com.yipin.liuwanr.entity.CourseSchedule;
import com.yipin.liuwanr.entity.Project_Management;
import com.yipin.liuwanr.vo.CourseAndProjectVo;
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.HashMap;
/**
* @auther River
* @date 2020/8/21 11:38
*/
@SpringBootTest
@RunWith(SpringRunner.class)
public class ProjectAndCourseServiceTest {
@Autowired
private ProjectAndCourseService projectAndCourseService;
/**
* 根据课程查询实验项目信息
*/
@Test
@Transactional
public void queryProjectTest(){
Integer courseId = 77;
Integer experimentalClassId = 87;
Integer pageNo = 1;
Integer pageSize = 10;
HashMap<String, Object> project = projectAndCourseService.queryProject(courseId, experimentalClassId, pageNo, pageSize);
for (String s : project.keySet()) {
System.out.println("key:" + s + "," + "value:" + project.get(s));
}
}
/**
* 修改项目状态
*/
@Test
@Transactional
public void updateIsExperimentTest(){
CourseAndProjectVo vo = new CourseAndProjectVo();
vo.setCourseId(77);
vo.setExperimentalClassId(87);
vo.setProject(new Project_Management(1,289));
HashMap<String, Object> experiment = projectAndCourseService.updateIsExperiment(vo);
for (String s : experiment.keySet()) {
System.out.println("key:" + s + "," + "value:" + experiment.get(s));
}
}
/**
* 修改考勤状态
*/
@Test
@Transactional
public void updateIsAttendanceTest(){
CourseAndProjectVo vo = new CourseAndProjectVo();
vo.setCourseId(77);
vo.setExperimentalClassId(87);
vo.setProject(new Project_Management(1,289,null));
HashMap<String, Object> attendance = projectAndCourseService.updateIsAttendance(vo);
for (String s : attendance.keySet()) {
System.out.println("key:" + s + "," + "value:" + attendance.get(s));
}
}
/**
* 获取课程进度
*/
@Test
@Transactional
public void getCourseScheduleTest(){
Integer courseId = 77;
Integer experimentalClassId = 87;
Integer studentId = null;
HashMap<String, Object> courseSchedule = projectAndCourseService.getCourseSchedule(courseId, experimentalClassId, studentId);
for (String s : courseSchedule.keySet()) {
System.out.println("key:" + s + "," + "value:" + courseSchedule.get(s));
}
}
/**
* 添加课程进度
*/
@Test
@Transactional
public void addCourseScheduleTest(){
CourseSchedule courseSchedule = new CourseSchedule();
courseSchedule.setScheduleId(1);
courseSchedule.setProjectId(5);
courseSchedule.setCourseId(5);
courseSchedule.setExperimentalClassId(0);
HashMap<String, Object> courseSchedule1 = projectAndCourseService.addCourseSchedule(courseSchedule);
for (String s : courseSchedule1.keySet()) {
System.out.println("key:" + s + "," + "value:" + courseSchedule1.get(s));
}
}
/**
* 课程视频
*/
@Test
@Transactional
public void getCoursevideoTest(){
Integer courseId = 77;
Integer experimentalClassId = 87;
Integer studentId = null;
HashMap<String, Object> coursevideo = projectAndCourseService.getCoursevideo(courseId, experimentalClassId, studentId);
for (String s : coursevideo.keySet()) {
System.out.println("key:" + s + "," + "value:" + coursevideo.get(s));
}
}
}

@ -0,0 +1,101 @@
package com.yipin.liuwanr.service;
import com.yipin.liuwanr.entity.School;
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.HashMap;
/**
* @auther River
* @date 2020/8/24 9:14
*/
@SpringBootTest
@RunWith(SpringRunner.class)
public class SchoolServiceTest {
@Autowired
private SchoolService schoolService;
/**
* 添加学校
*/
@Test
@Transactional
public void addSchoolTest(){
School school = new School();
school.setSchoolName("北京大学");
school.setProvinceId(1);
school.setCityId(1);
school.setLevel(1);
HashMap<String, Object> addSchool = schoolService.addSchool(school);
for (String s : addSchool.keySet()) {
System.out.println("key:" + s + "," + "value:" + addSchool.get(s));
}
}
/**
* 查询学校
*/
@Test
@Transactional
public void querySchoolTest(){
School school = new School();
school.setProvinceId(1);
school.setCityId(1);
school.setLevel(1);
HashMap<String, Object> querySchool = schoolService.querySchool(school);
for (String s : querySchool.keySet()) {
System.out.println("key:" + s + "," + "value:" + querySchool.get(s));
}
}
/**
* 查询学校详情
*/
@Test
@Transactional
public void querySchoolDetailsTest(){
Integer schoolId = 1;
HashMap<String, Object> schoolDetails = schoolService.querySchoolDetails(schoolId);
for (String s : schoolDetails.keySet()) {
System.out.println("key:" + s + "," + "value:" + schoolDetails.get(s));
}
}
/**
* 删除学校
*/
@Test
@Transactional
public void deleteSchoolTest(){
School school = new School();
school.setSchoolId(1);
HashMap<String, Object> deleteSchool = schoolService.deleteSchool(school);
for (String s : deleteSchool.keySet()) {
System.out.println("key:" + s + "," + "value:" + deleteSchool.get(s));
}
}
/**
* 更新学校
*/
@Test
@Transactional
public void updateSchoolTest(){
School school = new School();
school.setSchoolId(1);
school.setProvinceId(1);
school.setCityId(1);
school.setLevel(1);
school.setSchoolName("北京大学");
HashMap<String, Object> updateSchool = schoolService.updateSchool(school);
for (String s : updateSchool.keySet()) {
System.out.println("key:" + s + "," + "value:" + updateSchool.get(s));
}
}
}

@ -0,0 +1,93 @@
package com.yipin.liuwanr.service;
import com.yipin.liuwanr.entity.StaffGrade;
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.HashMap;
/**
* @auther River
* @date 2020/8/20 10:57
*/
@SpringBootTest
@RunWith(SpringRunner.class)
public class StaffGradServiceTest {
@Autowired
private StaffGradeService staffGradeService;
/**
* 添加员工年级
*/
@Test
@Transactional
public void addStaffGradeTest(){
StaffGrade staffGrade = new StaffGrade();
staffGrade.setStaffGradeName("教导处");
staffGrade.setStaffProfessionalArchitectureId(1);
HashMap<String, Object> addStaffGrade = staffGradeService.addStaffGrade(staffGrade);
for (String s : addStaffGrade.keySet()) {
System.out.println("key:" + s + "," + "value:" + addStaffGrade.get(s));
}
}
/**
* 查询员工年级
*/
@Test
@Transactional
public void queryStaffGradeTest(){
Integer staffProfessionalArchitectureId = 1;
HashMap<String, Object> staffGrade = staffGradeService.queryStaffGrade(staffProfessionalArchitectureId);
for (String s : staffGrade.keySet()) {
System.out.println("key:" + s + "," + "value:" + staffGrade.get(s));
}
}
/**
* 删除员工年级
*/
@Test
@Transactional
public void deleteStaffGradeTest(){
Integer staffGradeId = 1;
HashMap<String, Object> staffGrade = staffGradeService.deleteStaffGrade(staffGradeId);
for (String s : staffGrade.keySet()) {
System.out.println("key:" + s + "," + "value:" + staffGrade.get(s));
}
}
/**
* 查询员工年级详情
*/
@Test
@Transactional
public void queryStaffGradeDetailsTest(){
Integer staffGradeId = 1;
HashMap<String, Object> staffGradeDetails = staffGradeService.queryStaffGradeDetails(staffGradeId);
for (String s : staffGradeDetails.keySet()) {
System.out.println("key:" + s + "," + "value:" + staffGradeDetails.get(s));
}
}
/**
* 更新员工年级
*/
@Test
@Transactional
public void updateStaffGradeTest(){
StaffGrade staffGrade = new StaffGrade();
staffGrade.setStaffProfessionalArchitectureId(1);
staffGrade.setStaffGradeName("教务处");
staffGrade.setStaffGradeId(1);
HashMap<String, Object> staffGrade1 = staffGradeService.updateStaffGrade(staffGrade);
for (String s : staffGrade1.keySet()) {
System.out.println("key:" + s + "," + "value:" + staffGrade1.get(s));
}
}
}

@ -0,0 +1,194 @@
package com.yipin.liuwanr.service;
import com.yipin.liuwanr.entity.Staff;
import com.yipin.liuwanr.entity.UserM;
import com.yipin.liuwanr.vo.UserVO;
import org.apache.commons.io.IOUtils;
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.lang.Nullable;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.util.HashMap;
/**
* @auther River
* @date 2020/8/24 9:45
*/
@SpringBootTest
@RunWith(SpringRunner.class)
public class StaffServiceTest {
@Autowired
private StaffService staffService;
/**
* 读取员工表
*/
@Test
@Transactional
public void readStaffTest(){
MultipartFile file = new MultipartFile() {
@Override
public String getName() {
return null;
}
@Nullable
@Override
public String getOriginalFilename() {
return null;
}
@Nullable
@Override
public String getContentType() {
return null;
}
@Override
public boolean isEmpty() {
return false;
}
@Override
public long getSize() {
return 0;
}
@Override
public byte[] getBytes() throws IOException {
return new byte[0];
}
@Override
public InputStream getInputStream() throws IOException {
return null;
}
@Override
public void transferTo(File dest) throws IOException, IllegalStateException {
}
};
Integer schoolId = 1;
File file1 = new File("C:\\Users\\Hello\\Desktop\\aaaa.xlsx");
try {
//将file类型文件转换为MultipartFile类型文件
FileInputStream input = new FileInputStream(file1);
file = new MockMultipartFile("file", file1.getName(), "text/plain", IOUtils.toByteArray(input));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
HashMap<String, Object> readStaff = staffService.readStaff(file, schoolId);
for (String s : readStaff.keySet()) {
System.out.println("key:" + s + "," + "value:" + readStaff.get(s));
}
}
/**
* 添加员工
*/
@Test
@Transactional
public void addStaffTest(){
Staff staff = new Staff();
staff.setSchoolId(2043);
staff.setEmail("4867687@qq.com");
staff.setPhone("18873465488");
staff.setRoleId(3);
staff.setStaffGradeId(2050);
staff.setStaffName("zha");
staff.setStaffProfessionalArchitectureId(2057);
staff.setStaffWorkNumber("1222");
staff.setUniqueIdentificationAccount("204312221598238094000");
HashMap<String, Object> addStaff = staffService.addStaff(staff);
for (String s : addStaff.keySet()) {
System.out.println("key:" + s + "," + "value:" + addStaff.get(s));
}
}
/**
* 查询员工
*/
@Test
@Transactional
public void queryStaffTest(){
Staff staff = new Staff();
Integer pageNo = 1;
Integer pageSize = 10;
staff.setSchoolId(2043);
HashMap<String, Object> queryStaff = staffService.queryStaff(staff, pageNo, pageSize);
for (String s : queryStaff.keySet()) {
System.out.println("key:" + s + "," + "value:" + queryStaff.get(s));
}
}
/**
* 删除员工
*/
@Test
@Transactional
public void deleteStaffTest(){
Integer staffId = 118;
String phone = "13137366427";
HashMap<String, Object> deleteStaff = staffService.deleteStaff(staffId, phone);
for (String s : deleteStaff.keySet()) {
System.out.println("key:" + s + "," + "value:" + deleteStaff.get(s));
}
}
/**
* 查询员工详情
*/
@Test
@Transactional
public void queryStaffDetailsTest(){
Integer staffId = 118;
HashMap<String, Object> staffDetails = staffService.queryStaffDetails(staffId);
for (String s : staffDetails.keySet()) {
System.out.println("key:" + s + "," + "value:" + staffDetails.get(s));
}
}
/**
* 更新员工
*/
@Test
@Transactional
public void updateStaffTest(){
UserVO userVO = new UserVO();
Staff staff = new Staff();
UserM user = new UserM();
staff.setEmail("123@qq.com");
staff.setPhone("13137366427");
staff.setRoleId(4);
staff.setSchoolId(2043);
staff.setStaffGradeId(2050);
staff.setStaffId(118);
staff.setStaffName("世杰-教师");
staff.setStaffProfessionalArchitectureId(2057);
staff.setStaffWorkNumber("123");
staff.setUniqueIdentificationAccount("20431231596424406000");
userVO.setStaff(staff);
user.setAccountRole(3);
user.setCityId(1);
user.setDisciplineId(1);
user.setEmail("123@qq.com");
user.setName("世杰-教师");
user.setPhone("13137366427");
user.setProfessionalClassId(1);
user.setProvinceId(4);
user.setProfessionalId(4);
user.setSchoolId(2043);
user.setUniqueIdentificationAccount("20431231596424406000");
user.setUserAccount("123");
user.setUserId(461);
user.setWorkNumber("123");
userVO.setUser(user);
HashMap<String, Object> updateStaff = staffService.updateStaff(userVO);
for (String s : updateStaff.keySet()) {
System.out.println("key:" + s + "," + "value:" + updateStaff.get(s));
}
}
}

@ -0,0 +1,258 @@
package com.yipin.liuwanr.service;
import com.yipin.liuwanr.entity.StuProfessionalArchitecture;
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.HashMap;
/**
* @auther River
* @date 2020/8/25 9:46
*/
@SpringBootTest
@RunWith(SpringRunner.class)
public class StuProfessionalArchitectureServiceTest {
@Autowired
private StuProfessionalArchitectureService stuProfessionalArchitectureService;
/**
* 添加学生专业组织
*/
@Test
@Transactional
public void addStuProfessionalArchitectureTest(){
StuProfessionalArchitecture stuPA = new StuProfessionalArchitecture();
stuPA.setSchoolId(2043);
stuPA.setStuProfessionalArchitectureName("计算机学院");
HashMap<String, Object> stuProfessionalArchitecture = stuProfessionalArchitectureService.addStuProfessionalArchitecture(stuPA);
for (String s : stuProfessionalArchitecture.keySet()) {
System.out.println("key:" + s + "," + "value:" + stuProfessionalArchitecture.get(s));
}
}
/**
* 查询学生专业架构
*/
@Test
@Transactional
public void queryStuProfessionalArchitectureTest(){
Integer schoolId = 1;
HashMap<String, Object> professionalArchitecture = stuProfessionalArchitectureService.queryStuProfessionalArchitecture(schoolId);
for (String s : professionalArchitecture.keySet()) {
System.out.println("key:" + s + "," + "value:" + professionalArchitecture.get(s));
}
}
/**
* 查询学生专业架构详情
*/
@Test
@Transactional
public void queryStuPADTest(){
Integer stuProfessionalArchitectureId = 34;
HashMap<String, Object> stuPAD = stuProfessionalArchitectureService.queryStuPAD(stuProfessionalArchitectureId);
for (String s : stuPAD.keySet()) {
System.out.println("key:" + s + "," + "value:" + stuPAD.get(s));
}
}
/**
* 删除学生专业
*/
@Test
@Transactional
public void deleteStuProfessionalArchitectureTest(){
Integer stuProfessionalArchitectureId = 34;
HashMap<String, Object> professionalArchitecture = stuProfessionalArchitectureService.deleteStuProfessionalArchitecture(stuProfessionalArchitectureId);
for (String s : professionalArchitecture.keySet()) {
System.out.println("key:" + s + "," + "value:" + professionalArchitecture.get(s));
}
}
/**
* 删除学生转年级
*/
@Test
@Transactional
public void deleteStuGradeTest(){
Integer gradeId = 1;
HashMap<String, Object> stuGrade = stuProfessionalArchitectureService.deleteStuGrade(gradeId);
for (String s : stuGrade.keySet()) {
System.out.println("key:" + s + "," + "value:" + stuGrade.get(s));
}
}
/**
* 删除学生转班级
*/
@Test
@Transactional
public void deleteStuClassTest(){
Integer classId = 1;
HashMap<String, Object> stuClass = stuProfessionalArchitectureService.deleteStuClass(classId);
for (String s : stuClass.keySet()) {
System.out.println("key:" + s + "," + "value:" + stuClass.get(s));
}
}
/**
* 更新学生专业架构
*/
@Test
@Transactional
public void updateStuProfessionalArchitectureTest(){
StuProfessionalArchitecture stuPA = new StuProfessionalArchitecture();
stuPA.setSchoolId(2043);
stuPA.setStuProfessionalArchitectureId(34);
stuPA.setStuProfessionalArchitectureName("英语");
HashMap<String, Object> professionalArchitecture = stuProfessionalArchitectureService.updateStuProfessionalArchitecture(stuPA);
for (String s : professionalArchitecture.keySet()) {
System.out.println("key:" + s + "," + "value:" + professionalArchitecture.get(s));
}
}
/**
* 查询全部学生专业架构
*/
@Test
@Transactional
public void queryStudentProfessionalArchitectureTest(){
Integer schoolId = 1;
HashMap<String, Object> professionalArchitecture = stuProfessionalArchitectureService.queryStuProfessionalArchitecture(schoolId);
for (String s : professionalArchitecture.keySet()) {
System.out.println("key:" + s + "," + "value:" + professionalArchitecture.get(s));
}
}
/**
* 查询学生年级
*/
@Test
@Transactional
public void queryStuGradeTest(){
Integer stuProfessionalArchitectureId = 34;
HashMap<String, Object> queryStuGrade = stuProfessionalArchitectureService.queryStuGrade(stuProfessionalArchitectureId);
for (String s : queryStuGrade.keySet()) {
System.out.println("key:" + s + "," + "value:" + queryStuGrade.get(s));
}
}
/**
* 查询学生年级详情
*/
@Test
@Transactional
public void queryStuGradeDTest(){
Integer gradeId = 1;
HashMap<String, Object> stuGradeD = stuProfessionalArchitectureService.queryStuGradeD(gradeId);
for (String s : stuGradeD.keySet()) {
System.out.println("key:" + s + "," + "value:" + stuGradeD.get(s));
}
}
/**
* 查询学生班级
*/
@Test
@Transactional
public void queryStuClassTest(){
Integer gradeId = 1;
HashMap<String, Object> stuClass = stuProfessionalArchitectureService.queryStuClass(gradeId);
for (String s : stuClass.keySet()) {
System.out.println("key:" + s + "," + "value:" + stuClass.get(s));
}
}
/**
* 查询学生班级详情
*/
@Test
@Transactional
public void queryStuClassDTest(){
Integer classId = 1;
HashMap<String, Object> stuClassD = stuProfessionalArchitectureService.queryStuClassD(classId);
for (String s : stuClassD.keySet()) {
System.out.println("key:" + s + "," + "value:" + stuClassD.get(s));
}
}
/**
* 添加班级
*/
@Test
@Transactional
public void addStuClassTest(){
StuProfessionalArchitecture stuPA = new StuProfessionalArchitecture();
stuPA.setClassName("12");
stuPA.setGradeId(20);
HashMap<String, Object> addStuClass = stuProfessionalArchitectureService.addStuClass(stuPA);
for (String s : addStuClass.keySet()) {
System.out.println("key:" + s + "," + "value:" + addStuClass.get(s));
}
}
/**
* 修改班级
*/
@Test
@Transactional
public void updateStuClassTest(){
StuProfessionalArchitecture stuPA = new StuProfessionalArchitecture();
stuPA.setClassName("13");
stuPA.setClassId(76);
HashMap<String, Object> stuClass = stuProfessionalArchitectureService.updateStuClass(stuPA);
for (String s : stuClass.keySet()) {
System.out.println("key:" + s + "," + "value:" + stuClass.get(s));
}
}
/**
* 添加年级
*/
@Test
@Transactional
public void addStuGradeTest(){
StuProfessionalArchitecture stuPA = new StuProfessionalArchitecture();
stuPA.setGradeName("2020");
stuPA.setStuProfessionalArchitectureId(37);
HashMap<String, Object> stuGrade = stuProfessionalArchitectureService.addStuGrade(stuPA);
for (String s : stuGrade.keySet()) {
System.out.println("key:" + s + "," + "value:" + stuGrade.get(s));
}
}
/**
* 修改年级
*/
@Test
@Transactional
public void updateStuGradeTest(){
StuProfessionalArchitecture stuPA = new StuProfessionalArchitecture();
stuPA.setGradeId(50);
stuPA.setGradeName("2018");
stuPA.setStuProfessionalArchitectureId(37);
HashMap<String, Object> stuGrade = stuProfessionalArchitectureService.updateStuGrade(stuPA);
for (String s : stuGrade.keySet()) {
System.out.println("key:" + s + "," + "value:" + stuGrade.get(s));
}
}
/**
* 查询学生
*/
@Test
@Transactional
public void queryStudentTest(){
Integer classId = 1;
HashMap<String, Object> student = stuProfessionalArchitectureService.queryStudent(classId);
for (String s : student.keySet()) {
System.out.println("key:" + s + "," + "value:" + student.get(s));
}
}
}
Loading…
Cancel
Save