优化图片尺寸
This commit is contained in:
+12
-5
@@ -465,7 +465,9 @@ public class AppearancePatentCozeClient {
|
||||
text(firstNonNull(node.get("patent_reason"),
|
||||
firstNonNull(firstNonNull(node.get("patentReason"), node.get("patent reason")),
|
||||
firstNonNull(itemNode.get("patent_reason"),
|
||||
firstNonNull(itemNode.get("patentReason"), itemNode.get("patent reason"))))))
|
||||
firstNonNull(itemNode.get("patentReason"), itemNode.get("patent reason")))))),
|
||||
text(firstNonNull(firstNonNull(node.get("score"), node.get("Score")),
|
||||
firstNonNull(itemNode.get("score"), itemNode.get("Score"))))
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -570,6 +572,7 @@ public class AppearancePatentCozeClient {
|
||||
row.setTitleReason(result.titleReason());
|
||||
row.setAppearanceReason(result.appearanceReason());
|
||||
row.setPatentReason(result.patentReason());
|
||||
row.setScore(result.score());
|
||||
}
|
||||
|
||||
private RestClient restClient() {
|
||||
@@ -600,13 +603,14 @@ public class AppearancePatentCozeClient {
|
||||
row.setTitleReason(source.getTitleReason());
|
||||
row.setAppearanceReason(source.getAppearanceReason());
|
||||
row.setPatentReason(source.getPatentReason());
|
||||
row.setScore(source.getScore());
|
||||
return row;
|
||||
}
|
||||
|
||||
private AppearancePatentResultRowDto markFailed(AppearancePatentResultRowDto row, String failureMessage) {
|
||||
String reviewMessage = failureMessage == null || failureMessage.isBlank()
|
||||
? "Coze 检测失败,待人工复核"
|
||||
: "Coze 检测失败,待人工复核:" + failureMessage;
|
||||
? "Coze 检测失败"
|
||||
: "Coze 检测失败:" + failureMessage;
|
||||
if (row.getError() == null || row.getError().isBlank()) {
|
||||
row.setError(failureMessage);
|
||||
}
|
||||
@@ -797,7 +801,9 @@ public class AppearancePatentCozeClient {
|
||||
|| item.has("appearanceReason")
|
||||
|| item.has("patent_reason")
|
||||
|| item.has("patentReason")
|
||||
|| item.has("patent reason"));
|
||||
|| item.has("patent reason")
|
||||
|| item.has("score")
|
||||
|| item.has("Score"));
|
||||
}
|
||||
|
||||
private boolean isSuccessfulWorkflowStatus(String status) {
|
||||
@@ -1054,7 +1060,8 @@ public class AppearancePatentCozeClient {
|
||||
String status,
|
||||
String titleReason,
|
||||
String appearanceReason,
|
||||
String patentReason
|
||||
String patentReason,
|
||||
String score
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -78,6 +78,10 @@ public class AppearancePatentResultRowDto {
|
||||
@Schema(description = "Coze patent reason", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
private String patentReason;
|
||||
|
||||
@JsonAlias({"score", "Score", "评分"})
|
||||
@Schema(description = "Coze 回流的评分(外观维度),透传到最终 xlsx 第一张 sheet 的“评分”列。", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
private String score;
|
||||
|
||||
/**
|
||||
* 仅内存生命周期标记,标识当前 status 是 markFailed 时合成出来的(而不是用户/Python 真实回传)。
|
||||
* 不入库、不参与 chunk 序列化(@JsonIgnore),用于导出 / 重新上传判定时区分"系统合成 FAILED"与"用户真正失败",
|
||||
|
||||
+15
-9
@@ -128,7 +128,8 @@ public class AppearancePatentTaskService {
|
||||
"外观维度(外观设计专利)",
|
||||
"专利维度(发明/实用新型专利)",
|
||||
"结论",
|
||||
"状态"
|
||||
"状态",
|
||||
"评分"
|
||||
);
|
||||
|
||||
private final LocalFileStorageService localFileStorageService;
|
||||
@@ -1265,6 +1266,7 @@ public class AppearancePatentTaskService {
|
||||
row.setTitleReason(representative.getTitleReason());
|
||||
row.setAppearanceReason(representative.getAppearanceReason());
|
||||
row.setPatentReason(representative.getPatentReason());
|
||||
row.setScore(representative.getScore());
|
||||
row.setDone(representative.getDone());
|
||||
return row;
|
||||
}
|
||||
@@ -3240,7 +3242,8 @@ public class AppearancePatentTaskService {
|
||||
row.createCell(col++).setCellValue(resultRow == null ? missingReason : userFacingCozeCellValue(resultRow, resultRow.getAppearanceRisk()));
|
||||
row.createCell(col++).setCellValue(resultRow == null ? missingReason : userFacingCozeCellValue(resultRow, resultRow.getPatentRisk()));
|
||||
row.createCell(col++).setCellValue(resultRow == null ? "未送检" : userFacingConclusion(resultRow));
|
||||
row.createCell(col).setCellValue(resultRow == null ? "" : userFacingStatus(resultRow));
|
||||
row.createCell(col++).setCellValue(resultRow == null ? "" : userFacingStatus(resultRow));
|
||||
row.createCell(col).setCellValue(resultRow == null ? "" : firstNonBlank(resultRow.getScore(), ""));
|
||||
}
|
||||
writeReasonSheet(workbook, headerStyle, rowsToWrite, resultMap);
|
||||
workbook.write(fos);
|
||||
@@ -4041,11 +4044,12 @@ public class AppearancePatentTaskService {
|
||||
if (!normalizedValue.isBlank() && !isTechnicalCozeFailure(normalizedValue)) {
|
||||
return value;
|
||||
}
|
||||
// coze 技术性失败:有错误信息则放入错误信息,没有则留空
|
||||
if (row != null && isTechnicalCozeFailure(row.getError())) {
|
||||
return "待人工复核";
|
||||
return firstNonBlank(row.getError(), "");
|
||||
}
|
||||
if (row != null && isFailedCozeStatusValue(row.getStatus())) {
|
||||
return "待人工复核";
|
||||
return firstNonBlank(row.getError(), "");
|
||||
}
|
||||
return firstNonBlank(value, "");
|
||||
}
|
||||
@@ -4058,11 +4062,12 @@ public class AppearancePatentTaskService {
|
||||
if (!conclusion.isBlank() && !isTechnicalCozeFailure(conclusion)) {
|
||||
return row.getConclusion();
|
||||
}
|
||||
// coze 技术性失败:有错误信息则放入错误信息,没有则留空
|
||||
if (isTechnicalCozeFailure(row.getError())) {
|
||||
return "待人工复核";
|
||||
return firstNonBlank(row.getError(), "");
|
||||
}
|
||||
if (isFailedCozeStatusValue(row.getStatus())) {
|
||||
return "待人工复核";
|
||||
return firstNonBlank(row.getError(), "");
|
||||
}
|
||||
return firstNonBlank(row.getConclusion(), "");
|
||||
}
|
||||
@@ -4070,8 +4075,8 @@ public class AppearancePatentTaskService {
|
||||
/**
|
||||
* 导出最终 xlsx 时的状态展示:
|
||||
* - 如果 status 是 markFailed 合成的(failureSyntheticStatus=true),
|
||||
* 且 row 实际并没有任何风险维度结果,导出层降级为"待人工复核",避免用户原样
|
||||
* 重新上传时该行被反复识别为失败行重新触发 Coze。
|
||||
* 且 row 实际并没有任何风险维度结果,导出层展示错误信息(有则放入,无则留空),
|
||||
* 避免用户原样重新上传时该行被反复识别为失败行重新触发 Coze。
|
||||
* - 真正业务侧失败 / Python 真实回传 FAILED 仍按原值显示。
|
||||
*/
|
||||
private String userFacingStatus(AppearancePatentResultRowDto row) {
|
||||
@@ -4082,7 +4087,8 @@ public class AppearancePatentTaskService {
|
||||
if (!row.isFailureSyntheticStatus()) {
|
||||
return original;
|
||||
}
|
||||
return "待人工复核";
|
||||
// 合成状态:有错误信息则放入错误信息,没有则留空
|
||||
return firstNonBlank(row.getError(), "");
|
||||
}
|
||||
|
||||
private boolean isTechnicalCozeFailure(String value) {
|
||||
|
||||
Reference in New Issue
Block a user