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/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 83b5ab9..08ff0f9 100644 --- a/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java +++ b/src/main/java/com/msdw/tms/dao/AchievementManagementDao.java @@ -16,7 +16,6 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.poi.ss.formula.functions.T; -import java.util.ArrayList; import java.util.List; @Mapper @@ -48,7 +47,7 @@ public interface AchievementManagementDao extends BaseMapper queryEvaluationReport(Page tPage, String searchContant, Integer projectId); @@ -73,7 +72,4 @@ public interface AchievementManagementDao extends BaseMapper queryPythonTest(Integer eventId); void updateSignatrue(Integer isSignature,Integer signatureId,Integer reportId,String comment); - - - void deleteReportById(Integer projectId); } 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/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 1d56e21..9c0a6a9 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,20 +153,20 @@ 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 @@ -176,12 +177,14 @@ public class AchievementManagementServiceImpl extends ServiceImpl 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 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); diff --git a/src/main/resources/mapper/tms/AchievementManagementDao.xml b/src/main/resources/mapper/tms/AchievementManagementDao.xml index ea76066..44aeaa4 100644 --- a/src/main/resources/mapper/tms/AchievementManagementDao.xml +++ b/src/main/resources/mapper/tms/AchievementManagementDao.xml @@ -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 + diff --git a/src/main/resources/mapper/tms/StudentDao.xml b/src/main/resources/mapper/tms/StudentDao.xml index 9d14baa..349554a 100644 --- a/src/main/resources/mapper/tms/StudentDao.xml +++ b/src/main/resources/mapper/tms/StudentDao.xml @@ -43,7 +43,7 @@ AND u.isdel = 0 AND l.isdel = 0 AND s.isdel = 0 - AND (u.userName LIKE CONCAT('%',#{searchContent},'%') OR s.workNumber LIKE CONCAT('%',#{searchContent},'%')) + AND (u.account LIKE CONCAT('%',#{searchContent},'%') OR u.userName LIKE CONCAT('%',#{searchContent},'%') OR s.workNumber LIKE CONCAT('%',#{searchContent},'%')) ORDER BY lastLoginTime DESC,studentId DESC diff --git a/src/main/resources/mapper/tms/UserInfoDao.xml b/src/main/resources/mapper/tms/UserInfoDao.xml index fa949fc..5ec1bd1 100644 --- a/src/main/resources/mapper/tms/UserInfoDao.xml +++ b/src/main/resources/mapper/tms/UserInfoDao.xml @@ -215,7 +215,7 @@