Browse Source

添加已注册用户搜索不到问题处理,在操作前判空

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@7236 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
dongbw 9 years ago
parent
commit
a335445210

+ 6 - 3
src/main/java/com/uas/platform/b2b/model/UserInfo.java

@@ -9,6 +9,7 @@ import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageImpl;
 import org.springframework.util.CollectionUtils;
 
+import com.alibaba.fastjson.JSON;
 import com.uas.platform.core.model.Status;
 
 /**
@@ -38,9 +39,11 @@ public class UserInfo {
 		if (!CollectionUtils.isEmpty(user.getRoles())) { // 获取用户在该企业的权限
 			for (Role role: user.getRoles()) {
 				if (!CollectionUtils.isEmpty(user.getEnterprises())) {
-					if (role.getEnUU().equals(user.getEnterprise().getUu())) {
-						if (role.isSys()) {
-							this.sys = true;
+					if (null != user.getEnterprise()) {
+						if (role.getEnUU().equals(user.getEnterprise().getUu())) {
+							if (role.isSys()) {
+								this.sys = true;
+							}
 						}
 					}
 				}

+ 5 - 1
src/main/webapp/resources/js/index/app.js

@@ -5779,7 +5779,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	/*
 	 * 绑定用户到企业
 	 */
-	app.controller('AddExistUserCtrl', ['$scope', '$modalInstance', 'FuzzySearch', 'AuthenticationService', function($scope, $modalInstance,  FuzzySearch,AuthenticationService){
+	app.controller('AddExistUserCtrl', ['$scope', '$modalInstance', 'FuzzySearch', 'AuthenticationService', '$timeout', function($scope, $modalInstance,  FuzzySearch, AuthenticationService, $timeout){
 		$scope.searching = false;
 		//根据输入的内容查找用户
 		$scope.searchUser = function(keyWord) {
@@ -5843,7 +5843,11 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 						
 					}
 				}
+				
 			});	
+			$timeout(function() {
+				$modalInstance.close(true);
+			}, 500);
   		};
   		
   		$scope.cancel = function () {