From 812f7bae9696154f324a082e94c419df9b7485f9 Mon Sep 17 00:00:00 2001 From: xuliangtong <1124839262@qq.com> Date: Wed, 26 Oct 2022 21:50:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jlw/dao/StudentHandsOnTaskReportDao.java | 30 ++ .../jlw/entity/StudentHandsOnTaskReport.java | 198 +++++++++ .../entity/api/teacher/TeacherIndexData.java | 7 +- .../StudentHandsOnTaskReportService.java | 174 ++++++++ .../api/teacher/ApiTeacherService.java | 28 +- .../StudentHandsOnTaskReportController.java | 225 +++++++++++ .../query/StudentHandsOnTaskReportQuery.java | 176 ++++++++ .../sql/jlw/studentHandsOnTaskReport.md | 376 ++++++++++++++++++ .../js/jlw/studentHandsOnTaskReport/add.js | 38 ++ .../js/jlw/studentHandsOnTaskReport/del.js | 23 ++ .../js/jlw/studentHandsOnTaskReport/edit.js | 28 ++ .../js/jlw/studentHandsOnTaskReport/index.js | 192 +++++++++ .../studentHandsOnTaskReportApi.js | 18 + .../jlw/studentHandsOnTaskReport/add.html | 88 ++++ .../jlw/studentHandsOnTaskReport/edit.html | 88 ++++ .../jlw/studentHandsOnTaskReport/index.html | 29 ++ 16 files changed, 1701 insertions(+), 17 deletions(-) create mode 100644 web/src/main/java/com/ibeetl/jlw/dao/StudentHandsOnTaskReportDao.java create mode 100644 web/src/main/java/com/ibeetl/jlw/entity/StudentHandsOnTaskReport.java create mode 100644 web/src/main/java/com/ibeetl/jlw/service/StudentHandsOnTaskReportService.java create mode 100644 web/src/main/java/com/ibeetl/jlw/web/StudentHandsOnTaskReportController.java create mode 100644 web/src/main/java/com/ibeetl/jlw/web/query/StudentHandsOnTaskReportQuery.java create mode 100644 web/src/main/resources/sql/jlw/studentHandsOnTaskReport.md create mode 100644 web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/add.js create mode 100644 web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/del.js create mode 100644 web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/edit.js create mode 100644 web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/index.js create mode 100644 web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/studentHandsOnTaskReportApi.js create mode 100644 web/src/main/resources/templates/jlw/studentHandsOnTaskReport/add.html create mode 100644 web/src/main/resources/templates/jlw/studentHandsOnTaskReport/edit.html create mode 100644 web/src/main/resources/templates/jlw/studentHandsOnTaskReport/index.html diff --git a/web/src/main/java/com/ibeetl/jlw/dao/StudentHandsOnTaskReportDao.java b/web/src/main/java/com/ibeetl/jlw/dao/StudentHandsOnTaskReportDao.java new file mode 100644 index 00000000..813e4347 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/dao/StudentHandsOnTaskReportDao.java @@ -0,0 +1,30 @@ +package com.ibeetl.jlw.dao; + +import java.util.List; +import java.util.Map; + +import com.ibeetl.jlw.entity.*; +import com.ibeetl.jlw.web.query.StudentHandsOnTaskReportQuery; + +import org.beetl.sql.mapper.annotation.SqlResource; +import org.beetl.sql.mapper.BaseMapper; +import org.beetl.sql.core.engine.PageQuery; +import org.beetl.sql.mapper.annotation.Update; + +/** + * 学生-课程实操-报告撰写 Dao + */ +@SqlResource("jlw.studentHandsOnTaskReport") +public interface StudentHandsOnTaskReportDao extends BaseMapper{ + PageQuery queryByCondition(PageQuery query); + PageQuery queryByConditionQuery(PageQuery query); + @Update + void deleteStudentHandsOnTaskReportByIds(String ids); + @Update + int updateGivenByIds(StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery); + List getByIds(String ids); + List getValuesByQuery(StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery); + List getValuesByQueryNotWithPermission(StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery); + + List getReportList(List collect); +} diff --git a/web/src/main/java/com/ibeetl/jlw/entity/StudentHandsOnTaskReport.java b/web/src/main/java/com/ibeetl/jlw/entity/StudentHandsOnTaskReport.java new file mode 100644 index 00000000..f1350725 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/entity/StudentHandsOnTaskReport.java @@ -0,0 +1,198 @@ +package com.ibeetl.jlw.entity; + +import javax.validation.constraints.NotNull; + +import com.ibeetl.admin.core.entity.BaseEntity; +import org.beetl.sql.annotation.entity.*; + +import com.ibeetl.admin.core.util.ValidateConfig; + +import com.ibeetl.admin.core.annotation.Dict; + +import java.math.BigDecimal; +import java.util.Date; + +/* +* 学生-课程实操-报告撰写 +* gen by Spring Boot2 Admin 2022-10-26 +*/ +public class StudentHandsOnTaskReport extends BaseEntity{ + + //ID + @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class) + // @SeqID(name = ORACLE_CORE_SEQ_NAME) + @AssignID(value = "maskAutoID",param = "com.ibeetl.jlw.entity.StudentHandsOnTaskReport") + + private Long studentHandsOnTaskReportId ; + + //课程开课ID + + private Long teacherOpenCourseId ; + + //课程实操ID + + private Long handsOnId ; + + //课程实操任务ID + + private Long handsOnTaskId ; + + //文件地址PDF + + private String reportFile ; + + //报告分值 + + private BigDecimal reportScore ; + + //报告评语 + + private BigDecimal reportComment ; + + //创建时间 + + private Date createTime ; + + //组织ID + + private Long orgId ; + + //用户ID + + private Long userId ; + + public StudentHandsOnTaskReport(){ + } + + /**ID + *@return + */ + public Long getStudentHandsOnTaskReportId(){ + return studentHandsOnTaskReportId; + } + /**ID + *@param studentHandsOnTaskReportId + */ + public void setStudentHandsOnTaskReportId(Long studentHandsOnTaskReportId){ + this.studentHandsOnTaskReportId = studentHandsOnTaskReportId; + } + + /**课程开课ID + *@return + */ + public Long getTeacherOpenCourseId(){ + return teacherOpenCourseId; + } + /**课程开课ID + *@param teacherOpenCourseId + */ + public void setTeacherOpenCourseId(Long teacherOpenCourseId){ + this.teacherOpenCourseId = teacherOpenCourseId; + } + + /**课程实操ID + *@return + */ + public Long getHandsOnId(){ + return handsOnId; + } + /**课程实操ID + *@param handsOnId + */ + public void setHandsOnId(Long handsOnId){ + this.handsOnId = handsOnId; + } + + /**课程实操任务ID + *@return + */ + public Long getHandsOnTaskId(){ + return handsOnTaskId; + } + /**课程实操任务ID + *@param handsOnTaskId + */ + public void setHandsOnTaskId(Long handsOnTaskId){ + this.handsOnTaskId = handsOnTaskId; + } + + /**文件地址PDF + *@return + */ + public String getReportFile(){ + return reportFile; + } + /**文件地址PDF + *@param reportFile + */ + public void setReportFile(String reportFile){ + this.reportFile = reportFile; + } + + /**报告分值 + *@return + */ + public BigDecimal getReportScore(){ + return reportScore; + } + /**报告分值 + *@param reportScore + */ + public void setReportScore(BigDecimal reportScore){ + this.reportScore = reportScore; + } + + /**报告评语 + *@return + */ + public BigDecimal getReportComment(){ + return reportComment; + } + /**报告评语 + *@param reportComment + */ + public void setReportComment(BigDecimal reportComment){ + this.reportComment = reportComment; + } + + /**创建时间 + *@return + */ + public Date getCreateTime(){ + return createTime; + } + /**创建时间 + *@param createTime + */ + public void setCreateTime(Date createTime){ + this.createTime = createTime; + } + + /**组织ID + *@return + */ + public Long getOrgId(){ + return orgId; + } + /**组织ID + *@param orgId + */ + public void setOrgId(Long orgId){ + this.orgId = orgId; + } + + /**用户ID + *@return + */ + public Long getUserId(){ + return userId; + } + /**用户ID + *@param userId + */ + public void setUserId(Long userId){ + this.userId = userId; + } + + +} diff --git a/web/src/main/java/com/ibeetl/jlw/entity/api/teacher/TeacherIndexData.java b/web/src/main/java/com/ibeetl/jlw/entity/api/teacher/TeacherIndexData.java index b4434f1f..64939c66 100644 --- a/web/src/main/java/com/ibeetl/jlw/entity/api/teacher/TeacherIndexData.java +++ b/web/src/main/java/com/ibeetl/jlw/entity/api/teacher/TeacherIndexData.java @@ -1,9 +1,6 @@ package com.ibeetl.jlw.entity.api.teacher; -import com.ibeetl.jlw.entity.HandsOnSimulationTasks; -import com.ibeetl.jlw.entity.TeacherMergeApplication; -import com.ibeetl.jlw.entity.TeacherOpenCourseMergeTeacher; -import com.ibeetl.jlw.entity.TeacherOpenCourseNotice; +import com.ibeetl.jlw.entity.*; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -28,7 +25,7 @@ public class TeacherIndexData { * 代办事项 * 课程实操-实训任务 */ - private List toDoList; + private List toDoList; /** * 通知公告 diff --git a/web/src/main/java/com/ibeetl/jlw/service/StudentHandsOnTaskReportService.java b/web/src/main/java/com/ibeetl/jlw/service/StudentHandsOnTaskReportService.java new file mode 100644 index 00000000..ccb8a007 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/service/StudentHandsOnTaskReportService.java @@ -0,0 +1,174 @@ +package com.ibeetl.jlw.service; + +import java.io.*; +import java.text.DateFormat; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.math.BigDecimal; + +import cn.jlw.util.ToolUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.ibeetl.admin.core.entity.CoreUser; +import com.ibeetl.admin.core.util.TimeTool; +import com.ibeetl.admin.core.web.JsonResult; +import com.ibeetl.admin.core.web.JsonReturnCode; +import com.ibeetl.jlw.dao.StudentHandsOnTaskReportDao; +import com.ibeetl.jlw.entity.StudentHandsOnTaskReport; +import com.ibeetl.jlw.web.query.StudentHandsOnTaskReportQuery; +import com.ibeetl.jlw.entity.FileEntity; + +import com.ibeetl.admin.core.service.CoreBaseService; +import com.ibeetl.admin.core.util.PlatformException; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.beetl.sql.core.engine.PageQuery; +import org.beetl.sql.core.SqlId; +import javax.annotation.Resource; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; + +import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue; + +/** + * 学生-课程实操-报告撰写 Service + * 当分布式ID开启后请勿使用insert(*,true) + */ + +@Service +@Transactional +@Validated +public class StudentHandsOnTaskReportService extends CoreBaseService{ + + @Resource private StudentHandsOnTaskReportDao studentHandsOnTaskReportDao; + + public PageQueryqueryByCondition(PageQuery query){ + PageQuery ret = studentHandsOnTaskReportDao.queryByCondition(query); + queryListAfter(ret.getList()); + return ret; + } + + public PageQueryqueryByConditionQuery(PageQuery query){ + PageQuery ret = studentHandsOnTaskReportDao.queryByConditionQuery(query); + queryListAfter(ret.getList()); + return ret; + } + + public void deleteByList(List list){ + String ids = ""; + ToolUtils.deleteNullList(list); + for(int i=0;null != list && i studentHandsOnTaskReportList = new ArrayList<>(); + try { + studentHandsOnTaskReportList = JSON.parseArray(studentHandsOnTaskReportQuery.getStudentHandsOnTaskReportJsonStr(), StudentHandsOnTaskReport.class); + } catch (Exception e) { + try { + studentHandsOnTaskReportList.add(JSONObject.parseObject(studentHandsOnTaskReportQuery.getStudentHandsOnTaskReportJsonStr(), StudentHandsOnTaskReport.class)); + } catch (Exception e1) {} + } + ToolUtils.deleteNullList(studentHandsOnTaskReportList); + if(null != studentHandsOnTaskReportList && studentHandsOnTaskReportList.size()>0){ + for(int i=0;i 0; + if(!flag){ + msg = "更新指定参数失败"; + } + }else{ + msg = "指定参数为空"; + } + return msg; + } + + public List getValues (Object paras){ + return sqlManager.select(SqlId.of("jlw.studentHandsOnTaskReport.getStudentHandsOnTaskReportValues"), StudentHandsOnTaskReport.class, paras); + } + + public List getValuesByQuery (StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery){ + return studentHandsOnTaskReportDao.getValuesByQuery(studentHandsOnTaskReportQuery); + } + + public List getValuesByQueryNotWithPermission (StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery){ + return studentHandsOnTaskReportDao.getValuesByQueryNotWithPermission(studentHandsOnTaskReportQuery); + } + + public StudentHandsOnTaskReport getInfo (Long studentHandsOnTaskReportId){ + StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery = new StudentHandsOnTaskReportQuery(); + studentHandsOnTaskReportQuery.setStudentHandsOnTaskReportId(studentHandsOnTaskReportId); + List list = studentHandsOnTaskReportDao.getValuesByQuery(studentHandsOnTaskReportQuery); + if(null != list && list.size()>0){ + return list.get(0); + }else{ + return null; + } + } + + public StudentHandsOnTaskReport getInfo (StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery){ + List list = studentHandsOnTaskReportDao.getValuesByQuery(studentHandsOnTaskReportQuery); + if(null != list && list.size()>0){ + return list.get(0); + }else{ + return null; + } + } + + public List getReportList(List collect) { + return studentHandsOnTaskReportDao.getReportList(collect); + } +} diff --git a/web/src/main/java/com/ibeetl/jlw/service/api/teacher/ApiTeacherService.java b/web/src/main/java/com/ibeetl/jlw/service/api/teacher/ApiTeacherService.java index 04eb9be2..390a308d 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/api/teacher/ApiTeacherService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/api/teacher/ApiTeacherService.java @@ -2,23 +2,22 @@ package com.ibeetl.jlw.service.api.teacher; import cn.hutool.core.lang.Assert; import com.ibeetl.jlw.dao.TeacherMergeApplicationDao; -import com.ibeetl.jlw.entity.Teacher; -import com.ibeetl.jlw.entity.TeacherMergeApplication; -import com.ibeetl.jlw.entity.TeacherOpenCourseMergeTeacher; -import com.ibeetl.jlw.entity.TeacherOpenCourseNotice; +import com.ibeetl.jlw.entity.*; import com.ibeetl.jlw.entity.api.CurrentUserInfo; import com.ibeetl.jlw.entity.api.teacher.TeacherIndexData; import com.ibeetl.jlw.service.IndexBaseService; +import com.ibeetl.jlw.service.StudentHandsOnTaskReportService; import com.ibeetl.jlw.service.TeacherOpenCourseMergeTeacherService; import com.ibeetl.jlw.service.TeacherOpenCourseNoticeService; import com.ibeetl.jlw.web.query.TeacherMergeApplicationQuery; import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeTeacherQuery; import com.ibeetl.jlw.web.query.TeacherOpenCourseNoticeQuery; import org.assertj.core.util.Lists; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.List; +import java.util.stream.Collectors; /** *

@@ -32,11 +31,13 @@ import java.util.List; @Service public class ApiTeacherService { - @Autowired private IndexBaseService indexBaseService; - @Autowired private TeacherOpenCourseNoticeService teacherOpenCourseNoticeService; - @Autowired private TeacherMergeApplicationDao teacherMergeApplicationDao; + @Resource private IndexBaseService indexBaseService; + @Resource private TeacherOpenCourseNoticeService teacherOpenCourseNoticeService; + @Resource private TeacherMergeApplicationDao teacherMergeApplicationDao; - @Autowired private TeacherOpenCourseMergeTeacherService teacherOpenCourseMergeTeacherService; + @Resource private TeacherOpenCourseMergeTeacherService teacherOpenCourseMergeTeacherService; + + @Resource private StudentHandsOnTaskReportService studentHandsOnTaskReportService; /** * 教师端-首页数据 @@ -52,8 +53,7 @@ public class ApiTeacherService { // 教师ID final Long teacherId = ((Teacher) identityInfo).getTeacherId(); - // TODO xuliangtong 实训评阅列表查询 - List toDoList = Lists.emptyList(); + // 我的通知 TeacherOpenCourseNoticeQuery teacherOpenCourseNoticeQuery = new TeacherOpenCourseNoticeQuery(); @@ -70,8 +70,12 @@ public class ApiTeacherService { teacherOpenCourseMergeTeacherQuery.setTeacherId(teacherId); List openCourseList = teacherOpenCourseMergeTeacherService.getValuesByQuery(teacherOpenCourseMergeTeacherQuery); + // 实训评阅列表查询 + List collect = openCourseList.stream().map(TeacherOpenCourseMergeTeacher::getTeacherOpenCourseId).collect(Collectors.toList()); + List reportList = studentHandsOnTaskReportService.getReportList(collect); + return TeacherIndexData.builder() - .toDoList(toDoList) + .toDoList(reportList) .noticeList(noticeList) .myApplicationList(applicationList) .myOpenCourseList(openCourseList) diff --git a/web/src/main/java/com/ibeetl/jlw/web/StudentHandsOnTaskReportController.java b/web/src/main/java/com/ibeetl/jlw/web/StudentHandsOnTaskReportController.java new file mode 100644 index 00000000..9024f9d9 --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/web/StudentHandsOnTaskReportController.java @@ -0,0 +1,225 @@ +package com.ibeetl.jlw.web; + +import cn.jlw.Interceptor.RFile; +import cn.jlw.Interceptor.SCoreUser; +import cn.jlw.Interceptor.GetFile; +import cn.jlw.util.ToolUtils; +import cn.jlw.validate.ValidateConfig; +import com.ibeetl.admin.core.entity.CoreUser; +import com.ibeetl.admin.core.file.FileService; +import com.ibeetl.admin.core.util.ConvertUtil; +import com.ibeetl.admin.core.util.PlatformException; +import com.ibeetl.admin.core.util.TimeTool; +import com.ibeetl.admin.core.web.JsonResult; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.beetl.sql.core.engine.PageQuery; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.validation.annotation.Validated; + +import com.ibeetl.admin.console.web.dto.DictExcelImportData; +import com.ibeetl.admin.console.web.query.UserQuery; +import com.ibeetl.admin.core.annotation.Function; +import com.ibeetl.jlw.entity.*; +import com.ibeetl.jlw.service.*; +import com.ibeetl.jlw.web.query.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.math.BigDecimal; + +import javax.annotation.Resource; + +/** + * 学生-课程实操-报告撰写 学生-课程实操-报告撰写 接口 + * 切记不要对非线程安全的静态变量进行写操作 + */ + +@RestController +@Validated +public class StudentHandsOnTaskReportController{ + + private final Log log = LogFactory.getLog(this.getClass()); + private static final String MODEL = "/jlw/studentHandsOnTaskReport"; + private static final String API = "/api/studentHandsOnTaskReport"; + + + @Resource private StudentHandsOnTaskReportService studentHandsOnTaskReportService; + + @Resource FileService fileService; + + /* 前端接口 */ + + @PostMapping(API + "/getPageList.do") + public JsonResult getPageList(StudentHandsOnTaskReportQuery condition,@SCoreUser CoreUser coreUser){ + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + PageQuery page = condition.getPageQuery(); + studentHandsOnTaskReportService.queryByConditionQuery(page); + return JsonResult.success(page); + } + } + + + @GetMapping(API + "/getInfo.do") + public JsonResultgetInfo(StudentHandsOnTaskReportQuery param,@SCoreUser CoreUser coreUser) { + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + StudentHandsOnTaskReport studentHandsOnTaskReport = studentHandsOnTaskReportService.getInfo(param); + return JsonResult.success(studentHandsOnTaskReport); + } + } + + + @GetMapping(API + "/getList.do") + public JsonResult>getList(StudentHandsOnTaskReportQuery param,@SCoreUser CoreUser coreUser) { + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + Listlist = studentHandsOnTaskReportService.getValuesByQuery(param); + return JsonResult.success(list); + } + } + + + /* 后台页面 */ + + @GetMapping(MODEL + "/index.do") + @Function("studentHandsOnTaskReport.query") + public ModelAndView index() { + ModelAndView view = new ModelAndView("/jlw/studentHandsOnTaskReport/index.html") ; + view.addObject("search", StudentHandsOnTaskReportQuery.class.getName()); + return view; + } + + @GetMapping(MODEL + "/edit.do") + @Function("studentHandsOnTaskReport.edit") + public ModelAndView edit(Long studentHandsOnTaskReportId) { + ModelAndView view = new ModelAndView("/jlw/studentHandsOnTaskReport/edit.html"); + StudentHandsOnTaskReport studentHandsOnTaskReport = studentHandsOnTaskReportService.queryById(studentHandsOnTaskReportId); + view.addObject("studentHandsOnTaskReport", studentHandsOnTaskReport); + return view; + } + + @GetMapping(MODEL + "/add.do") + @Function("studentHandsOnTaskReport.add") + public ModelAndView add(Long studentHandsOnTaskReportId) { + ModelAndView view = new ModelAndView("/jlw/studentHandsOnTaskReport/add.html"); + if(null != studentHandsOnTaskReportId){ + StudentHandsOnTaskReport studentHandsOnTaskReport = studentHandsOnTaskReportService.queryById(studentHandsOnTaskReportId); + view.addObject("studentHandsOnTaskReport", studentHandsOnTaskReport); + }else { + view.addObject("studentHandsOnTaskReport", new StudentHandsOnTaskReport()); + } + return view; + } + + /* 后台接口 */ + + @PostMapping(MODEL + "/list.json") + @Function("studentHandsOnTaskReport.query") + public JsonResult list(StudentHandsOnTaskReportQuery condition){ + PageQuery page = condition.getPageQuery(); + studentHandsOnTaskReportService.queryByCondition(page); + return JsonResult.success(page); + } + + @PostMapping(MODEL + "/addAll.json") + @Function("studentHandsOnTaskReport.add") + public JsonResult addAll(StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery,@SCoreUser CoreUser coreUser){ + if(null == coreUser){ + return JsonResult.failMessage("请登录后再操作"); + }else{ + studentHandsOnTaskReportQuery.setUserId(coreUser.getId()); + studentHandsOnTaskReportQuery.setOrgId(coreUser.getOrgId()); + String msg = studentHandsOnTaskReportService.addAll(studentHandsOnTaskReportQuery); + if (StringUtils.isBlank(msg)) { + return JsonResult.success(); + } else { + return JsonResult.failMessage("新增失败,"+msg); + } + } + } + + @PostMapping(MODEL + "/add.json") + @Function("studentHandsOnTaskReport.add") + public JsonResult add(@Validated(ValidateConfig.ADD.class) StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery, BindingResult result,@SCoreUser CoreUser coreUser){ + if(result.hasErrors()){ + return JsonResult.failMessage(result); + }else{ + studentHandsOnTaskReportQuery.setUserId(coreUser.getId()); + studentHandsOnTaskReportQuery.setOrgId(coreUser.getOrgId()); + return studentHandsOnTaskReportService.add(studentHandsOnTaskReportQuery); + } + } + + @PostMapping(MODEL + "/edit.json") + @Function("studentHandsOnTaskReport.edit") + public JsonResult update(@Validated(ValidateConfig.UPDATE.class) StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery, BindingResult result) { + if(result.hasErrors()){ + return JsonResult.failMessage(result); + }else { + studentHandsOnTaskReportQuery.setUserId(null); + studentHandsOnTaskReportQuery.setOrgId(null); + String msg = studentHandsOnTaskReportService.edit(studentHandsOnTaskReportQuery); + if (StringUtils.isBlank(msg)) { + return JsonResult.success(); + } else { + return JsonResult.failMessage("更新失败,"+msg); + } + } + } + + + @GetMapping(MODEL + "/view.json") + @Function("studentHandsOnTaskReport.query") + public JsonResultqueryInfo(Long studentHandsOnTaskReportId) { + StudentHandsOnTaskReport studentHandsOnTaskReport = studentHandsOnTaskReportService.queryById( studentHandsOnTaskReportId); + return JsonResult.success(studentHandsOnTaskReport); + } + + @GetMapping(MODEL + "/getValues.json") + @Function("studentHandsOnTaskReport.query") + public JsonResult>getValues(StudentHandsOnTaskReportQuery param) { + Listlist = studentHandsOnTaskReportService.getValuesByQuery(param); + return JsonResult.success(list); + } + + + @PostMapping(MODEL + "/delete.json") + @Function("studentHandsOnTaskReport.delete") + @ResponseBody + public JsonResult delete(String ids) { + studentHandsOnTaskReportService.deleteStudentHandsOnTaskReport(ids); + return JsonResult.success(); + } + + +} diff --git a/web/src/main/java/com/ibeetl/jlw/web/query/StudentHandsOnTaskReportQuery.java b/web/src/main/java/com/ibeetl/jlw/web/query/StudentHandsOnTaskReportQuery.java new file mode 100644 index 00000000..fec8b07b --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/web/query/StudentHandsOnTaskReportQuery.java @@ -0,0 +1,176 @@ +package com.ibeetl.jlw.web.query; + +import cn.jlw.validate.ValidateConfig; +import com.ibeetl.jlw.entity.StudentHandsOnTaskReport; +import org.apache.commons.lang3.StringUtils; +import com.ibeetl.admin.core.annotation.Query; +import com.ibeetl.admin.core.util.Tool; +import com.ibeetl.admin.core.util.enums.CoreDictType; +import com.ibeetl.admin.core.web.query.PageParam; + +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; +import java.util.Date; + +/** + *学生-课程实操-报告撰写查询 + */ +public class StudentHandsOnTaskReportQuery extends PageParam { + @NotNull(message = "ID不能为空", groups =ValidateConfig.UPDATE.class) + @Query(name = "ID", display = false) + private Long studentHandsOnTaskReportId; + @Query(name = "课程开课ID", display = false) + private Long teacherOpenCourseId; + @Query(name = "课程实操ID", display = false) + private Long handsOnId; + @Query(name = "课程实操任务ID", display = false) + private Long handsOnTaskId; + @Query(name = "文件地址PDF", display = false) + private String reportFile; + @Query(name = "报告分值", display = false) + private BigDecimal reportScore; + @Query(name = "报告评语", display = false) + private BigDecimal reportComment; + @Query(name = "创建时间", display = false) + private Date createTime; + @Query(name = "组织ID", display = false) + private Long orgId; + @Query(name = "用户ID", display = false) + private Long userId; + + private String studentHandsOnTaskReportIdPlural; + private String teacherOpenCourseIdPlural; + private String handsOnIdPlural; + private String handsOnTaskIdPlural; + private String orgIdPlural; + private String userIdPlural; + + private String studentHandsOnTaskReportJsonStr;//json格式 + + private String _given;//指定更新的特定字段,多个逗号隔开 + + public Long getStudentHandsOnTaskReportId(){ + return studentHandsOnTaskReportId; + } + public void setStudentHandsOnTaskReportId(Long studentHandsOnTaskReportId ){ + this.studentHandsOnTaskReportId = studentHandsOnTaskReportId; + } + public Long getTeacherOpenCourseId(){ + return teacherOpenCourseId; + } + public void setTeacherOpenCourseId(Long teacherOpenCourseId ){ + this.teacherOpenCourseId = teacherOpenCourseId; + } + public Long getHandsOnId(){ + return handsOnId; + } + public void setHandsOnId(Long handsOnId ){ + this.handsOnId = handsOnId; + } + public Long getHandsOnTaskId(){ + return handsOnTaskId; + } + public void setHandsOnTaskId(Long handsOnTaskId ){ + this.handsOnTaskId = handsOnTaskId; + } + public String getReportFile(){ + return reportFile; + } + public void setReportFile(String reportFile ){ + this.reportFile = reportFile; + } + public BigDecimal getReportScore(){ + return reportScore; + } + public void setReportScore(BigDecimal reportScore ){ + this.reportScore = reportScore; + } + public BigDecimal getReportComment(){ + return reportComment; + } + public void setReportComment(BigDecimal reportComment ){ + this.reportComment = reportComment; + } + public Date getCreateTime(){ + return createTime; + } + public void setCreateTime(Date createTime ){ + this.createTime = createTime; + } + public Long getOrgId(){ + return orgId; + } + public void setOrgId(Long orgId ){ + this.orgId = orgId; + } + public Long getUserId(){ + return userId; + } + public void setUserId(Long userId ){ + this.userId = userId; + } + + public StudentHandsOnTaskReport pojo(){ + StudentHandsOnTaskReport pojo = new StudentHandsOnTaskReport(); + pojo.setStudentHandsOnTaskReportId(this.getStudentHandsOnTaskReportId()); + pojo.setTeacherOpenCourseId(this.getTeacherOpenCourseId()); + pojo.setHandsOnId(this.getHandsOnId()); + pojo.setHandsOnTaskId(this.getHandsOnTaskId()); + pojo.setReportFile(this.getReportFile()); + pojo.setReportScore(this.getReportScore()); + pojo.setReportComment(this.getReportComment()); + pojo.setCreateTime(this.getCreateTime()); + pojo.setOrgId(this.getOrgId()); + pojo.setUserId(this.getUserId()); + return pojo; + } + + public String getStudentHandsOnTaskReportIdPlural(){ + return studentHandsOnTaskReportIdPlural; + } + public void setStudentHandsOnTaskReportIdPlural(String studentHandsOnTaskReportIdPlural){ + this.studentHandsOnTaskReportIdPlural = studentHandsOnTaskReportIdPlural; + } + public String getTeacherOpenCourseIdPlural(){ + return teacherOpenCourseIdPlural; + } + public void setTeacherOpenCourseIdPlural(String teacherOpenCourseIdPlural){ + this.teacherOpenCourseIdPlural = teacherOpenCourseIdPlural; + } + public String getHandsOnIdPlural(){ + return handsOnIdPlural; + } + public void setHandsOnIdPlural(String handsOnIdPlural){ + this.handsOnIdPlural = handsOnIdPlural; + } + public String getHandsOnTaskIdPlural(){ + return handsOnTaskIdPlural; + } + public void setHandsOnTaskIdPlural(String handsOnTaskIdPlural){ + this.handsOnTaskIdPlural = handsOnTaskIdPlural; + } + public String getOrgIdPlural(){ + return orgIdPlural; + } + public void setOrgIdPlural(String orgIdPlural){ + this.orgIdPlural = orgIdPlural; + } + public String getUserIdPlural(){ + return userIdPlural; + } + public void setUserIdPlural(String userIdPlural){ + this.userIdPlural = userIdPlural; + } + public String getStudentHandsOnTaskReportJsonStr(){ + return studentHandsOnTaskReportJsonStr; + } + public void setStudentHandsOnTaskReportJsonStr(String studentHandsOnTaskReportJsonStr ){ + this.studentHandsOnTaskReportJsonStr = studentHandsOnTaskReportJsonStr; + } + public String get_given() { + return _given; + } + public void set_given(String _given) { + this._given = _given; + } +} diff --git a/web/src/main/resources/sql/jlw/studentHandsOnTaskReport.md b/web/src/main/resources/sql/jlw/studentHandsOnTaskReport.md new file mode 100644 index 00000000..bb836763 --- /dev/null +++ b/web/src/main/resources/sql/jlw/studentHandsOnTaskReport.md @@ -0,0 +1,376 @@ +queryByCondition +=== +* 根据不为空的参数进行分页查询 + + select + @pageTag(){ + t.* + @} + from student_hands_on_task_report t + where 1=1 + @//数据权限,该sql语句功能点,如果不考虑数据权限,可以删除此行 + and #function("studentHandsOnTaskReport.query")# + @if(!isEmpty(studentHandsOnTaskReportId)){ + and t.student_hands_on_task_report_id =#studentHandsOnTaskReportId# + @} + @if(!isEmpty(studentHandsOnTaskReportIdPlural)){ + and find_in_set(t.student_hands_on_task_report_id,#studentHandsOnTaskReportIdPlural#) + @} + @if(!isEmpty(teacherOpenCourseId)){ + and t.teacher_open_course_id =#teacherOpenCourseId# + @} + @if(!isEmpty(teacherOpenCourseIdPlural)){ + and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) + @} + @if(!isEmpty(handsOnId)){ + and t.hands_on_id =#handsOnId# + @} + @if(!isEmpty(handsOnIdPlural)){ + and find_in_set(t.hands_on_id,#handsOnIdPlural#) + @} + @if(!isEmpty(handsOnTaskId)){ + and t.hands_on_task_id =#handsOnTaskId# + @} + @if(!isEmpty(handsOnTaskIdPlural)){ + and find_in_set(t.hands_on_task_id,#handsOnTaskIdPlural#) + @} + @if(!isEmpty(reportFile)){ + and t.report_file =#reportFile# + @} + @if(!isEmpty(reportScore)){ + and t.report_score =#reportScore# + @} + @if(!isEmpty(reportComment)){ + and t.report_comment =#reportComment# + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + + +queryByConditionQuery +=== +* 根据不为空的参数进行分页查询(无权限) + + select + @pageTag(){ + t.* + @} + from student_hands_on_task_report t + where 1=1 + @if(!isEmpty(studentHandsOnTaskReportId)){ + and t.student_hands_on_task_report_id =#studentHandsOnTaskReportId# + @} + @if(!isEmpty(studentHandsOnTaskReportIdPlural)){ + and find_in_set(t.student_hands_on_task_report_id,#studentHandsOnTaskReportIdPlural#) + @} + @if(!isEmpty(teacherOpenCourseId)){ + and t.teacher_open_course_id =#teacherOpenCourseId# + @} + @if(!isEmpty(teacherOpenCourseIdPlural)){ + and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) + @} + @if(!isEmpty(handsOnId)){ + and t.hands_on_id =#handsOnId# + @} + @if(!isEmpty(handsOnIdPlural)){ + and find_in_set(t.hands_on_id,#handsOnIdPlural#) + @} + @if(!isEmpty(handsOnTaskId)){ + and t.hands_on_task_id =#handsOnTaskId# + @} + @if(!isEmpty(handsOnTaskIdPlural)){ + and find_in_set(t.hands_on_task_id,#handsOnTaskIdPlural#) + @} + @if(!isEmpty(reportFile)){ + and t.report_file =#reportFile# + @} + @if(!isEmpty(reportScore)){ + and t.report_score =#reportScore# + @} + @if(!isEmpty(reportComment)){ + and t.report_comment =#reportComment# + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + + + + +deleteStudentHandsOnTaskReportByIds +=== + +* 批量删除 + + delete from student_hands_on_task_report where find_in_set(student_hands_on_task_report_id,#ids#) + + + +getByIds +=== + +select * from student_hands_on_task_report where find_in_set(student_hands_on_task_report_id,#ids#) + + +updateGivenByIds +=== + +* 批量更新指定字段,无论此字段是否有值 + + update student_hands_on_task_report + set + @if(contain("teacherOpenCourseId",_given)){ + @if(isEmpty(teacherOpenCourseId)){ + teacher_open_course_id = null , + @}else{ + teacher_open_course_id = #teacherOpenCourseId# , + @} + @} + @if(contain("handsOnId",_given)){ + @if(isEmpty(handsOnId)){ + hands_on_id = null , + @}else{ + hands_on_id = #handsOnId# , + @} + @} + @if(contain("handsOnTaskId",_given)){ + @if(isEmpty(handsOnTaskId)){ + hands_on_task_id = null , + @}else{ + hands_on_task_id = #handsOnTaskId# , + @} + @} + @if(contain("reportFile",_given)){ + @if(isEmpty(reportFile)){ + report_file = null , + @}else{ + report_file = #reportFile# , + @} + @} + @if(contain("reportScore",_given)){ + @if(isEmpty(reportScore)){ + report_score = null , + @}else{ + report_score = #reportScore# , + @} + @} + @if(contain("reportComment",_given)){ + @if(isEmpty(reportComment)){ + report_comment = null , + @}else{ + report_comment = #reportComment# , + @} + @} + @if(contain("createTime",_given)){ + @if(isEmpty(createTime)){ + create_time = null , + @}else{ + create_time = #createTime# , + @} + @} + @if(contain("orgId",_given)){ + @if(isEmpty(orgId)){ + org_id = null , + @}else{ + org_id = #orgId# , + @} + @} + @if(contain("userId",_given)){ + @if(isEmpty(userId)){ + user_id = null , + @}else{ + user_id = #userId# , + @} + @} + student_hands_on_task_report_id = student_hands_on_task_report_id + where find_in_set(student_hands_on_task_report_id,#studentHandsOnTaskReportIdPlural#) + + + +getStudentHandsOnTaskReportValues +=== + +* 根据不为空的参数进行查询 + + select t.* + from student_hands_on_task_report t + where 1=1 + @if(!isEmpty(studentHandsOnTaskReportId)){ + and t.student_hands_on_task_report_id =#studentHandsOnTaskReportId# + @} + @if(!isEmpty(teacherOpenCourseId)){ + and t.teacher_open_course_id =#teacherOpenCourseId# + @} + @if(!isEmpty(handsOnId)){ + and t.hands_on_id =#handsOnId# + @} + @if(!isEmpty(handsOnTaskId)){ + and t.hands_on_task_id =#handsOnTaskId# + @} + @if(!isEmpty(reportFile)){ + and t.report_file =#reportFile# + @} + @if(!isEmpty(reportScore)){ + and t.report_score =#reportScore# + @} + @if(!isEmpty(reportComment)){ + and t.report_comment =#reportComment# + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + + +getValuesByQuery +=== + +* 根据不为空的参数进行查询 + + select t.* + from student_hands_on_task_report t + where 1=1 and #function("studentHandsOnTaskReport.query")# + @if(!isEmpty(studentHandsOnTaskReportId)){ + and t.student_hands_on_task_report_id =#studentHandsOnTaskReportId# + @} + @if(!isEmpty(studentHandsOnTaskReportIdPlural)){ + and find_in_set(t.student_hands_on_task_report_id,#studentHandsOnTaskReportIdPlural#) + @} + @if(!isEmpty(teacherOpenCourseId)){ + and t.teacher_open_course_id =#teacherOpenCourseId# + @} + @if(!isEmpty(teacherOpenCourseIdPlural)){ + and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) + @} + @if(!isEmpty(handsOnId)){ + and t.hands_on_id =#handsOnId# + @} + @if(!isEmpty(handsOnIdPlural)){ + and find_in_set(t.hands_on_id,#handsOnIdPlural#) + @} + @if(!isEmpty(handsOnTaskId)){ + and t.hands_on_task_id =#handsOnTaskId# + @} + @if(!isEmpty(handsOnTaskIdPlural)){ + and find_in_set(t.hands_on_task_id,#handsOnTaskIdPlural#) + @} + @if(!isEmpty(reportFile)){ + and t.report_file =#reportFile# + @} + @if(!isEmpty(reportScore)){ + and t.report_score =#reportScore# + @} + @if(!isEmpty(reportComment)){ + and t.report_comment =#reportComment# + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + + +getValuesByQueryNotWithPermission +=== + +* 根据不为空的参数进行查询(不包含权限) + + select t.* + from student_hands_on_task_report t + where 1=1 + @if(!isEmpty(studentHandsOnTaskReportId)){ + and t.student_hands_on_task_report_id =#studentHandsOnTaskReportId# + @} + @if(!isEmpty(studentHandsOnTaskReportIdPlural)){ + and find_in_set(t.student_hands_on_task_report_id,#studentHandsOnTaskReportIdPlural#) + @} + @if(!isEmpty(teacherOpenCourseId)){ + and t.teacher_open_course_id =#teacherOpenCourseId# + @} + @if(!isEmpty(teacherOpenCourseIdPlural)){ + and find_in_set(t.teacher_open_course_id,#teacherOpenCourseIdPlural#) + @} + @if(!isEmpty(handsOnId)){ + and t.hands_on_id =#handsOnId# + @} + @if(!isEmpty(handsOnIdPlural)){ + and find_in_set(t.hands_on_id,#handsOnIdPlural#) + @} + @if(!isEmpty(handsOnTaskId)){ + and t.hands_on_task_id =#handsOnTaskId# + @} + @if(!isEmpty(handsOnTaskIdPlural)){ + and find_in_set(t.hands_on_task_id,#handsOnTaskIdPlural#) + @} + @if(!isEmpty(reportFile)){ + and t.report_file =#reportFile# + @} + @if(!isEmpty(reportScore)){ + and t.report_score =#reportScore# + @} + @if(!isEmpty(reportComment)){ + and t.report_comment =#reportComment# + @} + @if(!isEmpty(createTime)){ + and t.create_time =#createTime# + @} + @if(!isEmpty(orgId)){ + and t.org_id =#orgId# + @} + @if(!isEmpty(orgIdPlural)){ + and find_in_set(t.org_id,#orgIdPlural#) + @} + @if(!isEmpty(userId)){ + and t.user_id =#userId# + @} + @if(!isEmpty(userIdPlural)){ + and find_in_set(t.user_id,#userIdPlural#) + @} + +getReportList +=== + +* 根据开课ID进行查询 + +select t.* +from student_hands_on_task_report t where t.teacherOpenCourseId in (#join(collect)#) diff --git a/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/add.js b/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/add.js new file mode 100644 index 00000000..e295a3f8 --- /dev/null +++ b/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/add.js @@ -0,0 +1,38 @@ +layui.define([ 'form', 'laydate', 'table','studentHandsOnTaskReportApi'], function(exports) { + var form = layui.form; + var studentHandsOnTaskReportApi = layui.studentHandsOnTaskReportApi; + var index = layui.index; + var view = { + init:function(){ + Lib.initGenrealForm($("#addForm"),form); + this.initSubmit(); + }, + initSubmit:function(){ + $("#addButton").click(function(){ + form.on('submit(form)', function(){ + var studentHandsOnTaskReportId = $("#addForm input[name='studentHandsOnTaskReportId']").val(); + if(!$.isEmpty(studentHandsOnTaskReportId)){ + studentHandsOnTaskReportApi.updateStudentHandsOnTaskReport($('#addForm'),function(){ + parent.window.dataReload(); + Common.info("更新成功"); + Lib.closeFrame(); + }); + }else{ + studentHandsOnTaskReportApi.addStudentHandsOnTaskReport($('#addForm'),function(){ + parent.window.dataReload(); + Common.info("添加成功"); + Lib.closeFrame(); + }); + } + + }); + }); + + $("#addButton-cancel").click(function(){ + Lib.closeFrame(); + }); + } + + } + exports('add',view); +}); diff --git a/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/del.js b/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/del.js new file mode 100644 index 00000000..db67b329 --- /dev/null +++ b/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/del.js @@ -0,0 +1,23 @@ +layui.define(['table', 'studentHandsOnTaskReportApi'], function(exports) { + var studentHandsOnTaskReportApi = layui.studentHandsOnTaskReportApi; + var table=layui.table; + var view = { + init:function(){ + }, + delBatch:function(){ + var data = Common.getMoreDataFromTable(table,"studentHandsOnTaskReportTable"); + if(data==null){ + return ; + } + Common.openConfirm("确认要删除这些学生-课程实操-报告撰写?",function(){ + var ids =Common.concatBatchId(data,"studentHandsOnTaskReportId"); + studentHandsOnTaskReportApi.del(ids,function(){ + Common.info("删除成功"); + dataReload(); + }) + }) + } + } + exports('del',view); + +}); \ No newline at end of file diff --git a/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/edit.js b/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/edit.js new file mode 100644 index 00000000..06649732 --- /dev/null +++ b/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/edit.js @@ -0,0 +1,28 @@ +layui.define([ 'form', 'laydate', 'table','studentHandsOnTaskReportApi'], function(exports) { + var form = layui.form; + var studentHandsOnTaskReportApi = layui.studentHandsOnTaskReportApi; + var index = layui.index; + var view = { + init:function(){ + Lib.initGenrealForm($("#updateForm"),form); + this.initSubmit(); + }, + initSubmit:function(){ + $("#updateButton").click(function(){ + form.on('submit(form)', function(){ + studentHandsOnTaskReportApi.updateStudentHandsOnTaskReport($('#updateForm'),function(){ + parent.window.dataReload(); + Common.info("更新成功"); + Lib.closeFrame(); + }); + }); + }); + $("#updateButton-cancel").click(function(){ + Lib.closeFrame(); + }); + } + + } + exports('edit',view); + +}); \ No newline at end of file diff --git a/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/index.js b/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/index.js new file mode 100644 index 00000000..38250d17 --- /dev/null +++ b/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/index.js @@ -0,0 +1,192 @@ +layui.define([ 'form', 'laydate', 'table' ], function(exports) { + var form = layui.form; + var laydate = layui.laydate; + var table = layui.table; + var studentHandsOnTaskReportTable = null; + var view ={ + init:function(){ + var that = this + this.initTable(); + this.initSearchForm(); + this.initToolBar(); + window.dataReload = function(){ + Lib.doSearchForm($("#searchForm"),studentHandsOnTaskReportTable) + that.initToolBar(); + } + }, + initTable:function(){ + var sx_ = localStorage.getItem("studentHandsOnTaskReportTable_field_"+Common.userInfoId); //筛选值显示、隐藏缓存 + if($.isEmpty(sx_)){sx_ = {};}else {sx_ = JSON.parse(sx_);} + studentHandsOnTaskReportTable = table.render({ + elem : '#studentHandsOnTaskReportTable', + height : Lib.getTableHeight(1), + cellMinWidth: 100, + method : 'post', + url : Common.ctxPath + '/jlw/studentHandsOnTaskReport/list.json' // 数据接口 + ,page : Lib.tablePage // 开启分页 + ,toolbar: '#toolbar_studentHandsOnTaskReport' //自定义头部左侧工具栏 + ,defaultToolbar: ['filter', 'print', 'exports'] //头部右侧工具栏 + ,limit : 10, + cols : [ [ // 表头 + { + type : 'checkbox', + + }, + { + field : 'studentHandsOnTaskReportId', + title : 'ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['studentHandsOnTaskReportId'])?false:sx_['studentHandsOnTaskReportId'], + + width : 60, + }, + { + field : 'teacherOpenCourseId', + title : '课程开课ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['teacherOpenCourseId'])?false:sx_['teacherOpenCourseId'], + }, + { + field : 'handsOnId', + title : '课程实操ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['handsOnId'])?false:sx_['handsOnId'], + }, + { + field : 'handsOnTaskId', + title : '课程实操任务ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['handsOnTaskId'])?false:sx_['handsOnTaskId'], + }, + { + field : 'reportFile', + title : '文件地址PDF', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['reportFile'])?false:sx_['reportFile'], + }, + { + field : 'reportScore', + title : '报告分值', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['reportScore'])?false:sx_['reportScore'], + }, + { + field : 'reportComment', + title : '报告评语', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['reportComment'])?false:sx_['reportComment'], + }, + { + field : 'createTime', + title : '创建时间', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['createTime'])?false:sx_['createTime'], + }, + { + field : 'orgId', + title : '组织ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['orgId'])?false:sx_['orgId'], + }, + { + field : 'userId', + title : '用户ID', + align:"center", + hideField :false, + hide:$.isEmpty(sx_['userId'])?false:sx_['userId'], + } + ,{ + field : 'operation_',title : '操作',align:"center", templet: function (d) { + var htm = ''; + htm += ''; + return htm; + } + } + + ] ] + + }); + + table.on('checkbox(studentHandsOnTaskReportTable)', function(obj){ + var studentHandsOnTaskReport = obj.data; + if(obj.checked){ + //按钮逻辑Lib.buttonEnable() + }else{ + + } + }) + }, + + initSearchForm:function(){ + Lib.initSearchForm( $("#searchForm"),studentHandsOnTaskReportTable,form); + }, + + initToolBar:function(){ + toolbar = { + add: function () { + var url = "/jlw/studentHandsOnTaskReport/add.do"; + Common.openDlg(url,"学生-课程实操-报告撰写管理>新增"); + }, + edit: function () { + var data = Common.getOneFromTable(table,"studentHandsOnTaskReportTable"); + if(data==null){ + return ; + } + var url = "/jlw/studentHandsOnTaskReport/add.do?studentHandsOnTaskReportId="+data.studentHandsOnTaskReportId; + Common.openDlg(url,"学生-课程实操-报告撰写管理>"+data.studentHandsOnTaskReportId+">编辑"); + }, + del: function () { + layui.use(['del'], function(){ + var delView = layui.del + delView.delBatch(); + }); + }, + search: function () { + Lib.doSearchForm($("#searchForm"), studentHandsOnTaskReportTable, 1); + view.initToolBar() + }, + refresh: function () { + searchForm.reset(); + Lib.doSearchForm($("#searchForm"), studentHandsOnTaskReportTable, 1); + view.initToolBar() + }, + } + //触发事件 + $('.ext-toolbar').on('click', function() { + var type = $(this).data('type'); + toolbar[type] ? toolbar[type].call(this) : ''; + }); + + }, initTableTool: table.on('tool(studentHandsOnTaskReportTable)', function (obj) { + var data = obj.data; + if (obj.event === 'edit') { + var url = "/jlw/studentHandsOnTaskReport/add.do?studentHandsOnTaskReportId="+data.studentHandsOnTaskReportId; + Common.openDlg(url,"学生-课程实操-报告撰写管理>"+data.studentHandsOnTaskReportId+">编辑"); + }else if(obj.event === "del"){ + layer.confirm('是否确定删除该信息?', function (index) { + var ret = Common.postAjax("/jlw/studentHandsOnTaskReport/delete.json",{ids:data.studentHandsOnTaskReportId}); + layer.msg(ret.code == 0?"删除成功!":ret.msg, { + offset: ['50%'], + icon: ret.code == 0?1:2, + time: 1500 //2秒关闭(如果不配置,默认是3秒) + },function (){ + if(ret.code == 0){ + Lib.tableRefresh(); + } + }); + }); + } + }) + } + exports('index',view); + +}); diff --git a/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/studentHandsOnTaskReportApi.js b/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/studentHandsOnTaskReportApi.js new file mode 100644 index 00000000..1e4a2df9 --- /dev/null +++ b/web/src/main/resources/static/js/jlw/studentHandsOnTaskReport/studentHandsOnTaskReportApi.js @@ -0,0 +1,18 @@ +/*访问后台的代码*/ +layui.define([], function(exports) { + var api={ + updateStudentHandsOnTaskReport:function(form,callback){ + Lib.submitForm("/jlw/studentHandsOnTaskReport/edit.json",form,{},callback) + }, + addStudentHandsOnTaskReport:function(form,callback){ + Lib.submitForm("/jlw/studentHandsOnTaskReport/add.json",form,{},callback) + }, + del:function(ids,callback){ + Common.post("/jlw/studentHandsOnTaskReport/delete.json",{"ids":ids},function(){ + callback(); + }) + } + + }; + exports('studentHandsOnTaskReportApi',api); +}); \ No newline at end of file diff --git a/web/src/main/resources/templates/jlw/studentHandsOnTaskReport/add.html b/web/src/main/resources/templates/jlw/studentHandsOnTaskReport/add.html new file mode 100644 index 00000000..4cc1a1a7 --- /dev/null +++ b/web/src/main/resources/templates/jlw/studentHandsOnTaskReport/add.html @@ -0,0 +1,88 @@ + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+ + + + + + diff --git a/web/src/main/resources/templates/jlw/studentHandsOnTaskReport/edit.html b/web/src/main/resources/templates/jlw/studentHandsOnTaskReport/edit.html new file mode 100644 index 00000000..8533aa63 --- /dev/null +++ b/web/src/main/resources/templates/jlw/studentHandsOnTaskReport/edit.html @@ -0,0 +1,88 @@ + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+ + + + + + diff --git a/web/src/main/resources/templates/jlw/studentHandsOnTaskReport/index.html b/web/src/main/resources/templates/jlw/studentHandsOnTaskReport/index.html new file mode 100644 index 00000000..1d6c9a20 --- /dev/null +++ b/web/src/main/resources/templates/jlw/studentHandsOnTaskReport/index.html @@ -0,0 +1,29 @@ + + + +
+ + + +