diff --git a/src/main/java/com/msdw/tms/api/ClassTeachingApi.java b/src/main/java/com/msdw/tms/api/ClassTeachingApi.java index 435b437..4efd927 100644 --- a/src/main/java/com/msdw/tms/api/ClassTeachingApi.java +++ b/src/main/java/com/msdw/tms/api/ClassTeachingApi.java @@ -3,9 +3,12 @@ package com.msdw.tms.api; import com.msdw.tms.common.utils.R; import com.msdw.tms.entity.ExperimentalReportEntity; import com.msdw.tms.entity.ExperimentalTeachingEntity; +import com.msdw.tms.entity.vo.ExperimentalReportVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; @Api(value = "用户端班级实验", tags = "用户端班级实验信息") public interface ClassTeachingApi { @@ -23,8 +26,14 @@ public interface ClassTeachingApi { R querySimulationPlayList(Integer page,Integer size); @ApiOperation(value = "校验是否需要邀请码",notes = "校验是否需要邀请码") - R check(Integer userId,Integer projectId); + R check(@ApiParam(value = "用户id",required = true) Integer userId,@ApiParam(value = "项目id",required = true) Integer projectId); - @ApiOperation(value = "查看实验报告",notes = "查看实验报告") - R queryExperimentalReport(ExperimentalReportEntity entity); + @ApiOperation(value = "查看教学实验报告",notes = "查看教学实验报告") + R queryExperimentalReport(@ApiParam(value = "学生id",required = true) Integer studentId, + @ApiParam(value = "项目id",required = true) Integer projectId, + @ApiParam(value = "实验记录主键",required = true) Integer recordId, + @ApiParam(value = "实验报告主键",required = true) Integer reportId); + + @ApiOperation(value = "查看虚拟实验报告",notes = "查看虚拟实验报告") + R queryVirtualReport(@ApiParam(value = "实验记录主键",required = true) Integer recordId); } diff --git a/src/main/java/com/msdw/tms/api/QuestionsControllerApi.java b/src/main/java/com/msdw/tms/api/QuestionsControllerApi.java index 2d67884..452ea20 100644 --- a/src/main/java/com/msdw/tms/api/QuestionsControllerApi.java +++ b/src/main/java/com/msdw/tms/api/QuestionsControllerApi.java @@ -4,7 +4,6 @@ import com.msdw.tms.common.utils.R; import com.msdw.tms.entity.request.QuestionsAddRequest; import com.msdw.tms.entity.request.QuestionsQueryRequest; import com.msdw.tms.entity.request.QuestionsUpdateRequest; -import com.msdw.tms.entity.vo.RulesVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -52,12 +51,8 @@ public interface QuestionsControllerApi { /** * 是否禁用试题 */ -// @ApiOperation(value = "是否禁用试题", notes = "是否禁用试题") -// R isNable(RulesVo rulesVo); @ApiOperation(value = "是否禁用试题", notes = "是否禁用试题") R isNable(@ApiParam(name = "id", value = "试题主键", required = true) List idList); -// 2020.09.18 -// R isNable(@ApiParam(name = "id", value = "试题主键", required = true) Integer id); /** * 删除 diff --git a/src/main/java/com/msdw/tms/api/StudentControllerApi.java b/src/main/java/com/msdw/tms/api/StudentControllerApi.java index 9efac77..8289ad3 100644 --- a/src/main/java/com/msdw/tms/api/StudentControllerApi.java +++ b/src/main/java/com/msdw/tms/api/StudentControllerApi.java @@ -41,4 +41,7 @@ public interface StudentControllerApi { @ApiOperation(value = "导入学生失败原因导出",notes = "导入学生失败原因导出") public void exportFailureRecord(HttpServletResponse response, String token) throws Exception; + + @ApiOperation(value = "查询账号信息",notes = "查询账号信息") + public R queryAccount(String account,Integer schoolId); } diff --git a/src/main/java/com/msdw/tms/api/SystemSetttingApi.java b/src/main/java/com/msdw/tms/api/SystemSetttingApi.java index c4300d4..85fe3c9 100644 --- a/src/main/java/com/msdw/tms/api/SystemSetttingApi.java +++ b/src/main/java/com/msdw/tms/api/SystemSetttingApi.java @@ -45,4 +45,9 @@ public interface SystemSetttingApi { @ApiOperation(value = "导入员工失败原因导出",notes = "导入员工失败原因导出") public void exportFailureRecord(HttpServletResponse response, String token) throws Exception; + + @ApiOperation(value = "查询账号信息",notes = "查询账号信息") + public R queryAccount(String account,Integer schoolId); } + + diff --git a/src/main/java/com/msdw/tms/controller/AchievementManagementController.java b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java new file mode 100644 index 0000000..e35cb28 --- /dev/null +++ b/src/main/java/com/msdw/tms/controller/AchievementManagementController.java @@ -0,0 +1,13 @@ +package com.msdw.tms.controller; + +import com.msdw.tms.service.AchievementManagementService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +@RestController +@RequestMapping("/Achievement") +public class AchievementManagementController { + + @Autowired + private AchievementManagementService achievementManagementService; +} diff --git a/src/main/java/com/msdw/tms/controller/ClassTeachingController.java b/src/main/java/com/msdw/tms/controller/ClassTeachingController.java index 98de3b0..fea92d9 100644 --- a/src/main/java/com/msdw/tms/controller/ClassTeachingController.java +++ b/src/main/java/com/msdw/tms/controller/ClassTeachingController.java @@ -6,6 +6,7 @@ import com.msdw.tms.common.utils.R; import com.msdw.tms.entity.ExperimentalReportEntity; import com.msdw.tms.entity.ExperimentalStudentEntity; import com.msdw.tms.entity.ExperimentalTeachingEntity; +import com.msdw.tms.entity.vo.ExperimentalReportVo; import com.msdw.tms.entity.vo.ProjectRecordVo; import com.msdw.tms.service.ClassTeachingService; import com.msdw.tms.service.ExperimentalReportService; @@ -151,11 +152,24 @@ public class ClassTeachingController implements ClassTeachingApi { * @return */ @Override - @PostMapping("/queryExperimentalReport") - public R queryExperimentalReport(@RequestBody ExperimentalReportEntity entity){ + @GetMapping("/queryExperimentalReport") + public R queryExperimentalReport(@RequestParam Integer studentId,@RequestParam Integer projectId,@RequestParam Integer recordId,@RequestParam Integer reportId){ +// public R queryExperimentalReport(@RequestBody ExperimentalReportVo entity){ + ExperimentalReportVo entity = new ExperimentalReportVo(); + R result = experimentalReportService.queryReport(studentId,projectId,recordId,reportId); - R result = experimentalReportService.queryReport(entity); + return result; + } - return R.ok().put("data",result); + /** + * 学生查看虚拟实验报告 + * @param entity + * @return + */ + @Override + @GetMapping("/queryVirtualReport") + public R queryVirtualReport(@RequestParam Integer recordId){ + R result = experimentalReportService.queryVirtualReport(recordId); + return result; } } diff --git a/src/main/java/com/msdw/tms/controller/QuestionsController.java b/src/main/java/com/msdw/tms/controller/QuestionsController.java index b4402e2..1e223b6 100644 --- a/src/main/java/com/msdw/tms/controller/QuestionsController.java +++ b/src/main/java/com/msdw/tms/controller/QuestionsController.java @@ -1,20 +1,13 @@ package com.msdw.tms.controller; import com.msdw.tms.api.QuestionsControllerApi; -import com.msdw.tms.common.exception.ExceptionCast; -import com.msdw.tms.common.utils.Constant; import com.msdw.tms.common.utils.FilesResult; import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.R; -import com.msdw.tms.entity.EvaluationRulesEntity; -import com.msdw.tms.entity.QuestionsEntity; import com.msdw.tms.entity.request.QuestionsAddRequest; import com.msdw.tms.entity.request.QuestionsQueryRequest; import com.msdw.tms.entity.request.QuestionsUpdateRequest; -import com.msdw.tms.entity.response.CommonCode; -import com.msdw.tms.entity.vo.EvaluationVO; import com.msdw.tms.entity.vo.QuestionsDetailVO; -import com.msdw.tms.entity.vo.RulesVo; import com.msdw.tms.service.QuestionsService; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; @@ -98,62 +91,11 @@ public class QuestionsController implements QuestionsControllerApi { */ @Override @PutMapping("/isenable") -// public R isNable(@RequestBody Integer id) { public R isNable(@RequestBody List idList) { Integer id = idList.get(0); - boolean b = questionsService.isEnable(id); - - return b ? R.ok() : R.error(); + R result = questionsService.isEnable(id); + return result; } - -// /** -// * 是否禁用试题 -// */ -// @Override -// @PutMapping("/isenable") -//// 2020.09.18 -//// @RequiresPermissions("qms:questions:isenable") -//// public R isNable(@RequestBody Integer id) { -// public R isNable(@RequestBody RulesVo rules) { -//// public R isNable(@RequestBody List idList) { -//// Integer id = idList.get(0); -// QuestionsEntity questionsEntity = new QuestionsEntity(); -// Integer id = rules.getQuestionId(); -// questionsEntity.setId(id); -// QuestionsEntity byId = questionsService.getById(id); -// int rulesNumber = rules.getQuestionsNumber(); -// if (byId.getIsEnable().equals(Constant.IsEnable.ENABLE.getType())) { -// Integer types = rules.getTypes(); -//// String questionsTypes= types==1 ? "single_num" : (types==2 ? "multiple_num":"judgment_num");//根据题型获取数据库字段名 -// EvaluationRulesEntity rule = questionsService.queryNumberOfTatolQuestions(); -// int num = 0; -// if (types==1){ -// num += rule.getSingleNum(); -// }else if (types==2){ -// num += rule.getMultipleNum(); -// }else if (types==3){ -// num += rule.getJudgmentNum(); -// } -// if (num querySimulationPlayList(Page page1); void updateSurplusTimeUp(ProjectRecordVo recordVo); + + void updateSurplusTimeLe(ProjectRecordVo recordVo); + + void updateSurplusTimeGt(ProjectRecordVo recordVo); } diff --git a/src/main/java/com/msdw/tms/dao/ExperimentalReportDao.java b/src/main/java/com/msdw/tms/dao/ExperimentalReportDao.java index 387daf4..f30aa92 100644 --- a/src/main/java/com/msdw/tms/dao/ExperimentalReportDao.java +++ b/src/main/java/com/msdw/tms/dao/ExperimentalReportDao.java @@ -9,5 +9,7 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ExperimentalReportDao extends BaseMapper { - ExperimentalReportVo queryReport(ExperimentalReportEntity entity); + ExperimentalReportVo queryReport(ExperimentalReportVo entity); + + ExperimentalReportVo queryVirtualReport(Integer recordId); } diff --git a/src/main/java/com/msdw/tms/dao/QuestionsDao.java b/src/main/java/com/msdw/tms/dao/QuestionsDao.java index a5399e1..56b05db 100644 --- a/src/main/java/com/msdw/tms/dao/QuestionsDao.java +++ b/src/main/java/com/msdw/tms/dao/QuestionsDao.java @@ -30,4 +30,6 @@ public interface QuestionsDao extends BaseMapper { EvaluationRulesEntity queryNumberOfTatolQuestions(); + Integer queryQuestionNumber(Integer number); + } diff --git a/src/main/java/com/msdw/tms/dao/StudentDao.java b/src/main/java/com/msdw/tms/dao/StudentDao.java index ba5f2ee..5964c93 100644 --- a/src/main/java/com/msdw/tms/dao/StudentDao.java +++ b/src/main/java/com/msdw/tms/dao/StudentDao.java @@ -33,4 +33,6 @@ public interface StudentDao extends BaseMapper { int bacthAddStudents(List students); int querySchoolAppellationName(String schoolAppellationName); + + List queryAccount(String account,Integer schoolId); } diff --git a/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java b/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java index 5c8612f..7e6848d 100644 --- a/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java +++ b/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java @@ -55,4 +55,6 @@ public interface SystemSetttingDao { Integer queryDepartmentNameOrganization(String staffProfessionalArchitectureName,Integer schoolId); List judgmentGrade(String name,Integer schoolId); + + List queryAccount(String account,Integer schoolId); } diff --git a/src/main/java/com/msdw/tms/dao/UserInfoDao.java b/src/main/java/com/msdw/tms/dao/UserInfoDao.java index 4840745..02353c3 100644 --- a/src/main/java/com/msdw/tms/dao/UserInfoDao.java +++ b/src/main/java/com/msdw/tms/dao/UserInfoDao.java @@ -25,9 +25,9 @@ public interface UserInfoDao extends BaseMapper { Integer disableAccount(StudentVo studentIds); - List queryStudentAccount(String account, Integer schoolId); + List queryStudentAccount(String account); - List queryStudentPhone(String phone, Integer schoolId); + List queryStudentPhone(String phone); // int bacthAddStudents(List students); @@ -39,8 +39,6 @@ public interface UserInfoDao extends BaseMapper { List queryPhone(String phone); -// List queryAccount(String account); - List queryAccount(String account); StaffVo queryAccountUpdate(Integer userId); diff --git a/src/main/java/com/msdw/tms/entity/AchievementManagementEntity.java b/src/main/java/com/msdw/tms/entity/AchievementManagementEntity.java new file mode 100644 index 0000000..35523c2 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/AchievementManagementEntity.java @@ -0,0 +1,14 @@ +package com.msdw.tms.entity; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 成绩管理/川大 + */ +@Data +@Accessors(chain = true) +public class AchievementManagementEntity { + + +} diff --git a/src/main/java/com/msdw/tms/entity/vo/ExperimentalReportVo.java b/src/main/java/com/msdw/tms/entity/vo/ExperimentalReportVo.java index 4142b39..1ad85b2 100644 --- a/src/main/java/com/msdw/tms/entity/vo/ExperimentalReportVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/ExperimentalReportVo.java @@ -28,4 +28,7 @@ public class ExperimentalReportVo extends ExperimentalReportEntity { private String submitTime; //实验成绩 private Integer score; + //试验记录id(实验记录表主键) + private Integer recordId; + } diff --git a/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java b/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java index b35683b..2ed4e36 100644 --- a/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java @@ -1,6 +1,5 @@ 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; @@ -12,8 +11,17 @@ import java.util.List; @Accessors(chain = true) public class ProjectRecordVo extends ProjectRecordEntity implements Serializable { + + /** + * 实验项目id + */ + private Integer id; + /** + * 教学实验主键id + */ + private Integer reportId; /** - * 实验项目名称 + * 项目名称 */ private String projectName; /** @@ -89,33 +97,4 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable */ private Integer studentId; -// /** -// * 班级实验状态,0 不限,1 未发布,2 进行中,3 已完成 -// */ -// private Integer experimentStartus; -// /** -// /** -// * 实验项目id -// */ -// private Integer projectid; -// /** -// * 实验项目名称 -// */ -// private String projectname; -// /** -// * 实验目标 -// */ -// private String projecttarget; -// /** -// * 实验描述 -// */ -// private String projectdescribe; -// /** -// * 实验描述(0开启 1未开启) -// */ -// private Integer isprojectdata; -// /** -// * 实验提示 -// */ -// private String projecttips; } diff --git a/src/main/java/com/msdw/tms/entity/vo/RulesVo.java b/src/main/java/com/msdw/tms/entity/vo/RulesVo.java deleted file mode 100644 index 8fb7d77..0000000 --- a/src/main/java/com/msdw/tms/entity/vo/RulesVo.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.msdw.tms.entity.vo; - -import lombok.Data; -import lombok.experimental.Accessors; - -@Data -@Accessors(chain = true) -public class RulesVo { - //题型(1单选2多选3判断) - private Integer types; - //试题数量 - private Integer questionsNumber; - //测评对应该试题数量 -// private int rulesNumber; - //试题id - private Integer questionId; - -} diff --git a/src/main/java/com/msdw/tms/entity/vo/StaffExportVo.java b/src/main/java/com/msdw/tms/entity/vo/StaffExportVo.java index 6c149ef..cb8bc10 100644 --- a/src/main/java/com/msdw/tms/entity/vo/StaffExportVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/StaffExportVo.java @@ -30,19 +30,19 @@ public class StaffExportVo { private String workNumber; //管理员专业名称 - @ExcelAttribute(sort = 4) + @ExcelAttribute(sort = 5) private String staffGradeName; //管理员组织架构名称 - @ExcelAttribute(sort = 5) + @ExcelAttribute(sort = 4) private String staffProfessionalArchitectureName; //老师专业组织名称 - @ExcelAttribute(sort = 6) + @ExcelAttribute(sort = 7) private String staffGradeNameTwo; //老师组织架构名称 - @ExcelAttribute(sort = 7) + @ExcelAttribute(sort = 6) private String staffProfessionalArchitectureNameTwo; //手机号码 diff --git a/src/main/java/com/msdw/tms/service/AchievementManagementService.java b/src/main/java/com/msdw/tms/service/AchievementManagementService.java new file mode 100644 index 0000000..77109c5 --- /dev/null +++ b/src/main/java/com/msdw/tms/service/AchievementManagementService.java @@ -0,0 +1,4 @@ +package com.msdw.tms.service; + +public interface AchievementManagementService { +} diff --git a/src/main/java/com/msdw/tms/service/ExperimentalReportService.java b/src/main/java/com/msdw/tms/service/ExperimentalReportService.java index 74f2f5a..716c5fb 100644 --- a/src/main/java/com/msdw/tms/service/ExperimentalReportService.java +++ b/src/main/java/com/msdw/tms/service/ExperimentalReportService.java @@ -8,5 +8,7 @@ import com.msdw.tms.entity.vo.ExperimentalReportVo; public interface ExperimentalReportService extends IService { - R queryReport(ExperimentalReportEntity entity); + R queryReport(Integer studentId,Integer projectId,Integer recordId,Integer reportId); + + R queryVirtualReport(Integer recordId); } diff --git a/src/main/java/com/msdw/tms/service/QuestionsService.java b/src/main/java/com/msdw/tms/service/QuestionsService.java index 54698a4..40164f1 100644 --- a/src/main/java/com/msdw/tms/service/QuestionsService.java +++ b/src/main/java/com/msdw/tms/service/QuestionsService.java @@ -4,15 +4,12 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.msdw.tms.common.utils.FilesResult; import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.R; -import com.msdw.tms.entity.EvaluationRulesEntity; import com.msdw.tms.entity.QuestionsEntity; import com.msdw.tms.entity.request.QuestionsAddRequest; import com.msdw.tms.entity.request.QuestionsQueryRequest; import com.msdw.tms.entity.request.QuestionsUpdateRequest; import com.msdw.tms.entity.vo.EvaluationVO; import com.msdw.tms.entity.vo.QuestionsDetailVO; -import com.msdw.tms.entity.vo.RulesVo; -import org.apache.tomcat.util.digester.Rules; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; @@ -37,7 +34,7 @@ public interface QuestionsService extends IService { boolean updateQuestionById(QuestionsUpdateRequest questions); - boolean isEnable(Integer id); +// boolean isEnable(Integer id); Map importQuestion(MultipartFile file) throws IOException; @@ -53,14 +50,8 @@ public interface QuestionsService extends IService { void exportFailureRecord(HttpServletResponse response, String token) throws Exception; + boolean deleteByIds(List asList); - - -// EvaluationRulesEntity queryNumberOfQuestions(); -// boolean isEnable(RulesVo rules,QuestionsEntity questionsEntity); -boolean deleteByIds(List asList); -//测评设置是否禁用试题 -// EvaluationRulesEntity queryNumberOfTatolQuestions(); - + R isEnable(Integer id); } diff --git a/src/main/java/com/msdw/tms/service/StudentService.java b/src/main/java/com/msdw/tms/service/StudentService.java index 58259c6..c9f1a46 100644 --- a/src/main/java/com/msdw/tms/service/StudentService.java +++ b/src/main/java/com/msdw/tms/service/StudentService.java @@ -35,4 +35,7 @@ public interface StudentService extends IService{ Map upload(MultipartFile file, Integer schoolId) throws IOException; void exportFailureRecord(HttpServletResponse response,String token) throws Exception; + + R queryAccount(String account,Integer schoolId); + } diff --git a/src/main/java/com/msdw/tms/service/SystemSetttingService.java b/src/main/java/com/msdw/tms/service/SystemSetttingService.java index 67d3f2d..6bd9838 100644 --- a/src/main/java/com/msdw/tms/service/SystemSetttingService.java +++ b/src/main/java/com/msdw/tms/service/SystemSetttingService.java @@ -32,4 +32,6 @@ public interface SystemSetttingService { void exportFailureRecord(HttpServletResponse response, String token) throws Exception; void downloadFiles(HttpServletResponse response) throws IOException; + + R queryAccount(String account,Integer schoolId); } diff --git a/src/main/java/com/msdw/tms/service/UserInfoService.java b/src/main/java/com/msdw/tms/service/UserInfoService.java index 24631dc..98dd39d 100644 --- a/src/main/java/com/msdw/tms/service/UserInfoService.java +++ b/src/main/java/com/msdw/tms/service/UserInfoService.java @@ -29,7 +29,7 @@ public interface UserInfoService extends IService { Integer queryStudentAccount(String account,Integer schoolId); - Integer queryStudentPhone(String phone,Integer schoolId); + Integer queryStudentPhone(String phone); HashMap queryUserInfo(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 new file mode 100644 index 0000000..f699b41 --- /dev/null +++ b/src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java @@ -0,0 +1,14 @@ +package com.msdw.tms.service.impl; + +import com.msdw.tms.dao.AchievementManagementDao; +import com.msdw.tms.service.AchievementManagementService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class AchievementManagementServiceImpl implements AchievementManagementService { + + @Autowired + private AchievementManagementDao achievementManagementDao; + +} 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 2b64460..db7039c 100644 --- a/src/main/java/com/msdw/tms/service/impl/ClassTeachingServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ClassTeachingServiceImpl.java @@ -42,6 +42,8 @@ public class ClassTeachingServiceImpl implements ClassTeachingService { this.classMapper.updateSurplusTimeNull(recordVo);//将已结束的实验的倒计时重置为0 this.classMapper.updateSurplusTime(recordVo);//倒计时:设定倒计时的剩余时间 this.classMapper.updateSurplusTimeUp(recordVo);//倒计时:设定距离实验开始的剩余时间 + this.classMapper.updateSurplusTimeLe(recordVo); + this.classMapper.updateSurplusTimeGt(recordVo); IPage schoolRecord = this.classMapper.getByClassRecord(page1, recordVo); PageUtils pageUtils = new PageUtils(schoolRecord); return pageUtils; diff --git a/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java index 111f075..3ce92b1 100644 --- a/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java @@ -9,6 +9,7 @@ import com.msdw.tms.dao.ExperimentalTeachingDao; import com.msdw.tms.entity.ExperimentalReportEntity; import com.msdw.tms.entity.vo.ExperimentalReportVo; import com.msdw.tms.service.ExperimentalReportService; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -19,13 +20,17 @@ public class ExperimentalReportServiceImpl extends ServiceImpl30天" + classTeachingDao.updateSurplusTimeGt(recordVo);//将剩余时间大于30天的记录的倒计时设置为'838:00:00',前端转为">30天" + Page page1 = new Page<>(page, size); ExperimentalTeachingDao userDao = this.getBaseMapper(); diff --git a/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java index ab1195f..12f500c 100644 --- a/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java @@ -56,6 +56,9 @@ public class QuestionsServiceImpl extends ServiceImpl im StudentVo studentVo = new StudentVo(); String schoolAppellationName = student.getSchoolAppellationName(); List result1 = studentDao.queryStudentIdNumber(workNumber,schoolId); - List result4 = userInfoDao.queryStudentAccount(account, schoolId); + List result4 = userInfoDao.queryStudentAccount(account); String email = student.getEmail(); if (phone!=null&&phone!=""){ - List result2 = userInfoDao.queryStudentPhone(phone, schoolId); - if (result2.size()==1){ + List result2 = userInfoDao.queryStudentPhone(phone); + if (result2.size()>=1){ log.error("该号码已被使用"); StudentImportFailureVo vo = new StudentImportFailureVo(); ++ii; @@ -182,7 +183,7 @@ public class StudentServiceImpl extends ServiceImpl im ; studentVo.setAccount(student.getAccount()).setSchoolAppellationName(schoolAppellationName).setUserName(student.getUserName()).setIsdel(Constant.IsDel.NOT_DEL.getType()); - if (result1.size()==1){ + if (result1.size()>=1){ log.error("该学号已存在"); StudentImportFailureVo vo = new StudentImportFailureVo(); ++ii; @@ -195,7 +196,7 @@ public class StudentServiceImpl extends ServiceImpl im students.remove(i); i--; continue; - }else if(result4.size()==1){ + }else if(result4.size()>=1){ log.error("账号已存在"); StudentImportFailureVo vo = new StudentImportFailureVo(); ++ii; @@ -283,67 +284,19 @@ public class StudentServiceImpl extends ServiceImpl im export(response, inputStream, parse, "学生信息导入失败表.xlsx"); } -// public HashMap readStudent(Integer schoolId, MultipartFile file) { -// HashMap resp = new HashMap(); -// try { -// // 读取excel文件中的学生信息 -// List students = ExcelImportHelper.readStudent(file); -// List users = new ArrayList(); -// // 循环员工信息,将员工信息与用户信息进行对比 -// for (int i = 0; i < students.size(); i++) { -// Student student = students.get(i); -// // 学校id -// student.setSchoolId(schoolId); -// -// Student stu=studentMapper.getStudent(student); -// -// if(stu!=null) { -// // 专业id -// student.setProfessionalId(stu.getProfessionalId()); -// // 年级 -// student.setGradeId(stu.getGradeId()); -// //班级 -// student.setClassId(stu.getClassId()); -// -// UserM user = new UserM(); -// // 用户名称 -// user.setName(student.getStudentName()); -// // 用户密码 -// user.setPassword("huoran123"); -// // 用户角色 -// user.setAccountRole(student.getRoleId()); -// // 工号 -// user.setWorkNumber(student.getWorkNumber()); -// // 手机号 -// user.setPhone(student.getPhone()); -// // 邮箱 -// user.setEmail(student.getEmail()); -// // 唯一标识性账号 -// user.setUniqueIdentificationAccount(student.getUniqueIdentificationAccount()); -// // 学校id -// user.setSchoolId(schoolId); -// -// users.add(user); -// -// }else { -// students.remove(i); -// i--; -// } -// } -// if (!students.isEmpty() && students.size() > 0) { -// // 批量添加学生 -// studentMapper.bacthAddStudent(students); -// // 批量添加用户 -// userMapper.addUserM(users); -// } -// resp.put("retcode", 200); -// } catch (RuntimeException e) { -// logger.error(e.getMessage()); -// resp.put("retcode", 500); -// resp.put("retvalue", "Inquiry Failed"); -// return resp; -// } -// return resp; -// } + + @Override + public R queryAccount(String account,Integer schoolId) { + List result = studentDao.queryAccount(account,schoolId); + List vos = userInfoDao.queryAccount(account); + if (result.size()>1){ + return R.error("系统存在多个相同的账号:"+account); + }else if (result.size()==1){return R.ok().put("data",result); + }else if (vos.size()>0){ + return R.error("账号已存在"); + } + return R.ok(); + + } } diff --git a/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java index 168de75..9898295 100644 --- a/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java @@ -2,6 +2,7 @@ package com.msdw.tms.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.msdw.tms.common.exception.ExceptionCast; @@ -10,6 +11,8 @@ import com.msdw.tms.common.utils.poi.ExcelExportUtil; import com.msdw.tms.dao.SystemSetttingDao; import com.msdw.tms.dao.UserInfoDao; import com.msdw.tms.entity.StaffEntity; +import com.msdw.tms.entity.StudentEntity; +import com.msdw.tms.entity.UserInfoEntity; import com.msdw.tms.entity.XlsxTemplateEntity; import com.msdw.tms.entity.response.CommonCode; import com.msdw.tms.entity.vo.StaffExportVo; @@ -130,7 +133,6 @@ public class SystemSettingServiceImpl implements SystemSetttingService { String email = staffVo.getEmail(); String workNumber = staffVo.getWorkNumber(); List staff = staffVo.getStaff();//获取员工数据 - StaffVo result = userInfoDao.queryAccountUpdate(staffVo.getUserId()); String roleIds = result.getRoleId(); String[] splitOld = staffVo.getRoleId().split(","); @@ -320,7 +322,7 @@ public class SystemSettingServiceImpl implements SystemSetttingService { if (architectureName!=null&&architectureName!=""){ if (gradeName==null|gradeName==""){ StaffExportVo vo = new StaffExportVo(); - vo.setFailureMsg("二级部门不能为空"); + vo.setFailureMsg("二级部门不能为空(管理员)"); vo.setIndex(ii).setUserName(staffVo.getUserName()).setAccount(staffVo.getAccount()).setRole(staffVo.getRole()).setWorkNumber(staffVo.getWorkNumber()).setStaffGradeName(staffVo.getStaffGradeName()).setStaffProfessionalArchitectureName(staffVo.getStaffProfessionalArchitectureName()).setStaffGradeNameTwo(staffVo.getStaffGradeNameTwo()).setStaffProfessionalArchitectureNameTwo(staffVo.getStaffProfessionalArchitectureNameTwo()).setPhone(staffVo.getPhone()).setEmail(staffVo.getEmail()).setSchoolAppellationName(staffVo.getSchoolAppellationName()); staffs.remove(i); i--; @@ -330,7 +332,7 @@ public class SystemSettingServiceImpl implements SystemSetttingService { Integer b = systemSetttingDao.queryDepartmentNameOrganization(architectureName, ConstantUtils.Keda_schoolId); if (b==null){ StaffExportVo vo = new StaffExportVo(); - vo.setFailureMsg("不存在的一级部门"); + vo.setFailureMsg("不存在的一级部门(管理员)"); vo.setIndex(ii).setUserName(staffVo.getUserName()).setAccount(staffVo.getAccount()).setRole(staffVo.getRole()).setWorkNumber(staffVo.getWorkNumber()).setStaffGradeName(staffVo.getStaffGradeName()).setStaffProfessionalArchitectureName(staffVo.getStaffProfessionalArchitectureName()).setStaffGradeNameTwo(staffVo.getStaffGradeNameTwo()).setStaffProfessionalArchitectureNameTwo(staffVo.getStaffProfessionalArchitectureNameTwo()).setPhone(staffVo.getPhone()).setEmail(staffVo.getEmail()).setSchoolAppellationName(staffVo.getSchoolAppellationName()); staffs.remove(i); i--; @@ -340,7 +342,7 @@ public class SystemSettingServiceImpl implements SystemSetttingService { List a = systemSetttingDao.judgmentGrade(architectureName,ConstantUtils.Keda_schoolId); if (a.size()==0){ StaffExportVo vo = new StaffExportVo(); - vo.setFailureMsg("不存在此子级部门"); + vo.setFailureMsg("不存在此子级部门(管理员)"); vo.setIndex(ii).setUserName(staffVo.getUserName()).setAccount(staffVo.getAccount()).setRole(staffVo.getRole()).setWorkNumber(staffVo.getWorkNumber()).setStaffGradeName(staffVo.getStaffGradeName()).setStaffProfessionalArchitectureName(staffVo.getStaffProfessionalArchitectureName()).setStaffGradeNameTwo(staffVo.getStaffGradeNameTwo()).setStaffProfessionalArchitectureNameTwo(staffVo.getStaffProfessionalArchitectureNameTwo()).setPhone(staffVo.getPhone()).setEmail(staffVo.getEmail()).setSchoolAppellationName(staffVo.getSchoolAppellationName()); staffs.remove(i); i--; @@ -349,11 +351,12 @@ public class SystemSettingServiceImpl implements SystemSetttingService { } } } - }else if (s.indexOf("3")!=-1){ + } + if (s.indexOf("3")!=-1){ if (architectureNameTwo!=null&&architectureNameTwo!=""){ if (gradeNameTwo==null|gradeNameTwo==""){ StaffExportVo vo = new StaffExportVo(); - vo.setFailureMsg("二级部门不能为空"); + vo.setFailureMsg("二级部门不能为空(老师)"); vo.setIndex(ii).setUserName(staffVo.getUserName()).setAccount(staffVo.getAccount()).setRole(staffVo.getRole()).setWorkNumber(staffVo.getWorkNumber()).setStaffGradeName(staffVo.getStaffGradeName()).setStaffProfessionalArchitectureName(staffVo.getStaffProfessionalArchitectureName()).setStaffGradeNameTwo(staffVo.getStaffGradeNameTwo()).setStaffProfessionalArchitectureNameTwo(staffVo.getStaffProfessionalArchitectureNameTwo()).setPhone(staffVo.getPhone()).setEmail(staffVo.getEmail()).setSchoolAppellationName(staffVo.getSchoolAppellationName()); staffs.remove(i); i--; @@ -363,7 +366,7 @@ public class SystemSettingServiceImpl implements SystemSetttingService { Integer b = systemSetttingDao.queryDepartmentNameOrganization(architectureNameTwo, ConstantUtils.Keda_schoolId); if (b==null){ StaffExportVo vo = new StaffExportVo(); - vo.setFailureMsg("不存在的一级部门"); + vo.setFailureMsg("不存在此的一级部门(老师)"); vo.setIndex(ii).setUserName(staffVo.getUserName()).setAccount(staffVo.getAccount()).setRole(staffVo.getRole()).setWorkNumber(staffVo.getWorkNumber()).setStaffGradeName(staffVo.getStaffGradeName()).setStaffProfessionalArchitectureName(staffVo.getStaffProfessionalArchitectureName()).setStaffGradeNameTwo(staffVo.getStaffGradeNameTwo()).setStaffProfessionalArchitectureNameTwo(staffVo.getStaffProfessionalArchitectureNameTwo()).setPhone(staffVo.getPhone()).setEmail(staffVo.getEmail()).setSchoolAppellationName(staffVo.getSchoolAppellationName()); staffs.remove(i); i--; @@ -373,7 +376,7 @@ public class SystemSettingServiceImpl implements SystemSetttingService { List a = systemSetttingDao.judgmentGrade(architectureNameTwo,ConstantUtils.Keda_schoolId); if (a.size()==0){ StaffExportVo vo = new StaffExportVo(); - vo.setFailureMsg("不存在此子级部门"); + vo.setFailureMsg("不存在的子级部门(老师)"); vo.setIndex(ii).setUserName(staffVo.getUserName()).setAccount(staffVo.getAccount()).setRole(staffVo.getRole()).setWorkNumber(staffVo.getWorkNumber()).setStaffGradeName(staffVo.getStaffGradeName()).setStaffProfessionalArchitectureName(staffVo.getStaffProfessionalArchitectureName()).setStaffGradeNameTwo(staffVo.getStaffGradeNameTwo()).setStaffProfessionalArchitectureNameTwo(staffVo.getStaffProfessionalArchitectureNameTwo()).setPhone(staffVo.getPhone()).setEmail(staffVo.getEmail()).setSchoolAppellationName(staffVo.getSchoolAppellationName()); staffs.remove(i); i--; @@ -476,4 +479,22 @@ public class SystemSettingServiceImpl implements SystemSetttingService { XlsxTemplateEntity xlsxTemplate = xlsxTemplateService.getById(ConstantUtils.XLSX_TEMPLATE_ID3); ossService.downloadFiles(response, xlsxTemplate.getFileName()); } + + @Override + public R queryAccount(String account,Integer schoolId) { + HashMap map = new HashMap<>(); + List result = systemSetttingDao.queryAccount(account,schoolId); + List vos = userInfoDao.queryAccount(account); + if (result.size()>1){return R.error("系统存在多个相同的账号:"+account); + }else if (result.size()==1){ + StaffVo staffVo = result.get(0); + map.put("user",staffVo); + List staffVos = systemSetttingDao.queryStaffInfo(staffVo.getUserId()); + map.put("staff",staffVos); + return R.ok().put("data",map); + }else if (vos.size()>0){ + return R.error("账号已存在"); + } + return R.ok(); + } } \ No newline at end of file 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 4513374..68ce1f5 100644 --- a/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java @@ -97,7 +97,7 @@ public class UserInfoServiceImpl extends ServiceImpl result = userInfoDao.queryStudentAccount(account,schoolId); + List result = userInfoDao.queryStudentAccount(account); if (result.size()==1){ return 1; }else{ @@ -106,8 +106,8 @@ public class UserInfoServiceImpl extends ServiceImpl result = userInfoDao.queryStudentPhone(phone,schoolId); + public Integer queryStudentPhone(String phone) { + List result = userInfoDao.queryStudentPhone(phone); if (result.size()==1){ return 1; }else{ diff --git a/src/main/resources/excel-template/虚拟仿真实验报告导出模板.xlsx b/src/main/resources/excel-template/虚拟仿真实验报告导出模板.xlsx index d4eb76e..2ab5031 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/AchievementManagementDao.xml b/src/main/resources/mapper/tms/AchievementManagementDao.xml new file mode 100644 index 0000000..b0fd2f0 --- /dev/null +++ b/src/main/resources/mapper/tms/AchievementManagementDao.xml @@ -0,0 +1,5 @@ + + + + + \ 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 c715161..8621c41 100644 --- a/src/main/resources/mapper/tms/ClassTeachingDao.xml +++ b/src/main/resources/mapper/tms/ClassTeachingDao.xml @@ -65,6 +65,7 @@ AND stop_time >= now( ) AND is_del = 0 AND `status` !=3 + AND 30 >= DATEDIFF( stop_time, now( ) ) UPDATE tms_experimental_teaching @@ -80,6 +81,27 @@ start_time > now() AND is_del = 0 AND `status` !=3 + AND 30 >= DATEDIFF( start_time,now( ) ) + AND DATEDIFF( start_time,now( ) ) >=0 + + + UPDATE tms_experimental_teaching + SET surplus_time = '838:00:00' + WHERE + now( ) >= start_time + AND stop_time >= now( ) + AND is_del = 0 + AND `status` !=3 + AND DATEDIFF( stop_time, now( ) ) > 30 + + + UPDATE tms_experimental_teaching + SET surplus_time = '838:00:00' + WHERE + start_time > now( ) + AND is_del = 0 + AND `status` != 3 + AND DATEDIFF( start_time, now( ) ) > 30 + \ 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 a3ab716..c256b36 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -3,7 +3,7 @@ - + @@ -19,6 +19,7 @@ - + - + SELECT - recordId, - tpr.projectId, - projectName, - schoolName, - userName, - score, - recordState, - submitTime, - COUNT(DISTINCT CASE WHEN recordState = '1' THEN recordState END) as complete, - COUNT(DISTINCT CASE WHEN recordState = '0' THEN recordState END) as tobescored + recordId, + tpr.projectId, + projectName, + schoolName, + userName, + score, + recordState, + submitTime, + COUNT(DISTINCT CASE WHEN recordState = '1' THEN recordState END) as complete, + COUNT(DISTINCT CASE WHEN recordState = '0' THEN recordState END) as tobescored FROM - tms_project_record tpr - LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId - LEFT JOIN hr_user_info u ON tpr.userId = u.userId - LEFT JOIN school sc ON u.schoolId = sc.schoolId + tms_project_record tpr + LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId + LEFT JOIN hr_user_info u ON tpr.userId = u.userId + LEFT JOIN school sc ON u.schoolId = sc.schoolId WHERE - tpr.isdel = #{pro.isdel} + tpr.isdel = #{pro.isdel} and - tp.isdel = #{pro.isdel} + tp.isdel = #{pro.isdel} and - u.isdel = #{pro.isdel} + u.isdel = #{pro.isdel} and - sc.isdel = #{pro.isdel} + sc.isdel = #{pro.isdel} and DATE_SUB(CURDATE(), INTERVAL #{pro.month} month ) <= date(submitTime) and submitTime between #{pro.startTime} and #{pro.endTime} and recordState=#{pro.recordState} diff --git a/src/main/resources/mapper/tms/QuestionsDao.xml b/src/main/resources/mapper/tms/QuestionsDao.xml index ffdfec9..85dfa11 100644 --- a/src/main/resources/mapper/tms/QuestionsDao.xml +++ b/src/main/resources/mapper/tms/QuestionsDao.xml @@ -59,6 +59,8 @@ - + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/StudentDao.xml b/src/main/resources/mapper/tms/StudentDao.xml index 4cbd992..2ff0cad 100644 --- a/src/main/resources/mapper/tms/StudentDao.xml +++ b/src/main/resources/mapper/tms/StudentDao.xml @@ -30,7 +30,7 @@ AND s.isdel = 0 AND (u.userName LIKE CONCAT('%',#{searchContent},'%') OR s.workNumber LIKE CONCAT('%',#{searchContent},'%')) ORDER BY - lastLoginTime DESC,studentId + lastLoginTime DESC,studentId DESC SELECT schoolId FROM school WHERE schoolName = #{schoolAppellationName} + - + INSERT INTO student ( schoolId, userId, workNumber, roleId, isdel,platformId ) VALUES ( #{schoolId},#{userId},#{workNumber},#{roleId},#{isdel},#{platformId} diff --git a/src/main/resources/mapper/tms/SystemSetting.xml b/src/main/resources/mapper/tms/SystemSetting.xml index e513654..a48e684 100644 --- a/src/main/resources/mapper/tms/SystemSetting.xml +++ b/src/main/resources/mapper/tms/SystemSetting.xml @@ -2,7 +2,7 @@ - + INSERT INTO staff (userId,schoolId,workNumber,staffGradeId,staffProfessionalArchitectureId,staffGradeName,staffProfessionalArchitectureName,platformId,roleId) VALUES (#{userId},#{schoolId},#{workNumber},#{staffGradeId},#{staffProfessionalArchitectureId},#{staffGradeName},#{staffProfessionalArchitectureName},#{platformId},#{roleId}) @@ -48,22 +48,22 @@ roleId=#{roleId} WHERE - staffId = #{staffId} + staffId = #{staffId} update staff s,hr_user_info u set s.isdel = 1 ,u.isdel = 1 where s.userId = u.userId and s.userId = #{userId} UPDATE staff s, - hr_user_info u + hr_user_info u SET s.isdel = 1, - u.isdel = 1 + u.isdel = 1 WHERE - s.userId = u.userId + s.userId = u.userId AND s.userId IN ( - #{userId} - ) + #{userId} + ) UPDATE staff @@ -85,35 +85,35 @@ delete from staff where userId = #{userId} and roleId = (select max(roleId) from staff where userId = #{userId}) - + + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/UserInfoDao.xml b/src/main/resources/mapper/tms/UserInfoDao.xml index 4fcbef4..65911ec 100644 --- a/src/main/resources/mapper/tms/UserInfoDao.xml +++ b/src/main/resources/mapper/tms/UserInfoDao.xml @@ -49,7 +49,10 @@ schoolId = #{schoolId}, - phone = #{phone} + phone = #{phone}, + + + updateTime = now() WHERE userId = #{userId}; @@ -66,8 +69,6 @@ hr_user_info WHERE account = #{account} - and - schoolId = #{schoolId}