| | |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.qxueyou.scc.admin.classes.model.ClsClass; |
| | | import com.qxueyou.scc.admin.classes.model.ClsSubjectChapter; |
| | |
| | | */ |
| | | @Api(tags="班级管理接口") |
| | | @RestController |
| | | @CrossOrigin |
| | | @RequestMapping("/admin/class") |
| | | public class ClassController { |
| | | |
| | |
| | | */ |
| | | @PostMapping(value = "add") |
| | | public Result add(String className, String classNumber, String startTime, String endTime, String subjectId, |
| | | String teacherId) { |
| | | String teacherId,String chargeClassName ) { |
| | | try { |
| | | return classService.insertClass(className, classNumber, DateUtils.convertStringToDate(startTime), |
| | | DateUtils.convertStringToDate(endTime), subjectId, teacherId); |
| | | DateUtils.convertStringToDate(endTime), subjectId, teacherId,chargeClassName); |
| | | |
| | | } catch (ParseException e) { |
| | | log.error(e, e); |
| | |
| | | List<Map<String, Object>> lstResult = QBeanUtils.listBean2ListMap(clsLst, |
| | | CollectionUtils.newStringMap("name", "className", "classId", "classId", "classNumber", "classNumber","classTypes","classTypes", |
| | | "studentCount", "studentCount", "createTime", "createTime", "startTime", "startTime", "endTime", |
| | | "endTime", "subjects", "sbjLst")); |
| | | "endTime", "subjects", "sbjLst","chargeClassName","chargeClassName","chargeClassId","chargeClassId")); |
| | | |
| | | // 单独处理课程的字段和结构 |
| | | for (Map<String, Object> item : lstResult) { |
| | |
| | | * @param showAnalysisAfterExer 完成练习后是否显示答案 |
| | | * @param canMultiExer 是否允许重复学习 |
| | | * @param needForum 是否开通论坛 |
| | | * @param chargeClassName 班主任名称 |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "update") |
| | |
| | | @RequestParam(defaultValue = "false") Boolean needQuitAudit, |
| | | @RequestParam(defaultValue = "false") Boolean showAnalysisAfterExer, |
| | | @RequestParam(defaultValue = "false") Boolean canMultiExer, |
| | | @RequestParam(defaultValue = "false") Boolean needForum) { |
| | | @RequestParam(defaultValue = "false") Boolean needForum, |
| | | String chargeClassName) { |
| | | try { |
| | | return classService.updateClass(classId, className, classNumber, DateUtils.convertStringToDate(startTime), |
| | | DateUtils.convertStringToDate(endTime), subjectId, needJoinAudit, needQuitAudit, |
| | | showAnalysisAfterExer, canMultiExer, needForum, teacherId); |
| | | showAnalysisAfterExer, canMultiExer, needForum, teacherId,chargeClassName); |
| | | } catch (ParseException e) { |
| | | log.error(e, e); |
| | | return new Result(false, "日期参数错误"); |