diff --git a/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java b/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java index 6cbab25..e079fe8 100644 --- a/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java +++ b/src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java @@ -27,7 +27,7 @@ public interface ProjectRcordControllerApi { R getUserScore(Integer userid); @ApiOperation(value = "个人实验记录导出",notes = "个人实验记录导出") - void exportProjectRecord(HttpServletResponse response,ProjectRecordVo list)throws Exception; + void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception; // @ApiOperation(value = "个人实验记录导出",notes = "个人实验记录导出") // void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception; diff --git a/src/main/java/com/msdw/tms/api/UserControllerApi.java b/src/main/java/com/msdw/tms/api/UserControllerApi.java index 2141e17..2cd9ee9 100644 --- a/src/main/java/com/msdw/tms/api/UserControllerApi.java +++ b/src/main/java/com/msdw/tms/api/UserControllerApi.java @@ -7,11 +7,13 @@ import com.msdw.tms.entity.vo.UserProsonalEntityVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import java.util.List; + @Api(value = "用户个人中心",tags = "用户个人中心信息展示,信息修改") public interface UserControllerApi { @ApiOperation(value = "个人中心信息展示",notes = "个人中心信息展示") - R userInfo(Integer id); + R userInfo(Integer id, List personalFileId); @ApiOperation(value = "个人中心信息修改",notes = "个人中心信息修改") R update(UserProsonalEntityVo userProsonalEntityVo); diff --git a/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java b/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java index ed792eb..8b50e41 100644 --- a/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java +++ b/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java @@ -139,4 +139,7 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi return R.ok().put("data", openExperiment); } + + + } diff --git a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java index 2e6333d..b8f208d 100644 --- a/src/main/java/com/msdw/tms/controller/ProjectRecordController.java +++ b/src/main/java/com/msdw/tms/controller/ProjectRecordController.java @@ -61,8 +61,8 @@ public class ProjectRecordController implements ProjectRcordControllerApi { */ @Override @GetMapping("/user/record") - public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userid){ - PageUtils page1 = projectRecordService.queryPage(page,size,userid); + public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userId){ + PageUtils page1 = projectRecordService.queryPage(page,size,userId); return R.ok().put("data", page1); } @@ -96,30 +96,30 @@ public class ProjectRecordController implements ProjectRcordControllerApi { } - /** - * 导出个人项目记录 - * @param response - * @throws Exception - */ - @Override - @PostMapping("/user/exportProjectRecord") - public void exportProjectRecord(HttpServletResponse response,@RequestBody ProjectRecordVo list)throws Exception{ - projectRecordService.exportProjectRecord(response,list); - } - - // /** // * 导出个人项目记录 // * @param response -// * @param userId // * @throws Exception // */ // @Override -// @GetMapping("/user/exportProjectRecord") -// public void exportProjectRecord(HttpServletResponse response,@RequestParam("userId") Integer userId)throws Exception{ -// projectRecordService.exportProjectRecord(response,userId); +// @PostMapping("/user/exportProjectRecord") +// public void exportProjectRecord(HttpServletResponse response,@RequestBody ProjectRecordVo list)throws Exception{ +// projectRecordService.exportProjectRecord(response,list); // } + + /** + * 导出个人项目记录 + * @param response + * @param userId + * @throws Exception + */ + @Override + @GetMapping("/user/exportProjectRecord") + public void exportProjectRecord(HttpServletResponse response,@RequestParam("userId") Integer userId)throws Exception{ + projectRecordService.exportProjectRecord(response,userId); + } + /** * 信息 */ diff --git a/src/main/java/com/msdw/tms/controller/UserController.java b/src/main/java/com/msdw/tms/controller/UserController.java index dd2f233..107fead 100644 --- a/src/main/java/com/msdw/tms/controller/UserController.java +++ b/src/main/java/com/msdw/tms/controller/UserController.java @@ -1,7 +1,5 @@ package com.msdw.tms.controller; -import cn.hutool.system.UserInfo; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.msdw.tms.api.UserControllerApi; import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.R; @@ -14,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -42,20 +41,23 @@ public class UserController implements UserControllerApi { public R info(@PathVariable("id") Long id){ UserEntity userEntity = userService.getById(id); -// userService.queryUserInfo(); - return R.ok().put("growthChangeHistory", userEntity); + + return R.ok(); } @Override - @GetMapping("/userinfo/{id}") - public R userInfo(@PathVariable("id") Integer id){ - UserEntityVo userEntityVo = userService.queryUserId(id); - return R.ok().put("data",userEntityVo); + @PostMapping("/userinfo/{id}") + public R userInfo(@PathVariable("id") Integer id,@RequestBody List personalFileId){ + + HashMap userEntityVoList = userService.queryUserInfo(id,personalFileId); +// UserEntityVo userEntityVo = userService.queryUserId(id); + return R.ok().put("data",userEntityVoList); } /** * 保存 */ + @Override @PostMapping("/save") public R save(@RequestBody UserEntity userEntity){ userService.save(userEntity); diff --git a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java index 9df465c..abbf531 100644 --- a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java +++ b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java @@ -24,7 +24,7 @@ public interface ProjectRecordDao extends BaseMapper { IPage getByUserExperimentRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity); - List getByUserRecordImport(@Param("pro") ProjectRecordEntity projectRecordEntity,List projectIds); + List getByUserRecordImport(ProjectRecordEntity projectRecordEntity); ProjectRecordVo getByUserScore(@Param("userid") Integer userId,@Param("isdel") Integer isdel); diff --git a/src/main/java/com/msdw/tms/dao/UserDao.java b/src/main/java/com/msdw/tms/dao/UserDao.java index d872a37..ed50495 100644 --- a/src/main/java/com/msdw/tms/dao/UserDao.java +++ b/src/main/java/com/msdw/tms/dao/UserDao.java @@ -1,15 +1,20 @@ package com.msdw.tms.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.msdw.tms.entity.ExperimentalTeachingEntity; import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.vo.UserEntityVo; +import com.msdw.tms.entity.vo.UserProsonalEntityVo; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + @Mapper public interface UserDao extends BaseMapper { UserEntityVo getByUserId(UserEntity userEntity); void updateUserPersonal(UserEntityVo vo); + + List queryPersonalFile(Integer userid,List personalFileId); + List queryUserInfo(Integer userid); } diff --git a/src/main/java/com/msdw/tms/entity/EvaluationQuestionEntity.java b/src/main/java/com/msdw/tms/entity/EvaluationQuestionEntity.java index e69c1ee..7e2bb12 100644 --- a/src/main/java/com/msdw/tms/entity/EvaluationQuestionEntity.java +++ b/src/main/java/com/msdw/tms/entity/EvaluationQuestionEntity.java @@ -55,5 +55,9 @@ public class EvaluationQuestionEntity implements Serializable { * 试题得分 */ private Integer questionScore; + /** + * 测评类型(0虚拟仿真实验,1教学实验) + */ + private Integer type; } diff --git a/src/main/java/com/msdw/tms/entity/UserEntity.java b/src/main/java/com/msdw/tms/entity/UserEntity.java index 062ed53..9d30c1e 100644 --- a/src/main/java/com/msdw/tms/entity/UserEntity.java +++ b/src/main/java/com/msdw/tms/entity/UserEntity.java @@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.experimental.Accessors; +import java.io.Serializable; + @Accessors(chain = true) @Data @TableName("hr_user_info") -public class UserEntity { +public class UserEntity implements Serializable { + private static final long serialVersionUID = 1L; //用户id @TableId private Integer userid; diff --git a/src/main/java/com/msdw/tms/service/ProjectRecordService.java b/src/main/java/com/msdw/tms/service/ProjectRecordService.java index 11ce9a7..410cf02 100644 --- a/src/main/java/com/msdw/tms/service/ProjectRecordService.java +++ b/src/main/java/com/msdw/tms/service/ProjectRecordService.java @@ -23,7 +23,7 @@ public interface ProjectRecordService extends IService { ProjectRecordVo queryUserScore(Integer userId); - void exportProjectRecord(HttpServletResponse response, ProjectRecordVo vo)throws Exception; + void exportProjectRecord(HttpServletResponse response, Integer userId)throws Exception; PageUtils querySchoolRecord(Integer page,Integer size,ProjectRecordVo projectRecord); diff --git a/src/main/java/com/msdw/tms/service/UserService.java b/src/main/java/com/msdw/tms/service/UserService.java index 6906da5..bb5ec21 100644 --- a/src/main/java/com/msdw/tms/service/UserService.java +++ b/src/main/java/com/msdw/tms/service/UserService.java @@ -4,7 +4,10 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.vo.UserEntityVo; +import com.msdw.tms.entity.vo.UserProsonalEntityVo; +import java.util.HashMap; +import java.util.List; import java.util.Map; public interface UserService extends IService { @@ -14,4 +17,6 @@ public interface UserService extends IService { UserEntityVo queryUserId(Integer userId); void updateUserPersonal(UserEntityVo personalFile); + + HashMap queryUserInfo(Integer id, List personalFileId); } diff --git a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java index 4506a33..29c2f6c 100644 --- a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java @@ -70,13 +70,11 @@ public class ProjectRecordServiceImpl extends ServiceImpl projectIds = vo.getProjectIds(); ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userId).setIsdel(Constant.IsDel.NOT_DEL.getType()); - List projectRecordVos = this.baseMapper.getByUserRecordImport(projectRecord,projectIds); + List projectRecordVos = this.baseMapper.getByUserRecordImport(projectRecord); List importRequests = projectRecordVos.stream().map(project -> { ProjectRecordImportRequest request = new ProjectRecordImportRequest(); diff --git a/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java index 22c27e8..10ca945 100644 --- a/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java @@ -9,10 +9,14 @@ import com.msdw.tms.common.utils.Query; import com.msdw.tms.dao.UserDao; import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.vo.UserEntityVo; +import com.msdw.tms.entity.vo.UserProsonalEntityVo; import com.msdw.tms.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; @Service("userService") @@ -43,4 +47,16 @@ public class UserServiceImpl extends ServiceImpl implements public void updateUserPersonal(UserEntityVo personalFile) { userMapper.updateUserPersonal(personalFile); } + + @Override + public HashMap queryUserInfo(Integer id,List personalIds) { + HashMap map = new HashMap(); + //用户sql user + List userInfo = userMapper.queryUserInfo(id); + map.put("userInfo",userInfo); + //个人档案sql + List userEntityVos = userMapper.queryPersonalFile(id, personalIds); + map.put("userPersonalFile",userEntityVos); + return map; + } } diff --git a/src/main/resources/mapper/tms/EvaluationQuestionDao.xml b/src/main/resources/mapper/tms/EvaluationQuestionDao.xml index eab21eb..e506f11 100644 --- a/src/main/resources/mapper/tms/EvaluationQuestionDao.xml +++ b/src/main/resources/mapper/tms/EvaluationQuestionDao.xml @@ -19,6 +19,8 @@ UPDATE tms_evaluation_question + set + type = 0, question_status=#{questionStatus, jdbcType=INTEGER}, diff --git a/src/main/resources/mapper/tms/ProjectRecordDao.xml b/src/main/resources/mapper/tms/ProjectRecordDao.xml index ca93d17..685f02c 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -69,14 +69,9 @@ tms_project_record tpr LEFT JOIN tms_project tp ON tpr.projectId = tp.projectId WHERE - tpr.userId = #{pro.userid} + tpr.userId = #{userid} AND - tpr.isdel = #{pro.isdel} - AND tpr.projectId IN - - #{projectId} - - + tpr.isdel = #{isdel} diff --git a/src/main/resources/mapper/tms/UserDao.xml b/src/main/resources/mapper/tms/UserDao.xml index 3268724..fe45dc0 100644 --- a/src/main/resources/mapper/tms/UserDao.xml +++ b/src/main/resources/mapper/tms/UserDao.xml @@ -3,7 +3,8 @@ - SELECT u.userId, userName, @@ -19,34 +20,51 @@ u.documentType, u.educationDegree, pro.provinceName, - s.schoolName, - per.SchoolName AS professionalSchoolName, - per.disciplineName, - per.professionalClassName, - per.professionalName, - per.personalCareerId, - s.cityName AS personalCityName, - s.provinceName AS personalProvinceName + s.schoolName FROM hr_user_info u, - hr_personal_file per, school s, city c, province pro WHERE - per.schoolId = s.schoolId - AND u.provinceId = pro.provinceId + u.provinceId = pro.provinceId AND u.schoolId = s.schoolId AND u.cityId = c.cityId - AND u.isdel = #{isdel} + AND u.isdel = #{pro.isdel} AND u.provinceId = c.provinceId - AND u.userId = per.userId - AND per.userId = #{userid} - AND pro.isdel = #{isdel} - AND c.isdel = #{isdel} - AND s.isdel = #{isdel} + AND u.userId = #{userid} + AND pro.isdel = 0 + AND c.isdel = 0 + AND s.isdel = 0 + + UPDATE hr_personal_file per