Merge remote-tracking branch 'origin/master'

hehai
shijie 4 years ago
commit 488bd840e1
  1. 13
      src/main/java/com/msdw/tms/api/AchievementManagementApi.java
  2. 2
      src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java
  3. 38
      src/main/java/com/msdw/tms/controller/AchievementManagementController.java
  4. 13
      src/main/java/com/msdw/tms/controller/ClassTeachingController.java
  5. 4
      src/main/java/com/msdw/tms/controller/ProjectRecordController.java
  6. 9
      src/main/java/com/msdw/tms/dao/AchievementManagementDao.java
  7. 3
      src/main/java/com/msdw/tms/dao/ClassTeachingDao.java
  8. 2
      src/main/java/com/msdw/tms/dao/ProjectRecordDao.java
  9. 2
      src/main/java/com/msdw/tms/dao/UserDao.java
  10. 9
      src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java
  11. 8
      src/main/java/com/msdw/tms/entity/vo/AchievementManagementVO.java
  12. 10
      src/main/java/com/msdw/tms/service/AchievementManagementService.java
  13. 2
      src/main/java/com/msdw/tms/service/ProjectRecordService.java
  14. 99
      src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java
  15. 43
      src/main/java/com/msdw/tms/service/impl/ClassTeachingServiceImpl.java
  16. 10
      src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java
  17. 7
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  18. 102
      src/main/resources/mapper/tms/AchievementManagementDao.xml
  19. 10
      src/main/resources/mapper/tms/ClassTeachingDao.xml
  20. 5
      src/main/resources/mapper/tms/ExperimentalTeachingDao.xml
  21. 10
      src/main/resources/mapper/tms/ProjectRecordDao.xml
  22. 5
      src/main/resources/mapper/tms/StudentDao.xml
  23. 4
      src/main/resources/mapper/tms/UserInfoDao.xml

@ -54,7 +54,7 @@ public interface AchievementManagementApi {
// R updateScore(@ApiParam(value = "recordid和score") ProjectRecordEntity entity); // R updateScore(@ApiParam(value = "recordid和score") ProjectRecordEntity entity);
@ApiOperation(value = "删除实验报告",notes = "根据实验记录主键reportId和实验报告主键recordId删除实验报告") @ApiOperation(value = "删除实验报告",notes = "根据实验记录主键reportId和实验报告主键recordId删除实验报告")
R deleteReport(@ApiParam(value = "实验记录主键",required = true) Integer reportId); R deleteReport(@ApiParam(value = "实验记录主键",required = true) Integer reportId,@ApiParam(value = "实验报告主键",required = true) @RequestParam Integer recordId);
@ApiOperation(value = "班级实验报告列表查询",notes = "班级实验报告列表查询") @ApiOperation(value = "班级实验报告列表查询",notes = "班级实验报告列表查询")
R queryEvaluationReport(@ApiParam(value = "搜索内容(学校名称/学生姓名)",required = false) String searchContant, R queryEvaluationReport(@ApiParam(value = "搜索内容(学校名称/学生姓名)",required = false) String searchContant,
@ -78,4 +78,15 @@ public interface AchievementManagementApi {
@ApiOperation(value = "发布成绩",notes = "发布成绩--修改教师签名") @ApiOperation(value = "发布成绩",notes = "发布成绩--修改教师签名")
R updateSignatrue(@ApiParam(value = "实验报告主键reportId + 是否使用教师签名isSignature + 教师签名id signatureId + 教师评语comment") ExperimentalReportEntity entity); R updateSignatrue(@ApiParam(value = "实验报告主键reportId + 是否使用教师签名isSignature + 教师签名id signatureId + 教师评语comment") ExperimentalReportEntity entity);
@ApiOperation(value = "成绩管理删除项目",notes = "将项目管理表isdel置1")
R deleteReportByProjectId(@ApiParam(value = "项目id",required = true) Integer projectId);
@ApiOperation(value = "成绩管理:虚拟仿真实验成绩管理", notes = "成绩管理:虚拟仿真实验成绩管理")
R getImitationAchievement(@ApiParam(value = "projectId", required = false) Integer projectId);
@ApiOperation(value = "成绩管理:实验教学成绩管理", notes = "成绩管理:实验教学成绩管理")
R getTeachAchievement(@RequestParam(required = true) Integer id);
} }

@ -18,7 +18,7 @@ public interface ProjectRcordControllerApi {
Integer recordState,String condition); Integer recordState,String condition);
@ApiOperation(value = "用户端虚拟仿真实验记录",notes = "用户端虚拟仿真实验记录") @ApiOperation(value = "用户端虚拟仿真实验记录",notes = "用户端虚拟仿真实验记录")
R queryUserRecord(Integer page,Integer size,Integer userId,Integer projectPermissions); 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);

