Merge remote-tracking branch 'origin/master'

hehai
zhiyong.ning 4 years ago
commit 7710bc2e58
  1. 2
      src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java
  2. 69
      src/main/java/com/msdw/tms/controller/ProjectRecordController.java
  3. 6
      src/main/java/com/msdw/tms/dao/ProjectRecordDao.java
  4. 13
      src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java
  5. 2
      src/main/java/com/msdw/tms/service/ProjectRecordService.java
  6. 12
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  7. 41
      src/main/resources/mapper/tms/ProjectRecordDao.xml

@ -25,7 +25,7 @@ public interface ProjectRcordControllerApi {
R queryUserRecord(Integer page,Integer size,Integer userId,Integer projectPermissions,Integer systemId); R queryUserRecord(Integer page,Integer size,Integer userId,Integer projectPermissions,Integer systemId);
@ApiOperation(value = "用户端教学实验记录",notes = "用户端教学实验记录") @ApiOperation(value = "用户端教学实验记录",notes = "用户端教学实验记录")
R getUserExperimentscore(Integer page,Integer size,Integer userid); R getUserExperimentscore(Integer page,Integer size,Integer userid, Integer systemId);
@ApiOperation(value = "个人实验概览",notes = "个人实验概览") @ApiOperation(value = "个人实验概览",notes = "个人实验概览")
R queryScore(Integer userId); R queryScore(Integer userId);

@ -18,8 +18,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
*
*
* @author * @author
* @email * @email
* @date 2020-08-19 16:07:02 * @date 2020-08-19 16:07:02
@ -35,27 +33,32 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
*/ */
@Override @Override
@GetMapping("/schoolRecord") @GetMapping("/schoolRecord")
public R list(@RequestParam Integer page, @RequestParam Integer size, @RequestParam Integer month,@RequestParam String startTime,@RequestParam String endTime, public R list(@RequestParam Integer page, @RequestParam Integer size, @RequestParam Integer month, @RequestParam String startTime, @RequestParam String endTime,
@RequestParam Integer recordState,@RequestParam String condition ){ @RequestParam Integer recordState, @RequestParam String condition) {
ProjectRecordVo recordVo = new ProjectRecordVo(); ProjectRecordVo recordVo = new ProjectRecordVo();
if(!StringUtils.isEmpty(month)) { if (!StringUtils.isEmpty(month)) {
recordVo.setMonth(month); recordVo.setMonth(month);
}if(!StringUtils.isEmpty(startTime)) { }
if (!StringUtils.isEmpty(startTime)) {
recordVo.setStartTime(startTime); recordVo.setStartTime(startTime);
}if(!StringUtils.isEmpty(endTime)) { }
if (!StringUtils.isEmpty(endTime)) {
recordVo.setEndTime(endTime); recordVo.setEndTime(endTime);
}if(!StringUtils.isEmpty(recordState)) { }
if (!StringUtils.isEmpty(recordState)) {
recordVo.setRecordstate(recordState); recordVo.setRecordstate(recordState);
}if(!StringUtils.isEmpty(condition)){ }
if (!StringUtils.isEmpty(condition)) {
recordVo.setCondition(condition); recordVo.setCondition(condition);
} }
PageUtils page1 = projectRecordService.querySchoolRecord(page,size,recordVo); PageUtils page1 = projectRecordService.querySchoolRecord(page, size, recordVo);
return R.ok().put("page", page1); return R.ok().put("page", page1);
} }
/** /**
* 用户端虚拟仿真实验记录 * 用户端虚拟仿真实验记录
*
* @param page * @param page
* @param size * @param size
* @param * @param
@ -63,13 +66,14 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
*/ */
@Override @Override
@GetMapping("/user/record") @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); PageUtils page1 = projectRecordService.queryPage(page, size, userId, projectPermissions, systemId);
return R.ok().put("data", page1); return R.ok().put("data", page1);
} }
/** /**
* 科大用户端虚拟仿真实验记录 * 科大用户端虚拟仿真实验记录
*
* @param page * @param page
* @param size * @param size
* @param * @param
@ -77,13 +81,14 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
*/ */
@Override @Override
@GetMapping("/user/kdRecord") @GetMapping("/user/kdRecord")
public R kdRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userId,@RequestParam Integer projectPermissions,@RequestParam Integer systemId){ public R kdRecord(@RequestParam Integer page, @RequestParam Integer size, @RequestParam Integer userId, @RequestParam Integer projectPermissions, @RequestParam Integer systemId) {
PageUtils page1 = projectRecordService.getByKDUserRecord(page,size,userId,projectPermissions,systemId); PageUtils page1 = projectRecordService.getByKDUserRecord(page, size, userId, projectPermissions, systemId);
return R.ok().put("data", page1); return R.ok().put("data", page1);
} }
/** /**
* 用户端教学实验记录 * 用户端教学实验记录
*
* @param page * @param page
* @param size * @param size
* @param userid * @param userid
@ -91,20 +96,21 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
*/ */
@Override @Override
@GetMapping("/user/experimentRecord") @GetMapping("/user/experimentRecord")
public R getUserExperimentscore(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userid){ public R getUserExperimentscore(@RequestParam Integer page, @RequestParam Integer size, @RequestParam Integer userid, @RequestParam Integer systemId) {
PageUtils page1 = projectRecordService.queryExperimentPage(page,size,userid); PageUtils page1 = projectRecordService.queryExperimentPage(page, size, userid, systemId);
return R.ok().put("data", page1); return R.ok().put("data", page1);
} }
/** /**
* 个人实验预览 * 个人实验预览
*
* @param userId * @param userId
* @return * @return
*/ */
@Override @Override
@GetMapping("/user/queryScore/{userId}") @GetMapping("/user/queryScore/{userId}")
public R queryScore(@PathVariable("userId") Integer userId){ public R queryScore(@PathVariable("userId") Integer userId) {
ProjectRecordVo projectRecord = projectRecordService.queryScore(userId); ProjectRecordVo projectRecord = projectRecordService.queryScore(userId);
return R.ok().put("data", projectRecord); return R.ok().put("data", projectRecord);
@ -112,12 +118,13 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
/** /**
* 个人实验预览 * 个人实验预览
*
* @param userid * @param userid
* @return * @return
*/ */
@Override @Override
@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);
return R.ok().put("data", projectRecord); return R.ok().put("data", projectRecord);
@ -125,35 +132,37 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
/** /**
* 导出个人虚拟仿真实验记录 * 导出个人虚拟仿真实验记录
*
* @param response * @param response
* @param userId * @param userId
* @throws Exception * @throws Exception
*/ */
@Override @Override
@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);
} }
/** /**
* 导出个人教学实验记录 * 导出个人教学实验记录
*
* @param response * @param response
* @param userId * @param userId
* @throws Exception * @throws Exception
*/ */
@Override @Override
@GetMapping("/user/exportExperimentProjectRecord") @GetMapping("/user/exportExperimentProjectRecord")
public void exportExperimentProjectRecord(HttpServletResponse response,@RequestParam("userId") Integer userId)throws Exception{ public void exportExperimentProjectRecord(HttpServletResponse response, @RequestParam("userId") Integer userId) throws Exception {
projectRecordService.exportExperimentProjectRecord(response,userId); projectRecordService.exportExperimentProjectRecord(response, userId);
} }
/** /**
* 信息 * 信息
*/ */
@GetMapping("/info/{recordid}") @GetMapping("/info/{recordid}")
public R info(@PathVariable("recordid") Integer recordid){ public R info(@PathVariable("recordid") Integer recordid) {
ProjectRecordEntity projectRecord = projectRecordService.getById(recordid); ProjectRecordEntity projectRecord = projectRecordService.getById(recordid);
return R.ok().put("projectRecord", projectRecord); return R.ok().put("projectRecord", projectRecord);
} }
@ -162,8 +171,8 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
* 保存 * 保存
*/ */
@RequestMapping("/save") @RequestMapping("/save")
public R save(@RequestBody ProjectRecordEntity projectRecord){ public R save(@RequestBody ProjectRecordEntity projectRecord) {
projectRecordService.save(projectRecord); projectRecordService.save(projectRecord);
return R.ok(); return R.ok();
} }
@ -173,10 +182,10 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
*/ */
@Override @Override
@PutMapping("/update") @PutMapping("/update")
public R update(@RequestBody ProjectRecordEntity projectRecord){ public R update(@RequestBody ProjectRecordEntity projectRecord) {
boolean result = projectRecordService.updateUserRecord(projectRecord); boolean result = projectRecordService.updateUserRecord(projectRecord);
return R.ok().put("data",result); return R.ok().put("data", result);
} }
/** /**
@ -184,8 +193,8 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
*/ */
@Override @Override
@DeleteMapping("/delete") @DeleteMapping("/delete")
public R delete(@RequestBody Integer[] recordids){ public R delete(@RequestBody Integer[] recordids) {
projectRecordService.removeByIds(Arrays.asList(recordids)); projectRecordService.removeByIds(Arrays.asList(recordids));
return R.ok(); return R.ok();
} }

