From 3bbaabd8714e8adf09050f559f320be7d652db7c Mon Sep 17 00:00:00 2001 From: mzh820631607 Date: Sun, 27 Sep 2020 16:56:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=B5=84=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/msdw/tms/api/UserControllerApi.java | 3 ++- .../msdw/tms/controller/UserController.java | 17 +++++++++++---- src/main/java/com/msdw/tms/dao/UserDao.java | 2 ++ .../com/msdw/tms/entity/vo/UserEntityVo.java | 6 ++++++ .../tms/entity/vo/UserProsonalEntityVo.java | 12 +++++++++++ .../com/msdw/tms/service/UserService.java | 1 + .../tms/service/impl/UserServiceImpl.java | 9 +++++++- src/main/resources/mapper/tms/UserDao.xml | 21 +++++++++++++++++++ 8 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/msdw/tms/entity/vo/UserProsonalEntityVo.java diff --git a/src/main/java/com/msdw/tms/api/UserControllerApi.java b/src/main/java/com/msdw/tms/api/UserControllerApi.java index da2b123..2141e17 100644 --- a/src/main/java/com/msdw/tms/api/UserControllerApi.java +++ b/src/main/java/com/msdw/tms/api/UserControllerApi.java @@ -3,6 +3,7 @@ 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; @@ -13,7 +14,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/UserController.java b/src/main/java/com/msdw/tms/controller/UserController.java index 18c8bde..dd2f233 100644 --- a/src/main/java/com/msdw/tms/controller/UserController.java +++ b/src/main/java/com/msdw/tms/controller/UserController.java @@ -7,12 +7,14 @@ 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.List; import java.util.Map; @RestController @@ -40,6 +42,7 @@ 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); } @@ -64,10 +67,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 { UserEntityVo getByUserId(UserEntity userEntity); + + void updateUserPersonal(UserEntityVo vo); } 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..3f2f1a2 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,10 @@ public class UserEntityVo extends UserEntity implements Serializable { private Integer personalCareerId; //个人档案学校名称 private String professionalSchoolName; + //个人档案主键 + private Integer personalFileId; + //绑定用户ID + private Integer userId; } 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/UserService.java b/src/main/java/com/msdw/tms/service/UserService.java index da5422b..6906da5 100644 --- a/src/main/java/com/msdw/tms/service/UserService.java +++ b/src/main/java/com/msdw/tms/service/UserService.java @@ -13,4 +13,5 @@ public interface UserService extends IService { UserEntityVo queryUserId(Integer userId); + void updateUserPersonal(UserEntityVo personalFile); } 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..22c27e8 100644 --- a/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/UserServiceImpl.java @@ -10,13 +10,15 @@ import com.msdw.tms.dao.UserDao; import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.vo.UserEntityVo; import com.msdw.tms.service.UserService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; 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 +38,9 @@ public class UserServiceImpl extends ServiceImpl implements UserEntityVo vo = userDao.getByUserId(userEntity); return vo; } + + @Override + public void updateUserPersonal(UserEntityVo personalFile) { + userMapper.updateUserPersonal(personalFile); + } } diff --git a/src/main/resources/mapper/tms/UserDao.xml b/src/main/resources/mapper/tms/UserDao.xml index ae30c52..3268724 100644 --- a/src/main/resources/mapper/tms/UserDao.xml +++ b/src/main/resources/mapper/tms/UserDao.xml @@ -46,4 +46,25 @@ AND c.isdel = #{isdel} AND s.isdel = #{isdel} + + + 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