@ -3,6 +3,7 @@ package com.msdw.tms.controller;
import com.msdw.tms.api.AchievementManagementApi; import com.msdw.tms.api.AchievementManagementApi;
import com.msdw.tms.common.utils.R; import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.*; import com.msdw.tms.entity.*;
import com.msdw.tms.entity.vo.AchievementManagementVO;
import com.msdw.tms.entity.vo.ResultsVo; import com.msdw.tms.entity.vo.ResultsVo;
import com.msdw.tms.service.AchievementManagementService; import com.msdw.tms.service.AchievementManagementService;
import com.msdw.tms.service.ProjectRecordService; import com.msdw.tms.service.ProjectRecordService;
@ -11,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -193,8 +195,8 @@ public class AchievementManagementController implements AchievementManagementApi
*/ */
@Override @Override
@PostMapping("/deleteReport") @PostMapping("/deleteReport")
public R deleteReport(@RequestParam Integer reportId){ public R deleteReport(@RequestParam Integer reportId,@RequestParam Integer recordId){
R result = service.deleteReport(reportId); R result = service.deleteReport(reportId,recordId);
return result; return result;
} }
@ -263,4 +265,36 @@ public class AchievementManagementController implements AchievementManagementApi
service.updateSignatrue(entity); service.updateSignatrue(entity);
return R.ok(); return R.ok();
} }
/**
* 删除成绩管理中的项目
* @param projectId
* @return
*/
@Override
@PostMapping("/deleteReportById")
public R deleteReportByProjectId(@RequestParam Integer projectId) {
return service.deleteReportByProjectId(projectId);
}
/**
* 成绩管理:虚拟仿真实验成绩管理
*/
@Override
@GetMapping("/getImitationAchievement")
public R getImitationAchievement(@RequestParam(required = true) Integer projectId) {
List<AchievementManagementVO> result = service.getImitationAchievement(projectId);
return R.ok().put("data", result);
}
/**
* 成绩管理:实验教学成绩管理
*/
@Override
@GetMapping("/getTeachAchievement")
public R getTeachAchievement(@RequestParam(required = true) Integer id) {
List<AchievementManagementVO> result = service.getTeachAchievement(id);
return R.ok().put("data", result);
}
} }

@ -54,9 +54,16 @@ public class ClassTeachingController implements ClassTeachingApi {
if (!StringUtils.isEmpty(condition)) { if (!StringUtils.isEmpty(condition)) {
recordVo.setCondition(condition); recordVo.setCondition(condition);
} }
if (!StringUtils.isEmpty(month)) { // 设置固定时间(当自定义时间为空时)
if (!StringUtils.isEmpty(month) && StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime)) {
recordVo.setMonth(month); recordVo.setMonth(month);
} else { }
// 设置自定义时间
if (!StringUtils.isEmpty(startTime) || !StringUtils.isEmpty(endTime)) {
recordVo.setStartTime(startTime);
recordVo.setEndTime(endTime);
}
/*else {
recordVo.setMonth(null); recordVo.setMonth(null);
if (!StringUtils.isEmpty(startTime)) { if (!StringUtils.isEmpty(startTime)) {
recordVo.setStartTime(startTime); recordVo.setStartTime(startTime);
@ -64,7 +71,7 @@ public class ClassTeachingController implements ClassTeachingApi {
if (!StringUtils.isEmpty(endTime)) { if (!StringUtils.isEmpty(endTime)) {
recordVo.setEndTime(endTime); recordVo.setEndTime(endTime);
} }
} }*/
recordVo.setSchoolId(schoolId); recordVo.setSchoolId(schoolId);
PageUtils page1 = classTeachingService.queryClassRecord(page, size, recordVo); PageUtils page1 = classTeachingService.queryClassRecord(page, size, recordVo);
return R.ok().put("page", page1); return R.ok().put("page", page1);

@ -63,8 +63,8 @@ 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){ 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); PageUtils page1 = projectRecordService.queryPage(page,size,userId,projectPermissions,systemId);
return R.ok().put("data", page1); return R.ok().put("data", page1);
} }

@ -47,7 +47,7 @@ public interface AchievementManagementDao extends BaseMapper<ExperimentalReportE
AchievementManagementVO queryReport(Integer reportId); AchievementManagementVO queryReport(Integer reportId);
void deleteReport(Integer reportId); void deleteReport(Integer reportId,Integer recordId);
IPage<AchievementManagementVO> queryEvaluationReport(Page<T> tPage, String searchContant, Integer projectId); IPage<AchievementManagementVO> queryEvaluationReport(Page<T> tPage, String searchContant, Integer projectId);
@ -72,4 +72,11 @@ public interface AchievementManagementDao extends BaseMapper<ExperimentalReportE
List<AchievementManagementVO> queryPythonTest(Integer eventId); List<AchievementManagementVO> queryPythonTest(Integer eventId);
void updateSignatrue(Integer isSignature,Integer signatureId,Integer reportId,String comment); void updateSignatrue(Integer isSignature,Integer signatureId,Integer reportId,String comment);
void deleteReportById(Integer projectId);
//虚拟仿真成绩管理查询
List<AchievementManagementVO> getImitationAchievement(Integer projectId);
List<AchievementManagementVO> getTeachAchievement(Integer id);
} }

@ -23,4 +23,7 @@ public interface ClassTeachingDao {
void updateSurplusTimeLe(ProjectRecordVo recordVo); void updateSurplusTimeLe(ProjectRecordVo recordVo);
void updateSurplusTimeGt(ProjectRecordVo recordVo); void updateSurplusTimeGt(ProjectRecordVo recordVo);
int updateExperimentalNumber(Integer number, Integer id);
} }

@ -23,7 +23,7 @@ import java.util.List;
@Mapper @Mapper
public interface ProjectRecordDao extends BaseMapper<ProjectRecordEntity> { public interface ProjectRecordDao extends BaseMapper<ProjectRecordEntity> {
IPage<GetByUserRecordResp> getByUserRecord(Page page, @Param("userId") Integer userId, @Param("projectPermissions") Integer projectPermissions); 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);

@ -41,7 +41,7 @@ public interface UserDao extends BaseMapper<UserEntity> {
List<String> findPhoneSetTime(String phone, String checkCode,Integer types); List<String> findPhoneSetTime(String phone, String checkCode,Integer types);
boolean saveCheckPhoneCode(CheckVo checkVo); // boolean saveCheckPhoneCode(CheckVo checkVo);
List<Integer> queryPhone(CheckVo checkVo); List<Integer> queryPhone(CheckVo checkVo);
} }

