Merge remote-tracking branch 'origin/master'

hehai
zhiyong.ning 4 years ago
commit 63c5aac00b
  1. 112
      src/main/java/com/msdw/tms/api/AchievementManagementApi.java
  2. 2
      src/main/java/com/msdw/tms/common/utils/ConstantUtils.java
  3. 126
      src/main/java/com/msdw/tms/controller/AchievementManagementController.java
  4. 3
      src/main/java/com/msdw/tms/controller/ExperimentalTeachingController.java
  5. 7
      src/main/java/com/msdw/tms/dao/AchievementManagementDao.java
  6. 2
      src/main/java/com/msdw/tms/dao/ClassTeachingDao.java
  7. 80
      src/main/java/com/msdw/tms/entity/ExperimentalReportEntity.java
  8. 2
      src/main/java/com/msdw/tms/entity/ResultsEntity.java
  9. 12
      src/main/java/com/msdw/tms/entity/request/AchievementImportRequest.java
  10. 9
      src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java
  11. 12
      src/main/java/com/msdw/tms/entity/response/ResponseResult.java
  12. 3
      src/main/java/com/msdw/tms/entity/vo/AchievementManagementVO.java
  13. 2
      src/main/java/com/msdw/tms/entity/vo/ResultsVo.java
  14. 13
      src/main/java/com/msdw/tms/service/AchievementManagementService.java
  15. 1
      src/main/java/com/msdw/tms/service/ExperimentalTeachingService.java
  16. 59
      src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java
  17. 10
      src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java
  18. 2
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  19. BIN
      src/main/resources/excel-template/川大成绩管理实验记录导出模板 (1).xlsx
  20. 187
      src/main/resources/mapper/tms/AchievementManagementDao.xml
  21. 7
      src/main/resources/mapper/tms/ClassTeachingDao.xml
  22. 44
      src/main/resources/mapper/tms/ExperimentalReportDao.xml
  23. 84
      src/main/resources/mapper/tms/ExperimentalTeachingDao.xml
  24. 20
      src/main/resources/mapper/tms/ProjectRecordDao.xml

@ -8,79 +8,82 @@ import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Api(value = "成绩管理",tags = "成绩管理") @Api(value = "成绩管理", tags = "成绩管理")
public interface AchievementManagementApi { public interface AchievementManagementApi {
@ApiOperation(value = "查询指导老师",notes = "查询指导老师") @ApiOperation(value = "查询指导老师", notes = "查询指导老师")
R getTeacher(Integer projectId); R getTeacher(Integer projectId);
@ApiOperation(value = "查询用户实验报告",notes = "查询用户实验报告") @ApiOperation(value = "查询用户实验报告", notes = "查询用户实验报告")
R getReport(Integer userId,Integer reportId); R getReport(Integer userId, Integer reportId);
@ApiOperation(value = "成绩管理列表",notes = "查询成绩管理列表") @ApiOperation(value = "成绩管理列表", notes = "查询成绩管理列表")
R list(@RequestParam(value = "系统id",required = true) Integer systemId, R list(@RequestParam(value = "系统id", required = true) Integer systemId,
@RequestParam(value = "分类",required = false) Integer projectPermissions, @RequestParam(value = "分类", required = false) Integer projectPermissions,
@RequestParam(value = "搜索内容",required = false) String searchContant, @RequestParam(value = "搜索内容", required = false) String searchContant,
@RequestParam(value = "开始时间",required = false) String startTime, @RequestParam(value = "开始时间", required = false) String startTime,
@RequestParam(value = "结束时间",required = false) String endTime, @RequestParam(value = "结束时间", required = false) String endTime,
@RequestParam(value = "月份",required = false) Integer month, @RequestParam(value = "月份", required = false) Integer month,
@RequestParam(value = "页码",required = true) Integer page, @RequestParam(value = "页码", required = true) Integer page,
@RequestParam(value = "页数大小",required = true) Integer size); @RequestParam(value = "页数大小", required = true) Integer size);
@ApiOperation(value = "查询实验教学列表",notes = "查询实验教学列表") @ApiOperation(value = "查询实验教学列表", notes = "查询实验教学列表")
R newList(@RequestParam(value = "用户id",required = true) Integer userId, R newList(@RequestParam(value = "用户id", required = true) Integer userId,
@RequestParam(value = "搜索内容",required = false) String searchContant, @RequestParam(value = "搜索内容", required = false) String searchContant,
@RequestParam(value = "开始时间",required = false) String startTime, @RequestParam(value = "开始时间", required = false) String startTime,
@RequestParam(value = "结束时间",required = false) String endTime, @RequestParam(value = "结束时间", required = false) String endTime,
@RequestParam(value = "月份",required = false) Integer month, @RequestParam(value = "月份", required = false) Integer month,
@RequestParam(value = "页码",required = true) Integer page, @RequestParam(value = "页码", required = true) Integer page,
@RequestParam(value = "页数大小",required = true) Integer size); @RequestParam(value = "页数大小", required = true) Integer size);
@ApiOperation(value = "成绩管理列表",notes = "查询成绩管理列表") @ApiOperation(value = "成绩管理列表", notes = "查询成绩管理列表")
R reportList(@RequestParam(value = "系统id",required = true) Integer systemId, R reportList(@RequestParam(value = "系统id", required = true) Integer systemId,
@RequestParam(value = "项目id",required = true) Integer projectId, @RequestParam(value = "项目id", required = true) Integer projectId,
@RequestParam(value = "搜索内容",required = false) String searchContant, @RequestParam(value = "搜索内容", required = false) String searchContant,
@RequestParam(value = "页码",required = true) Integer page, @RequestParam(value = "页码", required = true) Integer page,
@RequestParam(value = "页数大小",required = true) Integer size); @RequestParam(value = "页数大小", required = true) Integer size);
@ApiOperation(value = "川大新增实验记录",notes = "川大新增实验记录") @ApiOperation(value = "川大新增实验记录", notes = "川大新增实验记录")
R addReport(ExperimentalReportEntity entity); R addReport(ExperimentalReportEntity entity);
@ApiOperation(value = "查询实验记录",notes = "查询实验记录") @ApiOperation(value = "查询实验记录", notes = "查询实验记录")
R queryReport(@ApiParam(value = "实验报告主键id",required = true) Integer reportId); R queryReport(@ApiParam(value = "实验报告主键id", required = true) Integer reportId);
// @ApiOperation(value = "直接修改实验记录分数",notes = "直接修改实验记录分数") // @ApiOperation(value = "直接修改实验记录分数",notes = "直接修改实验记录分数")
// R updateScore(@ApiParam(value = "recordid和score") ProjectRecordEntity entity); // R updateScore(@ApiParam(value = "recordid和score") ProjectRecordEntity entity);
@ApiOperation(value = "删除实验报告",notes = "根据实验记录主键reportId和实验报告主键recordId删除实验报告") @ApiOperation(value = "删除实验报告", notes = "根据实验记录主键reportId和实验报告主键recordId删除实验报告")
R deleteReport(@ApiParam(value = "实验记录主键",required = true) Integer reportId,@ApiParam(value = "实验报告主键",required = true) @RequestParam Integer recordId); R deleteReport(@ApiParam(value = "实验记录主键", required = true) Integer reportId, @ApiParam(value = "实验报告主键", required = true) @RequestParam Integer recordId);
@ApiOperation(value = "班级实验报告列表查询",notes = "班级实验报告列表查询") @ApiOperation(value = "班级实验报告列表查询", notes = "班级实验报告列表查询")
R queryEvaluationReport(@ApiParam(value = "搜索内容(学校名称/学生姓名)",required = false) String searchContant, R queryEvaluationReport(@ApiParam(value = "搜索内容(学校名称/学生姓名)", required = false) String searchContant,
@ApiParam(value = "项目",required = true) Integer projectId, @ApiParam(value = "项目", required = true) Integer projectId,
@ApiParam(value = "当前页码",required = true) Integer page, @ApiParam(value = "当前页码", required = true) Integer page,
@ApiParam(value = "每页显示数据量",required = true) Integer size); @ApiParam(value = "每页显示数据量", required = true) Integer size);
@ApiOperation(value = "班级实验成绩导出",notes = "班级实验成绩导出") @ApiOperation(value = "班级实验成绩导出", notes = "班级实验成绩导出")
void exportAchievement(HttpServletResponse response, @ApiParam(value = "实验记录集合recordId(此处为ids字符串(1,2,3))")String ids) throws Exception; void exportAchievement(HttpServletResponse response, @ApiParam(value = "实验记录集合recordId(此处为ids字符串(1,2,3))") String ids) throws Exception;
@ApiOperation(value = "成绩管理列表",notes = "成绩管理列表筛选查询") @ApiOperation(value = "成绩管理列表", notes = "成绩管理列表筛选查询")
R queryAchievement(@ApiParam(value = "平台id",required = false) Integer systemId, R queryAchievement(@ApiParam(value = "平台id", required = false) Integer systemId,
@ApiParam(value = "项目类型(0练习,1考核)",required = false) Integer projectPermissions, @ApiParam(value = "项目类型(0练习,1考核)", required = false) Integer projectPermissions,
@ApiParam(value = "搜索内容(项目名称/实验班级)",required = false) String searchContant, @ApiParam(value = "搜索内容(项目名称/实验班级)", required = false) String searchContant,
@ApiParam(value = "开始时间",required = false) String startingtime, @ApiParam(value = "开始时间", required = false) String startingtime,
@ApiParam(value = "结束时间",required = false) String endtime, @ApiParam(value = "结束时间", required = false) String endtime,
@ApiParam(value = "最近几月",required = false) Integer month); @ApiParam(value = "最近几月", required = false) Integer month);
// @ApiOperation(value = "修改教师评语",notes = "修改教师评语:评语comment和实验报告主键reportId") // @ApiOperation(value = "修改教师评语",notes = "修改教师评语:评语comment和实验报告主键reportId")
// R updateComment(@ApiParam(value = "评语comment和实验报告主键reportId",required = true) ExperimentalReportEntity entity); // 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); R updateSignatrue(@ApiParam(value = "实验报告主键reportId + 是否使用教师签名isSignature + 教师签名id signatureId + 教师评语comment") ExperimentalReportEntity entity);
@ApiOperation(value = "成绩管理删除项目",notes = "将项目管理表isdel置1") @ApiOperation(value = "成绩管理批量删除项目", notes = "将项目管理下的成绩管理批量删除")
R deleteReportByProjectId(@ApiParam(value = "项目id",required = true) Integer projectId); R deleteReportByIds(@ApiParam(value = "项目id", required = true) List<Integer> projectIds,
@ApiParam(value = "项目类型(0练习,1考核)", required = true) Integer projectPermissions,
@ApiParam(value = "教学实验id",required = false) List<Integer> ids);
@ApiOperation(value = "成绩管理:虚拟仿真实验成绩管理", notes = "成绩管理:虚拟仿真实验成绩管理") @ApiOperation(value = "成绩管理:虚拟仿真实验成绩管理", notes = "成绩管理:虚拟仿真实验成绩管理")
@ -89,4 +92,7 @@ public interface AchievementManagementApi {
@ApiOperation(value = "成绩管理:实验教学成绩管理", notes = "成绩管理:实验教学成绩管理") @ApiOperation(value = "成绩管理:实验教学成绩管理", notes = "成绩管理:实验教学成绩管理")
R getTeachAchievement(@RequestParam(required = true) Integer id); R getTeachAchievement(@RequestParam(required = true) Integer id);
@ApiOperation(value = "成绩管理:编辑实验报告", notes = "成绩管理:编辑实验报告")
R modify(@ApiParam(value = "要修改的字段") ExperimentalReportEntity entity);
} }

@ -32,5 +32,5 @@ public class ConstantUtils {
//用户初始密码 //用户初始密码
public static final String INITIAL_PASSWORD = "huoran123"; public static final String INITIAL_PASSWORD = "111aaa";
} }

