|
@@ -74,6 +74,7 @@ public class CookieUtils {
|
|
|
// 登录
|
|
// 登录
|
|
|
Map<String, Object> loginResult = login(username, pwd, comCode);
|
|
Map<String, Object> loginResult = login(username, pwd, comCode);
|
|
|
if (loginResult.get("code") != null && (int) loginResult.get("code") != 200) {
|
|
if (loginResult.get("code") != null && (int) loginResult.get("code") != 200) {
|
|
|
|
|
+ System.out.println("华泰[" + username + "] 登录失败");
|
|
|
Map<String, Object> result1 = new HashMap<>();
|
|
Map<String, Object> result1 = new HashMap<>();
|
|
|
result1.put("code", 400);
|
|
result1.put("code", 400);
|
|
|
result1.put("message", "用户名、密码错误");
|
|
result1.put("message", "用户名、密码错误");
|
|
@@ -273,7 +274,7 @@ public class CookieUtils {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void getGuishu(String comCode, String useridName, String dlrCode, String dlxyCode) throws Exception {
|
|
private void getGuishu(String comCode, String useridName, String dlrCode, String dlxyCode) throws Exception {
|
|
|
- System.out.println("开始获取归属树");
|
|
|
|
|
|
|
+ System.out.println("开始获取归属树==================");
|
|
|
RestTemplate restTemplate = getRestTemplate();
|
|
RestTemplate restTemplate = getRestTemplate();
|
|
|
HttpHeaders headers = buildHeadersWithCookie();
|
|
HttpHeaders headers = buildHeadersWithCookie();
|
|
|
MultiValueMap<String, String> data = new LinkedMultiValueMap<>();
|
|
MultiValueMap<String, String> data = new LinkedMultiValueMap<>();
|
|
@@ -433,6 +434,7 @@ public class CookieUtils {
|
|
|
gsInfo.put("salesys_value", this.xstxCode);
|
|
gsInfo.put("salesys_value", this.xstxCode);
|
|
|
gsInfo.put("channel_orign", channelOrign);
|
|
gsInfo.put("channel_orign", channelOrign);
|
|
|
gsInfo.put("newChannel_orign", newChannelOrign);
|
|
gsInfo.put("newChannel_orign", newChannelOrign);
|
|
|
|
|
+ System.out.println("归属树用户列表结束==============");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private Map<String, Object> createCodeItem(String name, String code) {
|
|
private Map<String, Object> createCodeItem(String name, String code) {
|
|
@@ -497,6 +499,7 @@ public class CookieUtils {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void getCk() {
|
|
private void getCk() {
|
|
|
|
|
+ System.out.println("获取Cookie开始==========");
|
|
|
RestTemplate restTemplate = getRestTemplate();
|
|
RestTemplate restTemplate = getRestTemplate();
|
|
|
HttpHeaders headers = buildCommonHeaders();
|
|
HttpHeaders headers = buildCommonHeaders();
|
|
|
HttpEntity<String> entity = new HttpEntity<>(headers);
|
|
HttpEntity<String> entity = new HttpEntity<>(headers);
|
|
@@ -512,9 +515,11 @@ public class CookieUtils {
|
|
|
ResponseEntity<String> postResp = restTemplate.exchange(
|
|
ResponseEntity<String> postResp = restTemplate.exchange(
|
|
|
baseUrl + "/ShakeHandsAction.do?cmd=checkWeb", HttpMethod.POST, postEntity, String.class);
|
|
baseUrl + "/ShakeHandsAction.do?cmd=checkWeb", HttpMethod.POST, postEntity, String.class);
|
|
|
extractCookies(postResp);
|
|
extractCookies(postResp);
|
|
|
|
|
+ System.out.println("获取Cookie结束==========");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private String getComcode(String uname, String comCode) {
|
|
private String getComcode(String uname, String comCode) {
|
|
|
|
|
+ System.out.println("获取机构开始==========");
|
|
|
RestTemplate restTemplate = getRestTemplate();
|
|
RestTemplate restTemplate = getRestTemplate();
|
|
|
HttpHeaders headers = buildJsonHeaders();
|
|
HttpHeaders headers = buildJsonHeaders();
|
|
|
MultiValueMap<String, String> data = new LinkedMultiValueMap<>();
|
|
MultiValueMap<String, String> data = new LinkedMultiValueMap<>();
|
|
@@ -523,7 +528,6 @@ public class CookieUtils {
|
|
|
ResponseEntity<String> response = restTemplate.exchange(
|
|
ResponseEntity<String> response = restTemplate.exchange(
|
|
|
baseUrl + "/ShakeHandsAction.do?cmd=getBranch", HttpMethod.POST, entity, String.class);
|
|
baseUrl + "/ShakeHandsAction.do?cmd=getBranch", HttpMethod.POST, entity, String.class);
|
|
|
extractCookies(response);
|
|
extractCookies(response);
|
|
|
-
|
|
|
|
|
Map<String, Object> decrypted = htDecrypt(response.getBody());
|
|
Map<String, Object> decrypted = htDecrypt(response.getBody());
|
|
|
List<Map<String, Object>> comCodeList = (List<Map<String, Object>>) decrypted.get("comCodeList");
|
|
List<Map<String, Object>> comCodeList = (List<Map<String, Object>>) decrypted.get("comCodeList");
|
|
|
|
|
|
|
@@ -566,10 +570,12 @@ public class CookieUtils {
|
|
|
entity = new HttpEntity<>(data, headers);
|
|
entity = new HttpEntity<>(data, headers);
|
|
|
restTemplate.exchange(baseUrl + "/ShakeHandsAction.do?cmd=getPrompt", HttpMethod.POST, entity, String.class);
|
|
restTemplate.exchange(baseUrl + "/ShakeHandsAction.do?cmd=getPrompt", HttpMethod.POST, entity, String.class);
|
|
|
|
|
|
|
|
|
|
+ System.out.println("获取机构结束==========");
|
|
|
return comcode;
|
|
return comcode;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private Map<String, Object> doLogin(String uname, String pwd, String comcode) throws Exception {
|
|
private Map<String, Object> doLogin(String uname, String pwd, String comcode) throws Exception {
|
|
|
|
|
+ System.out.println("登录开始==========");
|
|
|
RestTemplate restTemplate = getRestTemplate();
|
|
RestTemplate restTemplate = getRestTemplate();
|
|
|
HttpHeaders headers = buildJsonHeaders();
|
|
HttpHeaders headers = buildJsonHeaders();
|
|
|
MultiValueMap<String, String> data = new LinkedMultiValueMap<>();
|
|
MultiValueMap<String, String> data = new LinkedMultiValueMap<>();
|
|
@@ -638,6 +644,7 @@ public class CookieUtils {
|
|
|
result.put("code", 400);
|
|
result.put("code", 400);
|
|
|
result.put("message", "账号密码错误");
|
|
result.put("message", "账号密码错误");
|
|
|
}
|
|
}
|
|
|
|
|
+ System.out.println("登录结束==========");
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|