@ -22,6 +22,15 @@ public class GetByUserRecordResp {
private String submitTime; private String submitTime;
private Integer timeSum; private Integer timeSum;
private Integer userId; private Integer userId;
private Integer systemId;
public Integer getSystemId() {
return systemId;
}
public void setSystemId(Integer systemId) {
this.systemId = systemId;
}
public String getProjectName() { public String getProjectName() {
return projectName; return projectName;

@ -32,7 +32,7 @@ public class AchievementManagementVO extends ExperimentalReportEntity {
//提交时间 //提交时间
private String submitTime; private String submitTime;
//=========================================================== 返回参数 //=========================================================== 返回参数
//项目名称 //项目名称
private String projectName; private String projectName;
@ -46,7 +46,7 @@ public class AchievementManagementVO extends ExperimentalReportEntity {
private String creationTime; private String creationTime;
//类型(1虚拟仿真,2教学实验) //类型(1虚拟仿真,2教学实验)
private Integer type; private Integer type;
// //
private Integer projectPermissions; private Integer projectPermissions;
//创建时间 //创建时间
@ -55,6 +55,8 @@ public class AchievementManagementVO extends ExperimentalReportEntity {
//实验记录id(tms_experimental_report主键) //实验记录id(tms_experimental_report主键)
private Integer recordId; private Integer recordId;
private Integer reportId;
//老师签名 存放路径 //老师签名 存放路径
private String signatureUrl; private String signatureUrl;
//签名名称 //签名名称
@ -72,7 +74,7 @@ public class AchievementManagementVO extends ExperimentalReportEntity {
//平台id //平台id
private Integer systemId; private Integer systemId;
//=========================================================== python实验数据 //=========================================================== python实验数据
//判分点id //判分点id
private Integer codeId; private Integer codeId;
//判分点-得分 //判分点-得分

@ -6,9 +6,11 @@ import com.msdw.tms.entity.ExperimentalReportEntity;
import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.ExperimentalTeachingEntity;
import com.msdw.tms.entity.ReportEntity; import com.msdw.tms.entity.ReportEntity;
import com.msdw.tms.entity.ResultsEntity; import com.msdw.tms.entity.ResultsEntity;
import com.msdw.tms.entity.vo.AchievementManagementVO;
import com.msdw.tms.entity.vo.ResultsVo; import com.msdw.tms.entity.vo.ResultsVo;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public interface AchievementManagementService extends IService<ExperimentalReportEntity> { public interface AchievementManagementService extends IService<ExperimentalReportEntity> {
@ -30,7 +32,7 @@ public interface AchievementManagementService extends IService<ExperimentalRepor
R queryReport(Integer reportId ); R queryReport(Integer reportId );
R deleteReport(Integer reportId); R deleteReport(Integer reportId,Integer recordId);
R queryEvaluationReport(String searchContant,Integer projectId,Integer page,Integer size); R queryEvaluationReport(String searchContant,Integer projectId,Integer page,Integer size);
@ -41,4 +43,10 @@ public interface AchievementManagementService extends IService<ExperimentalRepor
R updateComment(ExperimentalReportEntity entity); R updateComment(ExperimentalReportEntity entity);
void updateSignatrue(ExperimentalReportEntity entity); void updateSignatrue(ExperimentalReportEntity entity);
R deleteReportByProjectId(Integer projectId);
List<AchievementManagementVO> getImitationAchievement(Integer projectId);
List<AchievementManagementVO> getTeachAchievement(Integer id);
} }

@ -17,7 +17,7 @@ import java.util.List;
*/ */
public interface ProjectRecordService extends IService<ProjectRecordEntity> { public interface ProjectRecordService extends IService<ProjectRecordEntity> {
PageUtils queryPage(Integer page, Integer size, Integer userId, Integer projectPermissions); 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);

@ -28,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
import java.util.*; import java.util.*;
@Slf4j @Slf4j
@Service @Service
public class AchievementManagementServiceImpl extends ServiceImpl<AchievementManagementDao, ExperimentalReportEntity> implements AchievementManagementService { public class AchievementManagementServiceImpl extends ServiceImpl<AchievementManagementDao, ExperimentalReportEntity> implements AchievementManagementService {
@ -58,39 +59,39 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
experimentalReportEntity.setReportId(reportId); experimentalReportEntity.setReportId(reportId);
ExperimentalReportEntity experimentalReportEntity1 = baseMapper.getReport(experimentalReportEntity); ExperimentalReportEntity experimentalReportEntity1 = baseMapper.getReport(experimentalReportEntity);
List<UserScoreVO> score = baseMapper.getScore(userScoreVO); List<UserScoreVO> score = baseMapper.getScore(userScoreVO);
obj.put("score",score); obj.put("score", score);
obj.put("experimentalReportEntity",experimentalReportEntity1); obj.put("experimentalReportEntity", experimentalReportEntity1);
List<Integer> tradingJudgmentPointsIds = baseMapper.queryTradingJudgmentPointsId(reportId); List<Integer> tradingJudgmentPointsIds = baseMapper.queryTradingJudgmentPointsId(reportId);
Integer size = tradingJudgmentPointsIds.size(); Integer size = tradingJudgmentPointsIds.size();
for (int i = 0;i<size; i++){ for (int i = 0; i < size; i++) {
Integer tradingJudgmentPointsId = tradingJudgmentPointsIds.get(i); Integer tradingJudgmentPointsId = tradingJudgmentPointsIds.get(i);
List<JudgmentPointsRuleVO> judgmentPointsRuleList = baseMapper.getUserAnswers(tradingJudgmentPointsId); List<JudgmentPointsRuleVO> judgmentPointsRuleList = baseMapper.getUserAnswers(tradingJudgmentPointsId);
map.put("judgmentPointsRuleList"+i,judgmentPointsRuleList); map.put("judgmentPointsRuleList" + i, judgmentPointsRuleList);
} }
obj.put("userAnswersList",map); obj.put("userAnswersList", map);
return R.ok().put("data",obj); return R.ok().put("data", obj);
} }
@Override @Override
public R getTeacher(Integer projectId) { public R getTeacher(Integer projectId) {
String name = baseMapper.getTeacher(projectId); String name = baseMapper.getTeacher(projectId);
return R.ok().put("name",name); return R.ok().put("name", name);
} }
@Override @Override
public List<ResultsEntity> list(ResultsVo vo,Integer page,Integer size) { public List<ResultsEntity> list(ResultsVo vo, Integer page, Integer size) {
List<ResultsEntity> list = achievementManagementDao.list(vo); List<ResultsEntity> list = achievementManagementDao.list(vo);
return list; return list;
} }
@Override @Override
public List<ReportEntity> reportList(ResultsVo vo,Integer page,Integer size) { public List<ReportEntity> reportList(ResultsVo vo, Integer page, Integer size) {
List<ReportEntity> reportList = achievementManagementDao.reportList(vo); List<ReportEntity> reportList = achievementManagementDao.reportList(vo);
return reportList; return reportList;
} }
@Override @Override
public List<ResultsEntity> newList(ResultsVo vo,Integer page,Integer size) { public List<ResultsEntity> newList(ResultsVo vo, Integer page, Integer size) {
List<ResultsEntity> newList = achievementManagementDao.newList(vo); List<ResultsEntity> newList = achievementManagementDao.newList(vo);
return newList; return newList;
} }
@ -152,36 +153,38 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
Integer eventId = report.getEventId(); Integer eventId = report.getEventId();
ProjectRecordEntity record = projectRecordDao.queryReport(eventId); ProjectRecordEntity record = projectRecordDao.queryReport(eventId);
String userName = userInfoDao.queryUserReport(record.getUserid()); String userName = userInfoDao.queryUserReport(record.getUserid());
if (report.getProjectId()!=null){ if (report.getProjectId() != null) {
String evaluationName = achievementManagementDao.queryEvaluationName(report.getProjectId()); String evaluationName = achievementManagementDao.queryEvaluationName(report.getProjectId());
report.setEvaluationName(evaluationName); report.setEvaluationName(evaluationName);
} }
//python实验数据 //python实验数据
Integer systemId = report.getSystemId(); Integer systemId = report.getSystemId();
if (systemId==1|systemId==4|systemId==5) { if (systemId == 1 | systemId == 4 | systemId == 5) {
List<AchievementManagementVO> data = achievementManagementDao.queryPythonTest(eventId); List<AchievementManagementVO> data = achievementManagementDao.queryPythonTest(eventId);
map.put("data", data); map.put("data", data);
} }
report.setUserName(userName); report.setUserName(userName);
map.put("report",report); map.put("report", report);
map.put("record",record); map.put("record", record);
return R.ok().put("data",map); return R.ok().put("data", map);
} }
@Override @Override
@Transactional @Transactional
public R deleteReport(Integer reportId) { public R deleteReport(Integer reportId,Integer recordId) {
achievementManagementDao.deleteReport(reportId); achievementManagementDao.deleteReport(reportId,recordId);
return R.ok(); return R.ok();
} }
@Override @Override
public R queryEvaluationReport(String searchContant,Integer projectId,Integer page,Integer size) { public R queryEvaluationReport(String searchContant, Integer projectId, Integer page, Integer size) {
Page<T> tPage = new Page<>(page,size); Page<T> tPage = new Page<>(page, size);
IPage<AchievementManagementVO> data = achievementManagementDao.queryEvaluationReport(tPage,searchContant,projectId); IPage<AchievementManagementVO> data = achievementManagementDao.queryEvaluationReport(tPage, searchContant, projectId);
PageUtils result = new PageUtils(data); PageUtils result = new PageUtils(data);
return R.ok().put("data",result); return R.ok().put("data", result);
} }
@Override @Override
@ -190,10 +193,10 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
List<Integer> list = new ArrayList<>(); List<Integer> list = new ArrayList<>();
String[] split = ids.split(","); String[] split = ids.split(",");
for (int i = 0;i<split.length;i++){ for (int i = 0; i < split.length; i++) {
list.add(Integer.parseInt(split[i])); list.add(Integer.parseInt(split[i]));
} }
List<AchievementImportRequest> achievement = achievementManagementDao.queryAchievement(list); List<AchievementImportRequest> achievement = achievementManagementDao.queryAchievement(list);
//2.加载模板流数据 //2.加载模板流数据
ClassPathResource resource = new ClassPathResource("excel-template/川大成绩管理实验记录导出模板.xlsx"); ClassPathResource resource = new ClassPathResource("excel-template/川大成绩管理实验记录导出模板.xlsx");
@ -205,7 +208,7 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
} }
@Override @Override
public R queryAchievement(Integer systemId,Integer projectPermissions, String searchContant, String startingtime, public R queryAchievement(Integer systemId, Integer projectPermissions, String searchContant, String startingtime,
String endtime, Integer month) { String endtime, Integer month) {
try { try {
List<AchievementManagementVO> fictitious; List<AchievementManagementVO> fictitious;
@ -213,14 +216,16 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
List<AchievementManagementVO> vo = new ArrayList<>(); List<AchievementManagementVO> vo = new ArrayList<>();
List<Integer> educationResult = achievementManagementDao.countEducationProjectId();//获取教学实验的主键id List<Integer> educationResult = achievementManagementDao.countEducationProjectId();//获取教学实验的主键id
List<Integer> fictitiousResult = achievementManagementDao.countFictitiousProjectId();//获取教学实验的主键id List<Integer> fictitiousResult = achievementManagementDao.countFictitiousProjectId();//获取教学实验的主键id
if (projectPermissions==null){projectPermissions=-9999;} if (projectPermissions == null) {
if (projectPermissions==0){//只查询练习项目 projectPermissions = -9999;
}
if (projectPermissions == 0) {//只查询练习项目
fictitious = achievementManagementDao.queryFictitiousRecord(systemId, searchContant, startingtime, endtime, month, fictitiousResult); fictitious = achievementManagementDao.queryFictitiousRecord(systemId, searchContant, startingtime, endtime, month, fictitiousResult);
vo = fictitious; vo = fictitious;
}else if (projectPermissions==1){//只查询考核项目 } else if (projectPermissions == 1) {//只查询考核项目
education = achievementManagementDao.queryEducationRecord(systemId, searchContant, startingtime, endtime, month, educationResult); education = achievementManagementDao.queryEducationRecord(systemId, searchContant, startingtime, endtime, month, educationResult);
vo = education; vo = education;
}else {//查询练习+考核项目 } else {//查询练习+考核项目
if (educationResult.size() == 0) { if (educationResult.size() == 0) {
if (fictitiousResult.size() > 0) { if (fictitiousResult.size() > 0) {
fictitious = achievementManagementDao.queryFictitiousRecord(systemId, searchContant, startingtime, endtime, month, fictitiousResult); fictitious = achievementManagementDao.queryFictitiousRecord(systemId, searchContant, startingtime, endtime, month, fictitiousResult);
@ -245,10 +250,10 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
} }
} }
} }
return R.ok().put("data",vo); return R.ok().put("data", vo);
}catch (RuntimeException e){ } catch (RuntimeException e) {
log.info(e.getMessage()); log.info(e.getMessage());
return R.error(500,"系统异常!!!"); return R.error(500, "系统异常!!!");
} }
} }
@ -267,14 +272,36 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
Integer signatureId = entity.getSignatureId(); Integer signatureId = entity.getSignatureId();
Integer reportId = entity.getReportId(); Integer reportId = entity.getReportId();
String comment = entity.getComment(); String comment = entity.getComment();
if (comment==""){ if (comment == "") {
comment = null; comment = null;
} }
if (isSignature==1){ if (isSignature == 1) {
achievementManagementDao.updateSignatrue(1,signatureId,reportId,comment); achievementManagementDao.updateSignatrue(1, signatureId, reportId, comment);
}else { } else {
achievementManagementDao.updateSignatrue(0,null,reportId,comment); achievementManagementDao.updateSignatrue(0, null, reportId, comment);
} }
} }
@Override
public R deleteReportByProjectId(Integer projectId) {
achievementManagementDao.deleteReportById(projectId);
return R.ok();
}
@Override
public List<AchievementManagementVO> getImitationAchievement(Integer projectId) {
List<AchievementManagementVO> list = achievementManagementDao.getImitationAchievement(projectId);
return list;
}
@Override
public List<AchievementManagementVO> getTeachAchievement(Integer id) {
return achievementManagementDao.getTeachAchievement(id);
}
} }