@ -27,21 +27,24 @@ public class AchievementManagementController implements AchievementManagementApi
@Autowired @Autowired
private ProjectRecordService projectRecordService; private ProjectRecordService projectRecordService;
/** /**
* 查询用户实验报告 * 查询用户实验报告
*
* @param projectId * @param projectId
* @param * @param
* @return * @return
*/ */
@Override @Override
@GetMapping("/getTeacher") @GetMapping("/getTeacher")
public R getTeacher(@RequestParam Integer projectId){ public R getTeacher(@RequestParam Integer projectId) {
R data = service.getTeacher(projectId); R data = service.getTeacher(projectId);
return data; return data;
} }
/** /**
* 查询用户实验报告 * 查询用户实验报告
*
* @param userId * @param userId
* @param reportId * @param reportId
* @param * @param
@ -49,13 +52,12 @@ public class AchievementManagementController implements AchievementManagementApi
*/ */
@Override @Override
@GetMapping("/getReport") @GetMapping("/getReport")
public R getReport(@RequestParam Integer reportId,@RequestParam Integer userId){ public R getReport(@RequestParam Integer reportId, @RequestParam Integer userId) {
R data = service.getReport(userId,reportId); R data = service.getReport(userId, reportId);
return data; return data;
} }
/** /**
* 查询实验记录 * 查询实验记录
*/ */
@ -68,27 +70,27 @@ public class AchievementManagementController implements AchievementManagementApi
@RequestParam(required = false) String endTime, @RequestParam(required = false) String endTime,
@RequestParam(required = false) Integer month, @RequestParam(required = false) Integer month,
@RequestParam(required = true) Integer page, @RequestParam(required = true) Integer page,
@RequestParam(required = true) Integer size){ @RequestParam(required = true) Integer size) {
ResultsVo vo = new ResultsVo(); ResultsVo vo = new ResultsVo();
if (systemId==null){ if (systemId == null) {
return R.error("系统id不能为空!"); return R.error("系统id不能为空!");
}else{ } else {
vo.setSystemId(systemId); vo.setSystemId(systemId);
} }
if (projectPermissions!=null){ if (projectPermissions != null) {
vo.setProjectPermissions(projectPermissions); vo.setProjectPermissions(projectPermissions);
} }
if (searchContant!=null){ if (searchContant != null) {
vo.setSearchContant(searchContant); vo.setSearchContant(searchContant);
} }
if (startTime!=null){ if (startTime != null) {
vo.setStartTime(startTime); vo.setStartTime(startTime);
} }
if (endTime!=null){ if (endTime != null) {
vo.setEndTime(endTime); vo.setEndTime(endTime);
} }
List<ResultsEntity> result = service.list(vo,page,size); List<ResultsEntity> result = service.list(vo, page, size);
return R.ok().put("data",result); return R.ok().put("data", result);
} }
/** /**
@ -97,29 +99,29 @@ public class AchievementManagementController implements AchievementManagementApi
@Override @Override
@GetMapping("/newList") @GetMapping("/newList")
public R newList(@RequestParam(required = true) Integer userId, public R newList(@RequestParam(required = true) Integer userId,
@RequestParam(required = false) String searchContant, @RequestParam(required = false) String searchContant,
@RequestParam(required = false) String startTime, @RequestParam(required = false) String startTime,
@RequestParam(required = false) String endTime, @RequestParam(required = false) String endTime,
@RequestParam(required = false) Integer month, @RequestParam(required = false) Integer month,
@RequestParam(required = true) Integer page, @RequestParam(required = true) Integer page,
@RequestParam(required = true) Integer size){ @RequestParam(required = true) Integer size) {
ResultsVo vo = new ResultsVo(); ResultsVo vo = new ResultsVo();
if (userId==null){ if (userId == null) {
return R.error("用户id不能为空!"); return R.error("用户id不能为空!");
}else{ } else {
vo.setUserId(userId); vo.setUserId(userId);
} }
if (searchContant!=null){ if (searchContant != null) {
vo.setSearchContant(searchContant); vo.setSearchContant(searchContant);
} }
if (startTime!=null){ if (startTime != null) {
vo.setStartTime(startTime); vo.setStartTime(startTime);
} }
if (endTime!=null){ if (endTime != null) {
vo.setEndTime(endTime); vo.setEndTime(endTime);
} }
List<ResultsEntity> result = service.newList(vo,page,size); List<ResultsEntity> result = service.newList(vo, page, size);
return R.ok().put("data",result); return R.ok().put("data", result);
} }
/** /**
@ -128,22 +130,22 @@ public class AchievementManagementController implements AchievementManagementApi
@Override @Override
@GetMapping("/reportList") @GetMapping("/reportList")
public R reportList(@RequestParam(required = true) Integer systemId, public R reportList(@RequestParam(required = true) Integer systemId,
@RequestParam(required = true) Integer projectId, @RequestParam(required = true) Integer projectId,
@RequestParam(required = false) String searchContant, @RequestParam(required = false) String searchContant,
@RequestParam(required = true) Integer page, @RequestParam(required = true) Integer page,
@RequestParam(required = true) Integer size){ @RequestParam(required = true) Integer size) {
ResultsVo vo = new ResultsVo(); ResultsVo vo = new ResultsVo();
if (systemId==null||projectId==null){ if (systemId == null || projectId == null) {
return R.error("系统或项目数据不能为空!"); return R.error("系统或项目数据不能为空!");
}else{ } else {
vo.setSystemId(systemId); vo.setSystemId(systemId);
vo.setProjectId(projectId); vo.setProjectId(projectId);
} }
if (searchContant!=null){ if (searchContant != null) {
vo.setSearchContant(searchContant); vo.setSearchContant(searchContant);
} }
List<ReportEntity> result = service.reportList(vo,page,size); List<ReportEntity> result = service.reportList(vo, page, size);
return R.ok().put("data",result); return R.ok().put("data", result);
} }
/** /**
@ -151,9 +153,9 @@ public class AchievementManagementController implements AchievementManagementApi
*/ */
@Override @Override
@PostMapping("/addReport") @PostMapping("/addReport")
public R addReport(@RequestBody ExperimentalReportEntity entity){ public R addReport(@RequestBody ExperimentalReportEntity entity) {
R result = service.addReport(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 @Override
@GetMapping("/queryReport") @GetMapping("/queryReport")
public R queryReport(@RequestParam(required = true) Integer reportId){ public R queryReport(@RequestParam(required = true) Integer reportId) {
R result = service.queryReport(reportId); R result = service.queryReport(reportId);
return result; return result;
} }
@ -180,7 +182,7 @@ public class AchievementManagementController implements AchievementManagementApi
// @Override // @Override
@Transactional @Transactional
@PostMapping("/updateReport") @PostMapping("/updateReport")
public R updateScore(@RequestBody ProjectRecordEntity entity){ public R updateScore(@RequestBody ProjectRecordEntity entity) {
ProjectRecordEntity vo = new ProjectRecordEntity() ProjectRecordEntity vo = new ProjectRecordEntity()
.setRecordid(entity.getRecordid()).setScore(entity.getScore()); .setRecordid(entity.getRecordid()).setScore(entity.getScore());
projectRecordService.updateScore(vo); projectRecordService.updateScore(vo);
@ -189,20 +191,22 @@ public class AchievementManagementController implements AchievementManagementApi
/** /**
* 需求删除实验记录====管理端删除但是学生端仍需保留 * 需求删除实验记录====管理端删除但是学生端仍需保留
* 将isdel属性设置为0 * 将isdel属性设置为0
*
* @param reportId * @param reportId
* @return * @return
*/ */
@Override @Override
@PostMapping("/deleteReport") @PostMapping("/deleteReport")
public R deleteReport(@RequestParam Integer reportId,@RequestParam Integer recordId){ public R deleteReport(@RequestParam Integer reportId, @RequestParam Integer recordId) {
R result = service.deleteReport(reportId,recordId); R result = service.deleteReport(reportId, recordId);
return result; return result;
} }
/** /**
* 班级实验报告列表查询 * 班级实验报告列表查询
*
* @param searchContant * @param searchContant
* @return * @return
*/ */
@ -211,21 +215,22 @@ public class AchievementManagementController implements AchievementManagementApi
public R queryEvaluationReport(@RequestParam(required = false) String searchContant, public R queryEvaluationReport(@RequestParam(required = false) String searchContant,
@RequestParam(required = true) Integer projectId, @RequestParam(required = true) Integer projectId,
@RequestParam(required = true) Integer page, @RequestParam(required = true) Integer page,
@RequestParam(required = true) Integer size){ @RequestParam(required = true) Integer size) {
R result = service.queryEvaluationReport(searchContant,projectId,page,size); R result = service.queryEvaluationReport(searchContant, projectId, page, size);
return result; return result;
} }
/** /**
* 班级实验成绩导出 * 班级实验成绩导出
*
* @param response * @param response
* @param ids (idsrecordId) * @param ids (idsrecordId)
* @throws Exception * @throws Exception
*/ */
@Override @Override
@GetMapping("/exportAchievement") @GetMapping("/exportAchievement")
public void exportAchievement(HttpServletResponse response, @RequestParam String ids) throws Exception { 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 searchContant,
@RequestParam(required = false) String startingtime, @RequestParam(required = false) String startingtime,
@RequestParam(required = false) String endtime, @RequestParam(required = false) String endtime,
@RequestParam(required = false) Integer month){ @RequestParam(required = false) Integer month) {
R result = service.queryAchievement(systemId,projectPermissions,searchContant,startingtime,endtime,month); R result = service.queryAchievement(systemId, projectPermissions, searchContant, startingtime, endtime, month);
return result; return result;
} }
/** /**
* 修改评语 * 修改评语
*
* @param entity * @param entity
* @return * @return
*/ */
// @Override // @Override
@PostMapping("/updateComment") @PostMapping("/updateComment")
public R updateComment(@RequestBody ExperimentalReportEntity entity){ public R updateComment(@RequestBody ExperimentalReportEntity entity) {
R result = service.updateComment(entity); R result = service.updateComment(entity);
return result; return result;
} }
@ -256,26 +262,28 @@ public class AchievementManagementController implements AchievementManagementApi
/** /**
* 发布成绩 * 发布成绩
* 修改教师签名+修改教师评语 * 修改教师签名+修改教师评语
* @param entity isSignaturesignatureIdreportIdcomment *
* @param entity isSignaturesignatureIdreportIdcomment
* @return * @return
*/ */
@Override @Override
@PostMapping("/release") @PostMapping("/release")
public R updateSignatrue(@RequestBody ExperimentalReportEntity entity){ public R updateSignatrue(@RequestBody ExperimentalReportEntity entity) {
service.updateSignatrue(entity); service.updateSignatrue(entity);
return R.ok(); return R.ok();
} }
/** /**
* 删除成绩管理中的项目 * 批量删除成绩管理中的项目
* @param projectId *
* @return * @return
*/ */
@Override @Override
@PostMapping("/deleteReportById") @PostMapping("/deleteReportById")
public R deleteReportByProjectId(@RequestParam Integer projectId) { public R deleteReportByIds(@RequestParam List<Integer> projectIds,@RequestParam Integer projectPermissions,
return service.deleteReportByProjectId(projectId); @RequestParam(required = false) List<Integer> ids) {
return service.deleteReportById(projectIds,projectPermissions,ids);
} }
/** /**
@ -297,4 +305,12 @@ public class AchievementManagementController implements AchievementManagementApi
List<AchievementManagementVO> result = service.getTeachAchievement(id); List<AchievementManagementVO> result = service.getTeachAchievement(id);
return R.ok().put("data", result); return R.ok().put("data", result);
} }
@Override
@PostMapping("/modify")
public R modify(@RequestBody ExperimentalReportEntity entity) {
Integer code = service.modify(entity);
return R.ok();
}
} }

@ -124,7 +124,8 @@ public class ExperimentalTeachingController implements ExperimentalTeachingContr
@Override @Override
@PostMapping("/delete") @PostMapping("/delete")
public R delete(@RequestBody Integer[] ids){ public R delete(@RequestBody Integer[] ids){
experimentalTeachingService.removeByIds(Arrays.asList(ids)); //改为假删除tms_experimental_teaching
experimentalTeachingService.deleteTeachByIds(Arrays.asList(ids));
return R.ok(); return R.ok();
} }

@ -47,7 +47,7 @@ public interface AchievementManagementDao extends BaseMapper<ExperimentalReportE
AchievementManagementVO queryReport(Integer reportId); AchievementManagementVO queryReport(Integer reportId);
void deleteReport(Integer reportId,Integer recordId); void deleteReport(Integer reportId, Integer recordId);
IPage<AchievementManagementVO> queryEvaluationReport(Page<T> tPage, String searchContant, Integer projectId); IPage<AchievementManagementVO> queryEvaluationReport(Page<T> tPage, String searchContant, Integer projectId);
@ -71,7 +71,7 @@ public interface AchievementManagementDao extends BaseMapper<ExperimentalReportE
List<AchievementManagementVO> queryPythonTest(Integer eventId); List<AchievementManagementVO> 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); void deleteReportById(Integer projectId);
@ -79,4 +79,7 @@ public interface AchievementManagementDao extends BaseMapper<ExperimentalReportE
List<AchievementManagementVO> getImitationAchievement(Integer projectId); List<AchievementManagementVO> getImitationAchievement(Integer projectId);
List<AchievementManagementVO> getTeachAchievement(Integer id); List<AchievementManagementVO> getTeachAchievement(Integer id);
//编辑实验报告
Integer modify(ExperimentalReportEntity entity);
} }

@ -26,4 +26,6 @@ public interface ClassTeachingDao {
int updateExperimentalNumber(Integer number, Integer id); int updateExperimentalNumber(Integer number, Integer id);
void updateIsDel(Integer id);
} }

@ -13,112 +13,118 @@ import lombok.experimental.Accessors;
public class ExperimentalReportEntity { public class ExperimentalReportEntity {
//实验报告主键 //实验报告主键
@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO)
@ApiModelProperty(value = "实验报告主键",name = "reportId",required = false) @ApiModelProperty(value = "实验报告主键", name = "reportId", required = false)
private Integer reportId; private Integer reportId;
//绑定实验id //绑定实验id
@ApiModelProperty(value = "绑定实验id",name = "projectId",required = false) @ApiModelProperty(value = "绑定实验id", name = "projectId", required = false)
private Integer projectId; private Integer projectId;
//实验原理 //实验原理
@ApiModelProperty(value = "实验原理",name = "principle",required = false) @ApiModelProperty(value = "实验原理", name = "principle", required = false)
private String principle; private String principle;
//实验内容 //实验内容
@ApiModelProperty(value = "实验内容",name = "content",required = false) @ApiModelProperty(value = "实验内容", name = "content", required = false)
private String content; private String content;
//实验步骤 //实验步骤
@ApiModelProperty(value = "实验步骤",name = "step",required = false) @ApiModelProperty(value = "实验步骤", name = "step", required = false)
private String step; private String step;
//实验数据 //实验数据
@ApiModelProperty(value = "实验数据",name = "data",required = false) @ApiModelProperty(value = "实验数据", name = "data", required = false)
private String data; private String data;
//实验分析 //实验分析
@ApiModelProperty(value = "实验分析",name = "analysis",required = false) @ApiModelProperty(value = "实验分析", name = "analysis", required = false)
private String analysis; private String analysis;
//实验结论 //实验结论
@ApiModelProperty(value = "实验结论",name = "conclusion",required = false) @ApiModelProperty(value = "实验结论", name = "conclusion", required = false)
private String conclusion; private String conclusion;
//实验总结 //实验总结
@ApiModelProperty(value = "实验总结",name = "summarize",required = false) @ApiModelProperty(value = "实验总结", name = "summarize", required = false)
private String summarize; private String summarize;
//实验目的 //实验目的
@ApiModelProperty(value = "实验目的",name = "purpose",required = false) @ApiModelProperty(value = "实验目的", name = "purpose", required = false)
private String purpose; private String purpose;
//对本实验过程的方法及手段的改进建议 //对本实验过程的方法及手段的改进建议
@ApiModelProperty(value = "对本实验过程的方法及手段的改进建议",name = "improvement",required = false) @ApiModelProperty(value = "对本实验过程的方法及手段的改进建议", name = "improvement", required = false)
private String improvement; private String improvement;
//老师评语 //老师评语
@ApiModelProperty(value = "老师评语",name = "commentId",required = false) @ApiModelProperty(value = "老师评语", name = "commentId", required = false)
private Integer commentId; private Integer commentId;
//教师评语 //教师评语
@ApiModelProperty(value = "教师评语",name = "comment",required = false) @ApiModelProperty(value = "教师评语", name = "comment", required = false)
private String comment; private String comment;
//绑定学生id //绑定学生id
@ApiModelProperty(value = "绑定学生id",name = "studentId",required = false) @ApiModelProperty(value = "绑定学生id", name = "studentId", required = false)
private Integer studentId; private Integer studentId;
//绑定老师id //绑定老师id
@ApiModelProperty(value = "绑定老师id",name = "teacherId",required = false) @ApiModelProperty(value = "绑定老师id", name = "teacherId", required = false)
private Integer teacherId; private Integer teacherId;
//指导老师 //指导老师
@ApiModelProperty(value = "指导老师",name = "teacherName",required = false) @ApiModelProperty(value = "指导老师", name = "teacherName", required = false)
private String teacherName; private String teacherName;
//学时 //学时
@ApiModelProperty(value = "学时",name = "period",required = false) @ApiModelProperty(value = "学时", name = "period", required = false)
private String period; private String period;
//实验室名称 //实验室名称
@ApiModelProperty(value = "实验室名称",name = "laboratory",required = false) @ApiModelProperty(value = "实验室名称", name = "laboratory", required = false)
private String laboratory; private String laboratory;
//绑定教师签名id //绑定教师签名id
@ApiModelProperty(value = "绑定教师签名id",name = "signatureId",required = false) @ApiModelProperty(value = "绑定教师签名id", name = "signatureId", required = false)
private Integer signatureId; private Integer signatureId;
//是否启用教师签名照 //是否启用教师签名照
@ApiModelProperty(value = "是否启用教师签名照",name = "isSignature",required = false) @ApiModelProperty(value = "是否启用教师签名照", name = "isSignature", required = false)
private Integer isSignature; private Integer isSignature;
//绑定项目id //绑定项目id
@ApiModelProperty(value = "绑定项目id",name = "eventId",required = false) @ApiModelProperty(value = "绑定项目id", name = "eventId", required = false)
private Integer eventId; private Integer eventId;
//实验器材 //实验器材
@ApiModelProperty(value = "实验器材",name = "equipment",required = false) @ApiModelProperty(value = "实验器材", name = "equipment", required = false)
private String equipment; private String equipment;
@ApiModelProperty(value = "最终得分",name = "score",required = false) @ApiModelProperty(value = "最终得分", name = "score", required = false)
private Integer score; private Integer score;
@ApiModelProperty(value = "耗时/小时",name = "timeConsuming",required = false) @ApiModelProperty(value = "耗时/小时", name = "timeConsuming", required = false)
private Integer timeConsuming; private Integer timeConsuming;
@ApiModelProperty(value = "开始时间",name = "startTime",required = false) @ApiModelProperty(value = "开始时间", name = "startTime", required = false)
private String startTime; private String startTime;
@ApiModelProperty(value = "创建时间",name = "creationTime",required = false) @ApiModelProperty(value = "创建时间", name = "creationTime", required = false)
private String creationTime; private String creationTime;
@ApiModelProperty(value = "班级名称",name = "className",required = false) @ApiModelProperty(value = "班级名称", name = "className", required = false)
private String className; private String className;
//步骤1 //步骤1
@ApiModelProperty(value = "步骤1",name = "steps1",required = false) @ApiModelProperty(value = "步骤1", name = "steps1", required = false)
private String steps1; private String steps1;
//步骤2 //步骤2
@ApiModelProperty(value = "步骤2",name = "steps2",required = false) @ApiModelProperty(value = "步骤2", name = "steps2", required = false)
private String steps2; private String steps2;
//步骤3 //步骤3
@ApiModelProperty(value = "步骤3",name = "steps3",required = false) @ApiModelProperty(value = "步骤3", name = "steps3", required = false)
private String steps3; private String steps3;
//步骤4 //步骤4
@ApiModelProperty(value = "步骤4",name = "steps4",required = false) @ApiModelProperty(value = "步骤4", name = "steps4", required = false)
private String steps4; private String steps4;
//步骤5 //步骤5
@ApiModelProperty(value = "步骤5",name = "steps5",required = false) @ApiModelProperty(value = "步骤5", name = "steps5", required = false)
private String steps5; private String steps5;
//步骤6 //步骤6
@ApiModelProperty(value = "步骤6",name = "steps6",required = false) @ApiModelProperty(value = "步骤6", name = "steps6", required = false)
private String steps6; private String steps6;
//步骤7 //步骤7
@ApiModelProperty(value = "步骤7",name = "steps7",required = false) @ApiModelProperty(value = "步骤7", name = "steps7", required = false)
private String steps7; private String steps7;
//步骤8 //步骤8
@ApiModelProperty(value = "步骤8",name = "steps8",required = false) @ApiModelProperty(value = "步骤8", name = "steps8", required = false)
private String steps8; private String steps8;
//步骤9 //步骤9
@ApiModelProperty(value = "步骤9",name = "steps9",required = false) @ApiModelProperty(value = "步骤9", name = "steps9", required = false)
private String steps9; private String steps9;
//步骤10 //步骤10
@ApiModelProperty(value = "步骤10",name = "steps10",required = false) @ApiModelProperty(value = "步骤10", name = "steps10", required = false)
private String steps10; 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 projectName;
private transient String workNumber; private transient String workNumber;

@ -48,6 +48,8 @@ public class ResultsEntity{
//实验名称 //实验名称
private String experimentalName; private String experimentalName;
private Integer isdel;
} }

@ -15,24 +15,24 @@ public class AchievementImportRequest {
@ExcelAttribute(sort = 0) @ExcelAttribute(sort = 0)
private String schoolName; private String schoolName;
//实验班级 /* //实验班级
@ExcelAttribute(sort = 1) @ExcelAttribute(sort = 1)
private String experimentalClassName; private String experimentalClassName;*/
//学生姓名 //学生姓名
@ExcelAttribute(sort = 2) @ExcelAttribute(sort = 1)
private String userName; private String userName;
//学号 //学号
@ExcelAttribute(sort = 3) @ExcelAttribute(sort = 2)
private String workNumber; private String workNumber;
//分数 //分数
@ExcelAttribute(sort = 4) @ExcelAttribute(sort = 3)
private String score; private String score;
//提交时间 //提交时间
@ExcelAttribute(sort = 5) @ExcelAttribute(sort = 4)
private String submitTime; private String submitTime;
} }

@ -23,6 +23,7 @@ public class GetByUserRecordResp {
private Integer timeSum; private Integer timeSum;
private Integer userId; private Integer userId;
private Integer systemId; private Integer systemId;
private Integer reportId;
public Integer getSystemId() { public Integer getSystemId() {
return systemId; return systemId;
@ -95,4 +96,12 @@ public class GetByUserRecordResp {
public void setUserId(Integer userId) { public void setUserId(Integer userId) {
this.userId = userId; this.userId = userId;
} }
public Integer getReportId() {
return reportId;
}
public void setReportId(Integer reportId) {
this.reportId = reportId;
}
} }

@ -24,7 +24,7 @@ public class ResponseResult<T> {
/** /**
* 状态码 * 状态码
*/ */
private int code; private int status;
/** /**
* 返回的数据 * 返回的数据
@ -36,15 +36,15 @@ public class ResponseResult<T> {
*/ */
private String message; private String message;
public ResponseResult(boolean success, int code, String message) { public ResponseResult(boolean success, int status, String message) {
this.success = success; this.success = success;
this.code = code; this.status = status;
this.message = message; this.message = message;
} }
public ResponseResult(ResultCode resultCode) { public ResponseResult(ResultCode resultCode) {
this.success = resultCode.success(); this.success = resultCode.success();
this.code = resultCode.code(); this.status = resultCode.code();
this.message = resultCode.message(); this.message = resultCode.message();
} }
@ -68,8 +68,8 @@ public class ResponseResult<T> {
return new ResponseResult(CommonCode.FAIL); return new ResponseResult(CommonCode.FAIL);
} }
public static ResponseResult FAIL(int code, String message) { public static ResponseResult FAIL(int status, String message) {
return new ResponseResult<>(false, code, null, message); return new ResponseResult<>(false, status, null, message);
} }
} }

@ -20,6 +20,9 @@ public class AchievementManagementVO extends ExperimentalReportEntity {
//实验班级 //实验班级
private String experimentalClassName; private String experimentalClassName;
//实验名称
private String experimentalName;
//学生姓名 //学生姓名
private String userName; private String userName;

@ -40,4 +40,6 @@ public class ResultsVo {
//用户id //用户id
private Integer userId; private Integer userId;
private Integer isdel;
} }

@ -30,23 +30,26 @@ public interface AchievementManagementService extends IService<ExperimentalRepor
R addReport(ExperimentalReportEntity entity); R addReport(ExperimentalReportEntity entity);
R queryReport(Integer reportId ); R queryReport(Integer reportId);
R deleteReport(Integer reportId,Integer recordId); R deleteReport(Integer reportId, Integer recordId);
R queryEvaluationReport(String searchContant,Integer projectId,Integer page,Integer size); R queryEvaluationReport(String searchContant, Integer projectId, Integer page, Integer size);
void exportAchievement(HttpServletResponse response, String vo) throws Exception; void exportAchievement(HttpServletResponse response, String vo) throws Exception;
R queryAchievement(Integer systemId,Integer projectPermissions, String searchContant, String startingtime, String endtime, Integer month); R queryAchievement(Integer systemId, Integer projectPermissions, String searchContant, String startingtime, String endtime, Integer month);
R updateComment(ExperimentalReportEntity entity); R updateComment(ExperimentalReportEntity entity);
void updateSignatrue(ExperimentalReportEntity entity); void updateSignatrue(ExperimentalReportEntity entity);
R deleteReportByProjectId(Integer projectId); R deleteReportById(List<Integer> projectId,Integer projectPermissions, List<Integer> id);
List<AchievementManagementVO> getImitationAchievement(Integer projectId); List<AchievementManagementVO> getImitationAchievement(Integer projectId);
List<AchievementManagementVO> getTeachAchievement(Integer id); List<AchievementManagementVO> getTeachAchievement(Integer id);
//编辑实验报告
Integer modify(ExperimentalReportEntity entity);
} }

