20260511173242
This commit is contained in:
1 parent
56f5ba4e6b
commit
364d29dbaa
20 files changed
+2992
-88
No files matched your search
+3
@@ -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);
|
||||
}
|
||||
}
|
||||
+18
-1
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user