gaodd vor 1 Jahr
Ursprung
Commit
8a16b50db4

+ 22 - 33
src/main/java/com/chinaitop/depot/system/controller/UserInfoController.java

@@ -109,8 +109,6 @@ public class UserInfoController {
109 109
 	@Value("${KEY}")
110 110
 	private String KEY;
111 111
 	
112
-	@Value("${wsdlUrl}")
113
-	private String wsdlUrl;
114 112
 
115 113
 	/**
116 114
 	 * 查找用户信息
@@ -129,39 +127,30 @@ public class UserInfoController {
129 127
 	public PageInfo<UserInfo> getUserInfo(HttpServletRequest request, Integer pageNum, Integer pageSize,
130 128
                                           String username, String realName, Integer roleId, String orgIds) {
131 129
 		
132
-		if (pageNum!=null && pageSize!=null) {
133
-			PageHelper.startPage(pageNum, pageSize);
134
-		}
135 130
 		
136
-		HashMap<Object, Object> map = new HashMap<Object, Object>();
131
+		
132
+		/*HashMap<Object, Object> map = new HashMap<Object, Object>();
137 133
 		map.put("username", username);
138 134
 		map.put("realName", realName);
139 135
 		map.put("roleId", roleId);
140
-		List<UserInfo> listAll=userInfoService.queryAll(map);
136
+		List<UserInfo> listAll=userInfoService.queryAll(map);*/
141 137
 		
142
-		if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
143
-			try {
144
-				ExchangeServer wb = new ExchangeServer();
145
-				IExchangeService action = wb.getExchangeServiceImplPort();
146
-				for(UserInfo userInfo:listAll) {
147
-					String roleNames = userInfo.getRoleNames();
148
-					String userRolesInfo = action.getUserRolesInfo(FLATID, KEY, Integer.toString(userInfo.getUserId()) );
149
-					JSONObject obj = JSONObject.parseObject(userRolesInfo);  
150
-					String result = obj.getString("result");
151
-					JSONArray data = JSONArray.parseArray(result);
152
-					for(int i=0;i<data.size();i++) {
153
-						Map<String,Object> maps = (Map<String,Object>)data.get(i);
154
-						if(roleNames != null && !roleNames.isEmpty()) {
155
-							roleNames = roleNames + "," + ObjectUtils.toString(maps.get("roleName"),"");
156
-						}else {
157
-							roleNames = ObjectUtils.toString(maps.get("roleName"),"");
158
-						}
159
-					}
160
-					userInfo.setRoleNames(roleNames);
161
-				}
162
-			} catch (Exception e) {
163
-				e.printStackTrace();
164
-			}
138
+		UserInfoExample example = new UserInfoExample();
139
+		Criteria criteria = example.createCriteria();
140
+		if(null != username && ""!= username){
141
+			criteria.andUsernameLike(username);
142
+		}
143
+        if(null != realName && ""!= realName){
144
+        	criteria.andRealNameLike(realName);
145
+		}
146
+        if(null != orgIds && ""!= orgIds){
147
+        	criteria.andOrgIdEqualTo(Integer.valueOf(orgIds));
148
+        }
149
+		
150
+		List<UserInfo> listAll = userInfoService.queryByExample(example);
151
+		
152
+		if (pageNum!=null && pageSize!=null) {
153
+			PageHelper.startPage(pageNum, pageSize);
165 154
 		}
166 155
 		
167 156
 		PageInfo<UserInfo> pageInfo = new PageInfo<UserInfo>(listAll);
@@ -539,7 +528,7 @@ public class UserInfoController {
539 528
 		if (userId != null) {
540 529
 			userInfo = userInfoService.findById(userId);
541 530
 		}
542
-		if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
531
+		/*if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
543 532
 			try {
544 533
 				List<String> roleIds = userInfo.getRoleIds();
545 534
 				ExchangeServer wb = new ExchangeServer();
@@ -556,7 +545,7 @@ public class UserInfoController {
556 545
 			} catch (Exception e) {
557 546
 				e.printStackTrace();
558 547
 			}
559
-		}
548
+		}*/
560 549
 		return userInfo;
561 550
 	}
562 551
 
@@ -578,7 +567,7 @@ public class UserInfoController {
578 567
 	public Map<String, Object> save(String userInfoJson , String userRoleIds, String crkRoleIds) {
579 568
 		Map<String, Object> modelMap = new HashMap<>();
580 569
 		try {
581
-			modelMap = userInfoService.save(userInfoJson, userRoleIds, crkRoleIds, wsdlUrl, FLATID, KEY);
570
+			modelMap = userInfoService.save(userInfoJson, userRoleIds, crkRoleIds, null, FLATID, KEY);
582 571
 		} catch (Exception e) {
583 572
 			modelMap.put("status", "error");
584 573
 			e.printStackTrace();

+ 2 - 2
src/main/java/com/chinaitop/depot/system/service/impl/UserInfoServiceImpl.java

@@ -313,7 +313,7 @@ public class UserInfoServiceImpl implements UserInfoService {
313 313
 		}
314 314
 
315 315
 		if (StringUtils.isNotBlank(crkRoleIds) && !"[]".equals(crkRoleIds)) {//保存出入库用户角色信息
316
-			if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
316
+			//if("正常".equals(NetStateUtil.connectingAddress(wsdlUrl))) {
317 317
 				try {
318 318
 					String json = "{userId:\""+userInfo.getUserId()+"\", roleIds:"+crkRoleIds+"}";
319 319
 					ExchangeServer wb = new ExchangeServer();
@@ -322,7 +322,7 @@ public class UserInfoServiceImpl implements UserInfoService {
322 322
 				} catch (Exception e) {
323 323
 					e.printStackTrace();
324 324
 				}
325
-			}
325
+			//}
326 326
 
327 327
 		}
328 328