20260511173242

This commit is contained in:
oneao committed 2026-05-11 17:32:43 +08:00
1 parent 56f5ba4e6b
commit 364d29dbaa
20 files changed
+2992 -88

No files matched your search

@@ -276,6 +276,9 @@ public class DataSaveController {
mapData.put("b_option",operation);
mapData.put("b_datas",dataStr);
mapData.put("b_inputdatetime",dateTime);
mapData.put("b_inputuser_id",userId);
logList.add(mapData);
}
}
@@ -4,6 +4,7 @@ import cn.g3soft.config.FileConfig;
import cn.g3soft.context.UserContext;
import cn.g3soft.utils.*;
import cn.g3soft.utils.uniqueId.idgen.UniqueId;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.DateUtil;
@@ -286,11 +287,27 @@ public class FileController {
// 6. 删除数据库
dbUtils.deleteById("bf_file", "subid", subid);
return Result.ok();
// 7. 记录日志
Map<String,Object> mapData = new HashMap<>();
ObjectMapper objectMapper = new ObjectMapper();
String dataStr = objectMapper.writeValueAsString(objectMap);
String currentDateTime = TimeUtils.getDateTime();
mapData.put("b_table","bf_file");
mapData.put("b_option","DELETE");
mapData.put("b_datas",dataStr);
mapData.put("b_inputdatetime",currentDateTime);
mapData.put("b_inputuser_id",UserContext.get().getUserId());
dbUtils.insert("log_datas","b_id",mapData);
return Result.ok();
} catch (Exception e) {
e.printStackTrace();
return Result.fail("删除失败: " + e.getMessage());
}
}
}
@@ -26,7 +26,6 @@ public class OcrController {
String fileUrl = (String) params.get("fileUrl");
String requestUrl = "http://127.0.0.1:8867/ocr";
// String requestUrl = "http://127.0.0.1:8867/paddlex/ocr";
Map<String, Object> reqPayload = new HashMap<>();
reqPayload.put("file", fileUrl);
@@ -8,11 +8,6 @@ import java.util.concurrent.TimeUnit;
import com.fasterxml.jackson.databind.ObjectMapper;
import okhttp3.*;
/**
* 通用http发送方法
*
* @author ruoyi
*/
public class HttpUtils
{
private static final ObjectMapper MAPPER = new ObjectMapper();
@@ -87,19 +82,20 @@ public class HttpUtils
// ==================== POST JSON(Map版本)====================
public static String postJson(String url, Map<String, Object> params) throws Exception {
// 1. Map 转 JSON 字符串
String json = MAPPER.writeValueAsString(params);
RequestBody body = RequestBody.create(
MAPPER.writeValueAsString(params),
JSON
);
// 2. 构建请求体
RequestBody body = RequestBody.create(json, JSON);
OkHttpClient tempClient = client.newBuilder()
.build();
Request request = new Request.Builder()
.url(url)
.post(body)
.build();
// 3. 执行请求
try (Response response = client.newCall(request).execute()) {
try (Response response = tempClient.newCall(request).execute()) {
return response.body() != null ? response.body().string() : null;
}
}
@@ -4,4 +4,4 @@ server:
port: 80
file:
server-url: http://192.168.5.6:80/api
server-url: http://192.168.1.137:80/api
@@ -1,7 +1,4 @@
server:
servlet:
# context-path: / # 应用的访问路径
# context-path: /api/ # 应用的访问路径
tomcat:
uri-encoding: UTF-8 # URI编码
accept-count: 1000 # 连接数满后的排队数
@@ -19,7 +16,7 @@ spring:
time-zone: "Asia/Shanghai"
date-format: yyyy-MM-dd HH:mm:ss
profiles:
active: dev
active: build
file:
base-dir: D:/data/file
@@ -1,10 +1,10 @@
url=jdbc:sqlserver://118.89.70.199:1433;databaseName=G3BoxOCR;encrypt=false
username=sa
password=zhang520..
driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
#url=jdbc:sqlserver://127.0.0.1:1433;databaseName=G3ContainerOCR
#url=jdbc:sqlserver://118.89.70.199:1433;databaseName=G3BoxOCR;encrypt=false
#username=sa
#password=123456@aaa
#password=zhang520..
#driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
url=jdbc:sqlserver://127.0.0.1:1433;databaseName=G3ContainerOCR;encrypt=false
username=sa
password=123456@aaa
driver=com.microsoft.sqlserver.jdbc.SQLServerDriver