feat:管理端mock
This commit is contained in:
1 parent
f3cd784e14
commit
6644a37da7
23 files changed
+1884
-23
No files matched your search
Binary file not shown.
+80
-22
@@ -1,22 +1,80 @@
|
||||
2026-11-10 18:51:00.819 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Starting CrrcMallApplication using Java 17.0.21 with PID 12575 (/Users/air/yuankuang/crrc-mall/target/classes started by air in /Users/air/yuankuang/crrc-mall)
|
||||
2026-11-10 18:51:00.821 [main] INFO com.crrc.crrcmall.CrrcMallApplication - The following 1 profile is active: "local"
|
||||
2026-11-10 18:51:01.706 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port 8080 (http)
|
||||
2026-11-10 18:51:01.720 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
|
||||
2026-11-10 18:51:01.720 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/10.1.30]
|
||||
2026-11-10 18:51:01.770 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
|
||||
2026-11-10 18:51:01.770 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 917 ms
|
||||
2026-11-10 18:51:02.198 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port 8080 (http) with context path '/'
|
||||
2026-11-10 18:51:02.207 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Started CrrcMallApplication in 1.857 seconds (process running for 2.421)
|
||||
2026-11-10 20:09:56.077 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Starting CrrcMallApplication using Java 17.0.21 with PID 14064 (/Users/air/yuankuang/crrc-mall/target/classes started by air in /Users/air/yuankuang/crrc-mall)
|
||||
2026-11-10 20:09:56.078 [main] INFO com.crrc.crrcmall.CrrcMallApplication - The following 1 profile is active: "local"
|
||||
2026-11-10 20:09:56.872 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port 8080 (http)
|
||||
2026-11-10 20:09:56.884 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
|
||||
2026-11-10 20:09:56.885 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/10.1.30]
|
||||
2026-11-10 20:09:56.931 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
|
||||
2026-11-10 20:09:56.931 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 823 ms
|
||||
2026-11-10 20:09:57.356 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port 8080 (http) with context path '/'
|
||||
2026-11-10 20:09:57.364 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Started CrrcMallApplication in 1.731 seconds (process running for 2.25)
|
||||
2026-11-10 20:11:32.221 [http-nio-8080-exec-1] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2026-11-10 20:11:32.222 [http-nio-8080-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
|
||||
2026-11-10 20:11:32.223 [http-nio-8080-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 1 ms
|
||||
2026-11-10 20:11:32.339 [http-nio-8080-exec-1] INFO com.crrc.crrcmall.service.impl.SearchServiceImpl - 执行 AI 文本搜索,关键词:null
|
||||
2026-11-12 10:50:37.350 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Starting CrrcMallApplication using Java 21.0.4 with PID 47155 (/Users/air/yuankuang/crrc-mall/target/classes started by air in /Users/air/yuankuang/crrc-mall)
|
||||
2026-11-12 10:50:37.361 [main] INFO com.crrc.crrcmall.CrrcMallApplication - The following 1 profile is active: "local"
|
||||
2026-11-12 10:50:38.519 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port 8080 (http)
|
||||
2026-11-12 10:50:38.543 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
|
||||
2026-11-12 10:50:38.564 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/10.1.30]
|
||||
2026-11-12 10:50:38.714 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
|
||||
2026-11-12 10:50:38.714 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 1296 ms
|
||||
2026-11-12 10:50:38.799 [main] INFO c.crrc.crrcmall.common.mock.AuditWorkbenchMockData - [Mock] 审核工作台初始化完成,任务总数 = 160,本轮 = 128,待初审 = 32
|
||||
2026-11-12 10:50:39.318 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port 8080 (http) with context path '/'
|
||||
2026-11-12 10:50:39.325 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Started CrrcMallApplication in 2.605 seconds (process running for 3.166)
|
||||
2026-11-12 10:50:43.030 [http-nio-8080-exec-1] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2026-11-12 10:50:43.031 [http-nio-8080-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
|
||||
2026-11-12 10:50:43.032 [http-nio-8080-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 1 ms
|
||||
2026-11-12 10:51:42.833 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Starting CrrcMallApplication using Java 21.0.4 with PID 47259 (/Users/air/yuankuang/crrc-mall/target/classes started by air in /Users/air/yuankuang/crrc-mall)
|
||||
2026-11-12 10:51:42.835 [main] INFO com.crrc.crrcmall.CrrcMallApplication - The following 1 profile is active: "local"
|
||||
2026-11-12 10:51:43.856 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port 8080 (http)
|
||||
2026-11-12 10:51:43.871 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
|
||||
2026-11-12 10:51:43.871 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/10.1.30]
|
||||
2026-11-12 10:51:43.930 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
|
||||
2026-11-12 10:51:43.931 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 1061 ms
|
||||
2026-11-12 10:51:44.012 [main] INFO c.crrc.crrcmall.common.mock.AuditWorkbenchMockData - [Mock] 审核工作台初始化完成,任务总数 = 160,本轮 = 128,待初审 = 32
|
||||
2026-11-12 10:51:44.524 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port 8080 (http) with context path '/'
|
||||
2026-11-12 10:51:44.533 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Started CrrcMallApplication in 2.24 seconds (process running for 2.574)
|
||||
2026-11-12 10:51:47.190 [http-nio-8080-exec-1] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2026-11-12 10:51:47.190 [http-nio-8080-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
|
||||
2026-11-12 10:51:47.192 [http-nio-8080-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 1 ms
|
||||
2026-11-12 10:51:57.245 [http-nio-8080-exec-7] INFO c.c.c.service.impl.AuditWorkbenchServiceImpl - [Mock] 批量操作 action=ADOPT 请求 1 条,实际变更 1 条
|
||||
2026-11-12 10:51:57.338 [http-nio-8080-exec-10] WARN c.c.crrcmall.controller.AuditWorkbenchController - [审核工作台] 批量操作参数异常:驳回必须填写原因
|
||||
2026-11-12 10:52:29.726 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Starting CrrcMallApplication using Java 21.0.4 with PID 47359 (/Users/air/yuankuang/crrc-mall/target/classes started by air in /Users/air/yuankuang/crrc-mall)
|
||||
2026-11-12 10:52:29.729 [main] INFO com.crrc.crrcmall.CrrcMallApplication - The following 1 profile is active: "local"
|
||||
2026-11-12 10:52:30.766 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port 8080 (http)
|
||||
2026-11-12 10:52:30.783 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
|
||||
2026-11-12 10:52:30.783 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/10.1.30]
|
||||
2026-11-12 10:52:30.842 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
|
||||
2026-11-12 10:52:30.842 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 1069 ms
|
||||
2026-11-12 10:52:30.912 [main] INFO c.crrc.crrcmall.common.mock.AuditWorkbenchMockData - [Mock] 审核工作台初始化完成,任务总数 = 160,本轮 = 128,待初审 = 32
|
||||
2026-11-12 10:52:31.351 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port 8080 (http) with context path '/'
|
||||
2026-11-12 10:52:31.359 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Started CrrcMallApplication in 2.213 seconds (process running for 2.528)
|
||||
2026-11-12 10:52:31.793 [http-nio-8080-exec-1] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2026-11-12 10:52:31.793 [http-nio-8080-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
|
||||
2026-11-12 10:52:31.794 [http-nio-8080-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 0 ms
|
||||
2026-11-12 11:07:49.162 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Starting CrrcMallApplication using Java 17.0.21 with PID 48037 (/Users/air/yuankuang/crrc-mall/target/classes started by air in /Users/air/yuankuang/crrc-mall)
|
||||
2026-11-12 11:07:49.164 [main] INFO com.crrc.crrcmall.CrrcMallApplication - The following 1 profile is active: "local"
|
||||
2026-11-12 11:07:50.043 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port 8080 (http)
|
||||
2026-11-12 11:07:50.054 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
|
||||
2026-11-12 11:07:50.054 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/10.1.30]
|
||||
2026-11-12 11:07:50.097 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
|
||||
2026-11-12 11:07:50.097 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 900 ms
|
||||
2026-11-12 11:07:50.171 [main] INFO c.crrc.crrcmall.common.mock.AuditWorkbenchMockData - [Mock] 审核工作台初始化完成,任务总数 = 160,本轮 = 128,待初审 = 32
|
||||
2026-11-12 11:07:50.547 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port 8080 (http) with context path '/'
|
||||
2026-11-12 11:07:50.556 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Started CrrcMallApplication in 1.907 seconds (process running for 2.5)
|
||||
2026-11-12 11:09:24.044 [http-nio-8080-exec-1] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2026-11-12 11:09:24.047 [http-nio-8080-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
|
||||
2026-11-12 11:09:24.052 [http-nio-8080-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 5 ms
|
||||
2026-11-12 11:09:34.754 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Starting CrrcMallApplication using Java 17.0.21 with PID 48130 (/Users/air/yuankuang/crrc-mall/target/classes started by air in /Users/air/yuankuang/crrc-mall)
|
||||
2026-11-12 11:09:34.756 [main] INFO com.crrc.crrcmall.CrrcMallApplication - The following 1 profile is active: "local"
|
||||
2026-11-12 11:09:35.660 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port 8080 (http)
|
||||
2026-11-12 11:09:35.672 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
|
||||
2026-11-12 11:09:35.672 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/10.1.30]
|
||||
2026-11-12 11:09:35.721 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
|
||||
2026-11-12 11:09:35.721 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 881 ms
|
||||
2026-11-12 11:09:35.788 [main] INFO c.crrc.crrcmall.common.mock.AuditWorkbenchMockData - [Mock] 审核工作台初始化完成,任务总数 = 160,本轮 = 128,待初审 = 32
|
||||
2026-11-12 11:09:36.145 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port 8080 (http) with context path '/'
|
||||
2026-11-12 11:09:36.153 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Started CrrcMallApplication in 2.069 seconds (process running for 2.664)
|
||||
2026-11-12 11:10:00.719 [http-nio-8080-exec-1] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2026-11-12 11:10:00.720 [http-nio-8080-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
|
||||
2026-11-12 11:10:00.721 [http-nio-8080-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 1 ms
|
||||
2026-11-12 11:17:47.134 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Starting CrrcMallApplication using Java 17.0.21 with PID 48438 (/Users/air/yuankuang/crrc-mall/target/classes started by air in /Users/air/yuankuang/crrc-mall)
|
||||
2026-11-12 11:17:47.136 [main] INFO com.crrc.crrcmall.CrrcMallApplication - The following 1 profile is active: "local"
|
||||
2026-11-12 11:17:48.006 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port 8080 (http)
|
||||
2026-11-12 11:17:48.019 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
|
||||
2026-11-12 11:17:48.020 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/10.1.30]
|
||||
2026-11-12 11:17:48.068 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
|
||||
2026-11-12 11:17:48.069 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 897 ms
|
||||
2026-11-12 11:17:48.137 [main] INFO c.crrc.crrcmall.common.mock.AuditWorkbenchMockData - [Mock] 审核工作台初始化完成,任务总数 = 160,本轮 = 128,待初审 = 32
|
||||
2026-11-12 11:17:48.505 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port 8080 (http) with context path '/'
|
||||
2026-11-12 11:17:48.514 [main] INFO com.crrc.crrcmall.CrrcMallApplication - Started CrrcMallApplication in 1.879 seconds (process running for 2.372)
|
||||
2026-11-12 11:19:18.205 [http-nio-8080-exec-2] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2026-11-12 11:19:18.206 [http-nio-8080-exec-2] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
|
||||
2026-11-12 11:19:18.206 [http-nio-8080-exec-2] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 0 ms
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.crrc.crrcmall.common.enums;
|
||||
|
||||
/**
|
||||
* 审核工作台任务状态
|
||||
* <p>
|
||||
* 与原型顶部四张统计卡一一对应:
|
||||
* 待 AI 初审 / AI 已通过 / 需人工判定 / 已驳回
|
||||
*/
|
||||
public enum AuditTaskStatusEnum {
|
||||
|
||||
/** 待 AI 初审:已提交,排队中 */
|
||||
AI_PENDING("待AI初审"),
|
||||
|
||||
/** AI 已通过:自动进入待上架队列 */
|
||||
AI_PASSED("AI已通过"),
|
||||
|
||||
/** 需人工判定:内容类项转人工,未直接驳回 */
|
||||
NEED_MANUAL("需人工判定"),
|
||||
|
||||
/** 已驳回:回执已发送供应商 */
|
||||
REJECTED("已驳回");
|
||||
|
||||
private final String label;
|
||||
|
||||
AuditTaskStatusEnum(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public static AuditTaskStatusEnum of(String code) {
|
||||
if (code == null || code.isBlank()) {
|
||||
return null;
|
||||
}
|
||||
for (AuditTaskStatusEnum value : values()) {
|
||||
if (value.name().equalsIgnoreCase(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.crrc.crrcmall.common.enums;
|
||||
|
||||
/**
|
||||
* 审核类型(工作台顶部 Tab)
|
||||
* <p>
|
||||
* 说明:客户侧原枚举只有 1/2/3,原型新增了「变更审核」,
|
||||
* 这里补充 4-变更审核,保持与页面一致。
|
||||
*/
|
||||
public enum AuditTypeEnum {
|
||||
|
||||
/** 新品上架 */
|
||||
NEW_PRODUCT(1, "新品上架"),
|
||||
|
||||
/** 已上架复审 */
|
||||
RECHECK(2, "已上架复审"),
|
||||
|
||||
/** 调价审核 */
|
||||
PRICE_ADJUST(3, "调价审核"),
|
||||
|
||||
/** 变更审核(原型新增,客户原枚举中缺这一项) */
|
||||
CHANGE(4, "变更审核");
|
||||
|
||||
private final Integer code;
|
||||
private final String label;
|
||||
|
||||
AuditTypeEnum(Integer code, String label) {
|
||||
this.code = code;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public static AuditTypeEnum of(Integer code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (AuditTypeEnum value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String labelOf(Integer code) {
|
||||
AuditTypeEnum type = of(code);
|
||||
return type == null ? "" : type.getLabel();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.crrc.crrcmall.common.enums;
|
||||
|
||||
/**
|
||||
* 违规风险等级
|
||||
*/
|
||||
public enum RiskLevelEnum {
|
||||
|
||||
HIGH("高"),
|
||||
MEDIUM("中"),
|
||||
LOW("低");
|
||||
|
||||
private final String label;
|
||||
|
||||
RiskLevelEnum(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按置信度推导风险等级:>=0.9 高,>=0.7 中,其余低
|
||||
*/
|
||||
public static RiskLevelEnum ofConfidence(Double confidence) {
|
||||
if (confidence == null) {
|
||||
return LOW;
|
||||
}
|
||||
if (confidence >= 0.9) {
|
||||
return HIGH;
|
||||
}
|
||||
if (confidence >= 0.7) {
|
||||
return MEDIUM;
|
||||
}
|
||||
return LOW;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,560 @@
|
||||
package com.crrc.crrcmall.common.mock;
|
||||
|
||||
import com.crrc.crrcmall.common.enums.AuditTaskStatusEnum;
|
||||
import com.crrc.crrcmall.common.enums.AuditTypeEnum;
|
||||
import com.crrc.crrcmall.common.enums.RiskLevelEnum;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditFieldDetailVo;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditHistoryVo;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditViolationVo;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditWorkbenchTaskVo;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* 审核工作台 Mock 数据
|
||||
* <p>
|
||||
* 数据口径(与原型对齐,保证四个统计卡、进度条、列表总数三者自洽):
|
||||
* <ul>
|
||||
* <li>本轮 128 件 = AI 已通过 96 + 转人工 32</li>
|
||||
* <li>转人工 32 件 = 需人工判定 21 + 已驳回 11</li>
|
||||
* <li>待 AI 初审 32 件为另一批排队数据,不计入本轮</li>
|
||||
* <li>合计 160 条任务</li>
|
||||
* </ul>
|
||||
* 数据存放在内存 Map 中,批量操作会真实修改状态,便于演示时看到统计联动。
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class AuditWorkbenchMockData {
|
||||
|
||||
/** 任务主数据:taskNo -> 任务 */
|
||||
private final Map<String, AuditWorkbenchTaskVo> taskStore = new ConcurrentHashMap<>();
|
||||
|
||||
/** 违规点:taskNo -> 违规点列表 */
|
||||
private final Map<String, List<AuditViolationVo>> violationStore = new ConcurrentHashMap<>();
|
||||
|
||||
/** 字段级明细:taskNo -> 明细列表 */
|
||||
private final Map<String, List<AuditFieldDetailVo>> fieldStore = new ConcurrentHashMap<>();
|
||||
|
||||
/** 历史判定:taskNo -> 历史列表 */
|
||||
private final Map<String, List<AuditHistoryVo>> historyStore = new ConcurrentHashMap<>();
|
||||
|
||||
private static final String[] SUPPLIER_NAMES = {
|
||||
"山东中车同力达智能装备有限公司",
|
||||
"眉山中车紧固件科技有限公司",
|
||||
"中车智程文化科技(北京)有限公司",
|
||||
"中车常州车辆有限公司",
|
||||
"中车四方车辆有限公司"
|
||||
};
|
||||
|
||||
private static final String[] BRANDS = {"固特耐", "中车", "恒力", "三A", "鹰牌", "金鹿"};
|
||||
|
||||
private static final String[] CATEGORIES = {"树脂砂轮片", "切割片", "六角螺栓", "防松螺母", "拉铆钉",
|
||||
"轴承", "防护手套", "安全帽", "工业擦拭布", "一次性纸杯", "尼龙扎带", "不锈钢焊条"};
|
||||
|
||||
private static final String[] SPECS = {"100*6*16", "105*1.2*16", "M12*60", "M10", "LMY-T16-12G",
|
||||
"6205-2RS", "13针均码", "ABS 黄色", "25*25cm", "75mm/53mm", "4*200mm", "Φ3.2"};
|
||||
|
||||
private static final String[] GRADES = {"工业级", "标准型", "加厚型", "食品级", "8.8级", "镀锌", "发黑", "国产"};
|
||||
|
||||
/** 13 项审核字段(与 AuditContext 保持一致) */
|
||||
private static final String[][] AUDIT_FIELDS = {
|
||||
{"goodsName", "商品名称"},
|
||||
{"barcode", "条码"},
|
||||
{"brand", "品牌"},
|
||||
{"taxCode", "税收编码"},
|
||||
{"materialCode", "物料编码"},
|
||||
{"category", "商品目录"},
|
||||
{"goodsImage", "商品图片"},
|
||||
{"description", "详情描述"},
|
||||
{"marketUrl", "市场价链接"},
|
||||
{"jdUrl", "京东价链接"},
|
||||
{"price", "单价(含税)"},
|
||||
{"freight", "运费"},
|
||||
{"deliveryArea", "配送区域"}
|
||||
};
|
||||
|
||||
/** 违规模板 */
|
||||
private static final List<ViolationTemplate> VIOLATION_TEMPLATES = Arrays.asList(
|
||||
new ViolationTemplate("materialCode", "物料编码", "资质缺失", "物料编码缺失",
|
||||
"商品未填写 12 位物料编码,无法匹配中车采购目录",
|
||||
"补充符合编码规范的物料编码后重新提交", "规则 3.1"),
|
||||
new ViolationTemplate("taxCode", "税收编码", "格式错误", "税收编码格式错",
|
||||
"税收分类编码「1090101」不符合 19 位规范",
|
||||
"按国家税务总局税收分类编码表修正为 19 位", "规则 3.2"),
|
||||
new ViolationTemplate("goodsName", "商品名称", "虚假宣传", "名称含绝对化用语",
|
||||
"名称含「更耐磨」「工业级」等绝对化用语,违反广告法第九条",
|
||||
"删除绝对化用语,改为客观参数描述", "规则 2.4"),
|
||||
new ViolationTemplate("goodsImage", "商品图片", "图文不符", "图片内容相符性存疑",
|
||||
"主图为通用示意图,与商品名称描述的规格不一致",
|
||||
"更换与名称、规格一致的实拍图", "规则 4.1"),
|
||||
new ViolationTemplate("brand", "品牌", "品牌映射", "品牌映射不一致",
|
||||
"品牌「固特耐」未在中车标准品牌库中映射",
|
||||
"选择标准品牌,或补充品牌授权书", "规则 2.1"),
|
||||
new ViolationTemplate("category", "商品目录", "类目错误", "类目归属错误",
|
||||
"当前挂载类目「劳保用品」与商品属性不匹配",
|
||||
"调整至「五金工具 / 磨具磨料」类目", "规则 1.3"),
|
||||
new ViolationTemplate("specification", "规格型号", "规格不一致", "规格前后不一致",
|
||||
"标题规格 100*6*16 与参数表填写的 105*1.2*16 不一致",
|
||||
"统一标题与参数表规格后重新提交", "规则 2.2"),
|
||||
new ViolationTemplate("jdUrl", "京东价链接", "链接失效", "京东价链接失效",
|
||||
"京东价链接无法访问,价格无法抓取比对",
|
||||
"更新为有效商品链接", "规则 5.2"),
|
||||
new ViolationTemplate("price", "单价(含税)", "价格异常", "价格偏离同类均价",
|
||||
"单价比同类商品均价偏离 32%,超出 ±20% 阈值",
|
||||
"核实成本构成并说明调价原因", "规则 5.1"),
|
||||
new ViolationTemplate("qualification", "资质报告", "资质缺失", "检测报告缺失",
|
||||
"缺少该批次产品的检测报告或合格证",
|
||||
"上传检测报告后重新提交审核", "规则 3.3")
|
||||
);
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
LocalDateTime base = LocalDateTime.of(2026, 9, 30, 9, 42);
|
||||
|
||||
// ===== 原型前 4 行,逐字复刻 =====
|
||||
addTask("AI-20260930-0187", "G202609300187",
|
||||
"固特耐 100*6*16 树脂砂轮片 角磨片 眉山厂定制工业级 更耐磨 ZY008",
|
||||
"山东中车同力达智能装备有限公司", base, 1,
|
||||
AuditTaskStatusEnum.NEED_MANUAL, 0.93, true, "上架",
|
||||
Arrays.asList(VIOLATION_TEMPLATES.get(0), VIOLATION_TEMPLATES.get(1), VIOLATION_TEMPLATES.get(2)),
|
||||
"ZY008");
|
||||
|
||||
addTask("AI-20260930-0186", "G202609300186",
|
||||
"拉铆钉套环 普通 LMTP-T22G 镀锌",
|
||||
"眉山中车紧固件科技有限公司", base.minusMinutes(11), 1,
|
||||
AuditTaskStatusEnum.AI_PASSED, 0.98, false, "上架",
|
||||
Collections.emptyList(), "LMTP-T22G");
|
||||
|
||||
addTask("AI-20260930-0185", "G202609300185",
|
||||
"拉铆钉 拉断型 圆头 LMY-T16-12G 镀锌",
|
||||
"眉山中车紧固件科技有限公司", base.minusMinutes(20), 1,
|
||||
AuditTaskStatusEnum.AI_PASSED, 0.97, false, "上架",
|
||||
Collections.emptyList(), "LMY-T16-12G");
|
||||
|
||||
addTask("AI-20260930-0184", "G202609300184",
|
||||
"一次性纸杯 上口径 75mm/下口径 53mm 食品级",
|
||||
"中车智程文化科技(北京)有限公司", base.minusMinutes(32), 4,
|
||||
AuditTaskStatusEnum.NEED_MANUAL, 0.88, false, "变更",
|
||||
Arrays.asList(VIOLATION_TEMPLATES.get(3)), "ZYBC-750");
|
||||
|
||||
// ===== 其余 156 条按配额生成 =====
|
||||
// 已用:AI_PASSED 2、NEED_MANUAL 2
|
||||
int passedNeed = 94;
|
||||
int manualNeed = 19;
|
||||
int rejectedNeed = 11;
|
||||
int pendingNeed = 32;
|
||||
|
||||
List<AuditTaskStatusEnum> pool = new ArrayList<>();
|
||||
for (int i = 0; i < passedNeed; i++) {
|
||||
pool.add(AuditTaskStatusEnum.AI_PASSED);
|
||||
}
|
||||
for (int i = 0; i < manualNeed; i++) {
|
||||
pool.add(AuditTaskStatusEnum.NEED_MANUAL);
|
||||
}
|
||||
for (int i = 0; i < rejectedNeed; i++) {
|
||||
pool.add(AuditTaskStatusEnum.REJECTED);
|
||||
}
|
||||
for (int i = 0; i < pendingNeed; i++) {
|
||||
pool.add(AuditTaskStatusEnum.AI_PENDING);
|
||||
}
|
||||
// 固定种子,保证每次启动数据一致
|
||||
Collections.shuffle(pool, new Random(20260930L));
|
||||
|
||||
for (int i = 0; i < pool.size(); i++) {
|
||||
int idx = i + 4;
|
||||
String taskNo = String.format("AI-20260930-%04d", 187 - idx);
|
||||
String goodsId = "G2026093" + String.format("%05d", 187 - idx);
|
||||
String goodsName = buildGoodsName(idx);
|
||||
String supplierName = SUPPLIER_NAMES[idx % SUPPLIER_NAMES.length];
|
||||
// 时间从 0184 之后顺延,保证原型前 4 行位于列表最前
|
||||
LocalDateTime submitTime = base.minusMinutes(40 + idx * 2L);
|
||||
int auditType = resolveAuditType(idx);
|
||||
AuditTaskStatusEnum status = pool.get(i);
|
||||
|
||||
Random rnd = new Random(idx * 31L);
|
||||
Double confidence;
|
||||
switch (status) {
|
||||
case AI_PASSED:
|
||||
confidence = round(0.95 + rnd.nextDouble() * 0.045);
|
||||
break;
|
||||
case NEED_MANUAL:
|
||||
confidence = round(0.72 + rnd.nextDouble() * 0.22);
|
||||
break;
|
||||
case REJECTED:
|
||||
confidence = round(0.90 + rnd.nextDouble() * 0.09);
|
||||
break;
|
||||
default:
|
||||
confidence = null;
|
||||
}
|
||||
|
||||
List<ViolationTemplate> templates = new ArrayList<>();
|
||||
if (status == AuditTaskStatusEnum.NEED_MANUAL) {
|
||||
int cnt = 1 + rnd.nextInt(3);
|
||||
for (int k = 0; k < cnt; k++) {
|
||||
templates.add(VIOLATION_TEMPLATES.get((idx + k * 3) % VIOLATION_TEMPLATES.size()));
|
||||
}
|
||||
} else if (status == AuditTaskStatusEnum.REJECTED) {
|
||||
int cnt = 1 + rnd.nextInt(2);
|
||||
for (int k = 0; k < cnt; k++) {
|
||||
templates.add(VIOLATION_TEMPLATES.get((idx * 2 + k) % VIOLATION_TEMPLATES.size()));
|
||||
}
|
||||
}
|
||||
|
||||
addTask(taskNo, goodsId, goodsName, supplierName, submitTime, auditType, status, confidence,
|
||||
idx % 17 == 0, auditType == 4 ? "变更" : "上架", templates,
|
||||
SPECS[idx % SPECS.length]);
|
||||
}
|
||||
|
||||
log.info("[Mock] 审核工作台初始化完成,任务总数 = {},本轮 = {},待初审 = {}",
|
||||
taskStore.size(), countByStatus(AuditTaskStatusEnum.AI_PASSED)
|
||||
+ countByStatus(AuditTaskStatusEnum.NEED_MANUAL)
|
||||
+ countByStatus(AuditTaskStatusEnum.REJECTED),
|
||||
countByStatus(AuditTaskStatusEnum.AI_PENDING));
|
||||
}
|
||||
|
||||
private int resolveAuditType(int idx) {
|
||||
if (idx % 13 == 0) {
|
||||
return AuditTypeEnum.CHANGE.getCode();
|
||||
}
|
||||
if (idx % 11 == 0) {
|
||||
return AuditTypeEnum.RECHECK.getCode();
|
||||
}
|
||||
if (idx % 19 == 0) {
|
||||
return AuditTypeEnum.PRICE_ADJUST.getCode();
|
||||
}
|
||||
return AuditTypeEnum.NEW_PRODUCT.getCode();
|
||||
}
|
||||
|
||||
private String buildGoodsName(int idx) {
|
||||
return BRANDS[idx % BRANDS.length] + " " + SPECS[idx % SPECS.length] + " "
|
||||
+ CATEGORIES[idx % CATEGORIES.length] + " " + GRADES[idx % GRADES.length]
|
||||
+ " ZY" + String.format("%03d", idx % 100);
|
||||
}
|
||||
|
||||
private void addTask(String taskNo, String goodsId, String goodsName, String supplierName,
|
||||
LocalDateTime submitTime, Integer auditType, AuditTaskStatusEnum status,
|
||||
Double confidence, boolean urgent, String shelfStatus,
|
||||
List<ViolationTemplate> templates, String sku) {
|
||||
|
||||
AuditWorkbenchTaskVo task = new AuditWorkbenchTaskVo();
|
||||
task.setTaskNo(taskNo);
|
||||
task.setGoodsId(goodsId);
|
||||
task.setGoodsName(goodsName);
|
||||
task.setGoodsImage("https://mall.crrcgo.cc/mock/goods/" + goodsId + ".png");
|
||||
task.setUrgent(urgent);
|
||||
task.setShelfStatus(shelfStatus);
|
||||
task.setSupplierId("SUP" + (Math.abs(supplierName.hashCode()) % 100000));
|
||||
task.setSupplierName(supplierName);
|
||||
task.setSubmitTime(submitTime);
|
||||
task.setAuditType(auditType);
|
||||
task.setAuditTypeName(AuditTypeEnum.labelOf(auditType));
|
||||
task.setStatus(status.name());
|
||||
task.setStatusName(status.getLabel());
|
||||
task.setAiConclusion(conclusionOf(status));
|
||||
task.setConfidence(confidence);
|
||||
RiskLevelEnum risk = RiskLevelEnum.ofConfidence(confidence);
|
||||
task.setRiskLevel(risk.getCode());
|
||||
task.setRiskLevelName(risk.getLabel());
|
||||
task.setViolationCount(templates.size());
|
||||
task.setViolationSummary(buildSummary(templates));
|
||||
task.setSku(sku);
|
||||
taskStore.put(taskNo, task);
|
||||
|
||||
// 违规点
|
||||
List<AuditViolationVo> violations = new ArrayList<>();
|
||||
for (int i = 0; i < templates.size(); i++) {
|
||||
ViolationTemplate t = templates.get(i);
|
||||
AuditViolationVo v = new AuditViolationVo();
|
||||
v.setSeq(i + 1);
|
||||
v.setField(t.field);
|
||||
v.setFieldName(t.fieldName);
|
||||
v.setViolationType(t.type);
|
||||
RiskLevelEnum vr = i == 0 ? risk : RiskLevelEnum.MEDIUM;
|
||||
v.setRiskLevel(vr.getCode());
|
||||
v.setRiskLevelName(vr.getLabel());
|
||||
v.setConfidence(confidence == null ? 0.9 : round(Math.max(0.6, confidence - i * 0.03)));
|
||||
v.setDetail(t.detail);
|
||||
v.setSuggestion(t.suggestion);
|
||||
v.setRuleReference(t.rule);
|
||||
// 原文定位:在商品名称中查找该违规关键词
|
||||
int start = goodsName.indexOf(t.fieldName);
|
||||
v.setStart(start >= 0 ? start : 0);
|
||||
v.setEnd(start >= 0 ? start + t.fieldName.length() : 0);
|
||||
violations.add(v);
|
||||
}
|
||||
violationStore.put(taskNo, violations);
|
||||
|
||||
// 字段级明细
|
||||
fieldStore.put(taskNo, buildFieldDetails(task, templates, confidence));
|
||||
|
||||
// 历史判定
|
||||
historyStore.put(taskNo, buildHistory(task, status));
|
||||
}
|
||||
|
||||
private List<AuditFieldDetailVo> buildFieldDetails(AuditWorkbenchTaskVo task,
|
||||
List<ViolationTemplate> templates,
|
||||
Double confidence) {
|
||||
List<AuditFieldDetailVo> list = new ArrayList<>();
|
||||
for (String[] field : AUDIT_FIELDS) {
|
||||
AuditFieldDetailVo f = new AuditFieldDetailVo();
|
||||
f.setCustomField(field[0]);
|
||||
f.setCustomKey(field[1]);
|
||||
f.setCustomValue(valueOfField(task, field[0]));
|
||||
f.setCustomType(groupOfField(field[0]));
|
||||
|
||||
ViolationTemplate hit = null;
|
||||
for (ViolationTemplate t : templates) {
|
||||
if (t.field.equals(field[0])) {
|
||||
hit = t;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hit != null) {
|
||||
f.setAiIntent(hit.detail);
|
||||
f.setAiIntentType(intentTypeOf(hit.type));
|
||||
f.setAiRelevanceScore(confidence == null ? 0.9 : confidence);
|
||||
f.setCheckType(1);
|
||||
f.setAuditStatus(1);
|
||||
} else if (AuditTaskStatusEnum.AI_PENDING.name().equals(task.getStatus())) {
|
||||
f.setAiIntent("排队中,尚未检测");
|
||||
f.setAiIntentType(null);
|
||||
f.setAiRelevanceScore(null);
|
||||
f.setCheckType(null);
|
||||
f.setAuditStatus(0);
|
||||
} else {
|
||||
f.setAiIntent("检测通过");
|
||||
f.setAiIntentType(1);
|
||||
f.setAiRelevanceScore(0.98);
|
||||
f.setCheckType(1);
|
||||
f.setAuditStatus(0);
|
||||
}
|
||||
list.add(f);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private Object valueOfField(AuditWorkbenchTaskVo task, String field) {
|
||||
switch (field) {
|
||||
case "goodsName":
|
||||
return task.getGoodsName();
|
||||
case "barcode":
|
||||
return "69" + Math.abs(task.getGoodsId().hashCode() % 1000000000L);
|
||||
case "brand":
|
||||
return task.getGoodsName().split(" ")[0];
|
||||
case "taxCode":
|
||||
return "1090101";
|
||||
case "materialCode":
|
||||
return "";
|
||||
case "category":
|
||||
return "五金工具 / 磨具磨料";
|
||||
case "goodsImage":
|
||||
return task.getGoodsImage();
|
||||
case "description":
|
||||
return "本产品适用于工业场景,具体参数详见规格型号。";
|
||||
case "marketUrl":
|
||||
return "https://mall.crrcgo.cc/market/" + task.getGoodsId();
|
||||
case "jdUrl":
|
||||
return "https://item.jd.com/" + Math.abs(task.getGoodsId().hashCode() % 100000000L) + ".html";
|
||||
case "price":
|
||||
return 128.50;
|
||||
case "freight":
|
||||
return 12.00;
|
||||
case "deliveryArea":
|
||||
return "全国(港澳台除外)";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private String groupOfField(String field) {
|
||||
switch (field) {
|
||||
case "goodsName":
|
||||
case "barcode":
|
||||
case "brand":
|
||||
case "category":
|
||||
case "description":
|
||||
return "baseInfo";
|
||||
case "taxCode":
|
||||
case "materialCode":
|
||||
case "goodsImage":
|
||||
return "qualification";
|
||||
case "marketUrl":
|
||||
case "jdUrl":
|
||||
case "price":
|
||||
case "freight":
|
||||
case "deliveryArea":
|
||||
return "price";
|
||||
default:
|
||||
return "other";
|
||||
}
|
||||
}
|
||||
|
||||
private Integer intentTypeOf(String violationType) {
|
||||
if ("图文不符".equals(violationType)) {
|
||||
return 3;
|
||||
}
|
||||
if ("格式错误".equals(violationType)) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
private List<AuditHistoryVo> buildHistory(AuditWorkbenchTaskVo task, AuditTaskStatusEnum status) {
|
||||
List<AuditHistoryVo> list = new ArrayList<>();
|
||||
LocalDateTime t = task.getSubmitTime().minusDays(7);
|
||||
list.add(buildHistoryItem(task.getGoodsName(), task.getSupplierName(), t,
|
||||
status == AuditTaskStatusEnum.REJECTED ? "REJECT" : "PASS",
|
||||
status == AuditTaskStatusEnum.REJECTED ? "上次提交因资质缺失被驳回" : "上次提交审核通过"));
|
||||
list.add(buildHistoryItem(task.getGoodsName(), task.getSupplierName(), t.minusDays(21),
|
||||
"PASS", "同类商品历史无违规记录"));
|
||||
return list;
|
||||
}
|
||||
|
||||
private AuditHistoryVo buildHistoryItem(String goodsName, String supplierName, LocalDateTime time,
|
||||
String result, String reason) {
|
||||
AuditHistoryVo h = new AuditHistoryVo();
|
||||
h.setGoodsName(goodsName);
|
||||
h.setSupplierName(supplierName);
|
||||
h.setAuditTime(time);
|
||||
h.setResult(result);
|
||||
h.setResultName("PASS".equals(result) ? "通过" : "驳回");
|
||||
h.setReason(reason);
|
||||
return h;
|
||||
}
|
||||
|
||||
private String buildSummary(List<ViolationTemplate> templates) {
|
||||
if (templates.isEmpty()) {
|
||||
return "—";
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < templates.size(); i++) {
|
||||
if (i > 0) {
|
||||
sb.append(" · ");
|
||||
}
|
||||
sb.append(templates.get(i).shortLabel);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private String conclusionOf(AuditTaskStatusEnum status) {
|
||||
switch (status) {
|
||||
case AI_PASSED:
|
||||
return "AI已通过";
|
||||
case NEED_MANUAL:
|
||||
return "需人工判定";
|
||||
case REJECTED:
|
||||
return "已驳回";
|
||||
default:
|
||||
return "待AI初审";
|
||||
}
|
||||
}
|
||||
|
||||
private double round(double v) {
|
||||
return Math.round(v * 1000d) / 1000d;
|
||||
}
|
||||
|
||||
private long countByStatus(AuditTaskStatusEnum status) {
|
||||
return taskStore.values().stream().filter(t -> status.name().equals(t.getStatus())).count();
|
||||
}
|
||||
|
||||
// ==================== 对外读取方法 ====================
|
||||
|
||||
public Collection<AuditWorkbenchTaskVo> allTasks() {
|
||||
return taskStore.values();
|
||||
}
|
||||
|
||||
public AuditWorkbenchTaskVo getTask(String taskNo) {
|
||||
return taskStore.get(taskNo);
|
||||
}
|
||||
|
||||
public List<AuditViolationVo> getViolations(String taskNo) {
|
||||
return violationStore.getOrDefault(taskNo, Collections.emptyList());
|
||||
}
|
||||
|
||||
public List<AuditFieldDetailVo> getFieldDetails(String taskNo) {
|
||||
return fieldStore.getOrDefault(taskNo, Collections.emptyList());
|
||||
}
|
||||
|
||||
public List<AuditHistoryVo> getHistory(String taskNo) {
|
||||
return historyStore.getOrDefault(taskNo, Collections.emptyList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 按关键字模糊匹配(SKU、任务号、商品名)
|
||||
*/
|
||||
public List<AuditWorkbenchTaskVo> matchByKeyword(String keyword) {
|
||||
List<AuditWorkbenchTaskVo> result = new ArrayList<>();
|
||||
if (keyword == null || keyword.isBlank()) {
|
||||
return result;
|
||||
}
|
||||
String kw = keyword.trim().toLowerCase();
|
||||
for (AuditWorkbenchTaskVo task : taskStore.values()) {
|
||||
if (contains(task.getSku(), kw)
|
||||
|| contains(task.getTaskNo(), kw)
|
||||
|| contains(task.getGoodsName(), kw)) {
|
||||
result.add(task);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean contains(String source, String kw) {
|
||||
return source != null && source.toLowerCase().contains(kw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 排序快照(按提交时间倒序),供服务层做稳定排序基准
|
||||
*/
|
||||
public List<AuditWorkbenchTaskVo> snapshot() {
|
||||
List<AuditWorkbenchTaskVo> list = new ArrayList<>(taskStore.values());
|
||||
list.sort((a, b) -> {
|
||||
if (a.getSubmitTime() == null && b.getSubmitTime() == null) {
|
||||
return 0;
|
||||
}
|
||||
if (a.getSubmitTime() == null) {
|
||||
return 1;
|
||||
}
|
||||
if (b.getSubmitTime() == null) {
|
||||
return -1;
|
||||
}
|
||||
return b.getSubmitTime().compareTo(a.getSubmitTime());
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 违规模板
|
||||
*/
|
||||
private static final class ViolationTemplate {
|
||||
private final String field;
|
||||
private final String fieldName;
|
||||
private final String type;
|
||||
private final String shortLabel;
|
||||
private final String detail;
|
||||
private final String suggestion;
|
||||
private final String rule;
|
||||
|
||||
private ViolationTemplate(String field, String fieldName, String type, String shortLabel,
|
||||
String detail, String suggestion, String rule) {
|
||||
this.field = field;
|
||||
this.fieldName = fieldName;
|
||||
this.type = type;
|
||||
this.shortLabel = shortLabel;
|
||||
this.detail = detail;
|
||||
this.suggestion = suggestion;
|
||||
this.rule = rule;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.crrc.crrcmall.common.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 统一响应结构
|
||||
* <p>
|
||||
* 与客户侧接口保持一致:code / message / data / timestamp
|
||||
* <ul>
|
||||
* <li>code = 0 表示成功</li>
|
||||
* <li>data 为业务数据体,失败时为 null</li>
|
||||
* <li>timestamp 为服务端当前毫秒时间戳</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param <T> 业务数据类型
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "统一响应结构")
|
||||
public class ApiResponse<T> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 成功状态码 */
|
||||
public static final int CODE_SUCCESS = 0;
|
||||
/** 通用失败状态码 */
|
||||
public static final int CODE_FAIL = 500;
|
||||
|
||||
@Schema(description = "状态码:0-成功,其他-失败", example = "0")
|
||||
private Integer code;
|
||||
|
||||
@Schema(description = "提示信息", example = "操作成功")
|
||||
private String message;
|
||||
|
||||
@Schema(description = "业务数据")
|
||||
private T data;
|
||||
|
||||
@Schema(description = "服务端时间戳(毫秒)")
|
||||
private Long timestamp;
|
||||
|
||||
private ApiResponse(Integer code, String message, T data) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.data = data;
|
||||
this.timestamp = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功(带数据)
|
||||
*/
|
||||
public static <T> ApiResponse<T> success(T data) {
|
||||
return new ApiResponse<>(CODE_SUCCESS, "操作成功", data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功(带自定义提示)
|
||||
*/
|
||||
public static <T> ApiResponse<T> success(String message, T data) {
|
||||
return new ApiResponse<>(CODE_SUCCESS, message, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功(无数据)
|
||||
*/
|
||||
public static <T> ApiResponse<T> success() {
|
||||
return new ApiResponse<>(CODE_SUCCESS, "操作成功", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败(自定义状态码)
|
||||
*/
|
||||
public static <T> ApiResponse<T> fail(Integer code, String message) {
|
||||
return new ApiResponse<>(code, message, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败(默认失败码 500)
|
||||
*/
|
||||
public static <T> ApiResponse<T> fail(String message) {
|
||||
return new ApiResponse<>(CODE_FAIL, message, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.crrc.crrcmall.common.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 统一分页结果
|
||||
* <p>
|
||||
* 字段命名与客户侧接口保持一致:records / total / current / size,
|
||||
* 额外补充 pages(总页数)方便前端渲染分页器。
|
||||
*
|
||||
* @param <T> 列表元素类型
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "分页结果")
|
||||
public class PageResult<T> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "当前页数据列表")
|
||||
private List<T> records;
|
||||
|
||||
@Schema(description = "总记录数")
|
||||
private Long total;
|
||||
|
||||
@Schema(description = "当前页码,从 1 开始")
|
||||
private Long current;
|
||||
|
||||
@Schema(description = "每页条数")
|
||||
private Long size;
|
||||
|
||||
@Schema(description = "总页数")
|
||||
private Long pages;
|
||||
|
||||
public PageResult() {
|
||||
this.records = new ArrayList<>();
|
||||
this.total = 0L;
|
||||
this.current = 1L;
|
||||
this.size = 20L;
|
||||
this.pages = 0L;
|
||||
}
|
||||
|
||||
public PageResult(List<T> records, Long total, Long current, Long size) {
|
||||
this.records = records == null ? new ArrayList<>() : records;
|
||||
this.total = total == null ? 0L : total;
|
||||
this.current = (current == null || current < 1) ? 1L : current;
|
||||
this.size = (size == null || size < 1) ? 20L : size;
|
||||
this.pages = this.size == 0 ? 0L : (this.total + this.size - 1) / this.size;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建分页结果
|
||||
*
|
||||
* @param records 当前页数据
|
||||
* @param total 总记录数
|
||||
* @param current 当前页(从 1 开始)
|
||||
* @param size 每页条数
|
||||
*/
|
||||
public static <T> PageResult<T> of(List<T> records, long total, long current, long size) {
|
||||
return new PageResult<>(records, total, current, size);
|
||||
}
|
||||
|
||||
/**
|
||||
* 空结果
|
||||
*/
|
||||
public static <T> PageResult<T> empty(long current, long size) {
|
||||
return new PageResult<>(Collections.emptyList(), 0L, current, size);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
/**
|
||||
* AI 智能审核控制器
|
||||
*/
|
||||
@Tag(name = "AI 审核服务")
|
||||
@Tag(name = "AI审核服务")
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/audit")
|
||||
public class AuditController {
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.crrc.crrcmall.controller;
|
||||
|
||||
import com.crrc.crrcmall.common.response.ApiResponse;
|
||||
import com.crrc.crrcmall.dto.audit.AuditBatchActionDto;
|
||||
import com.crrc.crrcmall.dto.audit.AuditQuickQueryDto;
|
||||
import com.crrc.crrcmall.dto.audit.AuditWorkbenchQueryDto;
|
||||
import com.crrc.crrcmall.service.AuditWorkbenchService;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditQuickQueryResultVo;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditWorkbenchDetailVo;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditWorkbenchListVo;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditWorkbenchStatsVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 审核工作台(运营端)接口
|
||||
* <p>
|
||||
* 注意:与客户侧 /api/v1/audit/* 完全隔离,路径为 /api/v1/audit/workbench/*
|
||||
* 所有接口统一返回 ApiResponse(code / message / data / timestamp)
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/audit/workbench")
|
||||
@Tag(name = "审核工作台", description = "运营端审核列表、统计、详情、批量操作、加急查询")
|
||||
public class AuditWorkbenchController {
|
||||
|
||||
private final AuditWorkbenchService auditWorkbenchService;
|
||||
|
||||
@GetMapping("/tasks")
|
||||
@Operation(summary = "任务列表", description = "分页 + 条件筛选,同时返回顶部统计卡片数据")
|
||||
public ApiResponse<AuditWorkbenchListVo> list(AuditWorkbenchQueryDto query) {
|
||||
return ApiResponse.success(auditWorkbenchService.list(query));
|
||||
}
|
||||
|
||||
@GetMapping("/stats")
|
||||
@Operation(summary = "统计卡片", description = "四张统计卡 + 本轮进度条数据")
|
||||
public ApiResponse<AuditWorkbenchStatsVo> stats() {
|
||||
return ApiResponse.success(auditWorkbenchService.stats());
|
||||
}
|
||||
|
||||
@GetMapping("/tasks/{taskNo}")
|
||||
@Operation(summary = "任务详情", description = "商品原件 + AI 结论 + 违规点 + 字段明细 + 历史判定")
|
||||
public ApiResponse<AuditWorkbenchDetailVo> detail(@PathVariable String taskNo) {
|
||||
AuditWorkbenchDetailVo detail = auditWorkbenchService.detail(taskNo);
|
||||
if (detail == null) {
|
||||
return ApiResponse.fail(404, "任务不存在:" + taskNo);
|
||||
}
|
||||
return ApiResponse.success(detail);
|
||||
}
|
||||
|
||||
@PostMapping("/tasks/batch")
|
||||
@Operation(summary = "批量操作", description = "采纳AI结论 / 批量通过 / 驳回 / 批量下架,返回操作后最新统计")
|
||||
public ApiResponse<AuditWorkbenchStatsVo> batch(@RequestBody AuditBatchActionDto dto) {
|
||||
try {
|
||||
return ApiResponse.success("操作成功", auditWorkbenchService.batchAction(dto));
|
||||
} catch (IllegalArgumentException e) {
|
||||
log.warn("[审核工作台] 批量操作参数异常:{}", e.getMessage());
|
||||
return ApiResponse.fail(400, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/tasks/quick-query")
|
||||
@Operation(summary = "加急查询", description = "粘贴多个 SKU,支持英文逗号/斜杠/空格/换行 四种分隔符")
|
||||
public ApiResponse<AuditQuickQueryResultVo> quickQuery(@RequestBody AuditQuickQueryDto dto) {
|
||||
return ApiResponse.success(auditWorkbenchService.quickQuery(dto));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.crrc.crrcmall.dto.audit;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 审核工作台 - 批量操作入参
|
||||
* <p>
|
||||
* 注意:采纳与驳回均为不可逆动作,调用方需在前端二次确认后再提交。
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "批量操作入参")
|
||||
public class AuditBatchActionDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 采纳 AI 结论:需人工判定 -> AI 已通过 */
|
||||
public static final String ACTION_ADOPT = "ADOPT";
|
||||
/** 强制通过 */
|
||||
public static final String ACTION_PASS = "PASS";
|
||||
/** 驳回 */
|
||||
public static final String ACTION_REJECT = "REJECT";
|
||||
/** 批量下架 */
|
||||
public static final String ACTION_OFF_SHELF = "OFF_SHELF";
|
||||
|
||||
@Schema(description = "任务号列表")
|
||||
private List<String> taskNos;
|
||||
|
||||
@Schema(description = "动作:ADOPT-采纳AI结论 PASS-批量通过 REJECT-驳回 OFF_SHELF-批量下架")
|
||||
private String action;
|
||||
|
||||
@Schema(description = "操作原因/备注,驳回时必填")
|
||||
private String reason;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.crrc.crrcmall.dto.audit;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 审核工作台 - 加急查询入参
|
||||
* <p>
|
||||
* skus 为原始粘贴文本,服务端按 英文逗号 / 斜杠 / 空格 / 换行 四种分隔符切分。
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "加急查询入参")
|
||||
public class AuditQuickQueryDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "多个 SKU 原始文本,示例:LMY-T16-12G, LMTP-T22G / ZY008")
|
||||
private String skus;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.crrc.crrcmall.dto.audit;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 审核工作台 - 列表查询条件
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "审核工作台查询条件")
|
||||
public class AuditWorkbenchQueryDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "任务号,支持前缀模糊,如 AI-20260930-0")
|
||||
private String taskNo;
|
||||
|
||||
@Schema(description = "商品名称关键字")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "供应商全称或简称")
|
||||
private String supplierName;
|
||||
|
||||
@Schema(description = "审核类型:1-新品上架 2-已上架复审 3-调价审核 4-变更审核,不传为全部")
|
||||
private Integer auditType;
|
||||
|
||||
@Schema(description = "任务状态:AI_PENDING/AI_PASSED/NEED_MANUAL/REJECTED,不传为全部")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "是否只看加急")
|
||||
private Boolean urgent;
|
||||
|
||||
@Schema(description = "排序方式:TIME_DESC-提交时间倒序(默认,与原型一致) CONFIDENCE_ASC-低置信度优先",
|
||||
example = "TIME_DESC")
|
||||
private String sortBy;
|
||||
|
||||
@Schema(description = "页码,从 1 开始", example = "1")
|
||||
private Integer page = 1;
|
||||
|
||||
@Schema(description = "每页条数", example = "20")
|
||||
private Integer limit = 20;
|
||||
|
||||
public Integer getPage() {
|
||||
return (page == null || page < 1) ? 1 : page;
|
||||
}
|
||||
|
||||
public Integer getLimit() {
|
||||
if (limit == null || limit < 1) {
|
||||
return 20;
|
||||
}
|
||||
return Math.min(limit, 200);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.crrc.crrcmall.service;
|
||||
|
||||
import com.crrc.crrcmall.dto.audit.AuditBatchActionDto;
|
||||
import com.crrc.crrcmall.dto.audit.AuditQuickQueryDto;
|
||||
import com.crrc.crrcmall.dto.audit.AuditWorkbenchQueryDto;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditQuickQueryResultVo;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditWorkbenchDetailVo;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditWorkbenchListVo;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditWorkbenchStatsVo;
|
||||
|
||||
/**
|
||||
* 审核工作台(运营端)服务
|
||||
* <p>
|
||||
* 当前为 Mock 实现,数据存内存;后续接库时只需替换实现类。
|
||||
*/
|
||||
public interface AuditWorkbenchService {
|
||||
|
||||
/**
|
||||
* 列表分页查询(附带统计卡片)
|
||||
*/
|
||||
AuditWorkbenchListVo list(AuditWorkbenchQueryDto query);
|
||||
|
||||
/**
|
||||
* 仅取统计卡片
|
||||
*/
|
||||
AuditWorkbenchStatsVo stats();
|
||||
|
||||
/**
|
||||
* 任务详情,不存在返回 null
|
||||
*/
|
||||
AuditWorkbenchDetailVo detail(String taskNo);
|
||||
|
||||
/**
|
||||
* 批量操作,返回操作后的最新统计
|
||||
*/
|
||||
AuditWorkbenchStatsVo batchAction(AuditBatchActionDto dto);
|
||||
|
||||
/**
|
||||
* 加急查询:一次粘贴多个 SKU
|
||||
*/
|
||||
AuditQuickQueryResultVo quickQuery(AuditQuickQueryDto dto);
|
||||
}
|
||||
@@ -0,0 +1,297 @@
|
||||
package com.crrc.crrcmall.service.impl;
|
||||
|
||||
import com.crrc.crrcmall.common.enums.AuditTaskStatusEnum;
|
||||
import com.crrc.crrcmall.common.enums.AuditTypeEnum;
|
||||
import com.crrc.crrcmall.common.mock.AuditWorkbenchMockData;
|
||||
import com.crrc.crrcmall.common.response.PageResult;
|
||||
import com.crrc.crrcmall.dto.audit.AuditBatchActionDto;
|
||||
import com.crrc.crrcmall.dto.audit.AuditQuickQueryDto;
|
||||
import com.crrc.crrcmall.dto.audit.AuditWorkbenchQueryDto;
|
||||
import com.crrc.crrcmall.service.AuditWorkbenchService;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditQuickQueryResultVo;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditWorkbenchDetailVo;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditWorkbenchListVo;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditWorkbenchStatsVo;
|
||||
import com.crrc.crrcmall.vo.audit.workbench.AuditWorkbenchTaskVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 审核工作台(运营端)实现 —— Mock 版本
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AuditWorkbenchServiceImpl implements AuditWorkbenchService {
|
||||
|
||||
private final AuditWorkbenchMockData mockData;
|
||||
|
||||
/**
|
||||
* 默认排序:提交时间倒序(与原型列表一致)
|
||||
*/
|
||||
private static final Comparator<AuditWorkbenchTaskVo> ORDER_BY_TIME = Comparator
|
||||
.comparing((AuditWorkbenchTaskVo t) -> t.getSubmitTime() == null ? LocalDateTime.MIN : t.getSubmitTime(),
|
||||
Comparator.reverseOrder())
|
||||
.thenComparing(t -> t.getTaskNo() == null ? "" : t.getTaskNo(), Comparator.reverseOrder());
|
||||
|
||||
/**
|
||||
* 可选排序:低置信度优先 -> 驳回项优先 -> 提交时间倒序
|
||||
*/
|
||||
private static final Comparator<AuditWorkbenchTaskVo> ORDER_BY_CONFIDENCE = Comparator
|
||||
.comparing((AuditWorkbenchTaskVo t) -> t.getConfidence() == null ? 1.0d : t.getConfidence())
|
||||
.thenComparingInt(t -> statusPriority(t.getStatus()))
|
||||
.thenComparing(t -> t.getSubmitTime() == null ? LocalDateTime.MIN : t.getSubmitTime(),
|
||||
Comparator.reverseOrder());
|
||||
|
||||
private static Comparator<AuditWorkbenchTaskVo> comparatorOf(String sortBy) {
|
||||
if ("CONFIDENCE_ASC".equalsIgnoreCase(sortBy)) {
|
||||
return ORDER_BY_CONFIDENCE;
|
||||
}
|
||||
return ORDER_BY_TIME;
|
||||
}
|
||||
|
||||
private static int statusPriority(String status) {
|
||||
if (AuditTaskStatusEnum.REJECTED.name().equals(status)) {
|
||||
return 0;
|
||||
}
|
||||
if (AuditTaskStatusEnum.NEED_MANUAL.name().equals(status)) {
|
||||
return 1;
|
||||
}
|
||||
if (AuditTaskStatusEnum.AI_PENDING.name().equals(status)) {
|
||||
return 2;
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuditWorkbenchListVo list(AuditWorkbenchQueryDto query) {
|
||||
String taskNo = trim(query.getTaskNo());
|
||||
String goodsName = trim(query.getGoodsName());
|
||||
String supplierName = trim(query.getSupplierName());
|
||||
Integer auditType = query.getAuditType();
|
||||
String status = trim(query.getStatus());
|
||||
Boolean urgent = query.getUrgent();
|
||||
|
||||
List<AuditWorkbenchTaskVo> filtered = mockData.allTasks().stream()
|
||||
.filter(t -> taskNo == null || containsIgnoreCase(t.getTaskNo(), taskNo))
|
||||
.filter(t -> goodsName == null || containsIgnoreCase(t.getGoodsName(), goodsName))
|
||||
.filter(t -> supplierName == null || containsIgnoreCase(t.getSupplierName(), supplierName))
|
||||
.filter(t -> auditType == null || auditType.equals(t.getAuditType()))
|
||||
.filter(t -> status == null || status.equalsIgnoreCase(t.getStatus()))
|
||||
.filter(t -> urgent == null || urgent.equals(t.getUrgent()))
|
||||
.sorted(comparatorOf(query.getSortBy()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
int current = query.getPage();
|
||||
int size = query.getLimit();
|
||||
int from = Math.min((current - 1) * size, filtered.size());
|
||||
int to = Math.min(from + size, filtered.size());
|
||||
List<AuditWorkbenchTaskVo> records = new ArrayList<>(filtered.subList(from, to));
|
||||
|
||||
PageResult<AuditWorkbenchTaskVo> page = PageResult.of(records, filtered.size(), current, size);
|
||||
return new AuditWorkbenchListVo(page, stats());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuditWorkbenchStatsVo stats() {
|
||||
long total = mockData.allTasks().size();
|
||||
long aiPending = countBy(AuditTaskStatusEnum.AI_PENDING);
|
||||
long aiPassed = countBy(AuditTaskStatusEnum.AI_PASSED);
|
||||
long needManual = countBy(AuditTaskStatusEnum.NEED_MANUAL);
|
||||
long rejected = countBy(AuditTaskStatusEnum.REJECTED);
|
||||
long roundTotal = aiPassed + needManual + rejected;
|
||||
|
||||
AuditWorkbenchStatsVo vo = new AuditWorkbenchStatsVo();
|
||||
vo.setTotal(total);
|
||||
vo.setRoundTotal(roundTotal);
|
||||
vo.setAiPending(aiPending);
|
||||
vo.setAiPassed(aiPassed);
|
||||
vo.setNeedManual(needManual);
|
||||
vo.setRejected(rejected);
|
||||
vo.setAiPassRate(roundTotal == 0 ? 0d : round1(aiPassed * 100.0d / roundTotal));
|
||||
// 队列平均等待:按每人 0.04375 分钟线性估算,32 条 => 1.4 分钟
|
||||
vo.setAverageWaitMinutes(round1(aiPending * 0.04375d));
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuditWorkbenchDetailVo detail(String taskNo) {
|
||||
AuditWorkbenchTaskVo task = mockData.getTask(taskNo);
|
||||
if (task == null) {
|
||||
return null;
|
||||
}
|
||||
AuditWorkbenchDetailVo vo = new AuditWorkbenchDetailVo();
|
||||
vo.setTaskId(task.getTaskNo());
|
||||
vo.setGoodsId(task.getGoodsId());
|
||||
vo.setGoodsName(task.getGoodsName());
|
||||
vo.setGoodsImage(task.getGoodsImage());
|
||||
vo.setGoodsImages(List.of(task.getGoodsImage(),
|
||||
task.getGoodsImage().replace(".png", "-2.png"),
|
||||
task.getGoodsImage().replace(".png", "-3.png")));
|
||||
vo.setSupplierName(task.getSupplierName());
|
||||
vo.setSubmitTime(task.getSubmitTime());
|
||||
vo.setAuditType(task.getAuditType());
|
||||
vo.setAuditTypeName(AuditTypeEnum.labelOf(task.getAuditType()));
|
||||
vo.setStatus(task.getStatus());
|
||||
vo.setStatusName(task.getStatusName());
|
||||
vo.setAiConclusion(task.getAiConclusion());
|
||||
vo.setConfidence(task.getConfidence());
|
||||
vo.setRiskLevel(task.getRiskLevel());
|
||||
vo.setRiskLevelName(task.getRiskLevelName());
|
||||
vo.setViolations(mockData.getViolations(taskNo));
|
||||
vo.setFieldDetails(mockData.getFieldDetails(taskNo));
|
||||
vo.setHistory(mockData.getHistory(taskNo));
|
||||
vo.setCanOperate(!AuditTaskStatusEnum.AI_PENDING.name().equals(task.getStatus()));
|
||||
// 采纳与驳回均为不可逆动作
|
||||
vo.setIrreversible(Boolean.TRUE);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuditWorkbenchStatsVo batchAction(AuditBatchActionDto dto) {
|
||||
String action = trim(dto.getAction());
|
||||
if (action == null) {
|
||||
throw new IllegalArgumentException("action 不能为空");
|
||||
}
|
||||
if (dto.getTaskNos() == null || dto.getTaskNos().isEmpty()) {
|
||||
throw new IllegalArgumentException("taskNos 不能为空");
|
||||
}
|
||||
if (AuditBatchActionDto.ACTION_REJECT.equalsIgnoreCase(action)
|
||||
&& (dto.getReason() == null || dto.getReason().isBlank())) {
|
||||
throw new IllegalArgumentException("驳回必须填写原因");
|
||||
}
|
||||
|
||||
int changed = 0;
|
||||
for (String taskNo : dto.getTaskNos()) {
|
||||
AuditWorkbenchTaskVo task = mockData.getTask(taskNo);
|
||||
if (task == null) {
|
||||
continue;
|
||||
}
|
||||
switch (action.toUpperCase()) {
|
||||
case AuditBatchActionDto.ACTION_ADOPT:
|
||||
// 采纳 AI 结论:需人工判定 -> AI 已通过
|
||||
if (AuditTaskStatusEnum.NEED_MANUAL.name().equals(task.getStatus())) {
|
||||
updateStatus(task, AuditTaskStatusEnum.AI_PASSED);
|
||||
changed++;
|
||||
}
|
||||
break;
|
||||
case AuditBatchActionDto.ACTION_PASS:
|
||||
if (!AuditTaskStatusEnum.AI_PASSED.name().equals(task.getStatus())) {
|
||||
updateStatus(task, AuditTaskStatusEnum.AI_PASSED);
|
||||
changed++;
|
||||
}
|
||||
break;
|
||||
case AuditBatchActionDto.ACTION_REJECT:
|
||||
if (!AuditTaskStatusEnum.REJECTED.name().equals(task.getStatus())) {
|
||||
updateStatus(task, AuditTaskStatusEnum.REJECTED);
|
||||
changed++;
|
||||
}
|
||||
break;
|
||||
case AuditBatchActionDto.ACTION_OFF_SHELF:
|
||||
task.setShelfStatus("下架");
|
||||
changed++;
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("不支持的动作:" + action);
|
||||
}
|
||||
}
|
||||
log.info("[Mock] 批量操作 action={} 请求 {} 条,实际变更 {} 条", action, dto.getTaskNos().size(), changed);
|
||||
return stats();
|
||||
}
|
||||
|
||||
private void updateStatus(AuditWorkbenchTaskVo task, AuditTaskStatusEnum status) {
|
||||
task.setStatus(status.name());
|
||||
task.setStatusName(status.getLabel());
|
||||
task.setAiConclusion(conclusionOf(status));
|
||||
}
|
||||
|
||||
private String conclusionOf(AuditTaskStatusEnum status) {
|
||||
switch (status) {
|
||||
case AI_PASSED:
|
||||
return "AI已通过";
|
||||
case NEED_MANUAL:
|
||||
return "需人工判定";
|
||||
case REJECTED:
|
||||
return "已驳回";
|
||||
default:
|
||||
return "待AI初审";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuditQuickQueryResultVo quickQuery(AuditQuickQueryDto dto) {
|
||||
AuditQuickQueryResultVo vo = new AuditQuickQueryResultVo();
|
||||
Set<String> keywords = splitSkus(dto.getSkus());
|
||||
vo.setQueryCount(keywords.size());
|
||||
|
||||
List<AuditWorkbenchTaskVo> matched = new ArrayList<>();
|
||||
Set<String> seen = new LinkedHashSet<>();
|
||||
List<String> notFound = new ArrayList<>();
|
||||
|
||||
for (String kw : keywords) {
|
||||
List<AuditWorkbenchTaskVo> hits = mockData.matchByKeyword(kw);
|
||||
if (hits.isEmpty()) {
|
||||
notFound.add(kw);
|
||||
continue;
|
||||
}
|
||||
for (AuditWorkbenchTaskVo hit : hits) {
|
||||
if (seen.add(hit.getTaskNo())) {
|
||||
matched.add(hit);
|
||||
}
|
||||
}
|
||||
}
|
||||
matched.sort(ORDER_BY_TIME);
|
||||
vo.setMatched(matched);
|
||||
vo.setMatchedCount(matched.size());
|
||||
vo.setNotFound(notFound);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按 英文逗号 / 中文逗号 / 斜杠 / 顿号 / 空白(含换行) 切分
|
||||
*/
|
||||
private Set<String> splitSkus(String raw) {
|
||||
Set<String> result = new LinkedHashSet<>();
|
||||
if (raw == null || raw.isBlank()) {
|
||||
return result;
|
||||
}
|
||||
for (String s : raw.split("[,,/、\\s]+")) {
|
||||
String kw = s.trim();
|
||||
if (!kw.isEmpty()) {
|
||||
result.add(kw);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private long countBy(AuditTaskStatusEnum status) {
|
||||
return mockData.allTasks().stream()
|
||||
.filter(t -> status.name().equals(t.getStatus()))
|
||||
.count();
|
||||
}
|
||||
|
||||
private boolean containsIgnoreCase(String source, String keyword) {
|
||||
return source != null && source.toLowerCase().contains(keyword.toLowerCase());
|
||||
}
|
||||
|
||||
private String trim(String s) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
String t = s.trim();
|
||||
return t.isEmpty() ? null : t;
|
||||
}
|
||||
|
||||
private double round1(double v) {
|
||||
return Math.round(v * 10d) / 10d;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.crrc.crrcmall.vo.audit.workbench;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 审核工作台 - 字段级检测明细
|
||||
* <p>
|
||||
* 字段结构与客户侧 recordDetail 保持一致(customField/customKey/customValue/customType),
|
||||
* 在此基础上补充 AI 反馈与检测状态,供详情页逐字段展示。
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "字段级检测明细")
|
||||
public class AuditFieldDetailVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "字段标识,如 goodsName")
|
||||
private String customField;
|
||||
|
||||
@Schema(description = "字段显示名,如 商品名称")
|
||||
private String customKey;
|
||||
|
||||
@Schema(description = "本次申报值")
|
||||
private Object customValue;
|
||||
|
||||
@Schema(description = "所属分组,如 price / saleInfo")
|
||||
private Object customType;
|
||||
|
||||
@Schema(description = "AI 反馈")
|
||||
private String aiIntent;
|
||||
|
||||
@Schema(description = "AI 反馈类型:1-格式 2-逻辑 3-图片")
|
||||
private Integer aiIntentType;
|
||||
|
||||
@Schema(description = "AI 匹配度,0-1")
|
||||
private Double aiRelevanceScore;
|
||||
|
||||
@Schema(description = "规则类型:1-硬规则 2-AI规则")
|
||||
private Integer checkType;
|
||||
|
||||
@Schema(description = "检测状态:0-成功(通过) 1-失败(不通过)")
|
||||
private Integer auditStatus;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.crrc.crrcmall.vo.audit.workbench;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 审核工作台 - 同类商品历史判定(供复核参考)
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "历史判定记录")
|
||||
public class AuditHistoryVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "历史商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
@Schema(description = "判定时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
@Schema(description = "判定结果:PASS-通过 REJECT-驳回")
|
||||
private String result;
|
||||
|
||||
@Schema(description = "判定结果名称")
|
||||
private String resultName;
|
||||
|
||||
@Schema(description = "判定说明")
|
||||
private String reason;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.crrc.crrcmall.vo.audit.workbench;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 审核工作台 - 加急查询结果
|
||||
* <p>
|
||||
* 支持一次粘贴多个 SKU,用英文逗号/斜杠/空格/换行 四种分隔符切分。
|
||||
* 查不到的 SKU 通过 notFound 回传,避免静默丢弃。
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "加急查询结果")
|
||||
public class AuditQuickQueryResultVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "识别到的 SKU/关键词数量")
|
||||
private Integer queryCount;
|
||||
|
||||
@Schema(description = "命中数量")
|
||||
private Integer matchedCount;
|
||||
|
||||
@Schema(description = "命中的任务列表")
|
||||
private List<AuditWorkbenchTaskVo> matched = new ArrayList<>();
|
||||
|
||||
@Schema(description = "未命中的 SKU 列表")
|
||||
private List<String> notFound = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.crrc.crrcmall.vo.audit.workbench;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 审核工作台 - 单个违规点
|
||||
* <p>
|
||||
* 对应详情页右侧「AI 初审结论」里的一条命中项,
|
||||
* 含风险等级、置信度、处置建议,以及原文定位(start/end)供前端高亮标红。
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "违规点")
|
||||
public class AuditViolationVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "违规编号,从 1 开始")
|
||||
private Integer seq;
|
||||
|
||||
@Schema(description = "命中字段标识,如 goodsName / materialCode")
|
||||
private String field;
|
||||
|
||||
@Schema(description = "命中字段显示名,如 商品名称")
|
||||
private String fieldName;
|
||||
|
||||
@Schema(description = "违规类型,如 虚假宣传 / 资质缺失 / 价格异常")
|
||||
private String violationType;
|
||||
|
||||
@Schema(description = "风险等级:HIGH/MEDIUM/LOW")
|
||||
private String riskLevel;
|
||||
|
||||
@Schema(description = "风险等级名称:高/中/低")
|
||||
private String riskLevelName;
|
||||
|
||||
@Schema(description = "置信度,0-1")
|
||||
private Double confidence;
|
||||
|
||||
@Schema(description = "违规说明")
|
||||
private String detail;
|
||||
|
||||
@Schema(description = "处置建议")
|
||||
private String suggestion;
|
||||
|
||||
@Schema(description = "违规词在原文中的起始下标")
|
||||
private Integer start;
|
||||
|
||||
@Schema(description = "违规词在原文中的结束下标")
|
||||
private Integer end;
|
||||
|
||||
@Schema(description = "引用的审核规则编号,如 规则 3.2")
|
||||
private String ruleReference;
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.crrc.crrcmall.vo.audit.workbench;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 审核工作台 - 详情
|
||||
* <p>
|
||||
* 组成:商品原件信息 + AI 结论 + 违规点列表 + 字段级明细 + 同类历史判定 + 可操作标记
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "审核工作台详情")
|
||||
public class AuditWorkbenchDetailVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "任务号")
|
||||
private String taskId;
|
||||
|
||||
@Schema(description = "商品 ID")
|
||||
private String goodsId;
|
||||
|
||||
@Schema(description = "商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "商品主图")
|
||||
private String goodsImage;
|
||||
|
||||
@Schema(description = "商品图集")
|
||||
private List<String> goodsImages;
|
||||
|
||||
@Schema(description = "供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
@Schema(description = "提交时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime submitTime;
|
||||
|
||||
@Schema(description = "审核类型")
|
||||
private Integer auditType;
|
||||
|
||||
@Schema(description = "审核类型名称")
|
||||
private String auditTypeName;
|
||||
|
||||
@Schema(description = "任务状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "任务状态名称")
|
||||
private String statusName;
|
||||
|
||||
@Schema(description = "AI 判定结论文案")
|
||||
private String aiConclusion;
|
||||
|
||||
@Schema(description = "AI 置信度")
|
||||
private Double confidence;
|
||||
|
||||
@Schema(description = "风险等级")
|
||||
private String riskLevel;
|
||||
|
||||
@Schema(description = "风险等级名称")
|
||||
private String riskLevelName;
|
||||
|
||||
@Schema(description = "违规点列表")
|
||||
private List<AuditViolationVo> violations;
|
||||
|
||||
@Schema(description = "字段级检测明细")
|
||||
private List<AuditFieldDetailVo> fieldDetails;
|
||||
|
||||
@Schema(description = "同类商品历史判定")
|
||||
private List<AuditHistoryVo> history;
|
||||
|
||||
@Schema(description = "当前是否可执行审核动作")
|
||||
private Boolean canOperate;
|
||||
|
||||
@Schema(description = "动作是否不可逆(采纳/驳回均不可逆,需二次确认)")
|
||||
private Boolean irreversible;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.crrc.crrcmall.vo.audit.workbench;
|
||||
|
||||
import com.crrc.crrcmall.common.response.PageResult;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 审核工作台 - 列表响应(分页 + 统计一次返回)
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "审核工作台列表响应")
|
||||
public class AuditWorkbenchListVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "分页数据")
|
||||
private PageResult<AuditWorkbenchTaskVo> page;
|
||||
|
||||
@Schema(description = "统计卡片数据")
|
||||
private AuditWorkbenchStatsVo stats;
|
||||
|
||||
public AuditWorkbenchListVo() {
|
||||
}
|
||||
|
||||
public AuditWorkbenchListVo(PageResult<AuditWorkbenchTaskVo> page, AuditWorkbenchStatsVo stats) {
|
||||
this.page = page;
|
||||
this.stats = stats;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.crrc.crrcmall.vo.audit.workbench;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 审核工作台 - 统计卡片 + 本轮进度
|
||||
* <p>
|
||||
* 口径说明(与原型对齐):
|
||||
* <ul>
|
||||
* <li>roundTotal = 本轮任务数 = aiPassed + needManual + rejected(不含待初审)</li>
|
||||
* <li>aiPassRate = aiPassed / roundTotal</li>
|
||||
* <li>aiPending 为排队中、尚未进入本轮的任务数,独立统计</li>
|
||||
* </ul>
|
||||
* 所有数值均由任务数据实时聚合,不做硬编码,避免出现「128 与 160 对不上」。
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "审核工作台统计")
|
||||
public class AuditWorkbenchStatsVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "全部任务数(含待 AI 初审)")
|
||||
private Long total;
|
||||
|
||||
@Schema(description = "本轮任务数(AI已通过 + 需人工判定 + 已驳回)")
|
||||
private Long roundTotal;
|
||||
|
||||
@Schema(description = "待 AI 初审")
|
||||
private Long aiPending;
|
||||
|
||||
@Schema(description = "AI 已通过")
|
||||
private Long aiPassed;
|
||||
|
||||
@Schema(description = "需人工判定")
|
||||
private Long needManual;
|
||||
|
||||
@Schema(description = "已驳回")
|
||||
private Long rejected;
|
||||
|
||||
@Schema(description = "AI 自动通过率(百分比,保留 1 位小数),如 75.0")
|
||||
private Double aiPassRate;
|
||||
|
||||
@Schema(description = "队列平均等待分钟数")
|
||||
private Double averageWaitMinutes;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.crrc.crrcmall.vo.audit.workbench;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 审核工作台 - 列表行
|
||||
* <p>
|
||||
* 对应原型表格:任务号 | 商品 | 供应商 | 提交时间 | 类型 | AI 判定 | 违规点摘要 | 操作
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "审核工作台列表行")
|
||||
public class AuditWorkbenchTaskVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "任务号,如 AI-20260930-0187")
|
||||
private String taskNo;
|
||||
|
||||
@Schema(description = "商品 ID")
|
||||
private String goodsId;
|
||||
|
||||
@Schema(description = "商品名称(列表展示名)")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "商品 SKU,加急查询按此匹配")
|
||||
private String sku;
|
||||
|
||||
@Schema(description = "商品主图")
|
||||
private String goodsImage;
|
||||
|
||||
@Schema(description = "是否加急")
|
||||
private Boolean urgent;
|
||||
|
||||
@Schema(description = "上下架标签:上架/下架/变更")
|
||||
private String shelfStatus;
|
||||
|
||||
@Schema(description = "供应商 ID")
|
||||
private String supplierId;
|
||||
|
||||
@Schema(description = "供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
@Schema(description = "提交时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime submitTime;
|
||||
|
||||
@Schema(description = "审核类型:1-新品上架 2-已上架复审 3-调价审核 4-变更审核")
|
||||
private Integer auditType;
|
||||
|
||||
@Schema(description = "审核类型名称")
|
||||
private String auditTypeName;
|
||||
|
||||
@Schema(description = "任务状态:AI_PENDING/AI_PASSED/NEED_MANUAL/REJECTED")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "任务状态名称")
|
||||
private String statusName;
|
||||
|
||||
@Schema(description = "AI 判定结论文案")
|
||||
private String aiConclusion;
|
||||
|
||||
@Schema(description = "AI 置信度,0-1")
|
||||
private Double confidence;
|
||||
|
||||
@Schema(description = "风险等级:HIGH/MEDIUM/LOW")
|
||||
private String riskLevel;
|
||||
|
||||
@Schema(description = "风险等级名称:高/中/低")
|
||||
private String riskLevelName;
|
||||
|
||||
@Schema(description = "违规点摘要,如:物料编码缺失 · 税收编码格式错")
|
||||
private String violationSummary;
|
||||
|
||||
@Schema(description = "违规点数量")
|
||||
private Integer violationCount;
|
||||
}
|
||||
Reference in new issue
Block a user