Browse Source

fix:【法研平台接口】修改

master
zhangjing 1 month ago
parent
commit
09b2144c90
55 changed files with 1357 additions and 109 deletions
  1. +14
    -4
      pom.xml
  2. +1
    -1
      src/main/java/com/fkzy/warn/common/conf/WebInterceptor.java
  3. +10
    -0
      src/main/java/com/fkzy/warn/common/constants/LawResearchUrlConstants.java
  4. +2
    -1
      src/main/java/com/fkzy/warn/common/request/RequestParameter.java
  5. +6
    -6
      src/main/java/com/fkzy/warn/common/util/Demo.java
  6. +226
    -0
      src/main/java/com/fkzy/warn/common/util/FyOpenGatewayApiUtil.java
  7. +34
    -40
      src/main/java/com/fkzy/warn/common/util/HttpUtil.java
  8. +2
    -1
      src/main/java/com/fkzy/warn/common/util/JWTUtil.java
  9. +10
    -6
      src/main/java/com/fkzy/warn/common/util/LawResearchUtil.java
  10. +180
    -0
      src/main/java/com/fkzy/warn/common/util/MD5Util.java
  11. +3
    -2
      src/main/java/com/fkzy/warn/common/util/RedisUtil.java
  12. +1
    -1
      src/main/java/com/fkzy/warn/controller/AccountController.java
  13. +1
    -1
      src/main/java/com/fkzy/warn/controller/AnnouncementController.java
  14. +1
    -1
      src/main/java/com/fkzy/warn/controller/AuditRecordsController.java
  15. +1
    -1
      src/main/java/com/fkzy/warn/controller/AuthorizationController.java
  16. +1
    -1
      src/main/java/com/fkzy/warn/controller/ContractController.java
  17. +47
    -0
      src/main/java/com/fkzy/warn/controller/DataCenterController.java
  18. +1
    -1
      src/main/java/com/fkzy/warn/controller/MonitorUsersController.java
  19. +1
    -1
      src/main/java/com/fkzy/warn/controller/NewsManageController.java
  20. +1
    -1
      src/main/java/com/fkzy/warn/controller/PermissionController.java
  21. +1
    -1
      src/main/java/com/fkzy/warn/controller/PolicyManagementController.java
  22. +1
    -1
      src/main/java/com/fkzy/warn/controller/ReportController.java
  23. +1
    -1
      src/main/java/com/fkzy/warn/controller/VersionManageController.java
  24. +1
    -1
      src/main/java/com/fkzy/warn/mapper/DictItemMapper.java
  25. +1
    -1
      src/main/java/com/fkzy/warn/mapper/DictMapper.java
  26. +20
    -0
      src/main/java/com/fkzy/warn/model/AImessage.java
  27. +20
    -0
      src/main/java/com/fkzy/warn/model/AccessToken.java
  28. +17
    -0
      src/main/java/com/fkzy/warn/model/ApiResult.java
  29. +38
    -0
      src/main/java/com/fkzy/warn/model/ChapterNode.java
  30. +76
    -0
      src/main/java/com/fkzy/warn/model/LawGroup.java
  31. +45
    -0
      src/main/java/com/fkzy/warn/model/LawGroupInfo.java
  32. +17
    -0
      src/main/java/com/fkzy/warn/model/LawPageData.java
  33. +25
    -0
      src/main/java/com/fkzy/warn/model/params/AILawParams.java
  34. +68
    -0
      src/main/java/com/fkzy/warn/model/params/LawGroupParam.java
  35. +25
    -0
      src/main/java/com/fkzy/warn/model/params/PageParam.java
  36. +1
    -1
      src/main/java/com/fkzy/warn/service/AuthorizationService.java
  37. +1
    -1
      src/main/java/com/fkzy/warn/service/EnterpriseInfoService.java
  38. +23
    -0
      src/main/java/com/fkzy/warn/service/FyApiService.java
  39. +1
    -1
      src/main/java/com/fkzy/warn/service/InvocationRecordService.java
  40. +1
    -1
      src/main/java/com/fkzy/warn/service/LawCaseService.java
  41. +2
    -1
      src/main/java/com/fkzy/warn/service/UserService.java
  42. +2
    -2
      src/main/java/com/fkzy/warn/service/impl/AlarmCaseServiceImpl.java
  43. +1
    -1
      src/main/java/com/fkzy/warn/service/impl/AuthorizationServiceImpl.java
  44. +3
    -3
      src/main/java/com/fkzy/warn/service/impl/EnterpriseInfoServiceImpl.java
  45. +373
    -0
      src/main/java/com/fkzy/warn/service/impl/FyApiServiceImpl.java
  46. +12
    -12
      src/main/java/com/fkzy/warn/service/impl/LawCaseServiceImpl.java
  47. +3
    -1
      src/main/java/com/fkzy/warn/service/impl/MonitorUsersServiceImpl.java
  48. +1
    -1
      src/main/java/com/fkzy/warn/service/impl/UserServiceImpl.java
  49. +10
    -0
      src/main/resources/bootstrap-dev.yml
  50. +24
    -6
      src/main/resources/bootstrap-prod.yml
  51. +0
    -1
      丰县城市建设投资集团有限公司-司法.txt
  52. BIN
      司法风险报告demo.docx
  53. +0
    -1
      四川无声信息技术有限公司-司法.txt
  54. +0
    -1
      工商.txt
  55. +0
    -1
      徐州-司法.txt

+ 14
- 4
pom.xml View File

@ -123,12 +123,16 @@
</dependency> </dependency>
<!-- fastjson --> <!-- fastjson -->
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>fastjson</artifactId>-->
<!-- <version>1.2.83</version>-->
<!-- </dependency>-->
<dependency> <dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.83</version>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>2.0.43</version>
</dependency> </dependency>
<!-- swagger2 --> <!-- swagger2 -->
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
@ -137,6 +141,12 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.12.0</version> <!-- 请使用最新稳定版本 -->
</dependency>
<dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId> <artifactId>springfox-swagger2</artifactId>
<version>2.4.0</version> <version>2.4.0</version>

+ 1
- 1
src/main/java/com/fkzy/warn/common/conf/WebInterceptor.java View File

@ -1,7 +1,7 @@
package com.fkzy.warn.common.conf; package com.fkzy.warn.common.conf;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.fkzy.warn.common.constants.RedisKeyConstants; import com.fkzy.warn.common.constants.RedisKeyConstants;
import com.fkzy.warn.common.constants.ResponseMsgConstants; import com.fkzy.warn.common.constants.ResponseMsgConstants;
import com.fkzy.warn.common.response.ApiResponse; import com.fkzy.warn.common.response.ApiResponse;

+ 10
- 0
src/main/java/com/fkzy/warn/common/constants/LawResearchUrlConstants.java View File

