实验记录完善

hehai
mzh820631607 4 years ago
parent 5d6d1b6a0c
commit 347af0631d
  1. 1
      src/main/java/com/msdw/tms/controller/ProjectController.java
  2. 91
      src/main/java/com/msdw/tms/controller/ProjectRecordController.java
  3. 36
      src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java
  4. 12
      src/main/resources/mapper/tms/ProjectRecordDao.xml

@ -14,7 +14,6 @@ import java.util.Map;
/**
*
*
* @author
* @email

@ -3,6 +3,7 @@ package com.msdw.tms.controller;
import com.msdw.tms.api.ProjectRcordControllerApi;
import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.ProjectEntity;
import com.msdw.tms.entity.ProjectRecordEntity;
import com.msdw.tms.entity.vo.ProjectRecordVo;
import com.msdw.tms.service.ProjectRecordService;
@ -49,8 +50,81 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
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")
public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userid){
PageUtils page1 = projectRecordService.queryPage(page,size,userid);
@ -58,6 +132,11 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
return R.ok().put("data", page1);
}
/**
* 个人实验预览
* @param userid
* @return
*/
@GetMapping("/user/score/{userId}")
public R getUserScore(@PathVariable("userId") Integer userid){
ProjectRecordVo projectRecord = projectRecordService.queryUserScore(userid);
@ -65,6 +144,12 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
return R.ok().put("data", projectRecord);
}
/**
* 导出个人项目记录
* @param response
* @param userId
* @throws Exception
*/
@GetMapping("/user/exportProjectRecord")
public void exportProjectRecord(HttpServletResponse response,@RequestParam("userId") Integer userId)throws Exception{
projectRecordService.exportProjectRecord(response,userId);
@ -91,7 +176,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
}
/**
* 修改
* 修改实验分数
*/
@PutMapping("/update")
public R update(@RequestBody ProjectRecordEntity projectRecord){
@ -101,7 +186,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
}
/**
* 删除
* 删除实验报告
*/
@DeleteMapping("/delete")
public R delete(@RequestBody Integer[] recordids){

@ -56,4 +56,40 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable
* 待评分
*/
private Integer tobescored;
/** 记录状态(0 未修改,1 已修改)*/
private Integer recordState;
// =====================================记录实验项目信息
// /**
// * 班级实验状态,0 不限,1 未发布,2 进行中,3 已完成
// */
// private Integer experimentStartus;
// /**
// /**
// * 实验项目id
// */
// private Integer projectid;
// /**
// * 实验项目名称
// */
// private String projectname;
// /**
// * 实验目标
// */
// private String projecttarget;
// /**
// * 实验描述
// */
// private String projectdescribe;
// /**
// * 实验描述(0开启 1未开启)
// */
// private Integer isprojectdata;
// /**
// * 实验提示
// */
// private String projecttips;
// /**
// * 实验状态(0已发布 1未发布)
// */
// private Integer projectstate;
}

@ -33,6 +33,9 @@
AND
tpr.isdel = #{pro.isdel}
</select>
<!-- tpr.userId = #{pro.userid}-->
<!-- AND-->
<!-- tpr.isdel = #{pro.isdel}-->
<select id="getByUserRecordImport" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT
@ -52,6 +55,7 @@
tpr.isdel = #{isdel}
</select>
<!-- 个人实验预览-->
<select id="getByUserScore" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT
userName,
@ -64,7 +68,9 @@
WHERE
pr.userId = #{userid}
and
isdel = #{isdel}
pr.isdel = #{isdel}
and
u.isdel = #{isdel}
</select>
<select id="getBySchoolRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
@ -92,8 +98,8 @@
u.isdel = #{pro.isdel}
and
sc.isdel = #{pro.isdel}
<if test="pro.month!=null ">and DATE_SUB(CURDATE(), INTERVAL #{pro.month} month ) &lt;= date(submitTime)</if>
<if test="pro.startTime!=null and pro.endTime!=null">and submitTime between startingtime=#{pro.startTime} and endtime=#{pro.endTime}</if>
<if test="pro.month!=null">and DATE_SUB(CURDATE(), INTERVAL #{pro.month} month ) &lt;= date(submitTime)</if>
<if test="pro.startTime!=null and pro.endTime!=null">and submitTime between #{pro.startTime} and #{pro.endTime}</if>
<if test="pro.recordState!=null">and recordState=#{pro.recordState}</if>
<if test="pro.condition!=null">and ( projectName like concat('%',#{pro.condition},'%') or schoolName like concat('%',#{pro.condition},'%') or userName like concat('%',#{pro.condition},'%') )</if>
</select>

Loading…
Cancel
Save