@ -2,24 +2,34 @@ package com.msdw.tms.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.msdw.tms.common.utils.Constant; import com.msdw.tms.common.utils.Constant;
import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.dao.ClassTeachingDao; import com.msdw.tms.dao.ClassTeachingDao;
import com.msdw.tms.dao.ExperimentalTeachingDao;
import com.msdw.tms.entity.BroadcastEntity; import com.msdw.tms.entity.BroadcastEntity;
import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.ExperimentalTeachingEntity;
import com.msdw.tms.entity.ProjectRecordEntity; import com.msdw.tms.entity.ProjectRecordEntity;
import com.msdw.tms.entity.vo.ExperimentalTeachingVO;
import com.msdw.tms.entity.vo.ProjectRecordVo; import com.msdw.tms.entity.vo.ProjectRecordVo;
import com.msdw.tms.service.ClassTeachingService; import com.msdw.tms.service.ClassTeachingService;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.concurrent.locks.Lock;
@Service @Service
public class ClassTeachingServiceImpl implements ClassTeachingService { public class ClassTeachingServiceImpl extends ServiceImpl<ExperimentalTeachingDao, ExperimentalTeachingEntity> implements ClassTeachingService {
@Autowired @Autowired
private ClassTeachingDao classMapper; private ClassTeachingDao classMapper;
@Autowired
private ClassTeachingDao classTeachingDao;
@Override @Override
public ExperimentalTeachingEntity queryInvitationcode(ExperimentalTeachingEntity experimentEntity) { public ExperimentalTeachingEntity queryInvitationcode(ExperimentalTeachingEntity experimentEntity) {
ExperimentalTeachingEntity ex = classMapper.queryInvitationCode(experimentEntity); ExperimentalTeachingEntity ex = classMapper.queryInvitationCode(experimentEntity);
@ -44,8 +54,35 @@ public class ClassTeachingServiceImpl implements ClassTeachingService {
this.classMapper.updateSurplusTimeUp(recordVo);//倒计时:设定距离实验开始的剩余时间 this.classMapper.updateSurplusTimeUp(recordVo);//倒计时:设定距离实验开始的剩余时间
this.classMapper.updateSurplusTimeLe(recordVo); this.classMapper.updateSurplusTimeLe(recordVo);
this.classMapper.updateSurplusTimeGt(recordVo); this.classMapper.updateSurplusTimeGt(recordVo);
IPage<ProjectRecordVo> schoolRecord = this.classMapper.getByClassRecord(page1, recordVo); // IPage<ProjectRecordVo> schoolRecord = this.classMapper.getByClassRecord(page1, recordVo);
PageUtils pageUtils = new PageUtils(schoolRecord); // PageUtils pageUtils = new PageUtils(schoolRecord);
ExperimentalTeachingVO vo = new ExperimentalTeachingVO();
// 状态
vo.setStatus(recordVo.getStatus());
// 月份
vo.setMonth(recordVo.getMonth());
// 学校
vo.setSchoolId(recordVo.getSchoolId());
// 开始时间
vo.setStartTime(recordVo.getStartTime());
// 结束时间
vo.setStopTime(recordVo.getEndTime());
// 查询条件
vo.setSearchContent(recordVo.getCondition());
// BeanUtils.copyProperties(recordVo,vo);
ExperimentalTeachingDao userDao = this.getBaseMapper();
IPage<ExperimentalTeachingEntity> list = userDao.queryExperimentalTeaching(page1, vo);
for (int i = 0; i < list.getRecords().size(); i++) {
Integer number = list.getRecords().get(i).getExperimentalNumber();
Integer id = list.getRecords().get(i).getId();
//读取另一个表,将数据更新进 tms_experimental_teaching
int isTure = classTeachingDao.updateExperimentalNumber(number,id);
if(isTure < 0){
return null;
}
}
PageUtils pageUtils = new PageUtils(list);
return pageUtils; return pageUtils;
} }

@ -36,6 +36,16 @@ public class ExperimentalTeachingServiceImpl extends ServiceImpl<ExperimentalTea
Page<T> page1 = new Page<>(page, size); Page<T> page1 = new Page<>(page, size);
ExperimentalTeachingDao userDao = this.getBaseMapper(); ExperimentalTeachingDao userDao = this.getBaseMapper();
IPage<ExperimentalTeachingEntity> list = userDao.queryExperimentalTeaching(page1, vo); IPage<ExperimentalTeachingEntity> list = userDao.queryExperimentalTeaching(page1, vo);
for (int i = 0; i < list.getRecords().size(); i++) {
Integer number = list.getRecords().get(i).getExperimentalNumber();
Integer id = list.getRecords().get(i).getId();
//读取另一个表,将数据更新进 tms_experimental_teaching
int isTure = classTeachingDao.updateExperimentalNumber(number,id);
if(isTure < 0){
return null;
}
}
PageUtils pageUtils = new PageUtils(list); PageUtils pageUtils = new PageUtils(list);
return pageUtils; return pageUtils;
} }

@ -38,7 +38,7 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
@Override @Override
public PageUtils queryPage(Integer page, Integer size, Integer userId, Integer projectPermissions) { 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);*/
@ -46,7 +46,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); IPage<GetByUserRecordResp> projectRecordVos = this.baseMapper.getByUserRecord(page1, userId, projectPermissions,systemId);
PageUtils questionsPage = new PageUtils(projectRecordVos); PageUtils questionsPage = new PageUtils(projectRecordVos);
@ -75,10 +75,11 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
ProjectRecordVo projectRecordVo = this.baseMapper.getByUserScore(userId, isdel); ProjectRecordVo projectRecordVo = this.baseMapper.getByUserScore(userId, isdel);
Double totalTime = projectRecordVo.getTotalTime(); Double totalTime = projectRecordVo.getTotalTime();
if (totalTime != null) { if (totalTime != null) {
DecimalFormat df = new DecimalFormat("0.00"); DecimalFormat df = new DecimalFormat("0.0");
double time = totalTime / 60; double time = totalTime / 60;
String format = df.format(time); String format = df.format(time);
projectRecordVo.setTotalTime(Double.parseDouble(format)); projectRecordVo.setTotalTime(Double.parseDouble(format));
//projectRecordVo.setTotalTime(projectRecordVo.getTotalTime());
} }

