@ -3,6 +3,7 @@ package com.msdw.tms.controller;
import com.msdw.tms.api.ProjectRcordControllerApi ;
import com.msdw.tms.api.ProjectRcordControllerApi ;
import com.msdw.tms.common.utils.PageUtils ;
import com.msdw.tms.common.utils.PageUtils ;
import com.msdw.tms.common.utils.R ;
import com.msdw.tms.common.utils.R ;
import com.msdw.tms.entity.ProjectEntity ;
import com.msdw.tms.entity.ProjectRecordEntity ;
import com.msdw.tms.entity.ProjectRecordEntity ;
import com.msdw.tms.entity.vo.ProjectRecordVo ;
import com.msdw.tms.entity.vo.ProjectRecordVo ;
import com.msdw.tms.service.ProjectRecordService ;
import com.msdw.tms.service.ProjectRecordService ;
@ -49,8 +50,81 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
return R . ok ( ) . put ( "page" , page1 ) ;
return R . ok ( ) . put ( "page" , page1 ) ;
}
}
// /**
// * 用户端查看班级实验列表
// * @param page
// * @param size
// * @param month
// * @param startTime
// * @param endTime
// * @param experimentStartus
// * @param condition
// * @return
// */
// @GetMapping("user/Record")
// public R userList(@RequestParam Integer page, @RequestParam Integer size, @RequestParam Integer month,@RequestParam String startTime,@RequestParam String endTime,
// @RequestParam String condition, @RequestParam Integer experimentStartus){
// ProjectRecordVo recordVo = new ProjectRecordVo();
// if (experimentStartus==0){//不限定
// if(!StringUtils.isEmpty(month)) {
// recordVo.setMonth(month);
// }if(!StringUtils.isEmpty(startTime)) {
// recordVo.setStartTime(startTime);
// }if(!StringUtils.isEmpty(endTime)) {
// recordVo.setEndTime(endTime);
// }if(!StringUtils.isEmpty(condition)){
// recordVo.setCondition(condition);
// }
// PageUtils page1 = projectRecordService.queryUserRecord(page,size,recordVo);
// }if (experimentStartus==1){//实验未发布
// recordVo.setProjectstate(1);
// if(!StringUtils.isEmpty(condition)){
// recordVo.setCondition(condition);
// }
// PageUtils page1 = projectRecordService.queryUserRecord(page,size,recordVo);
// }if (experimentStartus==2){//实验进行中
// if(!StringUtils.isEmpty(month)) {
// recordVo.setMonth(month);
// }if(!StringUtils.isEmpty(condition)){
// recordVo.setCondition(condition);
// }
// recordVo.setStartTime(startTime);
// recordVo.setEndtime(null);
// PageUtils page1 = projectRecordService.queryUserRecord(page,size,recordVo);
// }if (experimentStartus==3){//实验已完成
// if(!StringUtils.isEmpty(month)) {
// recordVo.setMonth(month);
// }if(!StringUtils.isEmpty(startTime)){
// recordVo.setStartTime(startTime);
// }if(!StringUtils.isEmpty(endTime)) {
// recordVo.setEndTime(endTime);
// }if(!StringUtils.isEmpty(condition)){
// recordVo.setCondition(condition);
// }
// PageUtils page1 = projectRecordService.queryUserRecord(page,size,recordVo);
// }
// if(!StringUtils.isEmpty(month)) {
// recordVo.setMonth(month);
// }if(!StringUtils.isEmpty(startTime)) {
// recordVo.setStartTime(startTime);
// }if(!StringUtils.isEmpty(endTime)) {
// recordVo.setEndTime(endTime);
// }if(!StringUtils.isEmpty(condition)){
// recordVo.setCondition(condition);
// }
// PageUtils page1 = projectRecordService.queryUserRecord(page,size,recordVo);
//
//
// return R.ok().put("page", page1);
// }
/ * *
* 用户实验记录
* @param page
* @param size
* @param userid
* @return
* /
@GetMapping ( "/user/record" )
@GetMapping ( "/user/record" )
public R queryUserRecord ( @RequestParam Integer page , @RequestParam Integer size , @RequestParam Integer userid ) {
public R queryUserRecord ( @RequestParam Integer page , @RequestParam Integer size , @RequestParam Integer userid ) {
PageUtils page1 = projectRecordService . queryPage ( page , size , userid ) ;
PageUtils page1 = projectRecordService . queryPage ( page , size , userid ) ;
@ -58,6 +132,11 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
return R . ok ( ) . put ( "data" , page1 ) ;
return R . ok ( ) . put ( "data" , page1 ) ;
}
}
/ * *
* 个人实验预览
* @param userid
* @return
* /
@GetMapping ( "/user/score/{userId}" )
@GetMapping ( "/user/score/{userId}" )
public R getUserScore ( @PathVariable ( "userId" ) Integer userid ) {
public R getUserScore ( @PathVariable ( "userId" ) Integer userid ) {
ProjectRecordVo projectRecord = projectRecordService . queryUserScore ( userid ) ;
ProjectRecordVo projectRecord = projectRecordService . queryUserScore ( userid ) ;
@ -65,6 +144,12 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
return R . ok ( ) . put ( "data" , projectRecord ) ;
return R . ok ( ) . put ( "data" , projectRecord ) ;
}
}
/ * *
* 导出个人项目记录
* @param response
* @param userId
* @throws Exception
* /
@GetMapping ( "/user/exportProjectRecord" )
@GetMapping ( "/user/exportProjectRecord" )
public void exportProjectRecord ( HttpServletResponse response , @RequestParam ( "userId" ) Integer userId ) throws Exception {
public void exportProjectRecord ( HttpServletResponse response , @RequestParam ( "userId" ) Integer userId ) throws Exception {
projectRecordService . exportProjectRecord ( response , userId ) ;
projectRecordService . exportProjectRecord ( response , userId ) ;
@ -91,7 +176,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
}
}
/ * *
/ * *
* 修改
* 修改实验分数
* /
* /
@PutMapping ( "/update" )
@PutMapping ( "/update" )
public R update ( @RequestBody ProjectRecordEntity projectRecord ) {
public R update ( @RequestBody ProjectRecordEntity projectRecord ) {
@ -101,7 +186,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
}
}
/ * *
/ * *
* 删除
* 删除实验报告
* /
* /
@DeleteMapping ( "/delete" )
@DeleteMapping ( "/delete" )
public R delete ( @RequestBody Integer [ ] recordids ) {
public R delete ( @RequestBody Integer [ ] recordids ) {