个人中心更新资料

hehai
mzh820631607 4 years ago
parent 3bbaabd871
commit a9a9c3c0fe
  1. 2
      src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java
  2. 4
      src/main/java/com/msdw/tms/api/UserControllerApi.java
  3. 3
      src/main/java/com/msdw/tms/controller/EvaluationRecordController.java
  4. 36
      src/main/java/com/msdw/tms/controller/ProjectRecordController.java
  5. 18
      src/main/java/com/msdw/tms/controller/UserController.java
  6. 2
      src/main/java/com/msdw/tms/dao/ProjectRecordDao.java
  7. 7
      src/main/java/com/msdw/tms/dao/UserDao.java
  8. 4
      src/main/java/com/msdw/tms/entity/EvaluationQuestionEntity.java
  9. 5
      src/main/java/com/msdw/tms/entity/UserEntity.java
  10. 2
      src/main/java/com/msdw/tms/service/ProjectRecordService.java
  11. 5
      src/main/java/com/msdw/tms/service/UserService.java
  12. 6
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  13. 16
      src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java
  14. 2
      src/main/resources/mapper/tms/EvaluationQuestionDao.xml
  15. 9
      src/main/resources/mapper/tms/ProjectRecordDao.xml
  16. 54
      src/main/resources/mapper/tms/UserDao.xml

@ -27,7 +27,7 @@ public interface ProjectRcordControllerApi {
R getUserScore(Integer userid); R getUserScore(Integer userid);
@ApiOperation(value = "个人实验记录导出",notes = "个人实验记录导出") @ApiOperation(value = "个人实验记录导出",notes = "个人实验记录导出")
void exportProjectRecord(HttpServletResponse response,ProjectRecordVo list)throws Exception; void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception;
// @ApiOperation(value = "个人实验记录导出",notes = "个人实验记录导出") // @ApiOperation(value = "个人实验记录导出",notes = "个人实验记录导出")
// void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception; // void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception;

@ -7,11 +7,13 @@ import com.msdw.tms.entity.vo.UserProsonalEntityVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import java.util.List;
@Api(value = "用户个人中心",tags = "用户个人中心信息展示,信息修改") @Api(value = "用户个人中心",tags = "用户个人中心信息展示,信息修改")
public interface UserControllerApi { public interface UserControllerApi {
@ApiOperation(value = "个人中心信息展示",notes = "个人中心信息展示") @ApiOperation(value = "个人中心信息展示",notes = "个人中心信息展示")
R userInfo(Integer id); R userInfo(Integer id, List<Integer> personalFileId);
@ApiOperation(value = "个人中心信息修改",notes = "个人中心信息修改") @ApiOperation(value = "个人中心信息修改",notes = "个人中心信息修改")
R update(UserProsonalEntityVo userProsonalEntityVo); R update(UserProsonalEntityVo userProsonalEntityVo);

@ -139,4 +139,7 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi
return R.ok().put("data", openExperiment); return R.ok().put("data", openExperiment);
} }
} }

