From d85a6a57890eaa207c7d30deccfaecb1bd8d72f3 Mon Sep 17 00:00:00 2001 From: "jiakun.lin" Date: Thu, 4 Mar 2021 11:16:21 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=95=99=E5=AD=A6=E5=AE=9E=E9=AA=8C?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E7=AE=A1=E7=90=86=E6=8E=A5=E5=8F=A3=E6=8D=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E6=95=99=E5=B8=88=E7=AB=AF=E6=88=90?= =?UTF-8?q?=E7=BB=A9=E7=AE=A1=E7=90=86=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=20=E5=AD=A6=E7=94=9F=E7=AB=AF=E6=9B=B4=E6=94=B9=E5=AE=9E?= =?UTF-8?q?=E9=AA=8C=E8=AE=B0=E5=BD=95=E4=B8=8D=E5=88=A4=E6=96=ADisdel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tms/api/AchievementManagementApi.java | 4 +++ .../AchievementManagementController.java | 10 +++++++ .../tms/dao/AchievementManagementDao.java | 2 ++ .../service/AchievementManagementService.java | 2 ++ .../AchievementManagementServiceImpl.java | 5 ++++ .../mapper/tms/AchievementManagementDao.xml | 26 ++++++++++++++++--- .../resources/mapper/tms/ProjectRecordDao.xml | 6 +++-- 7 files changed, 49 insertions(+), 6 deletions(-) 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/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/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/resources/mapper/tms/AchievementManagementDao.xml b/src/main/resources/mapper/tms/AchievementManagementDao.xml index b629038..669e2a1 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/ProjectRecordDao.xml b/src/main/resources/mapper/tms/ProjectRecordDao.xml index 07900c6..b45954e 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 @@ -82,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 From 72ddb4a59bd87dd1dfb9b76db9c9d7a886981896 Mon Sep 17 00:00:00 2001 From: river <1376754470@qq.com> Date: Thu, 4 Mar 2021 11:45:03 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=9E=E9=AA=8C?= =?UTF-8?q?=E6=95=99=E5=AD=A6=E5=88=97=E8=A1=A8=E6=97=B6=E9=97=B4=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E5=92=8C=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tms/controller/ClassTeachingController.java | 13 ++++++++++--- .../service/impl/ClassTeachingServiceImpl.java | 16 +++++++++++++++- .../mapper/tms/ExperimentalTeachingDao.xml | 2 +- 3 files changed, 26 insertions(+), 5 deletions(-) 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/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/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) From e62fb12487183ffcc910d12484b9fc78c9b9b69b Mon Sep 17 00:00:00 2001 From: "zhiyong.ning" <354350178@qq.com> Date: Thu, 4 Mar 2021 11:48:49 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mapper/tms/StudentDao.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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