个人教学实验记录查询

hehai
mzh820631607 4 years ago
parent f522e25bb5
commit 8ba68c306c
  1. 8
      src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java
  2. 1
      src/main/java/com/msdw/tms/controller/ProjectController.java
  3. 24
      src/main/java/com/msdw/tms/controller/ProjectRecordController.java
  4. 2
      src/main/java/com/msdw/tms/dao/ProjectRecordDao.java
  5. 4
      src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java
  6. 2
      src/main/java/com/msdw/tms/service/ProjectRecordService.java
  7. 15
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  8. 25
      src/main/resources/mapper/tms/ProjectRecordDao.xml

@ -2,10 +2,13 @@ package com.msdw.tms.api;
import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.ProjectRecordEntity;
import com.msdw.tms.entity.vo.ProjectRecordVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Api(value = "实验报告",tags = "实验报告")
public interface ProjectRcordControllerApi {
@ -14,9 +17,12 @@ public interface ProjectRcordControllerApi {
R list( Integer page, Integer size,Integer month,String startTime,String endTime,
Integer recordState,String condition);
@ApiOperation(value = "用户端实验记录",notes = "用户端实验记录")
@ApiOperation(value = "用户端虚拟仿真实验记录",notes = "用户端虚拟仿真实验记录")
R queryUserRecord(Integer page,Integer size,Integer userid);
@ApiOperation(value = "用户端教学实验记录",notes = "用户端教学实验记录")
R getUserExperimentscore(Integer page,Integer size,Integer userid);
@ApiOperation(value = "个人实验概览",notes = "个人实验概览")
R getUserScore(Integer userid);

@ -41,6 +41,7 @@ public class ProjectController implements ProjectControllerApi {
* @param userId
* @return
*/
@Override
@GetMapping("/projects/info/{userid}")
public R list(@PathVariable("userid") Integer userId){
HashMap<Integer, ProjectEntity> result = projectService.list(userId);

@ -30,6 +30,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
/**
* 服务端实验报告
*/
@Override
@GetMapping("/schoolRecord")
public R list(@RequestParam Integer page, @RequestParam Integer size, @RequestParam Integer month,@RequestParam String startTime,@RequestParam String endTime,
@RequestParam Integer recordState,@RequestParam String condition ){
@ -51,12 +52,13 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
}
/**
* 用户实验记录
* 用户端虚拟仿真实验记录
* @param page
* @param size
* @param userid
* @return
*/
@Override
@GetMapping("/user/record")
public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userid){
PageUtils page1 = projectRecordService.queryPage(page,size,userid);
@ -64,11 +66,27 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
return R.ok().put("data", page1);
}
/**
* 用户端教学实验记录
* @param page
* @param size
* @param userid
* @return
*/
@Override
@GetMapping("/user/experimentRecord")
public R getUserExperimentscore(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userid){
PageUtils page1 = projectRecordService.queryExperimentPage(page,size,userid);
return R.ok().put("data", page1);
}
/**
* 个人实验预览
* @param userid
* @return
*/
@Override
@GetMapping("/user/score/{userId}")
public R getUserScore(@PathVariable("userId") Integer userid){
ProjectRecordVo projectRecord = projectRecordService.queryUserScore(userid);
@ -76,12 +94,14 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
return R.ok().put("data", projectRecord);
}
/**
* 导出个人项目记录
* @param response
* @param userId
* @throws Exception
*/
@Override
@GetMapping("/user/exportProjectRecord")
public void exportProjectRecord(HttpServletResponse response,@RequestParam("userId") Integer userId)throws Exception{
projectRecordService.exportProjectRecord(response,userId);
@ -110,6 +130,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
/**
* 修改实验分数
*/
@Override
@PutMapping("/update")
public R update(@RequestBody ProjectRecordEntity projectRecord){
boolean result = projectRecordService.updateUserRecord(projectRecord);
@ -120,6 +141,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
/**
* 删除实验报告
*/
@Override
@DeleteMapping("/delete")
public R delete(@RequestBody Integer[] recordids){
projectRecordService.removeByIds(Arrays.asList(recordids));

@ -22,6 +22,8 @@ public interface ProjectRecordDao extends BaseMapper<ProjectRecordEntity> {
IPage<ProjectRecordVo> getByUserRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity);
IPage<ProjectRecordVo> getByUserExperimentRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity);
List<ProjectRecordVo> getByUserRecordImport(ProjectRecordEntity projectRecordEntity);
ProjectRecordVo getByUserScore(@Param("userid") Integer userId,@Param("isdel") Integer isdel);

@ -75,6 +75,10 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable
* 绑定用户id
*/
private Integer userId;
/**
* 实验班级名
*/
private String experimentalClassName;
// /**
// * 班级实验状态,0 不限,1 未发布,2 进行中,3 已完成

@ -18,6 +18,8 @@ public interface ProjectRecordService extends IService<ProjectRecordEntity> {
PageUtils queryPage(Integer page,Integer size,Integer userid);
PageUtils queryExperimentPage(Integer page,Integer size,Integer userid);
ProjectRecordVo queryUserScore(Integer userId);
void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception;

@ -45,6 +45,21 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
return questionsPage;
}
@Override
public PageUtils queryExperimentPage(Integer page, Integer size, Integer userid) {
ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userid).setIsdel(Constant.IsDel.NOT_DEL.getType());
//分页对象
Page<T> page1 = new Page<>(page, size);
IPage<ProjectRecordVo> projectRecordVos = this.baseMapper.getByUserExperimentRecord(page1,projectRecord);
PageUtils questionsPage = new PageUtils(projectRecordVos);
return questionsPage;
}
@Override
public ProjectRecordVo queryUserScore(Integer userId) {

@ -14,6 +14,7 @@
<result property="endtime" column="endTime"/>
<result property="submitTime" column="submitTime"/>
<result property="isdel" column="isdel"/>
<result property="experimental_class_name" column="experimentalClassName"/>
</resultMap>
<select id="getByUserRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
@ -33,9 +34,27 @@
AND
tpr.isdel = #{pro.isdel}
</select>
<!-- tpr.userId = #{pro.userid}-->
<!-- AND-->
<!-- tpr.isdel = #{pro.isdel}-->
<!-- -->
<select id="getByUserExperimentRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT
tpr.projectId,
projectName,
score,
timeSum,
startingTime as startTime,
endTime,
recordState,
tet.experimental_class_name as experimentalClassName
FROM
tms_project_record tpr
LEFT JOIN tms_project tp ON tpr.projectId = tp.projectId
LEFT JOIN tms_experimental_teaching tet ON tet.project_id = tpr.projectId
WHERE
tpr.userId = #{pro.userid}
AND
tpr.isdel = #{pro.isdel}
</select>
<select id="getByUserRecordImport" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT

Loading…
Cancel
Save