@ -23,11 +23,11 @@ import java.util.List;
@Mapper @Mapper
public interface ProjectRecordDao extends BaseMapper<ProjectRecordEntity> { public interface ProjectRecordDao extends BaseMapper<ProjectRecordEntity> {
IPage<ProjectRecordVo> getByKDUserRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity,Integer projectPermissions); IPage<ProjectRecordVo> getByKDUserRecord(Page page, @Param("pro") ProjectRecordEntity projectRecordEntity, Integer projectPermissions);
IPage<GetByUserRecordResp> getByUserRecord(Page page, @Param("userId") Integer userId, @Param("projectPermissions") Integer projectPermissions,@Param("systemId") Integer systemId); IPage<GetByUserRecordResp> getByUserRecord(Page page, @Param("userId") Integer userId, @Param("projectPermissions") Integer projectPermissions, @Param("systemId") Integer systemId);
IPage<ProjectRecordVo> getByUserExperimentRecord(Page page, @Param("pro") ProjectRecordEntity projectRecordEntity); IPage<ProjectRecordVo> getByUserExperimentRecord(Page page, @Param("pro") ProjectRecordEntity projectRecordEntity, Integer systemId);
List<ProjectRecordExportVo> getByUserRecordImport(ProjectRecordEntity projectRecordEntity); List<ProjectRecordExportVo> getByUserRecordImport(ProjectRecordEntity projectRecordEntity);

@ -51,7 +51,7 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable
/** /**
* 平均分 * 平均分
*/ */
private double avgScore; private double avgScore;
/** /**
* 几个月 * 几个月
*/ */
@ -59,7 +59,7 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable
/** /**
* 查询条件 * 查询条件
*/ */
private String condition; private String condition;
/** /**
* 开始时间 * 开始时间
*/ */
@ -76,7 +76,9 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable
* 待评分 * 待评分
*/ */
private Integer tobescored; private Integer tobescored;
/** 记录状态(0 未修改,1 已修改)*/ /**
* 记录状态0 未修改1 已修改
*/
private Integer recordState; private Integer recordState;
// =====================================记录实验项目信息 // =====================================记录实验项目信息
/** /**
@ -109,4 +111,9 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable
*/ */
private Integer schoolId; private Integer schoolId;
/**
* 系统id
*/
private Integer systemId;
} }