@ -82,9 +82,9 @@
</insert> </insert>
<update id="deleteReport"> <update id="deleteReport">
UPDATE tms_project_record tpr,hr_experimental_report tcr UPDATE tms_project_record tpr,tms_experimental_report ter
SET tpr.isdel = 1, tcr.isdel = 1 SET tpr.isdel = 1, ter.isdel = 1
WHERE tpr.recordId = tcr.eventId AND tcr.reportId = #{reportId} WHERE tpr.recordId = #{recordId} AND ter.reportId = #{reportId}
</update> </update>
<update id="updateComment"> <update id="updateComment">
UPDATE tms_experimental_report UPDATE tms_experimental_report
@ -132,8 +132,9 @@
LEFT JOIN hr_project_management AS hpm ON hpm.projectId = tpr.projectId LEFT JOIN hr_project_management AS hpm ON hpm.projectId = tpr.projectId
WHERE reportId = #{reportId} WHERE reportId = #{reportId}
</select> </select>
<select id="queryEvaluationReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT <!--
SELECT
u.userName, u.userName,
sch.schoolName, sch.schoolName,
s.workNumber, s.workNumber,
@ -158,14 +159,46 @@
AND tcr.isdel = 0 AND tcr.isdel = 0
AND u.isdel = 0 AND u.isdel = 0
AND tpr.projectId = #{projectId} AND tpr.projectId = #{projectId}
<if test="searchContant!=null and searchContant!=''">AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%') <if test="searchContant!=null and searchContant!=''">
AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%')
OR u.userName LIKE CONCAT('%',#{searchContant},'%') ) OR u.userName LIKE CONCAT('%',#{searchContant},'%') )
</if> </if>
GROUP BY GROUP BY
tcr.reportId tcr.reportId
ORDER BY tpr.submitTime DESC ORDER BY tpr.submitTime DESC
-->
<select id="queryEvaluationReport" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT
r.reportId,
re.recordId,
sch.schoolName,
s.workNumber,
u.userName,
re.score,
re.submitTime,
r.eventId
FROM
tms_experimental_report r
INNER JOIN tms_experimental_teaching t ON t.id = r.projectId
INNER JOIN student s ON s.studentId = r.studentId
INNER JOIN school sch ON sch.schoolId = s.schoolId
INNER JOIN hr_user_info u ON u.userId = s.userId
INNER JOIN tms_project_record re ON re.projectId = t.project_id
WHERE
t.id = r.projectId
and r.eventId = re.recordId
AND r.projectId = #{projectId}
AND r.isdel = 0
AND t.is_del = 0
AND u.isdel = 0
<if test="searchContant!=null and searchContant!=''">
AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%')
OR u.userName LIKE CONCAT('%',#{searchContant},'%') )
</if>
GROUP BY r.reportId DESC
</select> </select>
<select id="queryAchievement" resultType="com.msdw.tms.entity.request.AchievementImportRequest"> <select id="queryAchievement" resultType="com.msdw.tms.entity.request.AchievementImportRequest">
SELECT SELECT
u.userName, u.userName,
@ -359,10 +392,11 @@
<select id="list" resultType="com.msdw.tms.entity.ResultsEntity"> <select id="list" resultType="com.msdw.tms.entity.ResultsEntity">
SELECT hpm.creationTime,hpm.projectId,hpm.projectName,hpm.projectPermissions,hpm.systemId,(SELECT count(*) FROM SELECT hpm.creationTime,hpm.projectId,hpm.projectName,hpm.projectPermissions,hpm.systemId,(SELECT count(*) FROM
hr_experimental_report her where hpm.projectId = her.projectId ) as number tms_project_record her where hpm.projectId = her.projectId and her.isdel = 0 ) as number
FROM hr_project_management hpm WHERE systemId = #{systemId} FROM hr_project_management hpm
WHERE systemId = #{systemId}
AND hpm.isdel = 0 AND hpm.isdel = 0
<if test="projectPermissions!=null and projectPermissions!=''">AND hpm.projectPermissions = <if test="projectPermissions!=null and projectPermissions!=''">AND hpm.projectPer missions =
#{projectPermissions} #{projectPermissions}
</if> </if>
<if test="searchContant!=null and searchContant!=''">and hpm.projectName like concat('%',#{searchContant},'%') <if test="searchContant!=null and searchContant!=''">and hpm.projectName like concat('%',#{searchContant},'%')
@ -380,7 +414,7 @@
SELECT et.id,et.experimental_class_name as experimentalClassName,et.experimental_name as SELECT et.id,et.experimental_class_name as experimentalClassName,et.experimental_name as
experimentalName,et.project_id as projectId, experimentalName,et.project_id as projectId,
pm.projectName,pm.projectPermissions,et.creation_time as creationTime,(SELECT count(*) FROM pm.projectName,pm.projectPermissions,et.creation_time as creationTime,(SELECT count(*) FROM
hr_experimental_report her where et.project_id = her.projectId ) as number tms_project_record her where et.project_id = her.projectId and her.isdel = 0 ) as number
FROM tms_experimental_teaching et,hr_project_management pm FROM tms_experimental_teaching et,hr_project_management pm
WHERE user_id = #{userId} WHERE user_id = #{userId}
AND et.project_id = pm.projectId AND et.project_id = pm.projectId
@ -440,4 +474,52 @@
WHERE ru.trading_judgment_points_id = #{tradingJudgmentPointsId} WHERE ru.trading_judgment_points_id = #{tradingJudgmentPointsId}
and ru.trading_judgment_points_id = tjp.id and ru.trading_judgment_points_id = tjp.id
</select> </select>
<update id="deleteReportById">
UPDATE hr_project_management
SET hr_project_management.isdel = 1
WHERE hr_project_management.projectId = #{projectId}
</update>
<select id="getImitationAchievement" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT r.recordId,
schoolName,
userName,
workNumber,
score,
submitTime,
re.reportId
FROM tms_project_record r
INNER JOIN student s ON s.userId = r.userId
INNER JOIN hr_user_info u ON u.userId = r.userId
INNER JOIN school sch ON sch.schoolId = u.schoolId
inner join tms_experimental_report re on r.recordId = re.eventId
WHERE r.projectId = #{projectId}
AND r.isdel = 0
AND s.isdel = 0
AND u.isdel = 0
AND sch.isdel = 0
AND re.isdel = 0;
</select>
<select id="getTeachAchievement" resultType="com.msdw.tms.entity.vo.AchievementManagementVO">
SELECT r.recordId, schoolName,tet.experimental_class_name, userName, workNumber, score, submitTime, ter.reportId
from tms_project_record r
inner join student s on s.userId = r.userId
inner join hr_user_info u on u.userId = r.userId
inner join school sch on sch.schoolId = u.schoolId
inner join tms_experimental_report ter on r.recordId = ter.eventId
inner join tms_experimental_teaching tet on r.projectId = tet.project_id
WHERE
tet.id = #{id}
AND r.isdel = 0
AND s.isdel = 0
AND u.isdel = 0
AND sch.isdel = 0
AND ter.isdel = 0
AND tet.is_del = 0
</select>
</mapper> </mapper>

@ -13,7 +13,8 @@
surplus_time, surplus_time,
experiment_duration, experiment_duration,
experimental_name, experimental_name,
experimental_number, (select count(*)
from tms_project_record WHERE projectId = project_id) as experimental_number,
start_time, start_time,
stop_time, stop_time,
`status`, `status`,
@ -109,4 +110,11 @@
<select id="querySimulationPlayList" resultType="com.msdw.tms.entity.BroadcastEntity"> <select id="querySimulationPlayList" resultType="com.msdw.tms.entity.BroadcastEntity">
SELECT id,title,links,isdel FROM tms_broadcast SELECT id,title,links,isdel FROM tms_broadcast
</select> </select>
<update id="updateExperimentalNumber">
UPDATE tms_experimental_teaching
SET experimental_number = #{number}
WHERE
id = #{id}
</update>
</mapper> </mapper>

@ -10,7 +10,8 @@
experimental_name, experimental_name,
project_id, project_id,
project_name, project_name,
experimental_number, (select count(*)
from tms_project_record WHERE projectId = project_id) as experimental_number,
experiment_duration, experiment_duration,
type, type,
start_time, start_time,
@ -38,7 +39,7 @@
AND creation_time between #{exp.startTime} and #{exp.stopTime} AND creation_time between #{exp.startTime} and #{exp.stopTime}
</if> </if>
<if test="exp.searchContent!=null"> <if test="exp.searchContent!=null">
AND (project_name like concat('%',#{exp.searchContent},'%') or experimental_class_name like concat('%',#{exp.searchContent},'%') ) AND (experimental_name like concat('%',#{exp.searchContent},'%') or experimental_class_name like concat('%',#{exp.searchContent},'%') )
</if> </if>
<if test="exp.month!=null"> <if test="exp.month!=null">
AND DATE_SUB(CURDATE(), INTERVAL #{exp.month} month ) &lt;= date(creation_time) AND DATE_SUB(CURDATE(), INTERVAL #{exp.month} month ) &lt;= date(creation_time)

@ -52,13 +52,16 @@
r.startingTime, r.startingTime,
r.submitTime, r.submitTime,
r.timeSum, r.timeSum,
c.userId c.userId,
t.systemId
FROM hr_experiment_code c FROM hr_experiment_code c
INNER JOIN hr_project_management t ON t.projectId = c.projectId INNER JOIN hr_project_management t ON t.projectId = c.projectId
INNER JOIN tms_project_record r ON r.recordId = c.recordId INNER JOIN tms_project_record r ON r.recordId = c.recordId
WHERE c.userId = #{userId} WHERE c.userId = #{userId}
and r.isdel = 0 -- 教师端逻辑删除,学生端不做判断
-- and r.isdel = 0
and projectPermissions = #{projectPermissions} and projectPermissions = #{projectPermissions}
and t.systemId = #{systemId}
GROUP BY c.recordId desc GROUP BY c.recordId desc
</select> </select>
@ -80,7 +83,8 @@
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 tpr.isdel = #{pro.isdel} -- 教师端逻辑删除,学生端不做判断(下面这行删掉报错,用>=来表示不管0,1都让通过)
AND tpr.isdel >= #{pro.isdel}
AND tp.projectPermissions !=0 AND tp.projectPermissions !=0
AND AND
ter.eventId = tpr.recordId ter.eventId = tpr.recordId

@ -43,9 +43,8 @@
AND u.isdel = 0 AND u.isdel = 0
AND l.isdel = 0 AND l.isdel = 0
AND s.isdel = 0 AND s.isdel = 0
<if test="searchContent!=null">AND (u.userName LIKE CONCAT('%',#{searchContent},'%') OR s.workNumber LIKE CONCAT('%',#{searchContent},'%'))</if> <if test="searchContent!=null">AND (u.account LIKE CONCAT('%',#{searchContent},'%') OR u.userName LIKE CONCAT('%',#{searchContent},'%') OR s.workNumber LIKE CONCAT('%',#{searchContent},'%'))</if>
ORDER BY ORDER BY studentId DESC
lastLoginTime DESC,studentId DESC
</select> </select>
<select id="queryStudentIdNumber" resultType="java.lang.Integer"> <select id="queryStudentIdNumber" resultType="java.lang.Integer">

@ -215,7 +215,7 @@
</update> </update>
<select id="queryPersonalFileES" parameterType="com.msdw.tms.entity.UserPersonalFileEntity" <select id="queryPersonalFileES" parameterType="com.msdw.tms.entity.UserPersonalFileEntity"
resultType="hashMap"> resultType="com.msdw.tms.entity.vo.UserProsonalEntityVo">
SELECT SELECT
personalFileId, personalFileId,
schoolId, schoolId,
@ -233,7 +233,7 @@
userId = #{userId} userId = #{userId}
</select> </select>
<select id="queryPersonalInfo" parameterType="com.msdw.tms.entity.UserInfoEntity" <select id="queryPersonalInfo" parameterType="com.msdw.tms.entity.UserInfoEntity"
resultType="hashMap"> resultType="com.msdw.tms.entity.vo.UserProsonalEntityVo">
SELECT SELECT
u.userId, u.userId,
userName, userName,

Loading…
Cancel
Save