Merge remote-tracking branch 'origin/master'

hehai
zhiyong.ning 4 years ago
commit db0af09c4e
  1. 2
      src/main/java/com/msdw/tms/api/ProjectRcordControllerApi.java
  2. 5
      src/main/java/com/msdw/tms/api/UserControllerApi.java
  3. 5
      src/main/java/com/msdw/tms/controller/EvaluationRecordController.java
  4. 36
      src/main/java/com/msdw/tms/controller/ProjectRecordController.java
  5. 29
      src/main/java/com/msdw/tms/controller/UserController.java
  6. 2
      src/main/java/com/msdw/tms/dao/ProjectRecordDao.java
  7. 9
      src/main/java/com/msdw/tms/dao/UserDao.java
  8. 5
      src/main/java/com/msdw/tms/entity/UserEntity.java
  9. 4
      src/main/java/com/msdw/tms/entity/vo/UserEntityVo.java
  10. 12
      src/main/java/com/msdw/tms/entity/vo/UserProsonalEntityVo.java
  11. 2
      src/main/java/com/msdw/tms/service/ProjectRecordService.java
  12. 6
      src/main/java/com/msdw/tms/service/UserService.java
  13. 6
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  14. 25
      src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java
  15. 9
      src/main/resources/mapper/tms/ProjectRecordDao.xml
  16. 74
      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;

@ -3,9 +3,12 @@ package com.msdw.tms.api;
import com.msdw.tms.common.utils.R; import com.msdw.tms.common.utils.R;
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 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 {
@ -13,7 +16,7 @@ public interface UserControllerApi {
R userInfo(Integer id); R userInfo(Integer id);
@ApiOperation(value = "个人中心信息修改",notes = "个人中心信息修改") @ApiOperation(value = "个人中心信息修改",notes = "个人中心信息修改")
R update(UserEntity userEntity); R update(UserProsonalEntityVo userProsonalEntityVo);
@ApiOperation(value = "更新密码",notes = "更新密码") @ApiOperation(value = "更新密码",notes = "更新密码")
R examinePassword(UserEntityVo entity); R examinePassword(UserEntityVo entity);

@ -63,7 +63,7 @@ public class EvaluationRecordController implements EvaluationRecordControllerApi
Integer evaluationRecordId = evaluationRecordVO.getId(); Integer evaluationRecordId = evaluationRecordVO.getId();
String userAnswer = evaluationRecordVO.getUserAnswer(); String userAnswer = evaluationRecordVO.getUserAnswer();
Integer currentQuestionSortNo = evaluationRecordVO.getCurrentQuestionSortNo(); 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); return R.ok().put("data", recordVO);
} }
// 备份:上一题/下一题/提交 // 备份:上一题/下一题/提交
@ -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,18 +1,19 @@
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;
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.transaction.annotation.Transactional; 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.Map; import java.util.Map;
@RestController @RestController
@ -40,19 +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);
return R.ok().put("growthChangeHistory", userEntity);
return R.ok();
} }
@Override @Override
@GetMapping("/userinfo/{id}") @GetMapping("/userinfo/{id}")
public R userInfo(@PathVariable("id") Integer id){ public R userInfo(@PathVariable("id") Integer id){
UserEntityVo userEntityVo = userService.queryUserId(id);
return R.ok().put("data",userEntityVo); HashMap<String,UserProsonalEntityVo> userEntityVoList = userService.queryUserInfo(id);
// 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);
@ -64,10 +69,16 @@ public class UserController implements UserControllerApi {
* 修改 * 修改
*/ */
@Override @Override
@Transactional
@PutMapping("/update") @PutMapping("/update")
public R update(@RequestBody UserEntity userEntity){ public R update(@RequestBody UserProsonalEntityVo vo){
userService.updateById(userEntity); List<UserEntityVo> userEntityVoList = vo.getUserEntityVoList();
UserEntity userInfo = vo.getUserEntity();
userService.updateById(userInfo);
for (int i = 0;i<userEntityVoList.size();i++){
UserEntityVo personalFile = userEntityVoList.get(i);
userService.updateUserPersonal(personalFile);
}
return R.ok(); return R.ok();
} }
@ -82,7 +93,7 @@ public class UserController implements UserControllerApi {
} }
/** /**
* 校验密码 * 校验并更新密码
* @param entity 封装用户id和输入的原密码和新密码 * @param entity 封装用户id和输入的原密码和新密码
* @return R 响应的状态信息 * @return R 响应的状态信息
*/ */

@ -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,13 +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);
List<UserProsonalEntityVo> queryPersonalFile(Integer userid);
List<UserProsonalEntityVo> queryUserInfo(Integer userid);
} }

