diff --git a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java index 1f8ecdf..14b035b 100644 --- a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java +++ b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java @@ -8,6 +8,7 @@ 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; +import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; @@ -57,7 +58,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi { } /** - * 用户端虚拟仿真实验记录 + * 用户端虚拟仿真实验记录(练习列表) * * @param page * @param size @@ -66,7 +67,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi { */ @Override @GetMapping("/user/record") - public R queryUserRecord(@RequestParam Integer page, @RequestParam Integer size, @RequestParam Integer userId, @RequestParam Integer projectPermissions, @RequestParam Integer systemId) { + public R queryUserRecord(@RequestParam Integer page, @RequestParam Integer size, @RequestParam Integer userId, @RequestParam Integer projectPermissions, @RequestParam Integer systemId) { PageUtils page1 = projectRecordService.queryPage(page, size, userId, projectPermissions, systemId); return R.ok().put("data", page1); } @@ -87,7 +88,7 @@ public class ProjectRecordController implements ProjectRcordControllerApi { } /** - * 用户端教学实验记录 + * 用户端教学实验记录(考核列表) * * @param page * @param size diff --git a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java index c1a5785..a7b082e 100644 --- a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java +++ b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java @@ -46,4 +46,11 @@ public interface ProjectRecordDao extends BaseMapper { ProjectRecordEntity queryReport(Integer recordId); void updateScore(ProjectRecordEntity vo); + + //练习统计 + List sumByPracticeNum(Integer userId); + + //考核统计 + List sumByAssessmentNum(Integer userId); + } diff --git a/src/main/java/com/msdw/tms/service/ProjectRecordService.java b/src/main/java/com/msdw/tms/service/ProjectRecordService.java index a598ede..3a77782 100644 --- a/src/main/java/com/msdw/tms/service/ProjectRecordService.java +++ b/src/main/java/com/msdw/tms/service/ProjectRecordService.java @@ -16,11 +16,11 @@ import java.util.List; * @date 2020-08-19 16:07:02 */ public interface ProjectRecordService extends IService { - PageUtils getByKDUserRecord(Integer page,Integer size,Integer userId,Integer projectPermissions,Integer systemId); + PageUtils getByKDUserRecord(Integer page, Integer size, Integer userId, Integer projectPermissions, Integer systemId); - PageUtils queryPage(Integer page, Integer size, Integer userId, Integer projectPermissions,Integer systemId); + PageUtils queryPage(Integer page, Integer size, Integer userId, Integer projectPermissions, Integer systemId); - PageUtils queryExperimentPage(Integer page, Integer size, Integer userid,Integer systemId); + PageUtils queryExperimentPage(Integer page, Integer size, Integer userid, Integer systemId); //学生端实验概览 ProjectRecordVo queryUserScore(Integer userId); @@ -36,5 +36,6 @@ public interface ProjectRecordService extends IService { boolean updateUserRecord(ProjectRecordEntity projectRecord); void updateScore(ProjectRecordEntity vo); + } 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 972a7fa..543d8b6 100644 --- a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java @@ -88,6 +88,16 @@ public class ProjectRecordServiceImpl extends ServiceImpl sumByPracticeNum = this.baseMapper.sumByPracticeNum(userId); + + //考核统计 + List sumByAssessmentNum = this.baseMapper.sumByAssessmentNum(userId); + + Integer numer = sumByPracticeNum.size() + sumByAssessmentNum.size(); + projectRecordVo.setExperimentNumber(numer); + Double totalTime = projectRecordVo.getTotalTime(); if (totalTime != null) { DecimalFormat df = new DecimalFormat("0.00"); @@ -183,4 +193,6 @@ public class ProjectRecordServiceImpl extends ServiceImpl + + + + + + + \ No newline at end of file