@ -61,8 +61,8 @@ public class ProjectRecordController implements ProjectRcordControllerApi {
*/ */
@Override @Override
@GetMapping("/user/record") @GetMapping("/user/record")
public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userid){ public R queryUserRecord(@RequestParam Integer page,@RequestParam Integer size,@RequestParam Integer userId){
PageUtils page1 = projectRecordService.queryPage(page,size,userid); PageUtils page1 = projectRecordService.queryPage(page,size,userId);
return R.ok().put("data", page1); 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 response
// * @param userId
// * @throws Exception // * @throws Exception
// */ // */
// @Override // @Override
// @GetMapping("/user/exportProjectRecord") // @PostMapping("/user/exportProjectRecord")
// public void exportProjectRecord(HttpServletResponse response,@RequestParam("userId") Integer userId)throws Exception{ // public void exportProjectRecord(HttpServletResponse response,@RequestBody ProjectRecordVo list)throws Exception{
// projectRecordService.exportProjectRecord(response,userId); // 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);
}
/** /**
* 信息 * 信息
*/ */

@ -1,7 +1,5 @@
package com.msdw.tms.controller; 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.api.UserControllerApi;
import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.common.utils.R; import com.msdw.tms.common.utils.R;
@ -14,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -42,20 +41,23 @@ public class UserController implements UserControllerApi {
public R info(@PathVariable("id") Long id){ public R info(@PathVariable("id") Long id){
UserEntity userEntity = userService.getById(id); UserEntity userEntity = userService.getById(id);
// userService.queryUserInfo();
return R.ok().put("growthChangeHistory", userEntity); return R.ok();
} }
@Override @Override
@GetMapping("/userinfo/{id}") @PostMapping("/userinfo/{id}")
public R userInfo(@PathVariable("id") Integer id){ public R userInfo(@PathVariable("id") Integer id,@RequestBody List<Integer> personalFileId){
UserEntityVo userEntityVo = userService.queryUserId(id);
return R.ok().put("data",userEntityVo); HashMap<String,UserProsonalEntityVo> userEntityVoList = userService.queryUserInfo(id,personalFileId);
// UserEntityVo userEntityVo = userService.queryUserId(id);
return R.ok().put("data",userEntityVoList);
} }
/** /**
* 保存 * 保存
*/ */
@Override
@PostMapping("/save") @PostMapping("/save")
public R save(@RequestBody UserEntity userEntity){ public R save(@RequestBody UserEntity userEntity){
userService.save(userEntity); userService.save(userEntity);

@ -24,7 +24,7 @@ public interface ProjectRecordDao extends BaseMapper<ProjectRecordEntity> {
IPage<ProjectRecordVo> getByUserExperimentRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity); IPage<ProjectRecordVo> getByUserExperimentRecord(Page page,@Param("pro") ProjectRecordEntity projectRecordEntity);
List<ProjectRecordVo> getByUserRecordImport(@Param("pro") ProjectRecordEntity projectRecordEntity,List<Integer> projectIds); List<ProjectRecordVo> getByUserRecordImport(ProjectRecordEntity projectRecordEntity);
ProjectRecordVo getByUserScore(@Param("userid") Integer userId,@Param("isdel") Integer isdel); ProjectRecordVo getByUserScore(@Param("userid") Integer userId,@Param("isdel") Integer isdel);

@ -1,15 +1,20 @@
package com.msdw.tms.dao; package com.msdw.tms.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.msdw.tms.entity.ExperimentalTeachingEntity;
import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.UserEntityVo; import com.msdw.tms.entity.vo.UserEntityVo;
import com.msdw.tms.entity.vo.UserProsonalEntityVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper @Mapper
public interface UserDao extends BaseMapper<UserEntity> { public interface UserDao extends BaseMapper<UserEntity> {
UserEntityVo getByUserId(UserEntity userEntity); UserEntityVo getByUserId(UserEntity userEntity);
void updateUserPersonal(UserEntityVo vo); void updateUserPersonal(UserEntityVo vo);
List<UserProsonalEntityVo> queryPersonalFile(Integer userid,List<Integer> personalFileId);
List<UserProsonalEntityVo> queryUserInfo(Integer userid);
} }

@ -55,5 +55,9 @@ public class EvaluationQuestionEntity implements Serializable {
* 试题得分 * 试题得分
*/ */
private Integer questionScore; private Integer questionScore;
/**
* 测评类型(0虚拟仿真实验1教学实验)
*/
private Integer type;
} }

@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
@Accessors(chain = true) @Accessors(chain = true)
@Data @Data
@TableName("hr_user_info") @TableName("hr_user_info")
public class UserEntity { public class UserEntity implements Serializable {
private static final long serialVersionUID = 1L;
//用户id //用户id
@TableId @TableId
private Integer userid; private Integer userid;

@ -23,7 +23,7 @@ public interface ProjectRecordService extends IService<ProjectRecordEntity> {
ProjectRecordVo queryUserScore(Integer userId); 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); PageUtils querySchoolRecord(Integer page,Integer size,ProjectRecordVo projectRecord);

@ -4,7 +4,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.UserEntityVo; 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; import java.util.Map;
public interface UserService extends IService<UserEntity> { public interface UserService extends IService<UserEntity> {
@ -14,4 +17,6 @@ public interface UserService extends IService<UserEntity> {
UserEntityVo queryUserId(Integer userId); UserEntityVo queryUserId(Integer userId);
void updateUserPersonal(UserEntityVo personalFile); void updateUserPersonal(UserEntityVo personalFile);
HashMap<String,UserProsonalEntityVo> queryUserInfo(Integer id, List<Integer> personalFileId);
} }

@ -70,13 +70,11 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
} }
@Override @Override
public void exportProjectRecord(HttpServletResponse response,ProjectRecordVo vo)throws Exception{ public void exportProjectRecord(HttpServletResponse response,Integer userId)throws Exception{
//获取数据 //获取数据
Integer userId = vo.getUserId();
List<Integer> projectIds = vo.getProjectIds();
ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userId).setIsdel(Constant.IsDel.NOT_DEL.getType()); ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userId).setIsdel(Constant.IsDel.NOT_DEL.getType());
List<ProjectRecordVo> projectRecordVos = this.baseMapper.getByUserRecordImport(projectRecord,projectIds); List<ProjectRecordVo> projectRecordVos = this.baseMapper.getByUserRecordImport(projectRecord);
List<ProjectRecordImportRequest> importRequests = projectRecordVos.stream().map(project -> { List<ProjectRecordImportRequest> importRequests = projectRecordVos.stream().map(project -> {
ProjectRecordImportRequest request = new ProjectRecordImportRequest(); ProjectRecordImportRequest request = new ProjectRecordImportRequest();

@ -9,10 +9,14 @@ import com.msdw.tms.common.utils.Query;
import com.msdw.tms.dao.UserDao; import com.msdw.tms.dao.UserDao;
import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.UserEntityVo; import com.msdw.tms.entity.vo.UserEntityVo;
import com.msdw.tms.entity.vo.UserProsonalEntityVo;
import com.msdw.tms.service.UserService; import com.msdw.tms.service.UserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
@Service("userService") @Service("userService")
@ -43,4 +47,16 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
public void updateUserPersonal(UserEntityVo personalFile) { public void updateUserPersonal(UserEntityVo personalFile) {
userMapper.updateUserPersonal(personalFile); userMapper.updateUserPersonal(personalFile);
} }
@Override
public HashMap<String,UserProsonalEntityVo> queryUserInfo(Integer id,List<Integer> personalIds) {
HashMap map = new HashMap();
//用户sql user
List<UserProsonalEntityVo> userInfo = userMapper.queryUserInfo(id);
map.put("userInfo",userInfo);
//个人档案sql
List<UserProsonalEntityVo> userEntityVos = userMapper.queryPersonalFile(id, personalIds);
map.put("userPersonalFile",userEntityVos);
return map;
}
} }

@ -19,6 +19,8 @@
<update id="updateById" parameterType="com.msdw.tms.entity.EvaluationQuestionEntity"> <update id="updateById" parameterType="com.msdw.tms.entity.EvaluationQuestionEntity">
UPDATE UPDATE
tms_evaluation_question tms_evaluation_question
set
type = 0,
<set> <set>
<if test="questionStatus != null"> <if test="questionStatus != null">
question_status=#{questionStatus, jdbcType=INTEGER}, question_status=#{questionStatus, jdbcType=INTEGER},

@ -69,14 +69,9 @@
tms_project_record tpr tms_project_record tpr
LEFT JOIN tms_project tp ON tpr.projectId = tp.projectId LEFT JOIN tms_project tp ON tpr.projectId = tp.projectId
WHERE WHERE
tpr.userId = #{pro.userid} tpr.userId = #{userid}
AND AND
tpr.isdel = #{pro.isdel} tpr.isdel = #{isdel}
<if test="projectIds!=null"> AND tpr.projectId IN
<foreach collection="projectIds" item="projectId" separator=",">
#{projectId}
</foreach>
</if>
</select> </select>
<!-- 个人实验预览--> <!-- 个人实验预览-->

@ -3,7 +3,8 @@
<mapper namespace="com.msdw.tms.dao.UserDao"> <mapper namespace="com.msdw.tms.dao.UserDao">
<select id="getByUserId" parameterType="com.msdw.tms.entity.UserEntity" resultType="com.msdw.tms.entity.vo.UserEntityVo">
<select id="queryUserInfo" resultType="hashMap">
SELECT SELECT
u.userId, u.userId,
userName, userName,
@ -19,34 +20,51 @@
u.documentType, u.documentType,
u.educationDegree, u.educationDegree,
pro.provinceName, pro.provinceName,
s.schoolName, s.schoolName
per.SchoolName AS professionalSchoolName,
per.disciplineName,
per.professionalClassName,
per.professionalName,
per.personalCareerId,
s.cityName AS personalCityName,
s.provinceName AS personalProvinceName
FROM FROM
hr_user_info u, hr_user_info u,
hr_personal_file per,
school s, school s,
city c, city c,
province pro province pro
WHERE WHERE
per.schoolId = s.schoolId u.provinceId = pro.provinceId
AND u.provinceId = pro.provinceId
AND u.schoolId = s.schoolId AND u.schoolId = s.schoolId
AND u.cityId = c.cityId AND u.cityId = c.cityId
AND u.isdel = #{isdel} AND u.isdel = #{pro.isdel}
AND u.provinceId = c.provinceId AND u.provinceId = c.provinceId
AND u.userId = per.userId AND u.userId = #{userid}
AND per.userId = #{userid} AND pro.isdel = 0
AND pro.isdel = #{isdel} AND c.isdel = 0
AND c.isdel = #{isdel} AND s.isdel = 0
AND s.isdel = #{isdel}
</select> </select>
<select id="queryPersonalFile" parameterType="com.msdw.tms.entity.UserEntity" resultType="com.msdw.tms.entity.vo.UserEntityVo">
SELECT
per.schoolId AS personalSchoolId,
per.SchoolName AS personalSchoolName,
disciplineId,
disciplineName,
professionalClassId,
per.professionalClassName,
per.professionalId,
per.professionalName,
per.personalCareerId,
s.cityName AS personalCityName,
s.provinceName AS personalProvinceName
FROM
hr_personal_file per,
school s
WHERE
per.schoolId = s.schoolId
AND per.userId = #{userid}
AND s.isdel = 0
AND per.personalFileId IN
<foreach collection="personalFileId" item="personalFileId" separator="," open="(" close=")">
#{personalFileId}
</foreach>
</select>
<update id="updateUserPersonal" parameterType="com.msdw.tms.entity.vo.UserProsonalEntityVo"> <update id="updateUserPersonal" parameterType="com.msdw.tms.entity.vo.UserProsonalEntityVo">
UPDATE UPDATE
hr_personal_file per hr_personal_file per

Loading…
Cancel
Save