|
|
|
@ -3,9 +3,13 @@ package com.msdw.tms.controller; |
|
|
|
|
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.PersonalFileEntity; |
|
|
|
|
import com.msdw.tms.entity.UserEntity; |
|
|
|
|
import com.msdw.tms.entity.UserInfoEntity; |
|
|
|
|
import com.msdw.tms.entity.UserPersonalFileEntity; |
|
|
|
|
import com.msdw.tms.entity.vo.UserEntityVo; |
|
|
|
|
import com.msdw.tms.entity.vo.UserProsonalEntityVo; |
|
|
|
|
import com.msdw.tms.service.UserInfoService; |
|
|
|
|
import com.msdw.tms.service.UserService; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
@ -22,6 +26,8 @@ public class UserController implements UserControllerApi { |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private UserService userService; |
|
|
|
|
@Autowired |
|
|
|
|
private UserInfoService userInfoService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 列表 |
|
|
|
@ -71,15 +77,33 @@ public class UserController implements UserControllerApi { |
|
|
|
|
@Transactional |
|
|
|
|
@PutMapping("/update") |
|
|
|
|
public R update(@RequestBody UserProsonalEntityVo vo){ |
|
|
|
|
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); |
|
|
|
|
List<UserPersonalFileEntity> entityList = vo.getPersonalFileEntities(); |
|
|
|
|
UserInfoEntity userInfo = vo.getUserInfoEntity(); |
|
|
|
|
|
|
|
|
|
userInfoService.updateUserInfoById(userInfo); |
|
|
|
|
// userInfoService.updateById(userInfo);
|
|
|
|
|
for (int i = 0;i<entityList.size();i++){ |
|
|
|
|
UserPersonalFileEntity personalFile = entityList.get(i); |
|
|
|
|
userService.updateUserPersonal(personalFile); |
|
|
|
|
} |
|
|
|
|
return R.ok(); |
|
|
|
|
} |
|
|
|
|
// /**
|
|
|
|
|
// * 修改
|
|
|
|
|
// */
|
|
|
|
|
// @Override
|
|
|
|
|
// @Transactional
|
|
|
|
|
// @PutMapping("/update")
|
|
|
|
|
// public R update(@RequestBody UserProsonalEntityVo vo){
|
|
|
|
|
// 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();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 删除 |
|
|
|
|