|
@@ -1,5 +1,6 @@
|
|
|
package com.diagbot.web;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -29,6 +30,7 @@ import com.diagbot.facade.UserAuthenticationFacade;
|
|
|
import com.diagbot.facade.UserFacade;
|
|
|
import com.diagbot.facade.UserOrganizationFacade;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
+import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.OrganizationVO;
|
|
|
import com.diagbot.vo.UserAndOrganizationVO;
|
|
|
import com.diagbot.vo.UserInfoAuditVO;
|
|
@@ -71,8 +73,19 @@ public class UserInfoController {
|
|
|
@ApiOperation(value = "修改用户信息和机构信息", notes = "用户信息和机构信息")
|
|
|
@PostMapping("/updateUserInfoAll")
|
|
|
@SysLogger("updateUserInfoAll")
|
|
|
- public RespDTO<UserInfoOrganizationsVO> updateUserInfoAll(@Valid @RequestBody UserInfoOrganizationsVO userInfo) {
|
|
|
- int res = userFacade.updateUserInfoAll(userInfo);
|
|
|
+ public RespDTO<UserInfoOrganizationsVO> updateUserInfoAll(
|
|
|
+ @Valid @RequestBody UserInfoOrganizationsVO userInfoOrganizationsVO) {
|
|
|
+ Map<String, Object> userMap = new HashMap<String, Object>();
|
|
|
+ // TODO wangfeng userMap.put("modifier",
|
|
|
+ // UserUtils.getCurrentPrincipleID());
|
|
|
+ userMap.put("gmtModified", DateUtil.now());
|
|
|
+ userMap.put("email", userInfoOrganizationsVO.getEmail());
|
|
|
+ userMap.put("principal", userInfoOrganizationsVO.getPrincipal());
|
|
|
+ userMap.put("address", userInfoOrganizationsVO.getAddress());
|
|
|
+ userMap.put("type", userInfoOrganizationsVO.getType());
|
|
|
+ userMap.put("position", userInfoOrganizationsVO.getPosition());
|
|
|
+ userMap.put("userId", userInfoOrganizationsVO.getUserId());
|
|
|
+ int res = userFacade.updateUserInfoAll(userMap);
|
|
|
|
|
|
if (res != 0) {
|
|
|
return RespDTO.onSuc("修改用户信息成功!");
|
|
@@ -86,8 +99,8 @@ public class UserInfoController {
|
|
|
public RespDTO<UserInfoAuditVO> auditUserInfoAll(@Valid @RequestBody UserInfoAuditVO userInfoAuditVO) {
|
|
|
Map<String, Object> auditMap = new HashMap<String, Object>();
|
|
|
auditMap.put("userId", userInfoAuditVO.getUserId());
|
|
|
- // TODO auditMap.put("modifier",UserUtils.getCurrentPrincipleID());
|
|
|
- auditMap.put("modifier", "5");
|
|
|
+ // TODO wangfeng auditMap.put("modifier",
|
|
|
+ // UserUtils.getCurrentPrincipleID());
|
|
|
auditMap.put("gmtModified", DateUtil.now());
|
|
|
auditMap.put("isReject", userInfoAuditVO.getIsReject());
|
|
|
auditMap.put("rejectComment", userInfoAuditVO.getRejectComment());
|
|
@@ -107,8 +120,7 @@ public class UserInfoController {
|
|
|
public RespDTO updateDeleted(@RequestParam String userId) {
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
map.put("userId", userId);
|
|
|
- // TODO map.put("modifier",UserUtils.getCurrentPrincipleID());
|
|
|
- map.put("modifier", "5");
|
|
|
+ // TODO wangfeng map.put("modifier",UserUtils.getCurrentPrincipleID());
|
|
|
map.put("gmtModified", DateUtil.now());
|
|
|
int res = userFacade.updateDeleted(map);
|
|
|
return RespDTO.onSuc("刪除成功" + res);
|
|
@@ -128,7 +140,7 @@ public class UserInfoController {
|
|
|
@PostMapping("/addOrganization")
|
|
|
@SysLogger("addOrganization")
|
|
|
public RespDTO<OrganizationVO> addOrganization(@Valid @RequestBody OrganizationVO organizationVO) {
|
|
|
- // TODO
|
|
|
+
|
|
|
String organizationName = organizationVO.getOrganizationName();
|
|
|
List<Organization> organizationList = organizationFacade.findOrganization(organizationName);
|
|
|
if (organizationList.size() > 0) {
|
|
@@ -141,8 +153,9 @@ public class UserInfoController {
|
|
|
organization.setSubNum(organizationVO.getSubNum());
|
|
|
organization.setAddress(organizationVO.getAddress());
|
|
|
organization.setGmtCreate(DateUtil.now());
|
|
|
- // TODO organization.setModifier(UserUtils.getCurrentPrincipleID());
|
|
|
- organization.setCreator("5");
|
|
|
+ // TODO wangfeng
|
|
|
+ // organization.setModifier(UserUtils.getCurrentPrincipleID());
|
|
|
+ // organization.setCreator("5");
|
|
|
|
|
|
boolean res = organizationFacade.save(organization);
|
|
|
|
|
@@ -176,7 +189,7 @@ public class UserInfoController {
|
|
|
}
|
|
|
|
|
|
User user = new User();
|
|
|
- user.setCreator("5");
|
|
|
+ // TODO wangfeng user.setCreator("5");
|
|
|
user.setUsername(userAndOrganizationVO.getUserName());
|
|
|
PasswordEncoder passwordEncoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
|
|
|
String entryPassword = passwordEncoder.encode(userAndOrganizationVO.getPassWord());
|
|
@@ -189,7 +202,9 @@ public class UserInfoController {
|
|
|
Long userId = user.getId();
|
|
|
// 用户信息的认证
|
|
|
UserAuthentication userAuthentication = new UserAuthentication();
|
|
|
- userAuthentication.setCreator("5");// 创建人Id
|
|
|
+ // TODO wangfeng
|
|
|
+ // userAuthentication.setCreator(UserUtils.getCurrentPrincipleID());//
|
|
|
+ // 创建人Id
|
|
|
userAuthentication.setGmtCreate(DateUtil.now());// 记录创建时间
|
|
|
userAuthentication.setPosition(userAndOrganizationVO.getPosition());// 岗位信息
|
|
|
userAuthentication.setUserId(userId);// 用户id
|
|
@@ -199,7 +214,9 @@ public class UserInfoController {
|
|
|
|
|
|
// 用户信息和机构信息的绑定
|
|
|
UserOrganization userOrganization = new UserOrganization();
|
|
|
- userOrganization.setCreator("5");// 创建人Id
|
|
|
+ // TODO wangfeng
|
|
|
+ // userOrganization.setCreator(UserUtils.getCurrentPrincipleID());//
|
|
|
+ // 创建人Id
|
|
|
userOrganization.setGmtCreate(DateUtil.now());
|
|
|
userOrganization.setOrganizationId(userAndOrganizationVO.getOrganizationid());// 机构id
|
|
|
userOrganization.setUserId(userId);// 用户id
|