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 56c016a..105dd4d 100644 --- a/src/main/java/com/msdw/tms/api/UserControllerApi.java +++ b/src/main/java/com/msdw/tms/api/UserControllerApi.java @@ -3,9 +3,12 @@ package com.msdw.tms.api; import com.msdw.tms.common.utils.R; import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.vo.UserEntityVo; +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 { @@ -13,7 +16,7 @@ public interface UserControllerApi { R userInfo(Integer id); @ApiOperation(value = "个人中心信息修改",notes = "个人中心信息修改") - R update(UserEntity userEntity); + R update(UserProsonalEntityVo userProsonalEntityVo); @ApiOperation(value = "更新密码",notes = "更新密码") R examinePassword(UserEntityVo entity); diff --git a/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java b/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java index ed792eb..f9aef3e 100644 --- a/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java +++ b/src/main/java/com/msdw/tms/controller/EvaluationRecordController.java @@ -63,7 +63,7 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi Integer evaluationRecordId = evaluationRecordVO.getId(); String userAnswer = evaluationRecordVO.getUserAnswer(); Integer currentQuestionSortNo = evaluationRecordVO.getCurrentQuestionSortNo(); - EvaluationRecordVO recordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo + 1); + EvaluationRecordVO recordVO = evaluationRecordService.convertQuestion(evaluationRecordId, currentQuestionSortNo, userAnswer, currentQuestionSortNo - 1); return R.ok().put("data", recordVO); } // 备份:上一题/下一题/提交 @@ -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 18c8bde..097438e 100644 --- a/src/main/java/com/msdw/tms/controller/UserController.java +++ b/src/main/java/com/msdw/tms/controller/UserController.java @@ -1,18 +1,19 @@ 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; 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.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; @RestController @@ -40,19 +41,23 @@ public class UserController implements UserControllerApi { public R info(@PathVariable("id") Long id){ UserEntity userEntity = userService.getById(id); - 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); + + HashMap userEntityVoList = userService.queryUserInfo(id); +// UserEntityVo userEntityVo = userService.queryUserId(id); + return R.ok().put("data",userEntityVoList); } /** * 保存 */ + @Override @PostMapping("/save") public R save(@RequestBody UserEntity userEntity){ userService.save(userEntity); @@ -64,10 +69,16 @@ public class UserController implements UserControllerApi { * 修改 */ @Override + @Transactional @PutMapping("/update") - public R update(@RequestBody UserEntity userEntity){ - userService.updateById(userEntity); - + public R update(@RequestBody UserProsonalEntityVo vo){ + List userEntityVoList = vo.getUserEntityVoList(); + UserEntity userInfo = vo.getUserEntity(); + userService.updateById(userInfo); + for (int i = 0;i { 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 129bf2b..b0f20ef 100644 --- a/src/main/java/com/msdw/tms/dao/UserDao.java +++ b/src/main/java/com/msdw/tms/dao/UserDao.java @@ -1,13 +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 queryUserInfo(Integer userid); } 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/entity/vo/UserEntityVo.java b/src/main/java/com/msdw/tms/entity/vo/UserEntityVo.java index 1b4831f..c6a7e0d 100644 --- a/src/main/java/com/msdw/tms/entity/vo/UserEntityVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/UserEntityVo.java @@ -13,6 +13,8 @@ public class UserEntityVo extends UserEntity implements Serializable { private String searchContent; //学校名称 private String schoolName; + // + private Integer schoolId; //省份名称 private String provinceName; //城市名称 @@ -45,6 +47,8 @@ public class UserEntityVo extends UserEntity implements Serializable { private Integer personalCareerId; //个人档案学校名称 private String professionalSchoolName; + //个人档案主键 + private Integer personalFileId; } diff --git a/src/main/java/com/msdw/tms/entity/vo/UserProsonalEntityVo.java b/src/main/java/com/msdw/tms/entity/vo/UserProsonalEntityVo.java new file mode 100644 index 0000000..2579d87 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/UserProsonalEntityVo.java @@ -0,0 +1,12 @@ +package com.msdw.tms.entity.vo; + +import com.msdw.tms.entity.UserEntity; +import lombok.Data; + +import java.util.List; +@Data +public class UserProsonalEntityVo { + private UserEntity userEntity; + private List userEntityVoList; + +} 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 da5422b..1f1541e 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 { @@ -13,4 +16,7 @@ public interface UserService extends IService { UserEntityVo queryUserId(Integer userId); + void updateUserPersonal(UserEntityVo personalFile); + + HashMap queryUserInfo(Integer id); } 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 0525ad5..92385ca 100644 --- a/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java @@ -9,14 +9,20 @@ 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") public class UserServiceImpl extends ServiceImpl implements UserService { - + @Autowired + private UserDao userMapper; @Override public PageUtils queryPage(Map params) { @@ -36,4 +42,21 @@ public class UserServiceImpl extends ServiceImpl implements UserEntityVo vo = userDao.getByUserId(userEntity); return vo; } + + @Override + public void updateUserPersonal(UserEntityVo personalFile) { + userMapper.updateUserPersonal(personalFile); + } + + @Override + public HashMap queryUserInfo(Integer id) { + HashMap map = new HashMap(); + //用户sql user + List userInfo = userMapper.queryUserInfo(id); + map.put("userInfo",userInfo); + //个人档案sql + List userEntityVos = userMapper.queryPersonalFile(id); + map.put("userPersonalFile",userEntityVos); + return map; + } } 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 ae30c52..01a0fbe 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, @@ -12,38 +13,77 @@ u.phone, u.account, u.countries, + c.cityId, c.cityName, u.dateBirth, u.weChatID, u.IDNumber, u.documentType, u.educationDegree, + pro.provinceId, 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.schoolId, + 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 = 0 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 + SET + per.personalCareerId = #{personalCareerId}, + per.schoolId = #{schoolId}, + per.schoolName = #{schoolName}, + per.disciplineId = #{disciplineId}, + per.disciplineName = #{disciplineName}, + per.professionalId = #{professionalId}, + per.professionalName = #{professionalName}, + per.professionalClassId = #{professionalClassId}, + per.professionalClassName = #{professionalClassName}, + per.updatetime = NOW() + WHERE + per.userId = #{userid} + AND + per.personalFileId = #{personalFileId} + + \ No newline at end of file