@ -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;

@ -13,6 +13,8 @@ public class UserEntityVo extends UserEntity implements Serializable {
private String searchContent; private String searchContent;
//学校名称 //学校名称
private String schoolName; private String schoolName;
//
private Integer schoolId;
//省份名称 //省份名称
private String provinceName; private String provinceName;
//城市名称 //城市名称
@ -45,6 +47,8 @@ public class UserEntityVo extends UserEntity implements Serializable {
private Integer personalCareerId; private Integer personalCareerId;
//个人档案学校名称 //个人档案学校名称
private String professionalSchoolName; private String professionalSchoolName;
//个人档案主键
private Integer personalFileId;
} }

@ -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<UserEntityVo> userEntityVoList;
}

@ -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> {
@ -13,4 +16,7 @@ public interface UserService extends IService<UserEntity> {
UserEntityVo queryUserId(Integer userId); UserEntityVo queryUserId(Integer userId);
void updateUserPersonal(UserEntityVo personalFile);
HashMap<String,UserProsonalEntityVo> queryUserInfo(Integer id);
} }

@ -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,14 +9,20 @@ 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.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")
public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService { public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService {
@Autowired
private UserDao userMapper;
@Override @Override
public PageUtils queryPage(Map<String, Object> params) { public PageUtils queryPage(Map<String, Object> params) {
@ -36,4 +42,21 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
UserEntityVo vo = userDao.getByUserId(userEntity); UserEntityVo vo = userDao.getByUserId(userEntity);
return vo; return vo;
} }
@Override
public void updateUserPersonal(UserEntityVo personalFile) {
userMapper.updateUserPersonal(personalFile);
}
@Override
public HashMap<String,UserProsonalEntityVo> queryUserInfo(Integer id) {
HashMap map = new HashMap();
//用户sql user
List<UserProsonalEntityVo> userInfo = userMapper.queryUserInfo(id);
map.put("userInfo",userInfo);
//个人档案sql
List<UserProsonalEntityVo> userEntityVos = userMapper.queryPersonalFile(id);
map.put("userPersonalFile",userEntityVos);
return map;
}
} }

@ -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,
@ -12,38 +13,77 @@
u.phone, u.phone,
u.account, u.account,
u.countries, u.countries,
c.cityId,
c.cityName, c.cityName,
u.dateBirth, u.dateBirth,
u.weChatID, u.weChatID,
u.IDNumber, u.IDNumber,
u.documentType, u.documentType,
u.educationDegree, u.educationDegree,
pro.provinceId,
pro.provinceName, pro.provinceName,
s.schoolName, s.schoolId,
per.SchoolName AS professionalSchoolName, s.schoolName
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 = 0
AND u.provinceId = c.provinceId AND u.provinceId = c.provinceId
AND u.userId = per.userId AND u.userId = #{userid}
AND pro.isdel = 0
AND c.isdel = 0
AND s.isdel = 0
</select>
<select id="queryPersonalFile" parameterType="com.msdw.tms.entity.UserEntity" resultType="com.msdw.tms.entity.vo.UserEntityVo">
SELECT
per.personalFileId,
per.schoolId,
per.schoolName,
disciplineId,
disciplineName,
professionalClassId,
per.professionalClassName,
per.professionalId,
per.professionalName,
per.personalCareerId,
s.cityId,
s.cityName,
s.provinceId,
s.provinceName
FROM
hr_personal_file per,
school s
WHERE
per.schoolId = s.schoolId
AND per.userId = #{userid} AND per.userId = #{userid}
AND pro.isdel = #{isdel} AND s.isdel = 0
AND c.isdel = #{isdel}
AND s.isdel = #{isdel}
</select> </select>
<update id="updateUserPersonal" parameterType="com.msdw.tms.entity.vo.UserProsonalEntityVo">
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}
</update>
</mapper> </mapper>
Loading…
Cancel
Save