@ -16,4 +16,5 @@ public interface ExperimentalTeachingService extends IService<ExperimentalTeachi
PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingVO vo); PageUtils queryExperimentalTeaching(Integer page, Integer size, ExperimentalTeachingVO vo);
void deleteTeachByIds(List<Integer> asList);
} }

@ -78,9 +78,26 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
return R.ok().put("name", name); return R.ok().put("name", name);
} }
/**
* 虚拟仿真列表
*
* @param vo
* @param page
* @param size
* @return
*/
@Override @Override
public List<ResultsEntity> list(ResultsVo vo, Integer page, Integer size) { public List<ResultsEntity> list(ResultsVo vo, Integer page, Integer size) {
List<ResultsEntity> list = achievementManagementDao.list(vo); List<ResultsEntity> list = achievementManagementDao.list(vo);
for (ResultsEntity entity : list) {
Integer number = achievementManagementDao.getImitationAchievement(entity.getProjectId()).size();
entity.setNumber(number);
}
return list; return list;
} }
@ -93,6 +110,10 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
@Override @Override
public List<ResultsEntity> newList(ResultsVo vo, Integer page, Integer size) { public List<ResultsEntity> newList(ResultsVo vo, Integer page, Integer size) {
List<ResultsEntity> newList = achievementManagementDao.newList(vo); List<ResultsEntity> newList = achievementManagementDao.newList(vo);
for (ResultsEntity entity : newList) {
Integer number = achievementManagementDao.getTeachAchievement(entity.getId()).size();
entity.setNumber(number);
}
return newList; return newList;
} }
@ -171,8 +192,8 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
@Override @Override
@Transactional @Transactional
public R deleteReport(Integer reportId,Integer recordId) { public R deleteReport(Integer reportId, Integer recordId) {
achievementManagementDao.deleteReport(reportId,recordId); achievementManagementDao.deleteReport(reportId, recordId);
return R.ok(); return R.ok();
} }
@ -199,7 +220,7 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
List<AchievementImportRequest> achievement = achievementManagementDao.queryAchievement(list); List<AchievementImportRequest> achievement = achievementManagementDao.queryAchievement(list);
//2.加载模板流数据 //2.加载模板流数据
ClassPathResource resource = new ClassPathResource("excel-template/川大成绩管理实验记录导出模板.xlsx"); ClassPathResource resource = new ClassPathResource("excel-template/川大成绩管理实验记录导出模板 (1).xlsx");
InputStream inputStream = resource.getInputStream(); InputStream inputStream = resource.getInputStream();
//3、通过工具类下载文件 //3、通过工具类下载文件
@ -283,11 +304,29 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
} }
@Override @Override
public R deleteReportByProjectId(Integer projectId) { public R deleteReportById(List<Integer> projectIds,Integer projectPermissions, List<Integer> ids) {
if (projectPermissions == 1){//实验教学
for (Integer id: ids) {
List<AchievementManagementVO> 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<AchievementManagementVO> 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(); return R.ok();
} }
@ -296,12 +335,18 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
public List<AchievementManagementVO> getImitationAchievement(Integer projectId) { public List<AchievementManagementVO> getImitationAchievement(Integer projectId) {
List<AchievementManagementVO> list = achievementManagementDao.getImitationAchievement(projectId); List<AchievementManagementVO> list = achievementManagementDao.getImitationAchievement(projectId);
return list; return list;
} }
@Override @Override
public List<AchievementManagementVO> getTeachAchievement(Integer id) { public List<AchievementManagementVO> getTeachAchievement(Integer id) {
return achievementManagementDao.getTeachAchievement(id); return achievementManagementDao.getTeachAchievement(id);
}
@Override
public Integer modify(ExperimentalReportEntity entity) {
return achievementManagementDao.modify(entity);
} }
} }

