|
|
|
@ -51,10 +51,89 @@ public class LawResearchUtil { |
|
|
|
jsonObject.put("authorize", 1); |
|
|
|
array.add(jsonObject); |
|
|
|
return getData(LawResearchUrlConstants.BASE_URL + LawResearchUrlConstants.QUERY_SSSXXG, |
|
|
|
array, null, null, |
|
|
|
"AmL92u2kCHjcCwcF", |
|
|
|
"Pv+mA1v2LRkgsZWqg2mAQDYM1hToAr3JmDZRYQRhZ07tHXJ2wSYEnFTWRp2ly+" |
|
|
|
); |
|
|
|
} |
|
|
|
//-------------------------------新接口-------------------- |
|
|
|
public String querySxx(String name, String creditCode) { |
|
|
|
|
|
|
|
//默认测试数据 |
|
|
|
if (name == null) { |
|
|
|
// name = "四川无声信息技术有限公司"; |
|
|
|
// creditCode = "915101007234134581"; |
|
|
|
// name = "徐州协能建材科技有限公司"; |
|
|
|
// creditCode = "91320301MA20TF8T84"; |
|
|
|
// name = "驻马店福强实业有限公司"; |
|
|
|
// creditCode = "91411728MA47Q0KJ5B"; |
|
|
|
name = "北京图灵高斯科技服务有限公司"; |
|
|
|
creditCode = "91110102MACPFACT41"; |
|
|
|
// name = "恒大集团有限公司"; |
|
|
|
// creditCode = "91440300087909371X"; |
|
|
|
} |
|
|
|
|
|
|
|
JSONArray array = new JSONArray(); |
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
jsonObject.put("name", name); |
|
|
|
jsonObject.put("creditCode", creditCode); |
|
|
|
jsonObject.put("authorize", 1); |
|
|
|
array.add(jsonObject); |
|
|
|
return getData(LawResearchUrlConstants.BASE_URL + LawResearchUrlConstants.QUERY_SXX, |
|
|
|
array, null, null, |
|
|
|
"AmL92u2kCHjcCwcF", |
|
|
|
"Pv+mA1v2LRkgsZWqg2mAQDYM1hToAr3JmDZRYQRhZ07tHXJ2wSYEnFTWRp2Iy+OI" |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
public String queryDishonest(String companyName, String fromDate, String legalPersionName, String creditcode) { |
|
|
|
//默认测试数据 |
|
|
|
if (companyName == null) { |
|
|
|
// companyName = "恒大集团有限公司"; |
|
|
|
// fromDate = "2022/01/01"; |
|
|
|
legalPersionName = "杨贵单"; |
|
|
|
// creditcode = "91440300087909371X"; |
|
|
|
} |
|
|
|
|
|
|
|
JSONArray array = new JSONArray(); |
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
jsonObject.put("name", legalPersionName); |
|
|
|
// jsonObject.put("creditCode", creditcode); |
|
|
|
jsonObject.put("authorize", 1); |
|
|
|
jsonObject.put("id", "623021198104204013"); |
|
|
|
jsonObject.put("type","0"); |
|
|
|
array.add(jsonObject); |
|
|
|
return getData(LawResearchUrlConstants.BASE_URL + LawResearchUrlConstants.QUERY_DISHONEST, |
|
|
|
array, null, null |
|
|
|
,"xsXnjpCBbwKYU1d5" |
|
|
|
,"Pv+mA1v2LRkgsZWqg2mAQJPn6o18VQagRlJny8DmuavlIoK6ZY6SG9CFBpFX0Ce5" |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
public String queryLimitConsumption(String companyName, String fromDate, String legalPersionName, String creditcode) { |
|
|
|
//默认测试数据 |
|
|
|
if (companyName == null) { |
|
|
|
companyName = "恒大集团有限公司"; |
|
|
|
// fromDate = "2022/01/01"; |
|
|
|
legalPersionName = "施新桃"; |
|
|
|
creditcode = "91440300087909371X"; |
|
|
|
} |
|
|
|
|
|
|
|
JSONArray array = new JSONArray(); |
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
jsonObject.put("name", companyName); |
|
|
|
jsonObject.put("creditCode", creditcode); |
|
|
|
jsonObject.put("authorize", 1); |
|
|
|
array.add(jsonObject); |
|
|
|
return getData(LawResearchUrlConstants.BASE_URL + LawResearchUrlConstants.QUERY_LIMITCONSUMPTION, |
|
|
|
array, null, null |
|
|
|
,"Ju000$LbdkX@tjTK" |
|
|
|
,"Pv+mA1v2LRkgsZWqg2mAQONIs4+TPrj8Zi7WRB8+xjBfG5HByVFpyzjoWwn0Wsi6" |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//-------------------------------新接口上面-------------------- |
|
|
|
/** |
|
|
|
* 工商模型 |
|
|
|
* |
|
|
|
@ -650,7 +729,7 @@ public class LawResearchUtil { |
|
|
|
public String addpublic(String name) { |
|
|
|
//默认测试数据 |
|
|
|
if (name == null) { |
|
|
|
name = "小米科技有限责任公司"; |
|
|
|
name = "平凉市宏建煤炭有限责任公司"; |
|
|
|
// creditCode = "91110108551385082Q"; |
|
|
|
} |
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
@ -659,6 +738,8 @@ public class LawResearchUtil { |
|
|
|
array.add(jsonObject); |
|
|
|
return getData(LawResearchUrlConstants.BASE_URL + LawResearchUrlConstants.ADD_PUBLIC, |
|
|
|
array, null, null |
|
|
|
,"Cdi9CIzt0AnWucOe" |
|
|
|
,"Pv+mA1v2LRkgsZWqg2mAQL/te4UiH52wshn/McsdLfmn+SBZ3LV86JM1jNjZIxqv" |
|
|
|
); |
|
|
|
} |
|
|
|
/** |
|
|
|
@ -672,7 +753,8 @@ public class LawResearchUtil { |
|
|
|
public String delcompany(String name) { |
|
|
|
//默认测试数据 |
|
|
|
if (name == null) { |
|
|
|
name = "小米科技有限责任公司"; |
|
|
|
// name = "小米科技有限责任公司"; |
|
|
|
name = "恒大集团有限公司"; |
|
|
|
// creditCode = "91110108551385082Q"; |
|
|
|
} |
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
@ -681,6 +763,8 @@ public class LawResearchUtil { |
|
|
|
array.add(jsonObject); |
|
|
|
return getData(LawResearchUrlConstants.BASE_URL + LawResearchUrlConstants.DEL_COMPANY, |
|
|
|
array, null, null |
|
|
|
,"Cdi9CIzt0AnWucOe" |
|
|
|
,"Pv+mA1v2LRkgsZWqg2mAQL/te4UiH52wshn/McsdLfmn+SBZ3LV86JM1jNjZIxqv" |
|
|
|
); |
|
|
|
} |
|
|
|
/** |
|
|
|
@ -703,6 +787,8 @@ public class LawResearchUtil { |
|
|
|
jsonObject.put("pageSize", pageSize); |
|
|
|
return getData(LawResearchUrlConstants.BASE_URL + LawResearchUrlConstants.MONITOR_QUERY, |
|
|
|
null, jsonObject, null |
|
|
|
,"Cdi9CIzt0AnWucOe" |
|
|
|
,"Pv+mA1v2LRkgsZWqg2mAQL/te4UiH52wshn/McsdLfmn+SBZ3LV86JM1jNjZIxqv" |
|
|
|
); |
|
|
|
} |
|
|
|
/** |
|
|
|
@ -715,19 +801,22 @@ public class LawResearchUtil { |
|
|
|
* @author zhangjing |
|
|
|
* @create 2024/9/19 |
|
|
|
**/ |
|
|
|
public String queryMonitorCases(String queryDate,Integer pageIndex,Integer pageSize) { |
|
|
|
public static String queryMonitorCases(String queryDate,Integer pageIndex,Integer pageSize) { |
|
|
|
//默认测试数据 |
|
|
|
if (queryDate == null) { |
|
|
|
queryDate="2022-07-06"; |
|
|
|
pageIndex = 1; |
|
|
|
pageSize = 20; |
|
|
|
// queryDate="2022-07-06"; |
|
|
|
queryDate="2026-02-08"; |
|
|
|
// pageIndex = 1; |
|
|
|
// pageSize = 20; |
|
|
|
} |
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
jsonObject.put("queryDate", queryDate); |
|
|
|
jsonObject.put("pageIndex", pageIndex); |
|
|
|
jsonObject.put("pageSize", pageSize); |
|
|
|
// jsonObject.put("pageIndex", pageIndex); |
|
|
|
// jsonObject.put("pageSize", pageSize); |
|
|
|
return getData(LawResearchUrlConstants.BASE_URL + LawResearchUrlConstants.QUERY_MONITOR_CASES, |
|
|
|
null, jsonObject, null |
|
|
|
null, jsonObject,null |
|
|
|
,"Cdi9CIzt0AnWucOe" |
|
|
|
,"Pv+mA1v2LRkgsZWqg2mAQL/te4UiH52wshn/McsdLfmn+SBZ3LV86JM1jNjZIxqv" |
|
|
|
); |
|
|
|
} |
|
|
|
/** |
|
|
|
@ -902,10 +991,15 @@ public class LawResearchUtil { |
|
|
|
null, jsonObject, null |
|
|
|
); |
|
|
|
} |
|
|
|
private String getData(String apiUrl, JSONArray array, JSONObject jsonObject, String method |
|
|
|
) { |
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String getData(String apiUrl, JSONArray array, JSONObject jsonObject, String method) { |
|
|
|
private static String getData(String apiUrl, JSONArray array, JSONObject jsonObject, String method, |
|
|
|
String key,String ticket |
|
|
|
) { |
|
|
|
RestTemplate restTemplate = new RestTemplate(); |
|
|
|
HttpComponentsClientHttpRequestFactory requestFactory |
|
|
|
= new HttpComponentsClientHttpRequestFactory(); |
|
|
|
@ -915,12 +1009,12 @@ public class LawResearchUtil { |
|
|
|
restTemplate.setRequestFactory(requestFactory); |
|
|
|
HttpHeaders headers = new HttpHeaders(); |
|
|
|
headers.setContentType(MediaType.APPLICATION_JSON); |
|
|
|
headers.set("ticket", LawResearchUrlConstants.TICKET); |
|
|
|
headers.set("Authorization", LawResearchUrlConstants.TICKET); |
|
|
|
headers.set("ticket", ticket); |
|
|
|
headers.set("Authorization", ticket); |
|
|
|
String request = (array != null) ? array.toJSONString() : jsonObject.toJSONString(); |
|
|
|
try { |
|
|
|
//需要对入参进行 aes 加密 |
|
|
|
String requestBody = AES.aesEncrypt(request, LawResearchUrlConstants.KEY); |
|
|
|
String requestBody = AES.aesEncrypt(request, key); |
|
|
|
System.out.println("requestBody=====" + requestBody); |
|
|
|
//设置访问的 Entity |
|
|
|
HttpEntity entity = new HttpEntity<>(requestBody, headers); |
|
|
|
@ -934,8 +1028,8 @@ public class LawResearchUtil { |
|
|
|
String resultData=null; |
|
|
|
try (PrintWriter writer = new PrintWriter(new File(filePath))) { |
|
|
|
//接收到返回结果需要进行 aes 解密 |
|
|
|
resultData = AES.aesDecrypt(result.getBody(), LawResearchUrlConstants.KEY); |
|
|
|
// 写入内容 |
|
|
|
resultData = AES.aesDecrypt(result.getBody(), key); |
|
|
|
//写入内容 |
|
|
|
writer.println(resultData); |
|
|
|
|
|
|
|
// 自动关闭,因为使用了 try-with-resources 语句 |
|
|
|
|