diff --git a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java index 3a43f0e..92d05d4 100644 --- a/src/main/java/com/msdw/tms/api/AchievementManagementApi.java +++ b/src/main/java/com/msdw/tms/api/AchievementManagementApi.java @@ -85,4 +85,8 @@ public interface AchievementManagementApi { @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/controller/AchievementManagementController.java b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java index 1d4e48f..05a12ef 100644 --- a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java +++ b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java @@ -287,4 +287,14 @@ public class AchievementManagementController implements AchievementManagementApi 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/StudentController.java b/src/main/java/com/msdw/tms/controller/StudentController.java index 148f6c7..614c4b9 100644 --- a/src/main/java/com/msdw/tms/controller/StudentController.java +++ b/src/main/java/com/msdw/tms/controller/StudentController.java @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; import java.io.IOException; import java.util.HashMap; import java.util.List; @@ -46,7 +47,7 @@ public class StudentController implements StudentControllerApi{ @Transactional @Override @PostMapping("/addStudent") - public R addStudent(@RequestBody StudentVo studentVo){ + public R addStudent(@RequestBody @Valid StudentVo studentVo){ studentVo.setSchoolId(ConstantUtils.Keda_schoolId); String account = studentVo.getAccount(); String phone = studentVo.getPhone(); @@ -130,7 +131,7 @@ public class StudentController implements StudentControllerApi{ @Override @Transactional @PutMapping("/updateStudent") - public R updateStudent(@RequestBody StudentVo studentVo) { + public R updateStudent(@RequestBody @Valid StudentVo studentVo) { studentVo.setSchoolId(ConstantUtils.Keda_schoolId);//设定学校id Integer studentId = studentVo.getStudentId(); diff --git a/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java b/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java index 959ce8a..27286ba 100644 --- a/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java +++ b/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java @@ -77,4 +77,6 @@ public interface AchievementManagementDao extends BaseMapper getImitationAchievement(Integer projectId); + + List getTeachAchievement(Integer id); } diff --git a/src/main/java/com/msdw/tms/entity/vo/StudentVo.java b/src/main/java/com/msdw/tms/entity/vo/StudentVo.java index 4c477a3..648238d 100644 --- a/src/main/java/com/msdw/tms/entity/vo/StudentVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/StudentVo.java @@ -5,6 +5,7 @@ import com.msdw.tms.entity.UserInfoEntity; import lombok.Data; import lombok.experimental.Accessors; +import javax.validation.constraints.Pattern; import java.util.List; /** @@ -19,6 +20,7 @@ public class StudentVo extends StudentEntity { //用户姓名 private String userName; //用户账号 + @Pattern(regexp = "^[0-9a-zA-Z]*$",message = "账号只能为数字或字母!") private String account; //密码 private String password; diff --git a/src/main/java/com/msdw/tms/service/AchievementManagementService.java b/src/main/java/com/msdw/tms/service/AchievementManagementService.java index 2aad068..b3a8ea7 100644 --- a/src/main/java/com/msdw/tms/service/AchievementManagementService.java +++ b/src/main/java/com/msdw/tms/service/AchievementManagementService.java @@ -47,4 +47,6 @@ public interface AchievementManagementService extends IService getImitationAchievement(Integer projectId); + + List getTeachAchievement(Integer id); } 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 5b51925..a51cf8c 100644 --- a/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java @@ -299,4 +299,9 @@ public class AchievementManagementServiceImpl extends ServiceImpl 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 fbf1d69..096dc12 100644 --- a/src/main/java/com/msdw/tms/service/impl/ClassTeachingServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ClassTeachingServiceImpl.java @@ -19,6 +19,8 @@ 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 extends ServiceImpl implements ClassTeachingService { @@ -55,7 +57,19 @@ public class ClassTeachingServiceImpl extends ServiceImpl schoolRecord = this.classMapper.getByClassRecord(page1, recordVo); // PageUtils pageUtils = new PageUtils(schoolRecord); ExperimentalTeachingVO vo = new ExperimentalTeachingVO(); - BeanUtils.copyProperties(recordVo,vo); + // 状态 + 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++) { diff --git a/src/main/resources/mapper/tms/AchievementManagementDao.xml b/src/main/resources/mapper/tms/AchievementManagementDao.xml index e2740a6..7b35c6a 100644 --- a/src/main/resources/mapper/tms/AchievementManagementDao.xml +++ b/src/main/resources/mapper/tms/AchievementManagementDao.xml @@ -82,10 +82,9 @@ - UPDATE tms_project_record tpr,hr_experimental_report tcr - SET tpr.isdel = 1, tcr.isdel = 1 - WHERE tpr.recordId = #{recordId} - 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 @@ -504,4 +503,23 @@ AND re.isdel = 0; + + \ 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 05c0745..84d123d 100644 --- a/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml +++ b/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml @@ -39,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 07900c6..bb906fe 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -58,7 +58,8 @@ 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 @@ -70,7 +71,7 @@ ter.reportId, tpr.recordId, tpr.projectId, - projectName, + tp.projectName, score, timeSum, startingTime as startTime, @@ -82,7 +83,7 @@ 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} + 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 349554a..a91bcac 100644 --- a/src/main/resources/mapper/tms/StudentDao.xml +++ b/src/main/resources/mapper/tms/StudentDao.xml @@ -44,8 +44,7 @@ AND l.isdel = 0 AND s.isdel = 0 AND (u.account LIKE CONCAT('%',#{searchContent},'%') OR u.userName LIKE CONCAT('%',#{searchContent},'%') OR s.workNumber LIKE CONCAT('%',#{searchContent},'%')) - ORDER BY - lastLoginTime DESC,studentId DESC + ORDER BY studentId DESC