zhoutg 6 éve
szülő
commit
84e928f387

+ 41 - 52
user-service/src/main/java/com/diagbot/facade/UserFacade.java

@@ -861,42 +861,37 @@ public class UserFacade extends UserServiceImpl {
         user.setLinkman(userAndOrganizationVO.getLinkman());
         user.setGmtCreate(DateUtil.now());
         user.setEmail(userAndOrganizationVO.getEmail());
-        boolean res = save(user);
-        if (res == true) {
-            Long userId = user.getId();
-            // 用户信息的认证
-            UserAuthentication userAuthentication = new UserAuthentication();
-            userAuthentication.setCreator(UserUtils.getCurrentPrincipleID());//
-            // 创建人Id
-            userAuthentication.setGmtCreate(DateUtil.now());// 记录创建时间
-            userAuthentication.setPosition(userAndOrganizationVO.getPosition());// 岗位信息
-            userAuthentication.setUserId(userId);// 用户id
-            userAuthentication.setIsReject(RejectEnum.PASS.getKey());// 是否通过认证 0:未通过,1:已通过
-            userAuthentication.setStatus(AuthStatusEnum.Authorized.getKey());// 认证状态(0:未认证,1:已认证,2:认证中)
-            userAuthenticationFacade.save(userAuthentication);
-
-            // 用户信息和机构信息的绑定
-            UserOrganization userOrganization = new UserOrganization();
-            userOrganization.setCreator(UserUtils.getCurrentPrincipleID());//
-            // 创建人Id
-            userOrganization.setGmtCreate(DateUtil.now());
-            userOrganization.setOrganizationId(userAndOrganizationVO.getOrganizationid());// 机构id
-            userOrganization.setUserId(userId);// 用户id
-
-            res = userOrganizationFacade.save(userOrganization);
-
-            UserRole userRole = new UserRole();
-            userRole.setUserId(user.getId());
-            userRole.setRoleId(1L);
-            userRole.setGmtCreate(new Date());
-            userRole.setCreator(UserUtils.getCurrentPrincipleID());
-            userRoleFacade.save(userRole);
+        save(user);
+
+        Long userId = user.getId();
+        // 用户信息的认证
+        UserAuthentication userAuthentication = new UserAuthentication();
+        userAuthentication.setCreator(UserUtils.getCurrentPrincipleID());//
+        // 创建人Id
+        userAuthentication.setGmtCreate(DateUtil.now());// 记录创建时间
+        userAuthentication.setPosition(userAndOrganizationVO.getPosition());// 岗位信息
+        userAuthentication.setUserId(userId);// 用户id
+        userAuthentication.setIsReject(RejectEnum.PASS.getKey());// 是否通过认证 0:未通过,1:已通过
+        userAuthentication.setStatus(AuthStatusEnum.Authorized.getKey());// 认证状态(0:未认证,1:已认证,2:认证中)
+        userAuthenticationFacade.save(userAuthentication);
+
+        // 用户信息和机构信息的绑定
+        UserOrganization userOrganization = new UserOrganization();
+        userOrganization.setCreator(UserUtils.getCurrentPrincipleID());//
+        // 创建人Id
+        userOrganization.setGmtCreate(DateUtil.now());
+        userOrganization.setOrganizationId(userAndOrganizationVO.getOrganizationid());// 机构id
+        userOrganization.setUserId(userId);// 用户id
 
-        } else {
-            throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED);
-        }
+        userOrganizationFacade.save(userOrganization);
 
-        return RespDTO.onSuc(res);
+        UserRole userRole = new UserRole();
+        userRole.setUserId(user.getId());
+        userRole.setRoleId(1L);
+        userRole.setGmtCreate(new Date());
+        userRole.setCreator(UserUtils.getCurrentPrincipleID());
+        userRoleFacade.save(userRole);
+        return RespDTO.onSuc(true);
     }
 
 
@@ -959,7 +954,7 @@ public class UserFacade extends UserServiceImpl {
     /**
      * 1.分页查询注册用户信息接口 queryUserInformation
      * @param page
-     * @param orgName
+     * @param userName
      * @param autStatus
      * @return
      */
@@ -1283,18 +1278,15 @@ public class UserFacade extends UserServiceImpl {
 
     //超管修改用户信息接口
 	public RespDTO<Boolean> updateUserInfos(AmendUserInfoVO amendUserInfoVO) {
-		 Map<String, Object> amendUserInfo = new HashMap<String, Object>();
-		 amendUserInfo.put("modifier", UserUtils.getCurrentPrincipleID());
-		 amendUserInfo.put("gmtModified", DateUtil.now());
-		 amendUserInfo.put("email", amendUserInfoVO.getEmail());
-		 amendUserInfo.put("userId", amendUserInfoVO.getUserId());
-		 amendUserInfo.put("autPosition",amendUserInfoVO.getAutPosition());
-		 amendUserInfo.put("linKman",amendUserInfoVO.getLinKman());
-	        boolean res = updateUserInfo(amendUserInfo);
-	        if (!res) {
-	            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
-	        }
-	        return RespDTO.onSuc(res);
+         Map<String, Object> amendUserInfo = new HashMap<String, Object>();
+         amendUserInfo.put("modifier", UserUtils.getCurrentPrincipleID());
+         amendUserInfo.put("gmtModified", DateUtil.now());
+         amendUserInfo.put("email", amendUserInfoVO.getEmail());
+         amendUserInfo.put("userId", amendUserInfoVO.getUserId());
+         amendUserInfo.put("autPosition",amendUserInfoVO.getAutPosition());
+         amendUserInfo.put("linKman",amendUserInfoVO.getLinKman());
+         updateUserInfo(amendUserInfo);
+         return RespDTO.onSuc(true);
 	}
 
     //超管修改机构信息
@@ -1306,11 +1298,8 @@ public class UserFacade extends UserServiceImpl {
 		 amendOrg.put("type", amendOrgVO.getOrgType());
 		 amendOrg.put("orgId", amendOrgVO.getOrgId());
 		 amendOrg.put("orgSubNum", amendOrgVO.getOrgSubNum());
-	        boolean res = updateOrganizations(amendOrg);
-	        if (!res) {
-	            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
-	        }
-	        return RespDTO.onSuc(res);
+	     updateOrganizations(amendOrg);
+	     return RespDTO.onSuc(true);
 	}