diff --git a/src/main/java/com/msdw/tms/controller/UserController.java b/src/main/java/com/msdw/tms/controller/UserController.java index 8e5945b..3f79133 100644 --- a/src/main/java/com/msdw/tms/controller/UserController.java +++ b/src/main/java/com/msdw/tms/controller/UserController.java @@ -79,7 +79,12 @@ public class UserController implements UserControllerApi { public R update(@RequestBody UserProsonalEntityVo vo){ List entityList = vo.getPersonalFileEntities(); UserInfoEntity userInfo = vo.getUserInfoEntity(); - + Integer userId = userInfo.getUserId(); + String password = userInfo.getPassword(); + String userPassword = userInfoService.queryPasword(userId); + if (userPassword.equals(password)==true){ + return R.error(400,"false,the password is the same!!!"); + }else{ userInfoService.updateUserInfoById(userInfo); // userInfoService.updateById(userInfo); for (int i = 0;i { IPage getByUserExperimentRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity); - List getByUserRecordImport(ProjectRecordEntity projectRecordEntity); + List getByUserRecordImport(ProjectRecordEntity projectRecordEntity); ProjectRecordVo getByUserScore(@Param("userid") Integer userId,@Param("isdel") Integer isdel); diff --git a/src/main/java/com/msdw/tms/dao/UserInfoDao.java b/src/main/java/com/msdw/tms/dao/UserInfoDao.java index d7be78b..6ed791c 100644 --- a/src/main/java/com/msdw/tms/dao/UserInfoDao.java +++ b/src/main/java/com/msdw/tms/dao/UserInfoDao.java @@ -13,4 +13,6 @@ public interface UserInfoDao extends BaseMapper { Boolean add(UserInfoEntity userEntity); void userInfupdateUserInfoById(UserInfoEntity entity); + + String queryUserPassword(Integer userid); } diff --git a/src/main/java/com/msdw/tms/entity/request/ProjectRecordImportRequest.java b/src/main/java/com/msdw/tms/entity/request/ProjectRecordImportRequest.java index b250786..eef5c6f 100644 --- a/src/main/java/com/msdw/tms/entity/request/ProjectRecordImportRequest.java +++ b/src/main/java/com/msdw/tms/entity/request/ProjectRecordImportRequest.java @@ -14,10 +14,16 @@ public class ProjectRecordImportRequest { /** * 状态 */ +// @ExcelAttribute(sort = 1) +// private String userRecordstate; +// +// private Integer recordstate; + /** + * 实验班级名称 + */ @ExcelAttribute(sort = 1) - private String userRecordstate; + private String experimental_class_name; - private Integer recordstate; /** * 得分 */ @@ -38,4 +44,10 @@ public class ProjectRecordImportRequest { */ @ExcelAttribute(sort = 5) private String endTime; + + /** + * 结束时间 + */ + @ExcelAttribute(sort = 6) + private String abc; } diff --git a/src/main/java/com/msdw/tms/entity/vo/ProjectRecordExportVo.java b/src/main/java/com/msdw/tms/entity/vo/ProjectRecordExportVo.java new file mode 100644 index 0000000..080b776 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/ProjectRecordExportVo.java @@ -0,0 +1,91 @@ +package com.msdw.tms.entity.vo; + +import com.msdw.tms.entity.ExperimentalTeachingEntity; +import com.msdw.tms.entity.ProjectRecordEntity; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.List; + +@Data +@Accessors(chain = true) +public class ProjectRecordExportVo extends ProjectRecordEntity implements Serializable { + + /** + * 实验项目名称 + */ + private String projectName; + /** + * 学校名称 + */ + private String SchoolName; + /** + * 用户名称 + */ + private String userName; + /** + * 实验次数 + */ + private Integer experimentNumber; + /** + * 总耗时 + */ + private Integer totalTime; + /** + * 平均分 + */ + private double avgScore; + /** + * 几个月 + */ + private Integer month; + /** + * 查询条件 + */ + private String condition; + /** + * 开始时间 + */ + private String startTime; + /** + * 结束时间 + */ + private String endTime; + /** + * 完成数量 + */ + private Integer complete; + /** + * 待评分 + */ + private Integer tobescored; + /** 记录状态(0 未修改,1 已修改)*/ + private Integer recordState; +// =====================================记录实验项目信息 + /** + * 实验状态(1待开始 2进行中 3已结束) + */ + private Integer status; + /** + * 是否启用邀请码 + */ + private Integer isCode; + /** + * 绑定用户id + */ + private Integer userId; + /** + * 实验班级名 + */ + private String experimentalClassName; + + /** + * 封装多个项目id + */ + private List projectIds; + /** + * 实验班级名称 + */ + private String experimental_class_name; +} diff --git a/src/main/java/com/msdw/tms/service/UserInfoService.java b/src/main/java/com/msdw/tms/service/UserInfoService.java index d8f4acd..2bacae2 100644 --- a/src/main/java/com/msdw/tms/service/UserInfoService.java +++ b/src/main/java/com/msdw/tms/service/UserInfoService.java @@ -14,4 +14,6 @@ public interface UserInfoService extends IService { R add(UserInfoEntity userInfoEntity); void updateUserInfoById(UserInfoEntity entity); + + String queryPasword(Integer userId); } diff --git a/src/main/java/com/msdw/tms/service/impl/EvaluationRecordServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/EvaluationRecordServiceImpl.java index bb14d78..c0283c5 100644 --- a/src/main/java/com/msdw/tms/service/impl/EvaluationRecordServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/EvaluationRecordServiceImpl.java @@ -187,8 +187,10 @@ public class EvaluationRecordServiceImpl extends ServiceImpl submitCurrentQuestionFuture = CompletableFuture.runAsync(() - -> submitCurrentQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer), executor); +// CompletableFuture submitCurrentQuestionFuture = CompletableFuture.runAsync(() +// -> submitCurrentQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer), executor); +// 2020.09.30 清除上面异步操作,需先提交并统计最后一题的结果 + submitCurrentQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer); //修改提交时间和测评记录状态 CompletableFuture updateEvaluationFuture = CompletableFuture.runAsync(() -> { @@ -207,7 +209,9 @@ public class EvaluationRecordServiceImpl extends ServiceImpl Constant.PASSING_SCORE ? Constant.EVALUATIONN_PASSED : Constant.EVALUATIONN_NOT_PASSED); +// submitVO.setIsPassed(sumScore > Constant.PASSING_SCORE ? Constant.EVALUATIONN_PASSED : Constant.EVALUATIONN_NOT_PASSED); + //成绩大于等于60分通过 + submitVO.setIsPassed(sumScore >= Constant.PASSING_SCORE ? Constant.EVALUATIONN_PASSED : Constant.EVALUATIONN_NOT_PASSED); }, executor); CompletableFuture getByIdFuture = CompletableFuture.supplyAsync(() -> { @@ -232,8 +236,9 @@ public class EvaluationRecordServiceImpl extends ServiceImpl projectRecordVos = this.baseMapper.getByUserRecordImport(projectRecord); + List projectRecordVos = this.baseMapper.getByUserRecordImport(projectRecord); List importRequests = projectRecordVos.stream().map(project -> { ProjectRecordImportRequest request = new ProjectRecordImportRequest(); BeanUtils.copyProperties(project, request); - request.setUserRecordstate(project.getRecordstate().equals(1) ? "已完成":"待评分"); +// request.setUserRecordstate(project.getRecordstate().equals(1) ? "已完成":"待评分"); return request; }).collect(Collectors.toList()); diff --git a/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java index 5b39367..e0c60c3 100644 --- a/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java @@ -52,4 +52,10 @@ public R add(UserInfoEntity userInfoEntity) { public void updateUserInfoById(UserInfoEntity entity){ userInfoDao.userInfupdateUserInfoById(entity); } + + @Override + public String queryPasword(Integer userId){ + String s = userInfoDao.queryUserPassword(userId); + return s; + } } diff --git a/src/main/resources/excel-template/实验报告导出模板.xlsx b/src/main/resources/excel-template/实验报告导出模板.xlsx index 03a2749..6ef2410 100644 Binary files a/src/main/resources/excel-template/实验报告导出模板.xlsx and b/src/main/resources/excel-template/实验报告导出模板.xlsx differ diff --git a/src/main/resources/mapper/tms/ClassTeachingDao.xml b/src/main/resources/mapper/tms/ClassTeachingDao.xml index b88ddf8..783223b 100644 --- a/src/main/resources/mapper/tms/ClassTeachingDao.xml +++ b/src/main/resources/mapper/tms/ClassTeachingDao.xml @@ -25,13 +25,42 @@ WHERE is_del=0 AND - start_time >='2020-01-01 00:00:00' - and `status` = #{cla.status} + type!=1 + AND + `status`!= 1 + + and `status` = #{cla.status} and ( project_name like concat('%',#{cla.condition},'%') or experimental_class_name like concat('%',#{cla.condition},'%') ) and stop_time between #{cla.endTime} and #{cla.startTime} and DATE_SUB(CURDATE(), INTERVAL #{cla.month} month ) <= date(creation_time) ORDER BY creation_time DESC + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE tms_experimental_teaching diff --git a/src/main/resources/mapper/tms/ProjectRecordDao.xml b/src/main/resources/mapper/tms/ProjectRecordDao.xml index 685f02c..03d7d16 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -56,7 +56,7 @@ tpr.isdel = #{pro.isdel} - SELECT tpr.projectId, projectName, @@ -64,14 +64,18 @@ timeSum, startingTime as startTime, endTime, - recordState + recordState, + tet.experimental_class_name FROM tms_project_record tpr LEFT JOIN tms_project tp ON tpr.projectId = tp.projectId + LEFT JOIN tms_experimental_teaching tet ON tpr.projectId = tet.project_id WHERE tpr.userId = #{userid} AND tpr.isdel = #{isdel} + AND + tpr.projectId = tet.project_id diff --git a/src/main/resources/mapper/tms/UserInfoDao.xml b/src/main/resources/mapper/tms/UserInfoDao.xml index 2361f75..2f8a991 100644 --- a/src/main/resources/mapper/tms/UserInfoDao.xml +++ b/src/main/resources/mapper/tms/UserInfoDao.xml @@ -48,8 +48,15 @@ schoolId = #{schoolId}, + + phone #{phone} + > WHERE userId = #{userId}; + + \ No newline at end of file