diff --git a/src/main/java/com/gxwebsoft/ai/controller/BaseAuditContentController.java b/src/main/java/com/gxwebsoft/ai/controller/BaseAuditContentController.java index cf78d5d..39bfce2 100644 --- a/src/main/java/com/gxwebsoft/ai/controller/BaseAuditContentController.java +++ b/src/main/java/com/gxwebsoft/ai/controller/BaseAuditContentController.java @@ -106,37 +106,61 @@ public abstract class BaseAuditContentController extends BaseController { private void convertWorkPaperFileInfo(JSONObject result) { JSONArray data = result.getJSONArray("data"); + for (int i = 0; i < data.size(); i++) { JSONObject obj = data.getJSONObject(i); JSONArray workPaperIndexFileIds = obj.getJSONArray("workPaperIndex"); - if (workPaperIndexFileIds == null || workPaperIndexFileIds.isEmpty()) { - continue; - } - - // 先查询所有文件 - List aiCloudFiles = aiCloudFileService.list(new LambdaQueryWrapper().in(AiCloudFile::getFileId, workPaperIndexFileIds)); - - // 创建文件ID到文件的映射,便于查找 - Map fileMap = aiCloudFiles.stream().collect(Collectors.toMap(AiCloudFile::getFileId, file -> file)); - - // 创建转换后的数组(保持原顺序) - JSONArray transformedArray = new JSONArray(); - for (Object fileIdObj : workPaperIndexFileIds) { - String fileId = (String) fileIdObj; - AiCloudFile file = fileMap.get(fileId); - if (file != null) { - String transformed = file.getFileId() + "||" + file.getFileName() + "||" + file.getFileUrl(); - transformedArray.add(transformed); - }else { - transformedArray.add(fileIdObj); + // 先获取并转换 workPaperIndex 字段 + if (workPaperIndexFileIds != null && !workPaperIndexFileIds.isEmpty()) { + // 先查询所有文件 + List aiCloudFiles = aiCloudFileService.list(new LambdaQueryWrapper().in(AiCloudFile::getFileId, workPaperIndexFileIds)); + + // 创建文件ID到文件的映射,便于查找 + Map fileMap = aiCloudFiles.stream().collect(Collectors.toMap(AiCloudFile::getFileId, file -> file)); + + // 创建转换后的数组(保持原顺序) + JSONArray transformedArray = new JSONArray(); + for (Object fileIdObj : workPaperIndexFileIds) { + String fileId = (String) fileIdObj; + AiCloudFile file = fileMap.get(fileId); + if (file != null) { + String transformed = file.getFileId() + "||" + file.getFileName() + "||" + file.getFileUrl(); + transformedArray.add(transformed); + } else { + transformedArray.add(fileIdObj); + } + } + + // 将转换后的数据塞回原字段 + obj.put("workPaperIndex", transformedArray); + + // 使用 workPaperIndexFileIds 中的每个 fileId 替换其他字段中的四种格式 + for (String key : obj.keySet()) { + if ("workPaperIndex".equals(key)) { + continue; // 跳过 workPaperIndex 字段 + } + Object value = obj.get(key); + if (value instanceof String) { + String text = (String) value; + for (Object fileIdObj : workPaperIndexFileIds) { + String fileId = (String) fileIdObj; + text = text.replace("【FileId:" + fileId + "】", "") + .replace("(FileId:" + fileId + ")", "") + .replace("(FileId:" + fileId + ")", "") + .replace("FileId:"+fileId, "") + .replace("【" + fileId + "】", "") + .replace("(" + fileId + ")", "") + .replace("(" + fileId + ")", "") + .replace(fileId, "");; + } + obj.put(key, text); + } } } - - // 将转换后的数据塞回原字段 - obj.put("workPaperIndex", transformedArray); } } + /** * 生成请求哈希 diff --git a/src/main/java/com/gxwebsoft/ai/service/impl/AuditContent3TripleServiceImpl.java b/src/main/java/com/gxwebsoft/ai/service/impl/AuditContent3TripleServiceImpl.java index 0cef94e..61e8f90 100644 --- a/src/main/java/com/gxwebsoft/ai/service/impl/AuditContent3TripleServiceImpl.java +++ b/src/main/java/com/gxwebsoft/ai/service/impl/AuditContent3TripleServiceImpl.java @@ -201,7 +201,11 @@ public class AuditContent3TripleServiceImpl extends AbstractAuditContentService context.append("3. 工作底稿索引必须准确对应实际文件名称,避免使用附表或章节标题\n"); context.append("4. 测试结果判定需严格,对于制度不一致、执行不到位、证据不充分的情况必须判定为不通过\n"); context.append("5. 审计检查的证据主要按公司制度为主,政策内容和集团制度为次要\n"); - context.append("6. 审计检查的证据增加判断公司制度是否与政策内容和集团制度相符\n\n"); + context.append("6. 审计检查的证据增加判断公司制度是否与政策内容和集团制度相符\n"); + context.append("7. 历史问题整改分析:需核查历史问题是否已整改,结合最新时间材料(如最新会议纪要)分析当前是否存在相同问题\n"); + context.append("8. 项目上会核查:涉及三重一大的项目必须核查是否按规定上会,检查有无会议纪要作为证据\n"); + context.append("9. 制度权限关系:明确分析公司制度与集团制度的关联关系,权限设置必须遵循公司权限≤集团权限的原则\n"); + context.append("10. 层级关系识别:注意识别文件中的上级单位信息,分析制度执行是否符合层级管理要求\n\n"); // 3. 参考数据(从常量类中获取) context.append("## 参考数据\n");