@ -15,6 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service("experimentalTeachingService") @Service("experimentalTeachingService")
public class ExperimentalTeachingServiceImpl extends ServiceImpl<ExperimentalTeachingDao, ExperimentalTeachingEntity> implements ExperimentalTeachingService { public class ExperimentalTeachingServiceImpl extends ServiceImpl<ExperimentalTeachingDao, ExperimentalTeachingEntity> implements ExperimentalTeachingService {
@ -50,4 +52,12 @@ public class ExperimentalTeachingServiceImpl extends ServiceImpl<ExperimentalTea
return pageUtils; return pageUtils;
} }
@Override
public void deleteTeachByIds(List<Integer> asList) {
int size = asList.size();
for (int i = 0; i < size; i++) {
classTeachingDao.updateIsDel(asList.get(i));
}
}
} }

@ -90,7 +90,7 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
ProjectRecordVo projectRecordVo = this.baseMapper.getByUserScore(userId, isdel); ProjectRecordVo projectRecordVo = this.baseMapper.getByUserScore(userId, isdel);
Double totalTime = projectRecordVo.getTotalTime(); Double totalTime = projectRecordVo.getTotalTime();
if (totalTime != null) { if (totalTime != null) {
DecimalFormat df = new DecimalFormat("0.0"); DecimalFormat df = new DecimalFormat("0.00");
double time = totalTime / 60; double time = totalTime / 60;
String format = df.format(time); String format = df.format(time);
projectRecordVo.setTotalTime(Double.parseDouble(format)); projectRecordVo.setTotalTime(Double.parseDouble(format));

@ -84,7 +84,8 @@
<update id="deleteReport"> <update id="deleteReport">
UPDATE tms_project_record tpr,tms_experimental_report ter UPDATE tms_project_record tpr,tms_experimental_report ter
SET tpr.isdel = 1, ter.isdel = 1 SET tpr.isdel = 1, ter.isdel = 1
WHERE tpr.recordId = #{recordId} AND ter.reportId = #{reportId} WHERE tpr.recordId = #{recordId}
AND ter.reportId = #{reportId}
</update> </update>
<update id="updateComment"> <update id="updateComment">
UPDATE tms_experimental_report UPDATE tms_experimental_report
@ -390,15 +391,35 @@
GROUP BY hec.codeId GROUP BY hec.codeId
</select> </select>
<!--SELECT hpm.creationTime,hpm.projectId,hpm.projectName,hpm.projectPermissions,hpm.systemId,(SELECT count(*) FROM
tms_project_record her where hpm.projectId = her.projectId and her.isdel = 0 ) as number
FROM hr_project_management hpm
WHERE systemId = #{systemId}
AND hpm.isdel = 0
AND hpm.projectPermissions = #{projectPermissions}
<if test="searchContant!=null and searchContant!=''">and hpm.projectName like concat('%',#{searchContant},'%')
</if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime != ''">and hpm.creationTime between
#{endTime} and #{startTime}
</if>
<if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;=
date(hpm.creationTime)
</if>
ORDER BY hpm.creationTime DESC-->
<select id="list" resultType="com.msdw.tms.entity.ResultsEntity"> <select id="list" resultType="com.msdw.tms.entity.ResultsEntity">
SELECT hpm.creationTime,hpm.projectId,hpm.projectName,hpm.projectPermissions,hpm.systemId,(SELECT count(*) FROM SELECT
tms_project_record her where hpm.projectId = her.projectId and her.isdel = 0 ) as number hpm.projectId,
FROM hr_project_management hpm hpm.projectName,
hpm.projectPermissions,
hpm.systemId,
hpm.creationTime,
hpm.isdel
FROM
hr_project_management hpm
WHERE systemId = #{systemId} WHERE systemId = #{systemId}
AND hpm.isdel = 0 AND hpm.projectPermissions = #{projectPermissions}
<if test="projectPermissions!=null and projectPermissions!=''">AND hpm.projectPer missions =
#{projectPermissions}
</if>
<if test="searchContant!=null and searchContant!=''">and hpm.projectName like concat('%',#{searchContant},'%') <if test="searchContant!=null and searchContant!=''">and hpm.projectName like concat('%',#{searchContant},'%')
</if> </if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime != ''">and hpm.creationTime between <if test="startTime!=null and startTime!='' and endTime!=null and endTime != ''">and hpm.creationTime between
@ -410,13 +431,52 @@
ORDER BY hpm.creationTime DESC ORDER BY hpm.creationTime DESC
</select> </select>
<!-- <select id="newList" resultType="com.msdw.tms.entity.ResultsEntity">-->
<!-- SELECT-->
<!-- et.id,-->
<!-- et.experimental_class_name AS experimentalClassName,-->
<!-- et.experimental_name AS experimentalName,-->
<!-- et.project_id AS projectId,-->
<!-- pm.projectName,-->
<!-- pm.projectPermissions,-->
<!-- et.creation_time AS creationTime,-->
<!-- ( SELECT count( * ) FROM tms_experimental_report her WHERE et.id = her.projectId AND her.isdel = 0 ) AS number,-->
<!-- et.is_del-->
<!-- FROM-->
<!-- tms_experimental_teaching et,-->
<!-- hr_project_management pm-->
<!-- WHERE-->
<!-- user_id = #{userId}-->
<!-- AND et.project_id = pm.projectId-->
<!-- AND pm.isdel = 0-->
<!-- <if test="searchContant!=null and searchContant!=''">and et.experimental_class_name like-->
<!-- concat('%',#{searchContant},'%') or et.experimental_name like concat('%',#{searchContant},'%') or-->
<!-- pm.projectName like concat('%',#{searchContant},'%')-->
<!-- </if>-->
<!-- <if test="startTime!=null and startTime!='' and endTime!=null and endTime != ''">and et.creation_time between-->
<!-- #{endTime} and #{startTime}-->
<!-- </if>-->
<!-- <if test="month!=null and month != ''">and DATE_SUB(CURDATE(), INTERVAL #{month} month ) &lt;=-->
<!-- date(et.creation_time)-->
<!-- </if>-->
<!-- ORDER BY et.creation_time DESC-->
<!-- </select>-->
<select id="newList" resultType="com.msdw.tms.entity.ResultsEntity"> <select id="newList" resultType="com.msdw.tms.entity.ResultsEntity">
SELECT et.id,et.experimental_class_name as experimentalClassName,et.experimental_name as SELECT
experimentalName,et.project_id as projectId, et.id,
pm.projectName,pm.projectPermissions,et.creation_time as creationTime,(SELECT count(*) FROM et.experimental_class_name AS experimentalClassName,
tms_project_record her where et.project_id = her.projectId and her.isdel = 0 ) as number et.experimental_name AS experimentalName,
FROM tms_experimental_teaching et,hr_project_management pm et.project_id AS projectId,
WHERE user_id = #{userId} pm.projectName,
pm.projectPermissions,
et.creation_time AS creationTime,
et.is_del
FROM
tms_experimental_teaching et,
hr_project_management pm
WHERE
user_id = #{userId}
AND et.project_id = pm.projectId AND et.project_id = pm.projectId
AND pm.isdel = 0 AND pm.isdel = 0
<if test="searchContant!=null and searchContant!=''">and et.experimental_class_name like <if test="searchContant!=null and searchContant!=''">and et.experimental_class_name like
@ -431,7 +491,6 @@
</if> </if>
ORDER BY et.creation_time DESC ORDER BY et.creation_time DESC
</select> </select>
<select id="reportList" resultType="com.msdw.tms.entity.ReportEntity"> <select id="reportList" resultType="com.msdw.tms.entity.ReportEntity">
SELECT hui.userId,her.reportId,hui.userName as SELECT hui.userId,her.reportId,hui.userName as
studentName,s.schoolName,stu.workNumber,her.score,her.creationTime studentName,s.schoolName,stu.workNumber,her.score,her.creationTime
@ -503,23 +562,91 @@
AND re.isdel = 0; AND re.isdel = 0;
</select> </select>
<!--SELECT r.recordId, schoolName,tet.experimental_class_name, userName, workNumber, score, submitTime, ter.reportId
from tms_project_record r
inner join student s on s.userId = r.userId
inner join hr_user_info u on u.userId = r.userId
inner join school sch on sch.schoolId = u.schoolId
inner join tms_experimental_report ter on r.recordId = ter.eventId
inner join tms_experimental_teaching tet on r.projectId = tet.project_id
WHERE
tet.id = #{id}
AND r.isdel = 0
AND s.isdel = 0
AND u.isdel = 0
AND sch.isdel = 0
AND ter.isdel = 0
AND tet.is_del = 0-->
<!-- <select id="getTeachAchievement" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">-->
<!-- SELECT schoolName,-->
<!-- experimental_class_name,-->
<!-- userName,-->
<!-- workNumber,-->
<!-- r.score,-->
<!-- r.recordId,-->
<!-- report.reportId,-->
<!-- r.submitTime,-->
<!-- stu.studentId,-->
<!-- t.id as projectId-->
<!-- FROM tms_experimental_teaching t-->
<!-- INNER JOIN tms_experimental_report report ON report.projectId = t.id-->
<!-- INNER JOIN tms_project_record r ON r.recordId = report.eventId-->
<!-- INNER JOIN hr_user_info u ON u.userId = r.userId-->
<!-- INNER JOIN school s ON s.schoolId = u.schoolId-->
<!-- INNER JOIN student stu ON stu.userId = u.userId-->
<!-- WHERE t.id = #{id}-->
<!-- AND t.is_del = 0-->
<!-- AND report.isdel = 0-->
<!-- </select>-->
<select id="getTeachAchievement" resultType="com.msdw.tms.entity.vo.AchievementManagementVO"> <select id="getTeachAchievement" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT r.recordId, schoolName,tet.experimental_class_name, userName, workNumber, score, submitTime, ter.reportId SELECT schoolName,
from tms_project_record r experimental_class_name,
inner join student s on s.userId = r.userId userName,
inner join hr_user_info u on u.userId = r.userId workNumber,
inner join school sch on sch.schoolId = u.schoolId r.score,
inner join tms_experimental_report ter on r.recordId = ter.eventId r.recordId,
inner join tms_experimental_teaching tet on r.projectId = tet.project_id report.reportId,
WHERE r.submitTime,
tet.id = #{id} stu.studentId,
AND r.isdel = 0 t.id as projectId,
AND s.isdel = 0 experimental_name as experimentalName
AND u.isdel = 0 FROM tms_experimental_teaching t
AND sch.isdel = 0 INNER JOIN tms_experimental_report report ON report.projectId = t.id
AND ter.isdel = 0 INNER JOIN tms_project_record r ON r.recordId = report.eventId
AND tet.is_del = 0 INNER JOIN hr_user_info u ON u.userId = r.userId
INNER JOIN school s ON s.schoolId = u.schoolId
INNER JOIN student stu ON stu.userId = u.userId
WHERE t.id = #{id}
AND report.isdel = 0
</select> </select>
<update id="modify" parameterType="com.msdw.tms.entity.ExperimentalReportEntity">
UPDATE tms_experimental_report
<set>
<if test="instructor != null">
instructor=#{instructor, jdbcType=VARCHAR},
</if>
<if test="period != null">
period=#{period, jdbcType=INTEGER},
</if>
<if test="proName != null">
proName=#{proName, jdbcType=VARCHAR},
</if>
<if test="purpose != null">
purpose=#{purpose, jdbcType=VARCHAR},
</if>
<if test="summarize != null">
summarize=#{summarize, jdbcType=VARCHAR},
</if>
</set>
WHERE reportId = #{reportId}
</update>
</mapper> </mapper>

@ -117,4 +117,11 @@
WHERE WHERE
id = #{id} id = #{id}
</update> </update>
<update id="updateIsDel">
UPDATE tms_experimental_teaching
SET is_del = 1
WHERE
id = #{id}
</update>
</mapper> </mapper>

@ -12,7 +12,7 @@
SELECT u.userId, SELECT u.userId,
u.userName, u.userName,
stu.workNumber, stu.workNumber,
tet.project_name, ter.proName,
tet.id AS experimentId, tet.id AS experimentId,
tet.experimental_class_name, tet.experimental_class_name,
hpm.experimentalGoal AS experiment_goal, hpm.experimentalGoal AS experiment_goal,
@ -28,7 +28,9 @@
ter.conclusion, ter.conclusion,
ter.summarize, ter.summarize,
ter.improvement, 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, FROM hr_user_info u,
student stu, student stu,
tms_experimental_report ter, tms_experimental_report ter,
@ -47,23 +49,27 @@
AND ter.projectId = #{projectId} AND ter.projectId = #{projectId}
</select> </select>
<select id="queryVirtualReport" resultType="com.msdw.tms.entity.vo.ExperimentalReportVo"> <select id="queryVirtualReport" resultType="com.msdw.tms.entity.vo.ExperimentalReportVo">
SELECT tpr.recordId, SELECT
u.userId, tpr.recordId,
u.userName, u.userId,
stu.workNumber, u.userName,
hpm.projectName, stu.workNumber,
hpm.experimentalGoal AS experiment_goal, ter.proName,
tpr.submitTime, ter.purpose,
tpr.score hpm.experimentalGoal AS experiment_goal,
FROM hr_user_info u, tpr.submitTime,
student stu, tpr.score,
hr_project_management hpm, ter.instructor,
tms_project_record tpr ter.period,
WHERE u.userId = stu.userId ter.summarize
AND stu.userId = tpr.userId FROM
AND hpm.projectId = tpr.projectId tms_experimental_report ter
AND tpr.isdel = 0 INNER JOIN student stu ON ter.studentId = stu.studentId
AND tpr.recordId = #{recordId} INNER JOIN hr_user_info u ON u.userId = stu.userId
INNER JOIN tms_project_record tpr ON tpr.recordId = ter.eventId
INNER JOIN hr_project_management hpm ON hpm.projectId = tpr.projectId
WHERE
tpr.recordId = #{recordId}
</select> </select>
<select id="querySystemId" resultType="java.lang.Integer"> <select id="querySystemId" resultType="java.lang.Integer">
SELECT systemId SELECT systemId

@ -3,29 +3,75 @@
<mapper namespace="com.msdw.tms.dao.ExperimentalTeachingDao"> <mapper namespace="com.msdw.tms.dao.ExperimentalTeachingDao">
<!--SELECT
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
FROM
tms_experimental_teaching
WHERE
is_del = 0
<if test="exp.type!=null">
AND `type`=#{exp.type,jdbcType=INTEGER}
</if>
<if test="exp.status!=null">
AND `status`=#{exp.status,jdbcType=INTEGER}
</if>
<if test="exp.systemId!=null">
AND `system_id`=#{exp.systemId,jdbcType=INTEGER}
</if>
<if test='exp.startTime!=null and exp.stopTime!=null'>
AND creation_time between #{exp.startTime} and #{exp.stopTime}
</if>
<if test="exp.searchContent!=null">
AND (experimental_name like concat('%',#{exp.searchContent},'%') or experimental_class_name like concat('%',#{exp.searchContent},'%') )
</if>
<if test="exp.month!=null">
AND DATE_SUB(CURDATE(), INTERVAL #{exp.month} month ) &lt;= date(creation_time)
</if>
<if test='exp.schoolId!=null and exp.schoolId!=null'>
AND (user_id in (select userId FROM staff WHERE schoolId = #{exp.schoolId} AND isdel = 0 AND FIND_IN_SET(roleId,'1,2,3') )
OR user_id IN ( SELECT userId FROM hr_user_info WHERE disableAccount = 0 AND isdel = 0 AND FIND_IN_SET( roleId, '1' ) ) )
</if>
order by creation_time desc-->
<select id="queryExperimentalTeaching" resultType="com.msdw.tms.entity.ExperimentalTeachingEntity"> <select id="queryExperimentalTeaching" resultType="com.msdw.tms.entity.ExperimentalTeachingEntity">
SELECT SELECT
id, id,
experimental_class_name, experimental_class_name,
experimental_name, experimental_name,
project_id, project_id,
project_name, project_name,
(select count(*) ( SELECT count( * ) FROM tms_project_record WHERE projectId = project_id AND tms_project_record.isdel = 0 ) AS experimental_number,
from tms_project_record WHERE projectId = project_id) as experimental_number, experiment_duration,
experiment_duration, type,
type, start_time,
start_time, stop_time,
stop_time, STATUS,
status, invitation_code,
invitation_code, is_code,
is_code, user_id,
user_id, creation_time,
creation_time, surplus_time ,
surplus_time systemId
FROM FROM
tms_experimental_teaching tms_experimental_teaching t
inner join hr_project_management m on m.projectId = t.project_id
WHERE WHERE
is_del = 0 t.is_del = 0
<if test="exp.type!=null"> <if test="exp.type!=null">
AND `type`=#{exp.type,jdbcType=INTEGER} AND `type`=#{exp.type,jdbcType=INTEGER}
</if> </if>

@ -47,7 +47,8 @@
<select id="getByUserRecord" resultType="com.msdw.tms.entity.resp.GetByUserRecordResp" <select id="getByUserRecord" resultType="com.msdw.tms.entity.resp.GetByUserRecordResp"
parameterType="java.lang.Integer"> parameterType="java.lang.Integer">
SELECT projectName, SELECT re.reportId,
projectName,
c.recordId, c.recordId,
r.score, r.score,
c.codeId, c.codeId,
@ -59,6 +60,7 @@
FROM hr_experiment_code c FROM hr_experiment_code c
INNER JOIN hr_project_management t ON t.projectId = c.projectId INNER JOIN hr_project_management t ON t.projectId = c.projectId
INNER JOIN tms_project_record r ON r.recordId = c.recordId INNER JOIN tms_project_record r ON r.recordId = c.recordId
INNER JOIN tms_experimental_report re ON re.eventId = r.recordId
WHERE c.userId = #{userId} WHERE c.userId = #{userId}
-- 教师端逻辑删除,学生端不做判断 -- 教师端逻辑删除,学生端不做判断
-- and r.isdel = 0 -- and r.isdel = 0
@ -73,7 +75,7 @@
ter.reportId, ter.reportId,
tpr.recordId, tpr.recordId,
tpr.projectId, tpr.projectId,
projectName, tp.projectName,
score, score,
timeSum, timeSum,
startingTime as startTime, startingTime as startTime,
@ -85,8 +87,7 @@
LEFT JOIN tms_experimental_teaching tet ON tet.project_id = tpr.projectId LEFT JOIN tms_experimental_teaching tet ON tet.project_id = tpr.projectId
LEFT JOIN tms_experimental_report ter ON ter.projectId = tet.id LEFT JOIN tms_experimental_report ter ON ter.projectId = tet.id
WHERE tpr.userId = #{pro.userid} WHERE tpr.userId = #{pro.userid}
-- 教师端逻辑删除,学生端不做判断(下面这行删掉报错,用>=来表示不管0,1都让通过) AND tpr.isdel >= #{pro.isdel}
AND tpr.isdel >= #{pro.isdel}
AND tp.projectPermissions !=0 AND tp.projectPermissions !=0
AND AND
ter.eventId = tpr.recordId ter.eventId = tpr.recordId
@ -114,6 +115,15 @@
tpr.submitTime DESC tpr.submitTime DESC
</select> </select>
<!--SELECT userName,
count(*) AS experimentNumber,
sum(timeSum) AS totalTime,
avg(score) avgScore
FROM tms_project_record pr
LEFT JOIN hr_user_info u ON pr.userId = u.userId
WHERE pr.userId = #{userid}
and pr.isdel = #{isdel}
and u.isdel = #{isdel}-->
<!-- 个人实验预览--> <!-- 个人实验预览-->
<select id="getByUserScore" resultType="com.msdw.tms.entity.vo.ProjectRecordVo"> <select id="getByUserScore" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT userName, SELECT userName,
@ -123,8 +133,6 @@
FROM tms_project_record pr FROM tms_project_record pr
LEFT JOIN hr_user_info u ON pr.userId = u.userId LEFT JOIN hr_user_info u ON pr.userId = u.userId
WHERE pr.userId = #{userid} WHERE pr.userId = #{userid}
and pr.isdel = #{isdel}
and u.isdel = #{isdel}
</select> </select>
<!-- 个人实验预览--> <!-- 个人实验预览-->
<select id="queryScore" resultType="com.msdw.tms.entity.vo.ProjectRecordVo"> <select id="queryScore" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">

Loading…
Cancel
Save