@ -20,7 +20,7 @@ public interface ProjectRecordService extends IService<ProjectRecordEntity> {
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); PageUtils queryExperimentPage(Integer page, Integer size, Integer userid,Integer systemId);
ProjectRecordVo queryUserScore(Integer userId); ProjectRecordVo queryUserScore(Integer userId);

@ -38,14 +38,14 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
@Override @Override
public PageUtils getByKDUserRecord(Integer page,Integer size,Integer userId,Integer projectPermissions,Integer systemId) { public PageUtils getByKDUserRecord(Integer page, Integer size, Integer userId, Integer projectPermissions, Integer systemId) {
ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userId); ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userId);
//分页对象 //分页对象
Page<T> page1 = new Page<>(page, size); Page<T> page1 = new Page<>(page, size);
IPage<ProjectRecordVo> projectRecordVos = this.baseMapper.getByKDUserRecord(page1,projectRecord,projectPermissions); IPage<ProjectRecordVo> projectRecordVos = this.baseMapper.getByKDUserRecord(page1, projectRecord, projectPermissions);
PageUtils questionsPage = new PageUtils(projectRecordVos); PageUtils questionsPage = new PageUtils(projectRecordVos);
@ -53,7 +53,7 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
} }
@Override @Override
public PageUtils queryPage(Integer page, Integer size, Integer userId, Integer projectPermissions,Integer systemId) { public PageUtils queryPage(Integer page, Integer size, Integer userId, Integer projectPermissions, Integer systemId) {
/*GetByUserRecordResp projectRecord = new GetByUserRecordResp(); /*GetByUserRecordResp projectRecord = new GetByUserRecordResp();
projectRecord.setUserId(userId);*/ projectRecord.setUserId(userId);*/
@ -61,7 +61,7 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
//分页对象 //分页对象
Page<T> page1 = new Page<>(page, size); Page<T> page1 = new Page<>(page, size);
IPage<GetByUserRecordResp> projectRecordVos = this.baseMapper.getByUserRecord(page1, userId, projectPermissions,systemId); IPage<GetByUserRecordResp> projectRecordVos = this.baseMapper.getByUserRecord(page1, userId, projectPermissions, systemId);
PageUtils questionsPage = new PageUtils(projectRecordVos); PageUtils questionsPage = new PageUtils(projectRecordVos);
@ -69,14 +69,14 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
} }
@Override @Override
public PageUtils queryExperimentPage(Integer page, Integer size, Integer userid) { public PageUtils queryExperimentPage(Integer page, Integer size, Integer userid, Integer systemId) {
ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userid).setIsdel(Constant.IsDel.NOT_DEL.getType()); ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userid).setIsdel(Constant.IsDel.NOT_DEL.getType());
//分页对象 //分页对象
Page<T> page1 = new Page<>(page, size); Page<T> page1 = new Page<>(page, size);
IPage<ProjectRecordVo> projectRecordVos = this.baseMapper.getByUserExperimentRecord(page1, projectRecord); IPage<ProjectRecordVo> projectRecordVos = this.baseMapper.getByUserExperimentRecord(page1, projectRecord, systemId);
PageUtils questionsPage = new PageUtils(projectRecordVos); PageUtils questionsPage = new PageUtils(projectRecordVos);

