diff --git a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java index 92d05d4..42ff62a 100644 --- a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java +++ b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java @@ -8,79 +8,82 @@ import io.swagger.annotations.ApiParam; import org.springframework.web.bind.annotation.RequestParam; import javax.servlet.http.HttpServletResponse; +import java.util.List; -@Api(value = "成绩管理",tags = "成绩管理") +@Api(value = "成绩管理", tags = "成绩管理") public interface AchievementManagementApi { - @ApiOperation(value = "查询指导老师",notes = "查询指导老师") + @ApiOperation(value = "查询指导老师", notes = "查询指导老师") R getTeacher(Integer projectId); - @ApiOperation(value = "查询用户实验报告",notes = "查询用户实验报告") - R getReport(Integer userId,Integer reportId); - - @ApiOperation(value = "成绩管理列表",notes = "查询成绩管理列表") - R list(@RequestParam(value = "系统id",required = true) Integer systemId, - @RequestParam(value = "分类",required = false) Integer projectPermissions, - @RequestParam(value = "搜索内容",required = false) String searchContant, - @RequestParam(value = "开始时间",required = false) String startTime, - @RequestParam(value = "结束时间",required = false) String endTime, - @RequestParam(value = "月份",required = false) Integer month, - @RequestParam(value = "页码",required = true) Integer page, - @RequestParam(value = "页数大小",required = true) Integer size); - - @ApiOperation(value = "查询实验教学列表",notes = "查询实验教学列表") - R newList(@RequestParam(value = "用户id",required = true) Integer userId, - @RequestParam(value = "搜索内容",required = false) String searchContant, - @RequestParam(value = "开始时间",required = false) String startTime, - @RequestParam(value = "结束时间",required = false) String endTime, - @RequestParam(value = "月份",required = false) Integer month, - @RequestParam(value = "页码",required = true) Integer page, - @RequestParam(value = "页数大小",required = true) Integer size); - - @ApiOperation(value = "成绩管理列表",notes = "查询成绩管理列表") - R reportList(@RequestParam(value = "系统id",required = true) Integer systemId, - @RequestParam(value = "项目id",required = true) Integer projectId, - @RequestParam(value = "搜索内容",required = false) String searchContant, - @RequestParam(value = "页码",required = true) Integer page, - @RequestParam(value = "页数大小",required = true) Integer size); - - @ApiOperation(value = "川大新增实验记录",notes = "川大新增实验记录") + @ApiOperation(value = "查询用户实验报告", notes = "查询用户实验报告") + R getReport(Integer userId, Integer reportId); + + @ApiOperation(value = "成绩管理列表", notes = "查询成绩管理列表") + R list(@RequestParam(value = "系统id", required = true) Integer systemId, + @RequestParam(value = "分类", required = false) Integer projectPermissions, + @RequestParam(value = "搜索内容", required = false) String searchContant, + @RequestParam(value = "开始时间", required = false) String startTime, + @RequestParam(value = "结束时间", required = false) String endTime, + @RequestParam(value = "月份", required = false) Integer month, + @RequestParam(value = "页码", required = true) Integer page, + @RequestParam(value = "页数大小", required = true) Integer size); + + @ApiOperation(value = "查询实验教学列表", notes = "查询实验教学列表") + R newList(@RequestParam(value = "用户id", required = true) Integer userId, + @RequestParam(value = "搜索内容", required = false) String searchContant, + @RequestParam(value = "开始时间", required = false) String startTime, + @RequestParam(value = "结束时间", required = false) String endTime, + @RequestParam(value = "月份", required = false) Integer month, + @RequestParam(value = "页码", required = true) Integer page, + @RequestParam(value = "页数大小", required = true) Integer size); + + @ApiOperation(value = "成绩管理列表", notes = "查询成绩管理列表") + R reportList(@RequestParam(value = "系统id", required = true) Integer systemId, + @RequestParam(value = "项目id", required = true) Integer projectId, + @RequestParam(value = "搜索内容", required = false) String searchContant, + @RequestParam(value = "页码", required = true) Integer page, + @RequestParam(value = "页数大小", required = true) Integer size); + + @ApiOperation(value = "川大新增实验记录", notes = "川大新增实验记录") R addReport(ExperimentalReportEntity entity); - @ApiOperation(value = "查询实验记录",notes = "查询实验记录") - R queryReport(@ApiParam(value = "实验报告主键id",required = true) Integer reportId); + @ApiOperation(value = "查询实验记录", notes = "查询实验记录") + R queryReport(@ApiParam(value = "实验报告主键id", required = true) Integer reportId); // @ApiOperation(value = "直接修改实验记录分数",notes = "直接修改实验记录分数") // R updateScore(@ApiParam(value = "recordid和score") ProjectRecordEntity entity); - @ApiOperation(value = "删除实验报告",notes = "根据实验记录主键reportId和实验报告主键recordId删除实验报告") - R deleteReport(@ApiParam(value = "实验记录主键",required = true) Integer reportId,@ApiParam(value = "实验报告主键",required = true) @RequestParam Integer recordId); + @ApiOperation(value = "删除实验报告", notes = "根据实验记录主键reportId和实验报告主键recordId删除实验报告") + R deleteReport(@ApiParam(value = "实验记录主键", required = true) Integer reportId, @ApiParam(value = "实验报告主键", required = true) @RequestParam Integer recordId); - @ApiOperation(value = "班级实验报告列表查询",notes = "班级实验报告列表查询") - R queryEvaluationReport(@ApiParam(value = "搜索内容(学校名称/学生姓名)",required = false) String searchContant, - @ApiParam(value = "项目",required = true) Integer projectId, - @ApiParam(value = "当前页码",required = true) Integer page, - @ApiParam(value = "每页显示数据量",required = true) Integer size); + @ApiOperation(value = "班级实验报告列表查询", notes = "班级实验报告列表查询") + R queryEvaluationReport(@ApiParam(value = "搜索内容(学校名称/学生姓名)", required = false) String searchContant, + @ApiParam(value = "项目", required = true) Integer projectId, + @ApiParam(value = "当前页码", required = true) Integer page, + @ApiParam(value = "每页显示数据量", required = true) Integer size); - @ApiOperation(value = "班级实验成绩导出",notes = "班级实验成绩导出") - void exportAchievement(HttpServletResponse response, @ApiParam(value = "实验记录集合recordId(此处为ids字符串(1,2,3))")String ids) throws Exception; + @ApiOperation(value = "班级实验成绩导出", notes = "班级实验成绩导出") + void exportAchievement(HttpServletResponse response, @ApiParam(value = "实验记录集合recordId(此处为ids字符串(1,2,3))") String ids) throws Exception; - @ApiOperation(value = "成绩管理列表",notes = "成绩管理列表筛选查询") - R queryAchievement(@ApiParam(value = "平台id",required = false) Integer systemId, - @ApiParam(value = "项目类型(0练习,1考核)",required = false) Integer projectPermissions, - @ApiParam(value = "搜索内容(项目名称/实验班级)",required = false) String searchContant, - @ApiParam(value = "开始时间",required = false) String startingtime, - @ApiParam(value = "结束时间",required = false) String endtime, - @ApiParam(value = "最近几月",required = false) Integer month); + @ApiOperation(value = "成绩管理列表", notes = "成绩管理列表筛选查询") + R queryAchievement(@ApiParam(value = "平台id", required = false) Integer systemId, + @ApiParam(value = "项目类型(0练习,1考核)", required = false) Integer projectPermissions, + @ApiParam(value = "搜索内容(项目名称/实验班级)", required = false) String searchContant, + @ApiParam(value = "开始时间", required = false) String startingtime, + @ApiParam(value = "结束时间", required = false) String endtime, + @ApiParam(value = "最近几月", required = false) Integer month); // @ApiOperation(value = "修改教师评语",notes = "修改教师评语:评语comment和实验报告主键reportId") // R updateComment(@ApiParam(value = "评语comment和实验报告主键reportId",required = true) ExperimentalReportEntity entity); - @ApiOperation(value = "发布成绩",notes = "发布成绩--修改教师签名") + @ApiOperation(value = "发布成绩", notes = "发布成绩--修改教师签名") R updateSignatrue(@ApiParam(value = "实验报告主键reportId + 是否使用教师签名isSignature + 教师签名id signatureId + 教师评语comment") ExperimentalReportEntity entity); - @ApiOperation(value = "成绩管理删除项目",notes = "将项目管理表isdel置1") - R deleteReportByProjectId(@ApiParam(value = "项目id",required = true) Integer projectId); + @ApiOperation(value = "成绩管理批量删除项目", notes = "将项目管理下的成绩管理批量删除") + R deleteReportByIds(@ApiParam(value = "项目id", required = true) List projectIds, + @ApiParam(value = "项目类型(0练习,1考核)", required = true) Integer projectPermissions, + @ApiParam(value = "教学实验id",required = false) List ids); @ApiOperation(value = "成绩管理:虚拟仿真实验成绩管理", notes = "成绩管理:虚拟仿真实验成绩管理") @@ -89,4 +92,7 @@ public interface AchievementManagementApi { @ApiOperation(value = "成绩管理:实验教学成绩管理", notes = "成绩管理:实验教学成绩管理") R getTeachAchievement(@RequestParam(required = true) Integer id); + @ApiOperation(value = "成绩管理:编辑实验报告", notes = "成绩管理:编辑实验报告") + R modify(@ApiParam(value = "要修改的字段") ExperimentalReportEntity entity); + } diff --git a/src/main/java/com/msdw/tms/common/utils/ConstantUtils.java b/src/main/java/com/msdw/tms/common/utils/ConstantUtils.java index c5a9703..0f8cf94 100644 --- a/src/main/java/com/msdw/tms/common/utils/ConstantUtils.java +++ b/src/main/java/com/msdw/tms/common/utils/ConstantUtils.java @@ -32,5 +32,5 @@ public class ConstantUtils { //用户初始密码 - public static final String INITIAL_PASSWORD = "huoran123"; + public static final String INITIAL_PASSWORD = "111aaa"; } diff --git a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java index 05a12ef..3b2f903 100644 --- a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java +++ b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java @@ -27,21 +27,24 @@ public class AchievementManagementController implements AchievementManagementApi @Autowired private ProjectRecordService projectRecordService; + /** * 查询用户实验报告 + * * @param projectId * @param * @return */ @Override @GetMapping("/getTeacher") - public R getTeacher(@RequestParam Integer projectId){ + public R getTeacher(@RequestParam Integer projectId) { R data = service.getTeacher(projectId); return data; } /** * 查询用户实验报告 + * * @param userId * @param reportId * @param @@ -49,13 +52,12 @@ public class AchievementManagementController implements AchievementManagementApi */ @Override @GetMapping("/getReport") - public R getReport(@RequestParam Integer reportId,@RequestParam Integer userId){ - R data = service.getReport(userId,reportId); + public R getReport(@RequestParam Integer reportId, @RequestParam Integer userId) { + R data = service.getReport(userId, reportId); return data; } - /** * 查询实验记录 */ @@ -68,27 +70,27 @@ public class AchievementManagementController implements AchievementManagementApi @RequestParam(required = false) String endTime, @RequestParam(required = false) Integer month, @RequestParam(required = true) Integer page, - @RequestParam(required = true) Integer size){ + @RequestParam(required = true) Integer size) { ResultsVo vo = new ResultsVo(); - if (systemId==null){ + if (systemId == null) { return R.error("系统id不能为空!"); - }else{ + } else { vo.setSystemId(systemId); } - if (projectPermissions!=null){ + if (projectPermissions != null) { vo.setProjectPermissions(projectPermissions); } - if (searchContant!=null){ + if (searchContant != null) { vo.setSearchContant(searchContant); } - if (startTime!=null){ + if (startTime != null) { vo.setStartTime(startTime); } - if (endTime!=null){ + if (endTime != null) { vo.setEndTime(endTime); } - List result = service.list(vo,page,size); - return R.ok().put("data",result); + List result = service.list(vo, page, size); + return R.ok().put("data", result); } /** @@ -97,29 +99,29 @@ public class AchievementManagementController implements AchievementManagementApi @Override @GetMapping("/newList") public R newList(@RequestParam(required = true) Integer userId, - @RequestParam(required = false) String searchContant, - @RequestParam(required = false) String startTime, - @RequestParam(required = false) String endTime, - @RequestParam(required = false) Integer month, - @RequestParam(required = true) Integer page, - @RequestParam(required = true) Integer size){ + @RequestParam(required = false) String searchContant, + @RequestParam(required = false) String startTime, + @RequestParam(required = false) String endTime, + @RequestParam(required = false) Integer month, + @RequestParam(required = true) Integer page, + @RequestParam(required = true) Integer size) { ResultsVo vo = new ResultsVo(); - if (userId==null){ + if (userId == null) { return R.error("用户id不能为空!"); - }else{ + } else { vo.setUserId(userId); } - if (searchContant!=null){ + if (searchContant != null) { vo.setSearchContant(searchContant); } - if (startTime!=null){ + if (startTime != null) { vo.setStartTime(startTime); } - if (endTime!=null){ + if (endTime != null) { vo.setEndTime(endTime); } - List result = service.newList(vo,page,size); - return R.ok().put("data",result); + List result = service.newList(vo, page, size); + return R.ok().put("data", result); } /** @@ -128,22 +130,22 @@ public class AchievementManagementController implements AchievementManagementApi @Override @GetMapping("/reportList") public R reportList(@RequestParam(required = true) Integer systemId, - @RequestParam(required = true) Integer projectId, - @RequestParam(required = false) String searchContant, - @RequestParam(required = true) Integer page, - @RequestParam(required = true) Integer size){ + @RequestParam(required = true) Integer projectId, + @RequestParam(required = false) String searchContant, + @RequestParam(required = true) Integer page, + @RequestParam(required = true) Integer size) { ResultsVo vo = new ResultsVo(); - if (systemId==null||projectId==null){ + if (systemId == null || projectId == null) { return R.error("系统或项目数据不能为空!"); - }else{ + } else { vo.setSystemId(systemId); vo.setProjectId(projectId); } - if (searchContant!=null){ + if (searchContant != null) { vo.setSearchContant(searchContant); } - List result = service.reportList(vo,page,size); - return R.ok().put("data",result); + List result = service.reportList(vo, page, size); + return R.ok().put("data", result); } /** @@ -151,9 +153,9 @@ public class AchievementManagementController implements AchievementManagementApi */ @Override @PostMapping("/addReport") - public R addReport(@RequestBody ExperimentalReportEntity entity){ + public R addReport(@RequestBody ExperimentalReportEntity entity) { R result = service.addReport(entity); - return R.ok().put("reportId",entity.getReportId()); + return R.ok().put("reportId", entity.getReportId()); } // /** @@ -171,7 +173,7 @@ public class AchievementManagementController implements AchievementManagementApi */ @Override @GetMapping("/queryReport") - public R queryReport(@RequestParam(required = true) Integer reportId){ + public R queryReport(@RequestParam(required = true) Integer reportId) { R result = service.queryReport(reportId); return result; } @@ -180,7 +182,7 @@ public class AchievementManagementController implements AchievementManagementApi // @Override @Transactional @PostMapping("/updateReport") - public R updateScore(@RequestBody ProjectRecordEntity entity){ + public R updateScore(@RequestBody ProjectRecordEntity entity) { ProjectRecordEntity vo = new ProjectRecordEntity() .setRecordid(entity.getRecordid()).setScore(entity.getScore()); projectRecordService.updateScore(vo); @@ -189,20 +191,22 @@ public class AchievementManagementController implements AchievementManagementApi /** * 需求:删除实验记录====管理端删除,但是学生端仍需保留 - * 将isdel属性设置为0 + * 将isdel属性设置为0 + * * @param reportId * @return */ @Override @PostMapping("/deleteReport") - public R deleteReport(@RequestParam Integer reportId,@RequestParam Integer recordId){ - R result = service.deleteReport(reportId,recordId); + public R deleteReport(@RequestParam Integer reportId, @RequestParam Integer recordId) { + R result = service.deleteReport(reportId, recordId); return result; } /** * 班级实验报告列表查询 + * * @param searchContant * @return */ @@ -211,21 +215,22 @@ public class AchievementManagementController implements AchievementManagementApi public R queryEvaluationReport(@RequestParam(required = false) String searchContant, @RequestParam(required = true) Integer projectId, @RequestParam(required = true) Integer page, - @RequestParam(required = true) Integer size){ - R result = service.queryEvaluationReport(searchContant,projectId,page,size); + @RequestParam(required = true) Integer size) { + R result = service.queryEvaluationReport(searchContant, projectId, page, size); return result; } /** * 班级实验成绩导出 + * * @param response - * @param ids (ids:recordId) + * @param ids (ids:recordId) * @throws Exception */ @Override @GetMapping("/exportAchievement") public void exportAchievement(HttpServletResponse response, @RequestParam String ids) throws Exception { - service.exportAchievement(response,ids);//SearchAchievementVo vo + service.exportAchievement(response, ids);//SearchAchievementVo vo } //成绩管理列表 @@ -236,19 +241,20 @@ public class AchievementManagementController implements AchievementManagementApi @RequestParam(required = false) String searchContant, @RequestParam(required = false) String startingtime, @RequestParam(required = false) String endtime, - @RequestParam(required = false) Integer month){ - R result = service.queryAchievement(systemId,projectPermissions,searchContant,startingtime,endtime,month); + @RequestParam(required = false) Integer month) { + R result = service.queryAchievement(systemId, projectPermissions, searchContant, startingtime, endtime, month); return result; } /** * 修改评语 + * * @param entity * @return */ // @Override @PostMapping("/updateComment") - public R updateComment(@RequestBody ExperimentalReportEntity entity){ + public R updateComment(@RequestBody ExperimentalReportEntity entity) { R result = service.updateComment(entity); return result; } @@ -256,26 +262,28 @@ public class AchievementManagementController implements AchievementManagementApi /** * 发布成绩: * 修改教师签名+修改教师评语 - * @param entity (isSignature,signatureId,reportId,comment) + * + * @param entity (isSignature,signatureId,reportId,comment) * @return */ @Override @PostMapping("/release") - public R updateSignatrue(@RequestBody ExperimentalReportEntity entity){ + public R updateSignatrue(@RequestBody ExperimentalReportEntity entity) { service.updateSignatrue(entity); return R.ok(); } /** - * 删除成绩管理中的项目 - * @param projectId + * 批量删除成绩管理中的项目 + * * @return */ @Override @PostMapping("/deleteReportById") - public R deleteReportByProjectId(@RequestParam Integer projectId) { - return service.deleteReportByProjectId(projectId); + public R deleteReportByIds(@RequestParam List projectIds,@RequestParam Integer projectPermissions, + @RequestParam(required = false) List ids) { + return service.deleteReportById(projectIds,projectPermissions,ids); } /** @@ -297,4 +305,12 @@ public class AchievementManagementController implements AchievementManagementApi List result = service.getTeachAchievement(id); return R.ok().put("data", result); } + + + @Override + @PostMapping("/modify") + public R modify(@RequestBody ExperimentalReportEntity entity) { + Integer code = service.modify(entity); + return R.ok(); + } } diff --git a/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java b/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java index f070234..9b0d5ac 100644 --- a/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java +++ b/src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java @@ -124,7 +124,8 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr @Override @PostMapping("/delete") public R delete(@RequestBody Integer[] ids){ - experimentalTeachingService.removeByIds(Arrays.asList(ids)); + //改为假删除tms_experimental_teaching + experimentalTeachingService.deleteTeachByIds(Arrays.asList(ids)); return R.ok(); } diff --git a/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java b/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java index 27286ba..799e79a 100644 --- a/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java +++ b/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java @@ -47,7 +47,7 @@ public interface AchievementManagementDao extends BaseMapper queryEvaluationReport(Page tPage, String searchContant, Integer projectId); @@ -71,7 +71,7 @@ public interface AchievementManagementDao extends BaseMapper queryPythonTest(Integer eventId); - void updateSignatrue(Integer isSignature,Integer signatureId,Integer reportId,String comment); + void updateSignatrue(Integer isSignature, Integer signatureId, Integer reportId, String comment); void deleteReportById(Integer projectId); @@ -79,4 +79,7 @@ public interface AchievementManagementDao extends BaseMapper getImitationAchievement(Integer projectId); List getTeachAchievement(Integer id); + + //编辑实验报告 + Integer modify(ExperimentalReportEntity entity); } diff --git a/src/main/java/com/msdw/tms/dao/ClassTeachingDao.java b/src/main/java/com/msdw/tms/dao/ClassTeachingDao.java index 5cbc435..3ad2f27 100644 --- a/src/main/java/com/msdw/tms/dao/ClassTeachingDao.java +++ b/src/main/java/com/msdw/tms/dao/ClassTeachingDao.java @@ -26,4 +26,6 @@ public interface ClassTeachingDao { int updateExperimentalNumber(Integer number, Integer id); + + void updateIsDel(Integer id); } diff --git a/src/main/java/com/msdw/tms/entity/ExperimentalReportEntity.java b/src/main/java/com/msdw/tms/entity/ExperimentalReportEntity.java index ae5e261..cc2f0bc 100644 --- a/src/main/java/com/msdw/tms/entity/ExperimentalReportEntity.java +++ b/src/main/java/com/msdw/tms/entity/ExperimentalReportEntity.java @@ -13,112 +13,118 @@ import lombok.experimental.Accessors; public class ExperimentalReportEntity { //实验报告主键 @TableId(type = IdType.AUTO) - @ApiModelProperty(value = "实验报告主键",name = "reportId",required = false) + @ApiModelProperty(value = "实验报告主键", name = "reportId", required = false) private Integer reportId; //绑定实验id - @ApiModelProperty(value = "绑定实验id",name = "projectId",required = false) + @ApiModelProperty(value = "绑定实验id", name = "projectId", required = false) private Integer projectId; //实验原理 - @ApiModelProperty(value = "实验原理",name = "principle",required = false) + @ApiModelProperty(value = "实验原理", name = "principle", required = false) private String principle; //实验内容 - @ApiModelProperty(value = "实验内容",name = "content",required = false) + @ApiModelProperty(value = "实验内容", name = "content", required = false) private String content; //实验步骤 - @ApiModelProperty(value = "实验步骤",name = "step",required = false) + @ApiModelProperty(value = "实验步骤", name = "step", required = false) private String step; //实验数据 - @ApiModelProperty(value = "实验数据",name = "data",required = false) + @ApiModelProperty(value = "实验数据", name = "data", required = false) private String data; //实验分析 - @ApiModelProperty(value = "实验分析",name = "analysis",required = false) + @ApiModelProperty(value = "实验分析", name = "analysis", required = false) private String analysis; //实验结论 - @ApiModelProperty(value = "实验结论",name = "conclusion",required = false) + @ApiModelProperty(value = "实验结论", name = "conclusion", required = false) private String conclusion; //实验总结 - @ApiModelProperty(value = "实验总结",name = "summarize",required = false) + @ApiModelProperty(value = "实验总结", name = "summarize", required = false) private String summarize; //实验目的 - @ApiModelProperty(value = "实验目的",name = "purpose",required = false) + @ApiModelProperty(value = "实验目的", name = "purpose", required = false) private String purpose; //对本实验过程的方法及手段的改进建议 - @ApiModelProperty(value = "对本实验过程的方法及手段的改进建议",name = "improvement",required = false) + @ApiModelProperty(value = "对本实验过程的方法及手段的改进建议", name = "improvement", required = false) private String improvement; //老师评语 - @ApiModelProperty(value = "老师评语",name = "commentId",required = false) + @ApiModelProperty(value = "老师评语", name = "commentId", required = false) private Integer commentId; //教师评语 - @ApiModelProperty(value = "教师评语",name = "comment",required = false) + @ApiModelProperty(value = "教师评语", name = "comment", required = false) private String comment; //绑定学生id - @ApiModelProperty(value = "绑定学生id",name = "studentId",required = false) + @ApiModelProperty(value = "绑定学生id", name = "studentId", required = false) private Integer studentId; //绑定老师id - @ApiModelProperty(value = "绑定老师id",name = "teacherId",required = false) + @ApiModelProperty(value = "绑定老师id", name = "teacherId", required = false) private Integer teacherId; //指导老师 - @ApiModelProperty(value = "指导老师",name = "teacherName",required = false) + @ApiModelProperty(value = "指导老师", name = "teacherName", required = false) private String teacherName; //学时 - @ApiModelProperty(value = "学时",name = "period",required = false) + @ApiModelProperty(value = "学时", name = "period", required = false) private String period; //实验室名称 - @ApiModelProperty(value = "实验室名称",name = "laboratory",required = false) + @ApiModelProperty(value = "实验室名称", name = "laboratory", required = false) private String laboratory; //绑定教师签名id - @ApiModelProperty(value = "绑定教师签名id",name = "signatureId",required = false) + @ApiModelProperty(value = "绑定教师签名id", name = "signatureId", required = false) private Integer signatureId; //是否启用教师签名照 - @ApiModelProperty(value = "是否启用教师签名照",name = "isSignature",required = false) + @ApiModelProperty(value = "是否启用教师签名照", name = "isSignature", required = false) private Integer isSignature; //绑定项目id - @ApiModelProperty(value = "绑定项目id",name = "eventId",required = false) + @ApiModelProperty(value = "绑定项目id", name = "eventId", required = false) private Integer eventId; //实验器材 - @ApiModelProperty(value = "实验器材",name = "equipment",required = false) + @ApiModelProperty(value = "实验器材", name = "equipment", required = false) private String equipment; - @ApiModelProperty(value = "最终得分",name = "score",required = false) + @ApiModelProperty(value = "最终得分", name = "score", required = false) private Integer score; - @ApiModelProperty(value = "耗时/小时",name = "timeConsuming",required = false) + @ApiModelProperty(value = "耗时/小时", name = "timeConsuming", required = false) private Integer timeConsuming; - @ApiModelProperty(value = "开始时间",name = "startTime",required = false) + @ApiModelProperty(value = "开始时间", name = "startTime", required = false) private String startTime; - @ApiModelProperty(value = "创建时间",name = "creationTime",required = false) + @ApiModelProperty(value = "创建时间", name = "creationTime", required = false) private String creationTime; - @ApiModelProperty(value = "班级名称",name = "className",required = false) + @ApiModelProperty(value = "班级名称", name = "className", required = false) private String className; //步骤1 - @ApiModelProperty(value = "步骤1",name = "steps1",required = false) + @ApiModelProperty(value = "步骤1", name = "steps1", required = false) private String steps1; //步骤2 - @ApiModelProperty(value = "步骤2",name = "steps2",required = false) + @ApiModelProperty(value = "步骤2", name = "steps2", required = false) private String steps2; //步骤3 - @ApiModelProperty(value = "步骤3",name = "steps3",required = false) + @ApiModelProperty(value = "步骤3", name = "steps3", required = false) private String steps3; //步骤4 - @ApiModelProperty(value = "步骤4",name = "steps4",required = false) + @ApiModelProperty(value = "步骤4", name = "steps4", required = false) private String steps4; //步骤5 - @ApiModelProperty(value = "步骤5",name = "steps5",required = false) + @ApiModelProperty(value = "步骤5", name = "steps5", required = false) private String steps5; //步骤6 - @ApiModelProperty(value = "步骤6",name = "steps6",required = false) + @ApiModelProperty(value = "步骤6", name = "steps6", required = false) private String steps6; //步骤7 - @ApiModelProperty(value = "步骤7",name = "steps7",required = false) + @ApiModelProperty(value = "步骤7", name = "steps7", required = false) private String steps7; //步骤8 - @ApiModelProperty(value = "步骤8",name = "steps8",required = false) + @ApiModelProperty(value = "步骤8", name = "steps8", required = false) private String steps8; //步骤9 - @ApiModelProperty(value = "步骤9",name = "steps9",required = false) + @ApiModelProperty(value = "步骤9", name = "steps9", required = false) private String steps9; //步骤10 - @ApiModelProperty(value = "步骤10",name = "steps10",required = false) + @ApiModelProperty(value = "步骤10", name = "steps10", required = false) private String steps10; + @ApiModelProperty(value = "指导老师", name = "instructor", required = false) + private String instructor; + + @ApiModelProperty(value = "项目名称", name = "proName", required = false) + private String proName; + private transient String projectName; private transient String workNumber; diff --git a/src/main/java/com/msdw/tms/entity/ResultsEntity.java b/src/main/java/com/msdw/tms/entity/ResultsEntity.java index 715cd3a..4ec085d 100644 --- a/src/main/java/com/msdw/tms/entity/ResultsEntity.java +++ b/src/main/java/com/msdw/tms/entity/ResultsEntity.java @@ -48,6 +48,8 @@ public class ResultsEntity{ //实验名称 private String experimentalName; + private Integer isdel; + } diff --git a/src/main/java/com/msdw/tms/entity/request/AchievementImportRequest.java b/src/main/java/com/msdw/tms/entity/request/AchievementImportRequest.java index eb3bf1f..8c4751f 100644 --- a/src/main/java/com/msdw/tms/entity/request/AchievementImportRequest.java +++ b/src/main/java/com/msdw/tms/entity/request/AchievementImportRequest.java @@ -15,24 +15,24 @@ public class AchievementImportRequest { @ExcelAttribute(sort = 0) private String schoolName; - //实验班级 + /* //实验班级 @ExcelAttribute(sort = 1) - private String experimentalClassName; + private String experimentalClassName;*/ //学生姓名 - @ExcelAttribute(sort = 2) + @ExcelAttribute(sort = 1) private String userName; //学号 - @ExcelAttribute(sort = 3) + @ExcelAttribute(sort = 2) private String workNumber; //分数 - @ExcelAttribute(sort = 4) + @ExcelAttribute(sort = 3) private String score; //提交时间 - @ExcelAttribute(sort = 5) + @ExcelAttribute(sort = 4) private String submitTime; } diff --git a/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java b/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java index 386b14b..74a4be1 100644 --- a/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java +++ b/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java @@ -23,6 +23,7 @@ public class GetByUserRecordResp { private Integer timeSum; private Integer userId; private Integer systemId; + private Integer reportId; public Integer getSystemId() { return systemId; @@ -95,4 +96,12 @@ public class GetByUserRecordResp { public void setUserId(Integer userId) { this.userId = userId; } + + public Integer getReportId() { + return reportId; + } + + public void setReportId(Integer reportId) { + this.reportId = reportId; + } } diff --git a/src/main/java/com/msdw/tms/entity/response/ResponseResult.java b/src/main/java/com/msdw/tms/entity/response/ResponseResult.java index 2b2464b..45a6820 100644 --- a/src/main/java/com/msdw/tms/entity/response/ResponseResult.java +++ b/src/main/java/com/msdw/tms/entity/response/ResponseResult.java @@ -24,7 +24,7 @@ public class ResponseResult { /** * 状态码 */ - private int code; + private int status; /** * 返回的数据 @@ -36,15 +36,15 @@ public class ResponseResult { */ private String message; - public ResponseResult(boolean success, int code, String message) { + public ResponseResult(boolean success, int status, String message) { this.success = success; - this.code = code; + this.status = status; this.message = message; } public ResponseResult(ResultCode resultCode) { this.success = resultCode.success(); - this.code = resultCode.code(); + this.status = resultCode.code(); this.message = resultCode.message(); } @@ -68,8 +68,8 @@ public class ResponseResult { return new ResponseResult(CommonCode.FAIL); } - public static ResponseResult FAIL(int code, String message) { - return new ResponseResult<>(false, code, null, message); + public static ResponseResult FAIL(int status, String message) { + return new ResponseResult<>(false, status, null, message); } } diff --git a/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVO.java b/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVO.java index 5c87f50..e5e2fa5 100644 --- a/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVO.java +++ b/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVO.java @@ -20,6 +20,9 @@ public class AchievementManagementVO extends ExperimentalReportEntity { //实验班级 private String experimentalClassName; + //实验名称 + private String experimentalName; + //学生姓名 private String userName; diff --git a/src/main/java/com/msdw/tms/entity/vo/ResultsVo.java b/src/main/java/com/msdw/tms/entity/vo/ResultsVo.java index 791c06e..cb68385 100644 --- a/src/main/java/com/msdw/tms/entity/vo/ResultsVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/ResultsVo.java @@ -40,4 +40,6 @@ public class ResultsVo { //用户id private Integer userId; + private Integer isdel; + } diff --git a/src/main/java/com/msdw/tms/service/AchievementManagementService.java b/src/main/java/com/msdw/tms/service/AchievementManagementService.java index b3a8ea7..b142c80 100644 --- a/src/main/java/com/msdw/tms/service/AchievementManagementService.java +++ b/src/main/java/com/msdw/tms/service/AchievementManagementService.java @@ -30,23 +30,26 @@ public interface AchievementManagementService extends IService projectId,Integer projectPermissions, List id); List getImitationAchievement(Integer projectId); List getTeachAchievement(Integer id); + + //编辑实验报告 + Integer modify(ExperimentalReportEntity entity); } diff --git a/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java b/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java index 3bea116..491c511 100644 --- a/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java +++ b/src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java @@ -16,4 +16,5 @@ public interface ExperimentalTeachingService extends IService asList); } diff --git a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java index a51cf8c..40089a4 100644 --- a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java @@ -78,9 +78,26 @@ public class AchievementManagementServiceImpl extends ServiceImpl list(ResultsVo vo, Integer page, Integer size) { + + List list = achievementManagementDao.list(vo); + + for (ResultsEntity entity : list) { + Integer number = achievementManagementDao.getImitationAchievement(entity.getProjectId()).size(); + entity.setNumber(number); + } + + return list; } @@ -93,6 +110,10 @@ public class AchievementManagementServiceImpl extends ServiceImpl newList(ResultsVo vo, Integer page, Integer size) { List newList = achievementManagementDao.newList(vo); + for (ResultsEntity entity : newList) { + Integer number = achievementManagementDao.getTeachAchievement(entity.getId()).size(); + entity.setNumber(number); + } return newList; } @@ -171,8 +192,8 @@ public class AchievementManagementServiceImpl extends ServiceImpl achievement = achievementManagementDao.queryAchievement(list); //2.加载模板流数据 - ClassPathResource resource = new ClassPathResource("excel-template/川大成绩管理实验记录导出模板.xlsx"); + ClassPathResource resource = new ClassPathResource("excel-template/川大成绩管理实验记录导出模板 (1).xlsx"); InputStream inputStream = resource.getInputStream(); //3、通过工具类下载文件 @@ -283,11 +304,29 @@ public class AchievementManagementServiceImpl extends ServiceImpl projectIds,Integer projectPermissions, List ids) { + if (projectPermissions == 1){//实验教学 + for (Integer id: ids) { + List teachAchievements = achievementManagementDao.getTeachAchievement(id); + for (AchievementManagementVO teachAchievement : teachAchievements) { + Integer reportId = teachAchievement.getReportId(); + Integer recordId = teachAchievement.getRecordId(); + achievementManagementDao.deleteReport(reportId, recordId); + } + } + }else { + for (Integer projectId: projectIds) {//虚仿实验 + List imitationAchievements = achievementManagementDao.getImitationAchievement(projectId); + for (AchievementManagementVO imitationAchievement: imitationAchievements) { + Integer reportId = imitationAchievement.getReportId(); + Integer recordId = imitationAchievement.getRecordId(); + achievementManagementDao.deleteReport(reportId,recordId); + } + } + } + - achievementManagementDao.deleteReportById(projectId); return R.ok(); } @@ -296,12 +335,18 @@ public class AchievementManagementServiceImpl extends ServiceImpl getImitationAchievement(Integer projectId) { List list = achievementManagementDao.getImitationAchievement(projectId); + return list; } @Override public List getTeachAchievement(Integer id) { - return achievementManagementDao.getTeachAchievement(id); + return achievementManagementDao.getTeachAchievement(id); + } + + @Override + public Integer modify(ExperimentalReportEntity entity) { + return achievementManagementDao.modify(entity); } } diff --git a/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java index 0e6843f..73df989 100644 --- a/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java @@ -15,6 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.List; + @Service("experimentalTeachingService") public class ExperimentalTeachingServiceImpl extends ServiceImpl implements ExperimentalTeachingService { @@ -50,4 +52,12 @@ public class ExperimentalTeachingServiceImpl extends ServiceImpl asList) { + int size = asList.size(); + for (int i = 0; i < size; i++) { + classTeachingDao.updateIsDel(asList.get(i)); + } + } + } diff --git a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java index df35b8f..89c6c31 100644 --- a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java @@ -90,7 +90,7 @@ public class ProjectRecordServiceImpl extends ServiceImpl UPDATE tms_project_record tpr,tms_experimental_report ter SET tpr.isdel = 1, ter.isdel = 1 - WHERE tpr.recordId = #{recordId} AND ter.reportId = #{reportId} + WHERE tpr.recordId = #{recordId} + AND ter.reportId = #{reportId} UPDATE tms_experimental_report @@ -390,15 +391,35 @@ GROUP BY hec.codeId + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE tms_experimental_report + + + instructor=#{instructor, jdbcType=VARCHAR}, + + + + period=#{period, jdbcType=INTEGER}, + + + proName=#{proName, jdbcType=VARCHAR}, + + + purpose=#{purpose, jdbcType=VARCHAR}, + + + summarize=#{summarize, jdbcType=VARCHAR}, + + + + WHERE reportId = #{reportId} + + + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/ClassTeachingDao.xml b/src/main/resources/mapper/tms/ClassTeachingDao.xml index 3265d03..6a54760 100644 --- a/src/main/resources/mapper/tms/ClassTeachingDao.xml +++ b/src/main/resources/mapper/tms/ClassTeachingDao.xml @@ -117,4 +117,11 @@ WHERE id = #{id} + + + UPDATE tms_experimental_teaching + SET is_del = 1 + WHERE + id = #{id} + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/ExperimentalReportDao.xml b/src/main/resources/mapper/tms/ExperimentalReportDao.xml index 7f087d8..c6dbaaa 100644 --- a/src/main/resources/mapper/tms/ExperimentalReportDao.xml +++ b/src/main/resources/mapper/tms/ExperimentalReportDao.xml @@ -12,7 +12,7 @@ SELECT u.userId, u.userName, stu.workNumber, - tet.project_name, + ter.proName, tet.id AS experimentId, tet.experimental_class_name, hpm.experimentalGoal AS experiment_goal, @@ -28,7 +28,9 @@ ter.conclusion, ter.summarize, ter.improvement, - IFNULL(ter.`comment`, (SELECT `comment` FROM tms_comment WHERE id = commentId)) AS comment + IFNULL(ter.`comment`, (SELECT `comment` FROM tms_comment WHERE id = commentId)) AS comment, + ter.instructor, + ter.purpose FROM hr_user_info u, student stu, tms_experimental_report ter, @@ -47,23 +49,27 @@ AND ter.projectId = #{projectId} SELECT - id, - experimental_class_name, - experimental_name, - project_id, - project_name, - (select count(*) - from tms_project_record WHERE projectId = project_id) as experimental_number, - experiment_duration, - type, - start_time, - stop_time, - status, - invitation_code, - is_code, - user_id, - creation_time, - surplus_time + id, + experimental_class_name, + experimental_name, + project_id, + project_name, + ( SELECT count( * ) FROM tms_project_record WHERE projectId = project_id AND tms_project_record.isdel = 0 ) AS experimental_number, + experiment_duration, + type, + start_time, + stop_time, + STATUS, + invitation_code, + is_code, + user_id, + creation_time, + surplus_time , + systemId FROM - tms_experimental_teaching + tms_experimental_teaching t + inner join hr_project_management m on m.projectId = t.project_id WHERE - is_del = 0 + t.is_del = 0 AND `type`=#{exp.type,jdbcType=INTEGER} diff --git a/src/main/resources/mapper/tms/ProjectRecordDao.xml b/src/main/resources/mapper/tms/ProjectRecordDao.xml index 132fe16..f327ea5 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -47,7 +47,8 @@ +