diff --git a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java index ac17681..92d05d4 100644 --- a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java +++ b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java @@ -54,7 +54,7 @@ public interface AchievementManagementApi { // R updateScore(@ApiParam(value = "recordid和score") ProjectRecordEntity entity); @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 = "班级实验报告列表查询") R queryEvaluationReport(@ApiParam(value = "搜索内容(学校名称/学生姓名)",required = false) String searchContant, @@ -78,4 +78,15 @@ public interface AchievementManagementApi { @ApiOperation(value = "发布成绩",notes = "发布成绩--修改教师签名") 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); + } diff --git a/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java b/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java index 44f3b3a..2214022 100644 --- a/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java +++ b/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java @@ -18,7 +18,7 @@ public interface ProjectRcordControllerApi { Integer recordState,String condition); @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 = "用户端教学实验记录") R getUserExperimentscore(Integer page,Integer size,Integer userid); diff --git a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java index 066e934..05a12ef 100644 --- a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java +++ b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java @@ -3,6 +3,7 @@ package com.msdw.tms.controller; import com.msdw.tms.api.AchievementManagementApi; import com.msdw.tms.common.utils.R; import com.msdw.tms.entity.*; +import com.msdw.tms.entity.vo.AchievementManagementVO; import com.msdw.tms.entity.vo.ResultsVo; import com.msdw.tms.service.AchievementManagementService; import com.msdw.tms.service.ProjectRecordService; @@ -11,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.List; /** @@ -193,8 +195,8 @@ public class AchievementManagementController implements AchievementManagementApi */ @Override @PostMapping("/deleteReport") - public R deleteReport(@RequestParam Integer reportId){ - R result = service.deleteReport(reportId); + public R deleteReport(@RequestParam Integer reportId,@RequestParam Integer recordId){ + R result = service.deleteReport(reportId,recordId); return result; } @@ -263,4 +265,36 @@ public class AchievementManagementController implements AchievementManagementApi service.updateSignatrue(entity); 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 result = service.getImitationAchievement(projectId); + return R.ok().put("data", result); + } + + /** + * 成绩管理:实验教学成绩管理 + */ + @Override + @GetMapping("/getTeachAchievement") + public R getTeachAchievement(@RequestParam(required = true) Integer id) { + List result = service.getTeachAchievement(id); + return R.ok().put("data", result); + } } diff --git a/src/main/java/com/msdw/tms/controller/ClassTeachingController.java b/src/main/java/com/msdw/tms/controller/ClassTeachingController.java index d6fe70b..9117b41 100644 --- a/src/main/java/com/msdw/tms/controller/ClassTeachingController.java +++ b/src/main/java/com/msdw/tms/controller/ClassTeachingController.java @@ -54,9 +54,16 @@ public class ClassTeachingController implements ClassTeachingApi { if (!StringUtils.isEmpty(condition)) { recordVo.setCondition(condition); } - if (!StringUtils.isEmpty(month)) { + // 设置固定时间(当自定义时间为空时) + if (!StringUtils.isEmpty(month) && StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime)) { recordVo.setMonth(month); - } else { + } + // 设置自定义时间 + if (!StringUtils.isEmpty(startTime) || !StringUtils.isEmpty(endTime)) { + recordVo.setStartTime(startTime); + recordVo.setEndTime(endTime); + } + /*else { recordVo.setMonth(null); if (!StringUtils.isEmpty(startTime)) { recordVo.setStartTime(startTime); @@ -64,7 +71,7 @@ public class ClassTeachingController implements ClassTeachingApi { if (!StringUtils.isEmpty(endTime)) { recordVo.setEndTime(endTime); } - } + }*/ recordVo.setSchoolId(schoolId); PageUtils page1 = classTeachingService.queryClassRecord(page, size, recordVo); return R.ok().put("page", page1); diff --git a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java index 0235cb4..9f1d364 100644 --- a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java +++ b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java @@ -63,8 +63,8 @@ public class ProjectRecordController implements ProjectRcordControllerApi { */ @Override @GetMapping("/user/record") - public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userId,@RequestParam Integer projectPermissions){ - PageUtils page1 = projectRecordService.queryPage(page,size,userId,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,systemId); return R.ok().put("data", page1); } diff --git a/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java b/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java index 08ff0f9..27286ba 100644 --- a/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java +++ b/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java @@ -47,7 +47,7 @@ public interface AchievementManagementDao extends BaseMapper queryEvaluationReport(Page tPage, String searchContant, Integer projectId); @@ -72,4 +72,11 @@ public interface AchievementManagementDao extends BaseMapper queryPythonTest(Integer eventId); void updateSignatrue(Integer isSignature,Integer signatureId,Integer reportId,String comment); + + void deleteReportById(Integer projectId); + + //虚拟仿真成绩管理查询 + List getImitationAchievement(Integer projectId); + + List getTeachAchievement(Integer id); } diff --git a/src/main/java/com/msdw/tms/dao/ClassTeachingDao.java b/src/main/java/com/msdw/tms/dao/ClassTeachingDao.java index d0c1029..5cbc435 100644 --- a/src/main/java/com/msdw/tms/dao/ClassTeachingDao.java +++ b/src/main/java/com/msdw/tms/dao/ClassTeachingDao.java @@ -23,4 +23,7 @@ public interface ClassTeachingDao { void updateSurplusTimeLe(ProjectRecordVo recordVo); void updateSurplusTimeGt(ProjectRecordVo recordVo); + + + int updateExperimentalNumber(Integer number, Integer id); } diff --git a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java index 4d4f96b..6cfa531 100644 --- a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java +++ b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java @@ -23,7 +23,7 @@ import java.util.List; @Mapper public interface ProjectRecordDao extends BaseMapper { - IPage getByUserRecord(Page page, @Param("userId") Integer userId, @Param("projectPermissions") Integer projectPermissions); + IPage getByUserRecord(Page page, @Param("userId") Integer userId, @Param("projectPermissions") Integer projectPermissions,@Param("systemId") Integer systemId); IPage getByUserExperimentRecord(Page page, @Param("pro") ProjectRecordEntity projectRecordEntity); diff --git a/src/main/java/com/msdw/tms/dao/UserDao.java b/src/main/java/com/msdw/tms/dao/UserDao.java index 20c28b6..876d757 100644 --- a/src/main/java/com/msdw/tms/dao/UserDao.java +++ b/src/main/java/com/msdw/tms/dao/UserDao.java @@ -41,7 +41,7 @@ public interface UserDao extends BaseMapper { List findPhoneSetTime(String phone, String checkCode,Integer types); - boolean saveCheckPhoneCode(CheckVo checkVo); +// boolean saveCheckPhoneCode(CheckVo checkVo); List queryPhone(CheckVo checkVo); } diff --git a/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java b/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java index 5155336..386b14b 100644 --- a/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java +++ b/src/main/java/com/msdw/tms/entity/resp/GetByUserRecordResp.java @@ -22,6 +22,15 @@ public class GetByUserRecordResp { private String submitTime; private Integer timeSum; private Integer userId; + private Integer systemId; + + public Integer getSystemId() { + return systemId; + } + + public void setSystemId(Integer systemId) { + this.systemId = systemId; + } public String getProjectName() { return projectName; diff --git a/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVO.java b/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVO.java index 91bc8bd..5c87f50 100644 --- a/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVO.java +++ b/src/main/java/com/msdw/tms/entity/vo/AchievementManagementVO.java @@ -32,7 +32,7 @@ public class AchievementManagementVO extends ExperimentalReportEntity { //提交时间 private String submitTime; -//=========================================================== 返回参数 + //=========================================================== 返回参数 //项目名称 private String projectName; @@ -46,7 +46,7 @@ public class AchievementManagementVO extends ExperimentalReportEntity { private String creationTime; //类型(1虚拟仿真,2教学实验) - private Integer type; + private Integer type; // private Integer projectPermissions; //创建时间 @@ -55,6 +55,8 @@ public class AchievementManagementVO extends ExperimentalReportEntity { //实验记录id(tms_experimental_report主键) private Integer recordId; + private Integer reportId; + //老师签名 存放路径 private String signatureUrl; //签名名称 @@ -72,7 +74,7 @@ public class AchievementManagementVO extends ExperimentalReportEntity { //平台id private Integer systemId; -//=========================================================== python实验数据 + //=========================================================== python实验数据 //判分点id private Integer codeId; //判分点-得分 diff --git a/src/main/java/com/msdw/tms/service/AchievementManagementService.java b/src/main/java/com/msdw/tms/service/AchievementManagementService.java index 761809e..b3a8ea7 100644 --- a/src/main/java/com/msdw/tms/service/AchievementManagementService.java +++ b/src/main/java/com/msdw/tms/service/AchievementManagementService.java @@ -6,9 +6,11 @@ import com.msdw.tms.entity.ExperimentalReportEntity; import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.ReportEntity; import com.msdw.tms.entity.ResultsEntity; +import com.msdw.tms.entity.vo.AchievementManagementVO; import com.msdw.tms.entity.vo.ResultsVo; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.List; public interface AchievementManagementService extends IService { @@ -30,7 +32,7 @@ public interface AchievementManagementService extends IService getImitationAchievement(Integer projectId); + + List getTeachAchievement(Integer id); } diff --git a/src/main/java/com/msdw/tms/service/ProjectRecordService.java b/src/main/java/com/msdw/tms/service/ProjectRecordService.java index 780ad3d..377cc13 100644 --- a/src/main/java/com/msdw/tms/service/ProjectRecordService.java +++ b/src/main/java/com/msdw/tms/service/ProjectRecordService.java @@ -17,7 +17,7 @@ import java.util.List; */ public interface ProjectRecordService extends IService { - 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); diff --git a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java index 97bd1e8..a51cf8c 100644 --- a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java @@ -28,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpServletResponse; import java.io.InputStream; import java.util.*; + @Slf4j @Service public class AchievementManagementServiceImpl extends ServiceImpl implements AchievementManagementService { @@ -58,39 +59,39 @@ public class AchievementManagementServiceImpl extends ServiceImpl score = baseMapper.getScore(userScoreVO); - obj.put("score",score); - obj.put("experimentalReportEntity",experimentalReportEntity1); + obj.put("score", score); + obj.put("experimentalReportEntity", experimentalReportEntity1); List tradingJudgmentPointsIds = baseMapper.queryTradingJudgmentPointsId(reportId); Integer size = tradingJudgmentPointsIds.size(); - for (int i = 0;i judgmentPointsRuleList = baseMapper.getUserAnswers(tradingJudgmentPointsId); - map.put("judgmentPointsRuleList"+i,judgmentPointsRuleList); + map.put("judgmentPointsRuleList" + i, judgmentPointsRuleList); } - obj.put("userAnswersList",map); - return R.ok().put("data",obj); + obj.put("userAnswersList", map); + return R.ok().put("data", obj); } @Override public R getTeacher(Integer projectId) { String name = baseMapper.getTeacher(projectId); - return R.ok().put("name",name); + return R.ok().put("name", name); } @Override - public List list(ResultsVo vo,Integer page,Integer size) { + public List list(ResultsVo vo, Integer page, Integer size) { List list = achievementManagementDao.list(vo); return list; } @Override - public List reportList(ResultsVo vo,Integer page,Integer size) { + public List reportList(ResultsVo vo, Integer page, Integer size) { List reportList = achievementManagementDao.reportList(vo); return reportList; } @Override - public List newList(ResultsVo vo,Integer page,Integer size) { + public List newList(ResultsVo vo, Integer page, Integer size) { List newList = achievementManagementDao.newList(vo); return newList; } @@ -152,36 +153,38 @@ public class AchievementManagementServiceImpl extends ServiceImpl data = achievementManagementDao.queryPythonTest(eventId); map.put("data", data); } report.setUserName(userName); - map.put("report",report); - map.put("record",record); - return R.ok().put("data",map); + map.put("report", report); + map.put("record", record); + return R.ok().put("data", map); } @Override @Transactional - public R deleteReport(Integer reportId) { - achievementManagementDao.deleteReport(reportId); + public R deleteReport(Integer reportId,Integer recordId) { + achievementManagementDao.deleteReport(reportId,recordId); return R.ok(); } @Override - public R queryEvaluationReport(String searchContant,Integer projectId,Integer page,Integer size) { - Page tPage = new Page<>(page,size); - IPage data = achievementManagementDao.queryEvaluationReport(tPage,searchContant,projectId); + public R queryEvaluationReport(String searchContant, Integer projectId, Integer page, Integer size) { + Page tPage = new Page<>(page, size); + IPage data = achievementManagementDao.queryEvaluationReport(tPage, searchContant, projectId); + + PageUtils result = new PageUtils(data); - return R.ok().put("data",result); + return R.ok().put("data", result); } @Override @@ -190,10 +193,10 @@ public class AchievementManagementServiceImpl extends ServiceImpl list = new ArrayList<>(); String[] split = ids.split(","); - for (int i = 0;i achievement = achievementManagementDao.queryAchievement(list); + List achievement = achievementManagementDao.queryAchievement(list); //2.加载模板流数据 ClassPathResource resource = new ClassPathResource("excel-template/川大成绩管理实验记录导出模板.xlsx"); @@ -205,7 +208,7 @@ public class AchievementManagementServiceImpl extends ServiceImpl fictitious; @@ -213,14 +216,16 @@ public class AchievementManagementServiceImpl extends ServiceImpl vo = new ArrayList<>(); List educationResult = achievementManagementDao.countEducationProjectId();//获取教学实验的主键id List fictitiousResult = achievementManagementDao.countFictitiousProjectId();//获取教学实验的主键id - if (projectPermissions==null){projectPermissions=-9999;} - if (projectPermissions==0){//只查询练习项目 + if (projectPermissions == null) { + projectPermissions = -9999; + } + if (projectPermissions == 0) {//只查询练习项目 fictitious = achievementManagementDao.queryFictitiousRecord(systemId, searchContant, startingtime, endtime, month, fictitiousResult); vo = fictitious; - }else if (projectPermissions==1){//只查询考核项目 + } else if (projectPermissions == 1) {//只查询考核项目 education = achievementManagementDao.queryEducationRecord(systemId, searchContant, startingtime, endtime, month, educationResult); vo = education; - }else {//查询练习+考核项目 + } else {//查询练习+考核项目 if (educationResult.size() == 0) { if (fictitiousResult.size() > 0) { fictitious = achievementManagementDao.queryFictitiousRecord(systemId, searchContant, startingtime, endtime, month, fictitiousResult); @@ -245,10 +250,10 @@ public class AchievementManagementServiceImpl extends ServiceImpl getImitationAchievement(Integer projectId) { + List list = achievementManagementDao.getImitationAchievement(projectId); + + return list; + } + + @Override + public List getTeachAchievement(Integer id) { + return achievementManagementDao.getTeachAchievement(id); + } + } diff --git a/src/main/java/com/msdw/tms/service/impl/ClassTeachingServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ClassTeachingServiceImpl.java index db7039c..096dc12 100644 --- a/src/main/java/com/msdw/tms/service/impl/ClassTeachingServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ClassTeachingServiceImpl.java @@ -2,24 +2,34 @@ package com.msdw.tms.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; 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.PageUtils; import com.msdw.tms.dao.ClassTeachingDao; +import com.msdw.tms.dao.ExperimentalTeachingDao; import com.msdw.tms.entity.BroadcastEntity; import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.ProjectRecordEntity; +import com.msdw.tms.entity.vo.ExperimentalTeachingVO; import com.msdw.tms.entity.vo.ProjectRecordVo; import com.msdw.tms.service.ClassTeachingService; import org.apache.poi.ss.formula.functions.T; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.concurrent.locks.Lock; + @Service -public class ClassTeachingServiceImpl implements ClassTeachingService { +public class ClassTeachingServiceImpl extends ServiceImpl implements ClassTeachingService { @Autowired private ClassTeachingDao classMapper; + + @Autowired + private ClassTeachingDao classTeachingDao; + @Override public ExperimentalTeachingEntity queryInvitationcode(ExperimentalTeachingEntity experimentEntity) { ExperimentalTeachingEntity ex = classMapper.queryInvitationCode(experimentEntity); @@ -44,8 +54,35 @@ public class ClassTeachingServiceImpl implements ClassTeachingService { this.classMapper.updateSurplusTimeUp(recordVo);//倒计时:设定距离实验开始的剩余时间 this.classMapper.updateSurplusTimeLe(recordVo); this.classMapper.updateSurplusTimeGt(recordVo); - IPage schoolRecord = this.classMapper.getByClassRecord(page1, recordVo); - PageUtils pageUtils = new PageUtils(schoolRecord); +// IPage schoolRecord = this.classMapper.getByClassRecord(page1, recordVo); +// 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 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; } diff --git a/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java index 1265737..0e6843f 100644 --- a/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ExperimentalTeachingServiceImpl.java @@ -36,6 +36,16 @@ public class ExperimentalTeachingServiceImpl extends ServiceImpl page1 = new Page<>(page, size); ExperimentalTeachingDao userDao = this.getBaseMapper(); IPage 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; } 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 8343694..255a4ba 100644 --- a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java @@ -38,7 +38,7 @@ public class ProjectRecordServiceImpl extends ServiceImpl page1 = new Page<>(page, size); - IPage projectRecordVos = this.baseMapper.getByUserRecord(page1, userId, projectPermissions); + IPage projectRecordVos = this.baseMapper.getByUserRecord(page1, userId, projectPermissions,systemId); PageUtils questionsPage = new PageUtils(projectRecordVos); @@ -75,10 +75,11 @@ public class ProjectRecordServiceImpl extends ServiceImpl - UPDATE tms_project_record tpr,hr_experimental_report tcr - SET tpr.isdel = 1, tcr.isdel = 1 - WHERE tpr.recordId = tcr.eventId AND tcr.reportId = #{reportId} + UPDATE tms_project_record tpr,tms_experimental_report ter + SET tpr.isdel = 1, ter.isdel = 1 + WHERE tpr.recordId = #{recordId} AND ter.reportId = #{reportId} UPDATE tms_experimental_report @@ -132,8 +132,9 @@ LEFT JOIN hr_project_management AS hpm ON hpm.projectId = tpr.projectId WHERE reportId = #{reportId} - + 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 + + AND (sch.schoolName LIKE CONCAT('%',#{searchContant},'%') + OR u.userName LIKE CONCAT('%',#{searchContant},'%') ) + + GROUP BY r.reportId DESC + 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 - FROM hr_project_management hpm WHERE systemId = #{systemId} + tms_project_record her where hpm.projectId = her.projectId and her.isdel = 0 ) as number + FROM hr_project_management hpm + WHERE systemId = #{systemId} AND hpm.isdel = 0 - AND hpm.projectPermissions = + AND hpm.projectPer missions = #{projectPermissions} and hpm.projectName like concat('%',#{searchContant},'%') @@ -380,7 +414,7 @@ SELECT et.id,et.experimental_class_name as experimentalClassName,et.experimental_name as experimentalName,et.project_id as projectId, 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 WHERE user_id = #{userId} AND et.project_id = pm.projectId @@ -440,4 +474,52 @@ WHERE ru.trading_judgment_points_id = #{tradingJudgmentPointsId} and ru.trading_judgment_points_id = tjp.id + + + + UPDATE hr_project_management + SET hr_project_management.isdel = 1 + WHERE hr_project_management.projectId = #{projectId} + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/ClassTeachingDao.xml b/src/main/resources/mapper/tms/ClassTeachingDao.xml index 17756c1..3265d03 100644 --- a/src/main/resources/mapper/tms/ClassTeachingDao.xml +++ b/src/main/resources/mapper/tms/ClassTeachingDao.xml @@ -13,7 +13,8 @@ surplus_time, experiment_duration, experimental_name, - experimental_number, + (select count(*) + from tms_project_record WHERE projectId = project_id) as experimental_number, start_time, stop_time, `status`, @@ -109,4 +110,11 @@ + + + UPDATE tms_experimental_teaching + SET experimental_number = #{number} + WHERE + id = #{id} + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml b/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml index 3891647..84d123d 100644 --- a/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml +++ b/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml @@ -10,7 +10,8 @@ experimental_name, project_id, project_name, - experimental_number, + (select count(*) + from tms_project_record WHERE projectId = project_id) as experimental_number, experiment_duration, type, start_time, @@ -38,7 +39,7 @@ AND creation_time between #{exp.startTime} and #{exp.stopTime} - 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},'%') ) AND DATE_SUB(CURDATE(), INTERVAL #{exp.month} month ) <= date(creation_time) diff --git a/src/main/resources/mapper/tms/ProjectRecordDao.xml b/src/main/resources/mapper/tms/ProjectRecordDao.xml index 5b67e32..b45954e 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -52,13 +52,16 @@ r.startingTime, r.submitTime, r.timeSum, - c.userId + c.userId, + t.systemId FROM hr_experiment_code c INNER JOIN hr_project_management t ON t.projectId = c.projectId INNER JOIN tms_project_record r ON r.recordId = c.recordId WHERE c.userId = #{userId} - and r.isdel = 0 +-- 教师端逻辑删除,学生端不做判断 +-- and r.isdel = 0 and projectPermissions = #{projectPermissions} + and t.systemId = #{systemId} GROUP BY c.recordId desc @@ -80,7 +83,8 @@ LEFT JOIN tms_experimental_teaching tet ON tet.project_id = tpr.projectId LEFT JOIN tms_experimental_report ter ON ter.projectId = tet.id WHERE tpr.userId = #{pro.userid} - AND tpr.isdel = #{pro.isdel} +-- 教师端逻辑删除,学生端不做判断(下面这行删掉报错,用>=来表示不管0,1都让通过) + AND tpr.isdel >= #{pro.isdel} AND tp.projectPermissions !=0 AND ter.eventId = tpr.recordId diff --git a/src/main/resources/mapper/tms/StudentDao.xml b/src/main/resources/mapper/tms/StudentDao.xml index 9d14baa..a91bcac 100644 --- a/src/main/resources/mapper/tms/StudentDao.xml +++ b/src/main/resources/mapper/tms/StudentDao.xml @@ -43,9 +43,8 @@ AND u.isdel = 0 AND l.isdel = 0 AND s.isdel = 0 - AND (u.userName LIKE CONCAT('%',#{searchContent},'%') OR s.workNumber LIKE CONCAT('%',#{searchContent},'%')) - ORDER BY - lastLoginTime DESC,studentId DESC + AND (u.account LIKE CONCAT('%',#{searchContent},'%') OR u.userName LIKE CONCAT('%',#{searchContent},'%') OR s.workNumber LIKE CONCAT('%',#{searchContent},'%')) + ORDER BY studentId DESC + resultType="com.msdw.tms.entity.vo.UserProsonalEntityVo"> SELECT personalFileId, schoolId, @@ -233,7 +233,7 @@ userId = #{userId}