@ -23,6 +23,16 @@ public class LawResearchUrlConstants {
// public final static String TICKET = "sWLi80ouoxiK9jYJFti2jz9KWnUtRvdepXf4jOWAwgyfSy4Kkf+n6yux/IuhFrL/"; // public final static String TICKET = "sWLi80ouoxiK9jYJFti2jz9KWnUtRvdepXf4jOWAwgyfSy4Kkf+n6yux/IuhFrL/";
public final static String APPID = "ea255f4a400342b5b96c8fb904616354";
public final static String API_KEY = "956ee3a3106ba289ce87d46f877b78ef";
public final static String API_SECRET = "b2f77e1395324dcbd1557d4a2908c9fd";
public final static String ACCESS_KEY = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJidXNpbmVzc1N5c3RlbUlkIjoiMTkyNzI1MzAzNjM5MjUzODExNCIsImFwcEtleSI6Ijk1NmVlM2EzMTA2YmEyODljZTg3ZDQ2Zjg3N2I3OGVmIiwiYXBwSWQiOiJlYTI1NWY0YTQwMDM0MmI1Yjk2YzhmYjkwNDYxNjM1NCIsInB1YmxpY0tleSI6IjgwMzRkODcxMzJkZjIyYjQwOGQzZTFhYmIwYmEyM2E4IiwiaXNzIjoiY29wIiwic3ViIjoi5oiR55qE6buY6K6k5bqU55SoIiwiYXVkIjoiMTE4LjExMy4xMTcuMjI4IiwiZXhwIjoxNzczOTkzNTg1LCJuYmYiOjE3NzM3MzQzODUsImlhdCI6MTc3MzczNDM4NSwianRpIjoiMTE2YmY1ZDJmYjAzNGQwMDlmYjhlN2Y1NDkzOWE1NDUifQ.26xvUO1ELQ8RqRFk-jyjo5HFhQrSjVpcSozx5xG4zCs";
//司法 //司法
public final static String QUERY_SSSXXG = "/qyss/sfss/querySssxxg"; public final static String QUERY_SSSXXG = "/qyss/sfss/querySssxxg";
//-------------------------------新接口-------------------- //-------------------------------新接口--------------------

+ 2
- 1
src/main/java/com/fkzy/warn/common/request/RequestParameter.java View File

@ -1,6 +1,7 @@
package com.fkzy.warn.common.request; package com.fkzy.warn.common.request;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;

+ 6
- 6
src/main/java/com/fkzy/warn/common/util/Demo.java View File

@ -1,9 +1,9 @@
package com.fkzy.warn.common.util; package com.fkzy.warn.common.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONException;
import com.alibaba.fastjson2.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.IgnoredErrorType; import org.apache.poi.ss.usermodel.IgnoredErrorType;
@ -25,8 +25,8 @@ public class Demo {
LawResearchUtil law = new LawResearchUtil(); LawResearchUtil law = new LawResearchUtil();
// law.querySxx(null, null); // law.querySxx(null, null);
// law.queryDishonest(null, null,null,null); // law.queryDishonest(null, null,null,null);
law.queryLimitConsumption(null, null,null,null);
// law.monitorQuery(null, null);
// law.queryLimitConsumption(null, null,null,null);
law.monitorQuery(null, null);
// law.delcompany(null); // law.delcompany(null);
// law.queryMonitorCases(null,null,null); // law.queryMonitorCases(null,null,null);
// law.addpublic(null); // law.addpublic(null);

+ 226
- 0
src/main/java/com/fkzy/warn/common/util/FyOpenGatewayApiUtil.java View File

@ -0,0 +1,226 @@
package com.fkzy.warn.common.util;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.fkzy.warn.common.constants.LawResearchUrlConstants;
import com.fkzy.warn.model.InvocationRecord;
import org.springframework.http.*;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
* @author zhangjing
* @date 2026/03/17 14:31
* @description
*/
public class FyOpenGatewayApiUtil {
public static final String FY_OPEN_GATEWAY_URL = "https://api.cjbdi.com:8443";
public static final String ACCESS_TOKEN_URL = FY_OPEN_GATEWAY_URL + "/auth/api/token/getAccess";
/**
* 请求开放平台网关获取accessToken
*
* @param url 调用地址
* @param appKey 应用key--从控制台应用系统中获取
* @param appSecret 应用密码--从控制台应用系统中获取
* @return 返回数据格式参考在线文档说明
*/
public static String getAccessToken(String url, String appKey, String appSecret) {
Map<String, String> paramMap = new HashMap<>();
paramMap.put("appKey", appKey);
paramMap.put("appSecret", appSecret);
try {
return HttpUtil.post(url, paramMap);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
// /**
// * 接口调用--url传参
// *
// * @param method 请求方法类型
// * @param url 接口地址包含url参数
// * @param headerMap 请求头
// * @return 返回数据格式参考在线文档说明
// * @see cn.hutool.http.Method
// */
// public static String invokeUrlApi(Method method, String url, Map<String, String> headerMap) {
// HttpRequest request = HttpUtil.createRequest(method, url);
// request.headerMap(headerMap, true);
// try (HttpResponse execute = request.execute()) {
// int status = execute.getStatus();
// if (status == 200) {
// return execute.body();
// }
// }
// return null;
// }
// /**
// * 接口调用--form表单提交
// *
// * @param url 接口地址包含url参数
// * @param headerMap 请求头
// * @param formParams form表单参数
// * @return 返回数据格式参考在线文档说明
// */
// public static String invokeFormApi(String url, Map<String, String> headerMap, Map<String, Object> formParams) {
// HttpRequest request = HttpUtil.createPost(url);
// request.headerMap(headerMap, true);
// request.form(formParams);
// try (HttpResponse execute = request.execute()) {
// int status = execute.getStatus();
// if (status == 200) {
// return execute.body();
// }
// }
// return null;
// }
// /**
// * 接口调用--body提交
// *
// * @param url 接口地址
// * @param headerMap 请求头
// * @param body body参数
// * @return 返回数据格式参考在线文档说明
// */
// public static String invokeBodyApi(String url, Map<String, String> headerMap, String body) {
// HttpRequest request = HttpUtil.createPost(url);
// request.headerMap(headerMap, true);
// request.body(body);
// try (HttpResponse execute = request.execute()) {
// int status = execute.getStatus();
// if (status == 200) {
// return execute.body();
// }
// }
// return null;
// }
public static void main(String[] args) {
// 控制台应用系统中的apiKey
String appKey = "";
// 控制台应用系统中的apiSecret
String appSecret = "";
// 控制台应用系统中的appId
String appId = "";
// 请求获取accessToken
String response = getAccessToken(ACCESS_TOKEN_URL, LawResearchUrlConstants.API_KEY, LawResearchUrlConstants.API_SECRET);
System.out.println(response);
// 构建请求头
Map<String, String> headerMap = new HashMap<>();
// 请求id每次请求需重新生成保证唯一用于做重复请求验证
headerMap.put("FYDN-OP-RequestId", UUID.randomUUID().toString().replaceAll("-", ""));
// 签名串使用在线文档中的MD5Util示例加密生成
headerMap.put("FYDN-OP-Sign", "");
// 需要从getAccessToken返回结果中解析出accessKey返回结构样例参考在线文档
headerMap.put("FYDN-OP-AccessToken", LawResearchUrlConstants.ACCESS_KEY);
headerMap.put("FYDN-OP-AppID", LawResearchUrlConstants.APPID);
// 调用的环境prod:线上环境默认test:测试环境
headerMap.put("FYDN-OP-Env", "prod");
// 用户所在系统的唯一标识
headerMap.put("FYDN-OP-UserId", "");
// 以下url参数等为示例以实际调用的信息为准
/*--------------------------------json传参-----------------------------------*/
// String jsonApiUrl = "http://127.0.0.1:8080/jsonApi";
// headerMap.put(Header.CONTENT_TYPE.getValue(), ContentType.JSON.getValue());
// String body = "{\"name\":\"test\", \"age\":18}";
// String jsonApiResult = FyOpenGatewayApiUtil.invokeBodyApi(jsonApiUrl, headerMap, body);
// System.out.println(jsonApiResult);
//
// /*--------------------------------form传参-----------------------------------*/
// String formApiUrl = "http://127.0.0.1:8080/formApi";
// // 普通form表单时设置为application/x-www-form-urlencoded
// headerMap.put(Header.CONTENT_TYPE.getValue(), ContentType.FORM_URLENCODED.getValue());
// // 文件上传form表单提交时设置为multipart/form-data
//// headerMap.put(Header.CONTENT_TYPE.getValue(), ContentType.MULTIPART.getValue());
// Map<String, Object> formParams = new HashMap<>();
// formParams.put("name", "test");
// formParams.put("age", 18);
// String formApiResult = FyOpenGatewayApiUtil.invokeFormApi(formApiUrl, headerMap, formParams);
// System.out.println(formApiResult);
//
// /*--------------------------------url传参-----------------------------------*/
// String url = "http://127.0.0.1:8080/urlApi?name=test&age=18";
// headerMap.put(Header.CONTENT_TYPE.getValue(), ContentType.FORM_URLENCODED.getValue());
// String result = FyOpenGatewayApiUtil.invokeUrlApi(Method.GET, url, headerMap);
// System.out.println(result);
}
private static InvocationRecord getData(String apiUrl, JSONArray array, JSONObject jsonObject, String method,
String key, String ticket, String apiName
) {
InvocationRecord invocationRecord = new InvocationRecord();
invocationRecord.setApiKey(key);
invocationRecord.setApiTicket(ticket);
invocationRecord.setApiUrl(apiUrl);
if (array!=null){
invocationRecord.setInputArr(array.toJSONString());
}
if (jsonObject!=null){
invocationRecord.setInputObj(jsonObject.toJSONString());
}
invocationRecord.setApiName(apiName);
RestTemplate restTemplate = new RestTemplate();
HttpComponentsClientHttpRequestFactory requestFactory
= new HttpComponentsClientHttpRequestFactory();
requestFactory.setConnectionRequestTimeout(60000);
requestFactory.setConnectTimeout(60000);
requestFactory.setReadTimeout(60000);
restTemplate.setRequestFactory(requestFactory);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("ticket", ticket);
headers.set("Authorization", ticket);
String request = (array != null) ? array.toJSONString() : jsonObject.toJSONString();
try {
//需要对入参进行 aes 加密
String requestBody = AES.aesEncrypt(request, key);
System.out.println("requestBody=====" + requestBody);
//设置访问的 Entity
HttpEntity entity = new HttpEntity<>(requestBody, headers);
//执行 请求
ResponseEntity<String> result =
restTemplate.exchange(apiUrl, method == null ? HttpMethod.POST : HttpMethod.GET, entity,
String.class);
// 指定文件路径
String filePath = "output.txt";
String resultData=null;
try (PrintWriter writer = new PrintWriter(new File(filePath))) {
//接收到返回结果需要进行 aes 解密
invocationRecord.setIsSuccess(0);
resultData = AES.aesDecrypt(result.getBody(), key);
//写入内容
writer.println(resultData);
invocationRecord.setIsSuccess(1);
invocationRecord.setApiResult(resultData);
// 自动关闭因为使用了 try-with-resources 语句
} catch (FileNotFoundException e) {
System.err.println("文件未找到: " + e.getMessage());
}
} catch (Exception e) {
e.printStackTrace();
} finally {
return invocationRecord;
}
}
}

+ 34
- 40
src/main/java/com/fkzy/warn/common/util/HttpUtil.java View File

@ -1,6 +1,7 @@
package com.fkzy.warn.common.util; package com.fkzy.warn.common.util;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
import org.apache.http.HttpStatus; import org.apache.http.HttpStatus;
import org.apache.http.StatusLine; import org.apache.http.StatusLine;
@ -19,6 +20,9 @@ import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
/** /**
* http工具类 * http工具类
@ -150,49 +154,39 @@ public class HttpUtil {
return resultJson; return resultJson;
} }
public static String doPost(String url, String params) throws Exception {
public static String post(String apiUrl, Map<String, String> paramMap) throws Exception {
// paramMap 转为 JSON 字符串
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(url);// 创建httpPost
httpPost.setHeader("Accept", "application/json");
httpPost.setHeader("Content-Type", "application/json");
RequestConfig defaultRequestConfig = RequestConfig.custom()
.setSocketTimeout(10000)
.setConnectTimeout(10000)
.setConnectionRequestTimeout(10000)
.build();
httpPost.setConfig(defaultRequestConfig);
String charSet = "UTF-8";
StringEntity entity = new StringEntity(params, charSet);
httpPost.setEntity(entity);
CloseableHttpResponse response = null;
HttpClientContext context = HttpClientContext.create();
try {
response = httpclient.execute(httpPost, context);
StatusLine status = response.getStatusLine();
int state = status.getStatusCode();
if (state == HttpStatus.SC_OK) {
HttpEntity responseEntity = response.getEntity();
String jsonString = EntityUtils.toString(responseEntity);
return jsonString;
} else {
//do log
}
} finally {
if (response != null) {
try {
response.close();
} catch (IOException e) {
e.printStackTrace();
try (CloseableHttpClient httpclient = HttpClients.createDefault()) {
HttpPost httpPost = new HttpPost(apiUrl);
RequestConfig config = RequestConfig.custom()
.setSocketTimeout(10000)
.setConnectTimeout(10000)
.setConnectionRequestTimeout(10000)
.build();
httpPost.setConfig(config);
// 构造 x-www-form-urlencoded 参数
String params = "appKey=" + URLEncoder.encode(paramMap.get("appKey"), StandardCharsets.UTF_8.toString()) +
"&appSecret=" + URLEncoder.encode(paramMap.get("appSecret"), StandardCharsets.UTF_8.toString());
StringEntity entity = new StringEntity(params, StandardCharsets.UTF_8);
httpPost.setEntity(entity);
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
try (CloseableHttpResponse response = httpclient.execute(httpPost)) {
int statusCode = response.getStatusLine().getStatusCode();
if (statusCode == 200) {
HttpEntity resEntity = response.getEntity();
return EntityUtils.toString(resEntity, StandardCharsets.UTF_8);
} else {
System.err.println("HTTP Error: " + statusCode);
return null;
} }
} }
try {
httpclient.close();
} catch (IOException e) {
e.printStackTrace();
}
} }
return null;
} }
} }

+ 2
- 1
src/main/java/com/fkzy/warn/common/util/JWTUtil.java View File

@ -3,6 +3,7 @@ package com.fkzy.warn.common.util;
//import com.lzrq.template.model.User; //import com.lzrq.template.model.User;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.fkzy.warn.model.User; import com.fkzy.warn.model.User;
@ -116,7 +117,7 @@ public class JWTUtil {
Payload payload = jwsObject.getPayload(); Payload payload = jwsObject.getPayload();
JSONObject jsonObject = payload.toJSONObject(); JSONObject jsonObject = payload.toJSONObject();
String result = jsonObject.toString(); String result = jsonObject.toString();
user = com.alibaba.fastjson.JSONObject.parseObject(result, User.class);
user = JSON.parseObject(result, User.class);
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();

+ 10
- 6
src/main/java/com/fkzy/warn/common/util/LawResearchUtil.java View File

@ -1,7 +1,8 @@
package com.fkzy.warn.common.util; package com.fkzy.warn.common.util;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.fkzy.warn.common.constants.EntityConstants; import com.fkzy.warn.common.constants.EntityConstants;
import com.fkzy.warn.common.constants.LawResearchUrlConstants; import com.fkzy.warn.common.constants.LawResearchUrlConstants;
import com.fkzy.warn.model.InvocationRecord; import com.fkzy.warn.model.InvocationRecord;
@ -76,8 +77,10 @@ public class LawResearchUtil {
// creditCode = "91411728MA47Q0KJ5B"; // creditCode = "91411728MA47Q0KJ5B";
// name = "北京图灵高斯科技服务有限公司"; // name = "北京图灵高斯科技服务有限公司";
// creditCode = "91110102MACPFACT41"; // creditCode = "91110102MACPFACT41";
name = "丰县城市建设投资集团有限公司";
creditCode = "91320321687806130M";
// name = "丰县城市建设投资集团有限公司";
// creditCode = "91320321687806130M";
name = "刘超";
creditCode = "320122198410080037";
// name = "恒大集团有限公司"; // name = "恒大集团有限公司";
// creditCode = "91440300087909371X"; // creditCode = "91440300087909371X";
} }
@ -85,7 +88,8 @@ public class LawResearchUtil {
JSONArray array = new JSONArray(); JSONArray array = new JSONArray();
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("name", name); jsonObject.put("name", name);
jsonObject.put("creditCode", creditCode);
// jsonObject.put("creditCode", creditCode);
jsonObject.put("id", creditCode);
jsonObject.put("authorize", 1); jsonObject.put("authorize", 1);
array.add(jsonObject); array.add(jsonObject);
return getData(LawResearchUrlConstants.BASE_URL + LawResearchUrlConstants.QUERY_SXX, return getData(LawResearchUrlConstants.BASE_URL + LawResearchUrlConstants.QUERY_SXX,
@ -741,7 +745,7 @@ public class LawResearchUtil {
public InvocationRecord addpublic(String name) { public InvocationRecord addpublic(String name) {
//默认测试数据 //默认测试数据
if (name == null) { if (name == null) {
name = "平凉市宏建煤炭有限责任公司";
name = "丰县城市建设投资集团有限公司";
// creditCode = "91110108551385082Q"; // creditCode = "91110108551385082Q";
} }
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();

+ 180
- 0
src/main/java/com/fkzy/warn/common/util/MD5Util.java View File

@ -0,0 +1,180 @@
package com.fkzy.warn.common.util;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSONWriter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Iterator;
import java.util.Objects;
import java.util.TreeMap;
/**
* MD5工具类
*/
@Slf4j
public class MD5Util {
/**
* 生成签名串
*
* @param params 升序的参数
* @param slat 加盐应用系统的apiKey从控制台应用系统中获取
* @return 16进制签名串
*/
public static String md5Sign(String params, String slat) {
return digestToHex(params + slat);
}
/**
* 验签
*
* @param params 升序的参数
* @param sign 签名串
* @param slat 加盐应用系统的apiKey从控制台应用系统中获取
* @return true 表示验签通过
*/
public static boolean checkSign(String params, String sign, String slat) {
try {
String signData = digestToHex(params + slat);
log.info("生成的签名:{}", signData);
return StringUtils.equals(signData, sign);
} catch (Exception e) {
log.error("验签异常:", e);
return false;
}
}
/**
* json参数排序 <br/>
* <p>
* post请求为json传参时调用该方法按json中的key升序排列
* </p>
* @param obj json参数
* @return key升序的json字符串
*/
public static String sortJsonToStr(Object obj) {
if (Objects.isNull(obj) || "".equals(obj)) {
return "";
}
if (obj instanceof Integer
|| obj instanceof Short
|| obj instanceof Long
|| obj instanceof Float
|| obj instanceof Double
|| obj instanceof Boolean
|| obj instanceof Character
|| obj instanceof Byte) {
return String.valueOf(obj);
}
if (obj instanceof String) {
return JSONObject.toJSONString(JSONObject.parseObject(String.valueOf(obj)), JSONWriter.Feature.MapSortField);
}
try {
return JSONObject.toJSONString(obj, JSONWriter.Feature.MapSortField);
} catch (Exception e) {
return String.valueOf(obj);
}
}
/**
* url参数排序
* <br/>
* 该方法适用范围
* <ul>
* <li>get请求url参数传参</li>
* <li>post请求form-data传参</li>
* </ul>
* <p>
* 比如: a=1&c=3&b=2 排序后 a=1&b=2&c=3
* </p>
*
* @param paraMap TreeMap类型将参数都放入其中
* @return 按顺序拼接好的参数串
*/
public static String getUrlParamsSign(TreeMap<String, Object> paraMap, String slat) {
if (Objects.isNull(paraMap) || paraMap.isEmpty()) {
return md5Sign("", slat);
}
Iterator<String> it = paraMap.keySet().iterator();
StringBuilder paramStr = new StringBuilder();
while (it.hasNext()) {
String key = it.next();
Object o = paraMap.get(key);
if (Objects.isNull(o)) {
paramStr.append("&").append(key).append("=");
} else {
paramStr.append("&").append(key).append("=").append(o);
}
}
String urlParams = paramStr.substring(1);
return md5Sign(urlParams, slat);
}
private static String digestToHex(String s) {
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
byte[] b = digest.digest(s.getBytes(StandardCharsets.UTF_8));
return toHexString(b);
} catch (NoSuchAlgorithmException e) {
log.info("MD5异常,", e);
return null;
}
}
private static final char[] HEX_CHARS = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
private static String toHexString(byte[] b) {
return b == null ? null : toHexString(b, 0, b.length);
}
private static String toHexString(byte[] b, int offset, int length) {
if (b == null) {
return null;
} else {
int end = offset + length;
StringBuilder sb = new StringBuilder(length * 2);
for (int i = offset; i < end; ++i) {
int c = b[i] >> 4 & 15;
sb.append(HEX_CHARS[c]);
c = b[i] & 15;
sb.append(HEX_CHARS[c]);
}
return sb.toString();
}
}
public static void main(String[] args) {
// 签名的盐值控制台应用系统中的apiKey
String apiKey = "123456";
// url传参方式签名 比如a=1&b=2&c=3
TreeMap<String, Object> paramMap = new TreeMap<>();
paramMap.put("a", 1);
paramMap.put("b", 2);
paramMap.put("c", 3);
String urlParamsSign = getUrlParamsSign(paramMap, apiKey);
System.out.println("url参数签名(getUrlParamsSign方法): " + urlParamsSign);
String urlParamsSign2 = md5Sign("a=1&b=2&c=3", apiKey);
System.out.println("url参数签名(md5Sign方法): " + urlParamsSign2);
// json传参方式签名
String obj = "{\"a\":\"0\",\"c\":\"\",\"d\":0,\"b\":\"0\",\"c1\":\"\",\"a1\":\"0\"}";
String sortedJsonStr = sortJsonToStr(obj);
System.out.println("json字符串排序结果:" + sortedJsonStr);
String jsonStrSign = md5Sign(sortedJsonStr, apiKey);
System.out.println("json字符串签名结果:" + jsonStrSign);
JSONObject jsonObject = JSONObject.parseObject(obj);
String sortedJsonStr2 = sortJsonToStr(jsonObject);
System.out.println("json对象排序结果:" + sortedJsonStr2);
String jsonSign = md5Sign(sortedJsonStr2, apiKey);
System.out.println("json对象签名结果:" + jsonSign);
}
}

+ 3
- 2
src/main/java/com/fkzy/warn/common/util/RedisUtil.java View File

@ -1,8 +1,9 @@
package com.fkzy.warn.common.util; package com.fkzy.warn.common.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.TypeReference;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

+ 1
- 1
src/main/java/com/fkzy/warn/controller/AccountController.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.controller; package com.fkzy.warn.controller;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.fkzy.warn.common.constants.ResponseMsgConstants; import com.fkzy.warn.common.constants.ResponseMsgConstants;
import com.fkzy.warn.common.request.RequestParameter; import com.fkzy.warn.common.request.RequestParameter;
import com.fkzy.warn.model.User; import com.fkzy.warn.model.User;

+ 1
- 1
src/main/java/com/fkzy/warn/controller/AnnouncementController.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.controller; package com.fkzy.warn.controller;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.fkzy.warn.model.Announcement; import com.fkzy.warn.model.Announcement;
import com.fkzy.warn.service.AnnouncementService; import com.fkzy.warn.service.AnnouncementService;
import com.fkzy.warn.common.constants.ResponseMsgConstants; import com.fkzy.warn.common.constants.ResponseMsgConstants;

+ 1
- 1
src/main/java/com/fkzy/warn/controller/AuditRecordsController.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.controller; package com.fkzy.warn.controller;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.fkzy.warn.common.constants.ResponseMsgConstants; import com.fkzy.warn.common.constants.ResponseMsgConstants;
import com.fkzy.warn.common.request.RequestParameter; import com.fkzy.warn.common.request.RequestParameter;
import com.fkzy.warn.common.response.ApiResponse; import com.fkzy.warn.common.response.ApiResponse;

+ 1
- 1
src/main/java/com/fkzy/warn/controller/AuthorizationController.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.controller; package com.fkzy.warn.controller;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.fkzy.warn.service.AuthorizationService; import com.fkzy.warn.service.AuthorizationService;
import com.fkzy.warn.common.constants.ResponseMsgConstants; import com.fkzy.warn.common.constants.ResponseMsgConstants;
import com.fkzy.warn.common.request.RequestParameter; import com.fkzy.warn.common.request.RequestParameter;

+ 1
- 1
src/main/java/com/fkzy/warn/controller/ContractController.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.controller; package com.fkzy.warn.controller;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.fkzy.warn.common.constants.ResponseMsgConstants; import com.fkzy.warn.common.constants.ResponseMsgConstants;
import com.fkzy.warn.common.request.RequestParameter; import com.fkzy.warn.common.request.RequestParameter;
import com.fkzy.warn.common.response.ApiResponse; import com.fkzy.warn.common.response.ApiResponse;

+ 47
- 0
src/main/java/com/fkzy/warn/controller/DataCenterController.java View File

@ -2,6 +2,10 @@ package com.fkzy.warn.controller;
import com.fkzy.warn.common.constants.ResponseMsgConstants; import com.fkzy.warn.common.constants.ResponseMsgConstants;
import com.fkzy.warn.common.response.ApiResponse; import com.fkzy.warn.common.response.ApiResponse;
import com.fkzy.warn.model.AImessage;
import com.fkzy.warn.model.params.AILawParams;
import com.fkzy.warn.model.params.LawGroupParam;
import com.fkzy.warn.service.FyApiService;
import com.fkzy.warn.service.LawCaseService; import com.fkzy.warn.service.LawCaseService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -12,6 +16,10 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/** /**
* @author zhangjing * @author zhangjing
@ -25,6 +33,8 @@ import javax.annotation.Resource;
public class DataCenterController { public class DataCenterController {
@Resource @Resource
private LawCaseService lawCaseService; private LawCaseService lawCaseService;
@Resource
private FyApiService fyApiService;
@RequestMapping(value = "judicialModelSave", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "judicialModelSave", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ApiOperation(value = "司法模型") @ApiOperation(value = "司法模型")
@ -40,4 +50,41 @@ public class DataCenterController {
return apiResponse; return apiResponse;
} }
@RequestMapping(value = "getLawGroup", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ApiOperation(value = "法律法规分组列表")
public ApiResponse getLawGroup() {
ApiResponse apiResponse = new ApiResponse();
try {
LawGroupParam lawGroupParam = new LawGroupParam();
lawGroupParam.setOrgan("全国人民代表大会");
lawGroupParam.setExprityDateList(Collections.singletonList("[全国人民代表大会]"));
lawGroupParam.setSourceList(Collections.singletonList("[地方政府规章]"));
lawGroupParam.setTimeliness("现行有效");
lawGroupParam.setPageSize(20);
lawGroupParam.setPubDate("2014");
lawGroupParam.setPubDateList(Collections.singletonList("[地方政府规章]"));
lawGroupParam.setTimelinessList(Collections.singletonList("[现行有效]"));
lawGroupParam.setTitle("中国");
lawGroupParam.setPageNum(1);
// fyApiService.getLawGroup(lawGroupParam);
// fyApiService.getLawGroupInfo("9f9d4094-d788-52f6-804d-0fc2a5dd462f");
AILawParams aiLawParams = new AILawParams();
aiLawParams.setStream(true);
aiLawParams.setModel("中国法研LLM");
AImessage aImessage = new AImessage();
aImessage.setContent("借条和欠条的区别");
aImessage.setRole("user");
List<AImessage> aImessageList = new ArrayList<>();
aImessageList.add(aImessage);
aiLawParams.setMessages(aImessageList);
fyApiService.sendAILaw(aiLawParams);
} catch (Exception e) {
log.error("查询错误,errMsg==={}", e.getMessage());
e.printStackTrace();
apiResponse.recordError(ResponseMsgConstants.OPERATE_FAIL);
}
return apiResponse;
}
} }

+ 1
- 1
src/main/java/com/fkzy/warn/controller/MonitorUsersController.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.controller; package com.fkzy.warn.controller;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.fkzy.warn.common.constants.ResponseMsgConstants; import com.fkzy.warn.common.constants.ResponseMsgConstants;
import com.fkzy.warn.common.request.RequestParameter; import com.fkzy.warn.common.request.RequestParameter;
import com.fkzy.warn.common.response.ApiResponse; import com.fkzy.warn.common.response.ApiResponse;

+ 1
- 1
src/main/java/com/fkzy/warn/controller/NewsManageController.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.controller; package com.fkzy.warn.controller;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.fkzy.warn.common.constants.ResponseMsgConstants; import com.fkzy.warn.common.constants.ResponseMsgConstants;
import com.fkzy.warn.common.request.RequestParameter; import com.fkzy.warn.common.request.RequestParameter;
import com.fkzy.warn.common.response.ApiResponse; import com.fkzy.warn.common.response.ApiResponse;

+ 1
- 1
src/main/java/com/fkzy/warn/controller/PermissionController.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.controller; package com.fkzy.warn.controller;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.fkzy.warn.model.Permission; import com.fkzy.warn.model.Permission;
import com.fkzy.warn.service.PermissionService; import com.fkzy.warn.service.PermissionService;
import com.fkzy.warn.common.constants.ResponseMsgConstants; import com.fkzy.warn.common.constants.ResponseMsgConstants;

+ 1
- 1
src/main/java/com/fkzy/warn/controller/PolicyManagementController.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.controller; package com.fkzy.warn.controller;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.fkzy.warn.common.constants.ResponseMsgConstants; import com.fkzy.warn.common.constants.ResponseMsgConstants;
import com.fkzy.warn.common.request.RequestParameter; import com.fkzy.warn.common.request.RequestParameter;
import com.fkzy.warn.common.response.ApiResponse; import com.fkzy.warn.common.response.ApiResponse;

+ 1
- 1
src/main/java/com/fkzy/warn/controller/ReportController.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.controller; package com.fkzy.warn.controller;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.fkzy.warn.model.Report; import com.fkzy.warn.model.Report;
import com.fkzy.warn.model.params.GenerateReportParams; import com.fkzy.warn.model.params.GenerateReportParams;
import com.fkzy.warn.service.ReportService; import com.fkzy.warn.service.ReportService;

+ 1
- 1
src/main/java/com/fkzy/warn/controller/VersionManageController.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.controller; package com.fkzy.warn.controller;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.fkzy.warn.model.VersionManage; import com.fkzy.warn.model.VersionManage;
import com.fkzy.warn.service.VersionManageService; import com.fkzy.warn.service.VersionManageService;
import com.fkzy.warn.common.constants.ResponseMsgConstants; import com.fkzy.warn.common.constants.ResponseMsgConstants;

+ 1
- 1
src/main/java/com/fkzy/warn/mapper/DictItemMapper.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.mapper; package com.fkzy.warn.mapper;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

+ 1
- 1
src/main/java/com/fkzy/warn/mapper/DictMapper.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.mapper; package com.fkzy.warn.mapper;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fkzy.warn.model.Dict; import com.fkzy.warn.model.Dict;

+ 20
- 0
src/main/java/com/fkzy/warn/model/AImessage.java View File

@ -0,0 +1,20 @@
package com.fkzy.warn.model;
import lombok.Data;
/**
* @author zhangjing
* @date 2026/03/18 15:23
* @description
*/
@Data
public class AImessage {
/**
* 会话角色user代表用户assistant代表系统
*/
String role;
/**
* 会话内容
*/
String content;
}

+ 20
- 0
src/main/java/com/fkzy/warn/model/AccessToken.java View File

@ -0,0 +1,20 @@
package com.fkzy.warn.model;
import lombok.Data;
/**
* @author zhangjing
* @date 2026/03/17 17:20
* @description
*/
@Data
public class AccessToken {
private String accessKey;
private String dateTime;
private Long expires;
private String publicKey;
}

+ 17
- 0
src/main/java/com/fkzy/warn/model/ApiResult.java View File

@ -0,0 +1,17 @@
package com.fkzy.warn.model;
import lombok.Data;
/**
* @author zhangjing
* @date 2026/03/17 17:16
* @description
*/
@Data
public class ApiResult<T> {
private Integer code;
private String msg;
private T data; // 使用泛型 T
}

+ 38
- 0
src/main/java/com/fkzy/warn/model/ChapterNode.java View File

@ -0,0 +1,38 @@
package com.fkzy.warn.model;
import lombok.Data;
import java.util.List;
/**
* @author zhangjing
* @date 2026/03/18 16:43
* @description
*/
@Data
public class ChapterNode {
/**
* 节点类型 (例如: chapter, article, clause)
*/
private String type;
/**
* 名称
*/
private String name;
/**
* 内容
*/
private String content;
/**
* 编码/序号 (用于排序例如 "1", "2", "A", "B")
*/
private String code;
/**
* 子节点列表 (例如: 该章节下的条款项等)
*/
private List<ChapterNode> children;
}

+ 76
- 0
src/main/java/com/fkzy/warn/model/LawGroup.java View File

@ -0,0 +1,76 @@
package com.fkzy.warn.model;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author zhangjing
* @date 2026/03/18 15:11
* @description
*/
@Data
public class LawGroup {
private String title;
private String organ;
private String pubDate;
private String exprityDate;
private String timeliness;
private String id;
// 数据库或系统相关字段
private String createBy;
private Date createTime;
private String updateBy;
private Date updateTime;
private String remark;
private Integer pageNum;
private Integer pageSize;
// 核心业务字段
private String lawId;
private String base;
private String preface;
private String source;
// 文件路径相关字段
private String minioPath;
private String pdfPathName;
private String isPdf;
private String syncFlag;
// 查询辅助字段
private String timelinessIn;
private String cnt;
private String name;
private String titleEq;
private String titleIn;
private String pubdate_range_start;
private String pubdate_range_end;
private String content;
// 系统标识字段
private String fyopentoken;
private String fyopensysid;
private String fyopensign;
private String fyopserviceid;
// 列表查询字段
private List<String> sourceList;
private List<String> timelinessList;
private List<String> organList;
private List<String> pubDateList;
private List<String> exprityDateList;
// 排序字段
private String sortItem;
private String sortMethod;
// 其他状态字段
private String isValid;
private String lawType;
}

+ 45
- 0
src/main/java/com/fkzy/warn/model/LawGroupInfo.java View File

@ -0,0 +1,45 @@
package com.fkzy.warn.model;
import java.util.List;
/**
* @author zhangjing
* @date 2026/03/18 16:25
* @description
*/
public class LawGroupInfo {
/**
* 时间
*/
private String time;
/**
* 标题
*/
private String title;
/**
* 发布机构
*/
private String organ;
/**
* 失效日期
*/
private String exprityDate;
/**
* 时效性 (例如: 现行有效, 已废止, 尚未生效)
*/
private String timeliness;
/**
* 文号
*/
private String doc_number;
/**
* 子节点列表 (例如: 附件子通知等)
*/
private List<ChapterNode> children;
}

+ 17
- 0
src/main/java/com/fkzy/warn/model/LawPageData.java View File

@ -0,0 +1,17 @@
package com.fkzy.warn.model;
import lombok.Data;
import java.util.List;
/**
* @author zhangjing
* @date 2026/03/18 16:03
* @description
*/
@Data
public class LawPageData<T> {
Integer total;
List<T> result;
}

+ 25
- 0
src/main/java/com/fkzy/warn/model/params/AILawParams.java View File

@ -0,0 +1,25 @@
package com.fkzy.warn.model.params;
import com.fkzy.warn.model.AImessage;
import lombok.Data;
import java.util.List;
/**
* @author zhangjing
* @date 2026/03/18 15:26
* @description
*/
@Data
public class AILawParams {
/**
* 模型标识 中国法研LLM
*/
String model;
/**
* 流式开关固定值true
*/
Boolean stream;
List<AImessage> messages;
}

+ 68
- 0
src/main/java/com/fkzy/warn/model/params/LawGroupParam.java View File

@ -0,0 +1,68 @@
package com.fkzy.warn.model.params;
import lombok.Data;
import java.util.List;
/**
* @author zhangjing
* @date 2026/03/17 16:20
* @description
*/
@Data
public class LawGroupParam {
/**
* 每页条数
*/
private Integer pageSize;
/**
* 当前页码
*/
private Integer pageNum;
/**
* 法规名称关键词
*/
private String title;
/**
* 发布部门
*/
private String organ;
/**
* 时效状态现行有效
*/
private String timeliness;
/**
* 发布时间
*/
private String pubDate;
/**
* 发布部门列表支持多选
*/
private List<String> organList;
/**
* 时效状态列表支持多选
*/
private List<String> timelinessList;
/**
* 发布时间列表支持多选
*/
private List<String> pubDateList;
/**
* 效力级别列表地方政府规章
*/
private List<String> sourceList;
/**
* 实施日期列表2015
*/
private List<String> exprityDateList;
}

+ 25
- 0
src/main/java/com/fkzy/warn/model/params/PageParam.java View File

@ -0,0 +1,25 @@
package com.fkzy.warn.model.params;
import lombok.Data;
import java.util.List;
/**
* @author zhangjing
* @date 2026/03/17 16:20
* @description
*/
@Data
public class PageParam {
/**
* 每页条数
*/
private Integer pageSize;
/**
* 当前页码
*/
private Integer pageNum;
}

+ 1
- 1
src/main/java/com/fkzy/warn/service/AuthorizationService.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.service; package com.fkzy.warn.service;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fkzy.warn.common.request.RequestParameter; import com.fkzy.warn.common.request.RequestParameter;

+ 1
- 1
src/main/java/com/fkzy/warn/service/EnterpriseInfoService.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.service; package com.fkzy.warn.service;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fkzy.warn.model.EnterpriseInfo; import com.fkzy.warn.model.EnterpriseInfo;

+ 23
- 0
src/main/java/com/fkzy/warn/service/FyApiService.java View File

@ -0,0 +1,23 @@
package com.fkzy.warn.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fkzy.warn.model.LawCase;
import com.fkzy.warn.model.params.AILawParams;
import com.fkzy.warn.model.params.LawGroupParam;
import java.util.List;
/**
* @author zhangjing
* @date 2023/10/16 18:17
* @description
*/
public interface FyApiService extends IService<LawCase> {
void getAccessToken();
void getLawGroup(LawGroupParam lawGroupParam);
void getLawGroupInfo(String id);
void sendAILaw(AILawParams aiLawParams);
}

+ 1
- 1
src/main/java/com/fkzy/warn/service/InvocationRecordService.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.service; package com.fkzy.warn.service;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fkzy.warn.common.request.RequestParameter; import com.fkzy.warn.common.request.RequestParameter;

+ 1
- 1
src/main/java/com/fkzy/warn/service/LawCaseService.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.service; package com.fkzy.warn.service;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fkzy.warn.model.LawCase; import com.fkzy.warn.model.LawCase;

+ 2
- 1
src/main/java/com/fkzy/warn/service/UserService.java View File

@ -1,6 +1,7 @@
package com.fkzy.warn.service; package com.fkzy.warn.service;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fkzy.warn.common.request.RequestParameter; import com.fkzy.warn.common.request.RequestParameter;

+ 2
- 2
src/main/java/com/fkzy/warn/service/impl/AlarmCaseServiceImpl.java View File

@ -1,7 +1,7 @@
package com.fkzy.warn.service.impl; package com.fkzy.warn.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

+ 1
- 1
src/main/java/com/fkzy/warn/service/impl/AuthorizationServiceImpl.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.service.impl; package com.fkzy.warn.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fkzy.warn.mapper.AuthorizationMapper; import com.fkzy.warn.mapper.AuthorizationMapper;

+ 3
- 3
src/main/java/com/fkzy/warn/service/impl/EnterpriseInfoServiceImpl.java View File

@ -1,8 +1,8 @@
package com.fkzy.warn.service.impl; package com.fkzy.warn.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fkzy.warn.common.constants.EntityConstants; import com.fkzy.warn.common.constants.EntityConstants;

+ 373
- 0
src/main/java/com/fkzy/warn/service/impl/FyApiServiceImpl.java View File

@ -0,0 +1,373 @@
package com.fkzy.warn.service.impl;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.TypeReference;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fkzy.warn.common.constants.LawResearchUrlConstants;
import com.fkzy.warn.common.util.MD5Util;
import com.fkzy.warn.common.util.RedisUtil;
import com.fkzy.warn.mapper.LawCaseMapper;
import com.fkzy.warn.model.*;
import com.fkzy.warn.model.params.AILawParams;
import com.fkzy.warn.model.params.LawGroupParam;
import com.fkzy.warn.model.params.PageParam;
import com.fkzy.warn.service.FyApiService;
import com.fkzy.warn.service.InvocationRecordService;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import okio.BufferedSource;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.http.MediaType;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
* @author zhangjing
* @date 2023/10/16 18:17
* @description
*/
@Slf4j
@Service
public class FyApiServiceImpl extends ServiceImpl<LawCaseMapper, LawCase> implements FyApiService {
@Value(value = "${api.accessTokenUrl}")
private String accessTokenUrl;
@Value(value = "${api.appKey}")
private String appKey;
@Value(value = "${api.appSecret}")
private String appSecret;
@Value(value = "${api.lawGroupUrl}")
private String lawGroupUrl;
@Value(value = "${api.lawGroupInfoUrl}")
private String lawGroupInfoUrl;
@Value(value = "${api.aiLawUrl}")
private String aiLawUrl;
@Value(value = "${api.apiId}")
private String apiId;
@Resource
RedisUtil redisUtil;
@Resource
InvocationRecordService invocationRecordService;
@Override
public void getAccessToken() {
try {
String result = postAccessToken(accessTokenUrl, appKey, appSecret);
ApiResult<AccessToken> apiResult = JSON.parseObject(
result,
new TypeReference<ApiResult<AccessToken>>() {
}
);
if (apiResult != null && apiResult.getCode().equals(1000)) {
String accessKey = apiResult.getData().getAccessKey();
redisUtil.del("accessKey");
redisUtil.set("accessKey", accessKey, 60 * 48);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@Override
public void getLawGroup(LawGroupParam lawGroupParam) {
// getAccessToken();
// if (true){
// return;
// }
PageParam pageParam = new PageParam();
pageParam.setPageNum(1);
pageParam.setPageSize(20);
String json = JSON.toJSONString(lawGroupParam);
HttpHeaders headers = getRequestHeader(json);
String result = postAip(lawGroupUrl, headers, json, "法研平台-法律法规分组列表");
ApiResult<LawPageData<LawGroup>> resultData = JSON.parseObject(
result,
new TypeReference<ApiResult<LawPageData<LawGroup>>>() {
}
);
}
@Override
public void getLawGroupInfo(String id) {
JSONObject object = new JSONObject();
object.put("id", id);
String json = object.toJSONString();
HttpHeaders headers = getRequestHeader(json);
String result = postAip(lawGroupInfoUrl, headers, json, "法研平台-法律法规详情");
ApiResult<LawGroupInfo> resultData = JSON.parseObject(
result,
new TypeReference<ApiResult<LawGroupInfo>>() {
}
);
}
@Override
public void sendAILaw(AILawParams aiLawParams) {
// getAccessToken();
// if (true) {
// return;
// }
String jsonParams = JSON.toJSONString(aiLawParams);
HttpHeaders headers = getRequestHeader(jsonParams);
postStream(aiLawUrl, headers, jsonParams, "法研平台-AI检索法规");
}
/**
* 发送流式请求到指定URL并处理SSE响应
*
* @param url 请求的完整URL
* @param headers 已经构建好的请求头应包含认证等信息
* @param jsonParams JSON格式的请求体
* @param logDesc 用于日志描述的标识
*/
public void postStream(String url, HttpHeaders headers, String jsonParams, String logDesc) {
// 1. 创建 OkHttpClient 实例
OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(30, TimeUnit.SECONDS)
// SSE是长连接设置较长的读取超时
.readTimeout(5, TimeUnit.MINUTES)
.build();
// 2. 构建 Request
okhttp3.MediaType JSON_TYPE = okhttp3.MediaType.parse("application/json; charset=utf-8");
RequestBody body = RequestBody.create(JSON_TYPE, jsonParams);
Request.Builder requestBuilder = new Request.Builder()
.url(url)
.post(body);
// Spring HttpHeaders 复制到 OkHttp Request.Builder
for (String headerName : headers.keySet()) {
String headerValue = headers.getFirst(headerName);
if (headerValue != null) {
requestBuilder.addHeader(headerName, headerValue);
}
}
Request request = requestBuilder.build();
// 3. 发起异步请求
Call call = client.newCall(request);
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
System.err.println(logDesc + " - 请求失败: " + e.getMessage());
e.printStackTrace();
}
@Override
public void onResponse(Call call, Response response) throws IOException {
try {
if (!response.isSuccessful()) {
System.err.println(logDesc + " - 请求失败,状态码: " + response.code());
System.err.println(logDesc + " - 错误响应体: " + response.body().string());
return;
}
// 检查 Content-Type
String contentType = response.header("Content-Type");
if (contentType != null && contentType.toLowerCase().contains("text/event-stream")) {
System.out.println(logDesc + " - 检测到 content-type: " + contentType);
} else {
System.err.println(logDesc + " - 警告: 响应的 content-type 不是 'text/event-stream': " + contentType);
}
// 获取响应体源
ResponseBody responseBody = response.body();
if (responseBody == null) {
System.err.println(logDesc + " - 响应体为空");
return;
}
BufferedSource source = responseBody.source();
System.out.println(logDesc + " - 请求成功,开始处理流式响应...");
// 4. 逐行读取并处理流
while (!source.exhausted()) {
String line = source.readUtf8LineStrict();
if (line.startsWith("data:")) {
// 提取 data 字段后的 JSON 内容
String jsonData = line.substring(5).trim(); // 去掉 "data:" 前缀和空格
try {
// 假设服务器返回的 data JSON可以使用 Fastjson2 解析
Object parsedData = JSON.parse(jsonData);
System.out.println(logDesc + " - 收到数据: " + parsedData);
// 在这里你可以将 parsedData 转换为你需要的对象类型
// 并进行后续的业务处理
} catch (Exception e) {
// 如果 data 不是 JSON直接打印
System.out.println(logDesc + " - 收到非JSON数据: " + jsonData);
}
} else if (line.startsWith("event:") || line.startsWith("id:") || line.startsWith("retry:")) {
// 处理其他 SSE 事件字段 (如果需要)
System.out.println(logDesc + " - SSE Event Line: " + line);
} else if (line.isEmpty()) {
// SSE 规范中空行表示一个事件的结束
// System.out.println(logDesc + " - Event End (empty line)");
} else {
// 有些服务器可能直接发送数据而不带 "data:" 前缀
System.out.println(logDesc + " - Received raw line: " + line);
}
}
System.out.println(logDesc + " - 流式响应处理完毕。");
} finally {
response.close(); // 确保资源被释放
}
}
});
System.out.println(logDesc + " - 异步请求已发送,正在监听流式响应...");
}
private String postAip(String lawGroupUrl, HttpHeaders headers
, String request, String apiName) {
//接口调用日志
InvocationRecord invocationRecord = new InvocationRecord();
RestTemplate restTemplate = new RestTemplate();
HttpComponentsClientHttpRequestFactory requestFactory
= new HttpComponentsClientHttpRequestFactory();
requestFactory.setConnectionRequestTimeout(60000);
requestFactory.setConnectTimeout(60000);
requestFactory.setReadTimeout(60000);
restTemplate.setRequestFactory(requestFactory);
try {
HttpEntity<String> entity = new HttpEntity<>(request, headers);
ResponseEntity<String> response = restTemplate.exchange(
lawGroupUrl,
HttpMethod.POST,
entity,
String.class
);
String rawResponseBody = response.getBody();
String resultData;
// 获取响应头中的 Content-Type
String contentType = response.getHeaders().getContentType().toString();
if (contentType != null && contentType.toLowerCase().contains("charset=utf-8")) {
// 指定了UTF-8则使用UTF-8解码
resultData = new String(rawResponseBody.getBytes("ISO-8859-1"), "UTF-8");
} else {
// 兜底
resultData = new String(rawResponseBody.getBytes("ISO-8859-1"), "UTF-8");
}
//日志
invocationRecord.setApiUrl(lawGroupUrl);
if (request != null) {
invocationRecord.setInputObj(request);
}
invocationRecord.setApiName(apiName);
invocationRecord.setIsSuccess(0);
invocationRecord.setApiResult(resultData);
JSONObject jsonObject = JSONObject.parseObject(resultData);
if (jsonObject != null && jsonObject.getString("code").equals("1000")) {
invocationRecord.setIsSuccess(1);
return resultData;
}
} catch (Exception e) {
// 记录失败情况
invocationRecord.setIsSuccess(0);
invocationRecord.setApiResult("Error: " + e.getMessage());
e.printStackTrace(); // 或者使用更合适的日志框架
} finally {
// 无论成功还是失败都确保记录被保存
invocationRecordService.save(invocationRecord);
}
return null;
}
private HttpHeaders getRequestHeader(String params) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("FYDN-OP-RequestId", UUID.randomUUID().toString().replaceAll("-", ""));
// 签名串使用在线文档中的MD5Util示例加密生成
String sortString = MD5Util.sortJsonToStr(params);
String sign = MD5Util.md5Sign(sortString, appKey);
headers.set("FYDN-OP-Sign", sign);
// 需要从getAccessToken返回结果中解析出accessKey返回结构样例参考在线文档
String accessToken = getRedisAccessToken();
headers.set("FYDN-OP-AccessToken", accessToken);
headers.set("FYDN-OP-AppID", apiId);
// 调用的环境prod:线上环境默认test:测试环境
headers.set("FYDN-OP-Env", "prod");
// 用户所在系统的唯一标识
headers.set("FYDN-OP-UserId", "");
return headers;
}
private String getRedisAccessToken() {
String accessToken = redisUtil.getString("accessKey");
if (accessToken == null) {
getAccessToken();
accessToken = redisUtil.getString("accessKey");
}
if (accessToken != null && accessToken.startsWith("\"") && accessToken.endsWith("\"")) {
// 使用 substring 去掉第一个和最后一个字符
return accessToken.substring(1, accessToken.length() - 1);
}
return accessToken;
}
public String postAccessToken(String apiUrl, String appKey, String appSecret) throws Exception {
// paramMap 转为 JSON 字符串
try (CloseableHttpClient httpclient = HttpClients.createDefault()) {
HttpPost httpPost = new HttpPost(apiUrl);
RequestConfig config = RequestConfig.custom().setSocketTimeout(10000).setConnectTimeout(10000).setConnectionRequestTimeout(10000).build();
httpPost.setConfig(config);
// 构造 x-www-form-urlencoded 参数
String params = "appKey=" + URLEncoder.encode(appKey, StandardCharsets.UTF_8.toString()) + "&appSecret=" + URLEncoder.encode(appSecret, StandardCharsets.UTF_8.toString());
StringEntity entity = new StringEntity(params, StandardCharsets.UTF_8);
httpPost.setEntity(entity);
httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded");
try (CloseableHttpResponse response = httpclient.execute(httpPost)) {
int statusCode = response.getStatusLine().getStatusCode();
if (statusCode == 200) {
org.apache.http.HttpEntity resEntity = response.getEntity();
return EntityUtils.toString(resEntity, StandardCharsets.UTF_8);
} else {
System.err.println("HTTP Error: " + statusCode);
return null;
}
}
}
}
}

+ 12
- 12
src/main/java/com/fkzy/warn/service/impl/LawCaseServiceImpl.java View File

@ -1,8 +1,8 @@
package com.fkzy.warn.service.impl; package com.fkzy.warn.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fkzy.warn.common.constants.EntityConstants; import com.fkzy.warn.common.constants.EntityConstants;
@ -204,14 +204,14 @@ public class LawCaseServiceImpl extends ServiceImpl impl
// ReportModel reportModel = createReportData(); // ReportModel reportModel = createReportData();
// ReportUtil.createReport(reportModel); // ReportUtil.createReport(reportModel);
String filePath = "丰县城市建设投资集团有限公司-司法.txt";
// String filePath = "工商.txt";
String jsonOutput = convertTextToJson(filePath);
if (jsonOutput == null) {
logger.error("转换失败,JSON 字符串为空");
return;
}
jsonObject = new JSONObject().parseObject(jsonOutput);
// String filePath = "丰县城市建设投资集团有限公司-司法.txt";
//// String filePath = "工商.txt";
// String jsonOutput = convertTextToJson(filePath);
// if (jsonOutput == null) {
// logger.error("转换失败,JSON 字符串为空");
// return;
// }
// jsonObject = new JSONObject().parseObject(jsonOutput);
// enterpriseInfoService.industryModelSave(jsonObject); // enterpriseInfoService.industryModelSave(jsonObject);
JSONArray arr = jsonObject.getJSONArray("data"); JSONArray arr = jsonObject.getJSONArray("data");
if (arr == null || arr.isEmpty()) { if (arr == null || arr.isEmpty()) {
@ -247,7 +247,7 @@ public class LawCaseServiceImpl extends ServiceImpl impl
// 八类案件 // 八类案件
JSONObject detail = data.getJSONObject("detail"); JSONObject detail = data.getJSONObject("detail");
// setCases(detail, companyName, creditCode);
setCases(detail, companyName, creditCode);
//案件树 //案件树
JSONObject tree = detail.getJSONObject("cases_tree"); JSONObject tree = detail.getJSONObject("cases_tree");
JSONArray civil = tree.getJSONArray("civil"); JSONArray civil = tree.getJSONArray("civil");

+ 3
- 1
src/main/java/com/fkzy/warn/service/impl/MonitorUsersServiceImpl.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.service.impl; package com.fkzy.warn.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -112,6 +112,8 @@ public class MonitorUsersServiceImpl extends ServiceImpl
report.setReportType("first"); report.setReportType("first");
report.setName(item.getCompanyName()); report.setName(item.getCompanyName());
report.setReportTime(new Date()); report.setReportTime(new Date());
report.setBusinessId(item.getBindUserId());
report.setIsDel(EntityConstants.NORMAL);
reportService.save(report); reportService.save(report);
} }

+ 1
- 1
src/main/java/com/fkzy/warn/service/impl/UserServiceImpl.java View File

@ -1,6 +1,6 @@
package com.fkzy.warn.service.impl; package com.fkzy.warn.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

+ 10
- 0
src/main/resources/bootstrap-dev.yml View File

@ -61,6 +61,16 @@ file:
fileUploadPath: /upload/ fileUploadPath: /upload/
preViewRealPath: http://182.151.8.209:9000/fkzy/ preViewRealPath: http://182.151.8.209:9000/fkzy/
api:
#法研平台接口
accessTokenUrl: https://api.cjbdi.com:8443/auth/api/token/getAccess
appKey: 956ee3a3106ba289ce87d46f877b78ef
appSecret: b2f77e1395324dcbd1557d4a2908c9fd
lawGroupUrl: https://api.cjbdi.com:8443/354347/kaas/law/getLawListByGroup
lawGroupInfoUrl: https://api.cjbdi.com:8443/354347/kaas/web/law/getLawStripRelateResultById
aiLawUrl: https://api.cjbdi.com:8443/354347/defg/web/openapis/template/flux/38
apiId: ea255f4a400342b5b96c8fb904616354

+ 24
- 6
src/main/resources/bootstrap-prod.yml View File

@ -1,17 +1,18 @@
server: server:
port: 12101
port: 12000
spring: spring:
datasource: datasource:
driver-class-name: com.kingbase8.Driver
url: jdbc:kingbase8://47.109.88.209:54321/gas?currentSchema=gas_service_db
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:33066/fkzy_operation?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT%2b8&allowMultiQueries=true
username: root username: root
password: zjtc321!
password: Zjtc!@#0804
druid: druid:
#配置初始化连接数大小 #配置初始化连接数大小
initial-size: 50 initial-size: 50
# 最大连接数 # 最大连接数
maxActive: 150
maxActive: 100
#最小连接数 #最小连接数
minIdle: 50 minIdle: 50
#获取连接等待超时时间 #获取连接等待超时时间
@ -19,7 +20,7 @@ spring:
#Redis #Redis
redis: redis:
host: 47.109.88.209
host: 127.0.0.1
port: 63799 port: 63799
password: zjtc321! password: zjtc321!
pool: pool:
@ -42,6 +43,23 @@ mybatis-plus:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
call-setters-on-nulls: true call-setters-on-nulls: true
minio:
host: http://127.0.0.1:9000 # endpoint MinIO服务所在地址
url: ${minio.host}/${minio.bucket}/
access-key: zjtc
secret-key: Zjtc!@#0804
bucket: fkzy
ali:
accessKeyId: http://182.151.8.209:8081/gas_apportal/publicApi/auth/logout
secret: http://182.151.8.209:8081/gas_apportal/menu/getMenuByUserId
file:
#附件上传盘符,liunx服务器需要切换
fileUploadRootPath: D:/
fileUploadPath: /upload/
preViewRealPath: http://8.140.252.221:9000/fkzy/

+ 0
- 1
丰县城市建设投资集团有限公司-司法.txt
File diff suppressed because it is too large
View File


BIN
司法风险报告demo.docx View File


+ 0
- 1
四川无声信息技术有限公司-司法.txt
File diff suppressed because it is too large
View File


+ 0
- 1
工商.txt
File diff suppressed because it is too large
View File


+ 0
- 1
徐州-司法.txt
File diff suppressed because it is too large
View File


Loading…
Cancel
Save