@ -22,26 +22,21 @@
</insert> </insert>
<select id="getByKDUserRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo"> <select id="getByKDUserRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT SELECT her.reportId as reportId,
her.reportId as reportId, her.projectId,
her.projectId, projectName,
projectName, her.score,
her.score, her.timeConsuming,
her.timeConsuming, her.startTime,
her.startTime, her.creationTime as endTime,
her.creationTime as endTime, her.className
her.className FROM hr_experimental_report her
FROM LEFT JOIN hr_project_management tp ON her.projectId = tp.projectId
hr_experimental_report her WHERE her.studentId = #{pro.userid}
LEFT JOIN hr_project_management tp ON her.projectId = tp.projectId AND her.isdel = 0
WHERE AND tp.projectPermissions = #{projectPermissions}
her.studentId = #{pro.userid} order by her.creationTime desc
AND
her.isdel = 0
AND
tp.projectPermissions = #{projectPermissions}
order by her.creationTime desc
</select> </select>
@ -81,12 +76,14 @@
startingTime as startTime, startingTime as startTime,
endTime, endTime,
recordState, recordState,
tet.experimental_class_name as experimentalClassName tet.experimental_class_name as experimentalClassName,
systemId
FROM tms_project_record tpr FROM tms_project_record tpr
LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId
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}
and systemId = #{systemId}
AND tpr.isdel >= #{pro.isdel} AND tpr.isdel >= #{pro.isdel}
AND tp.projectPermissions !=0 AND tp.projectPermissions !=0
AND AND
@ -139,7 +136,7 @@
<select id="queryScore" resultType="com.msdw.tms.entity.vo.ProjectRecordVo"> <select id="queryScore" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">
SELECT count(*) as experimentNumber, sum(timeConsuming) as totalTime, avg(score) as avgScore SELECT count(*) as experimentNumber, sum(timeConsuming) as totalTime, avg(score) as avgScore
FROM hr_experimental_report FROM hr_experimental_report
where studentId = 547 where studentId = #{studentId}
</select> </select>
<select id="getBySchoolRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo"> <select id="getBySchoolRecord" resultType="com.msdw.tms.entity.vo.ProjectRecordVo">

Loading…
Cancel
Save