fix(patrol-delete): 删除条件为空的任务四层拦截——①前端启动前拦截(不再先创建后失败,避免任务残留执行中)并创建时上传delete_conditions ②Java服务端校验删除条件非空(旧版本/直调兜底) ③Python端空条件直接按失败上报,不再逐店空转
This commit is contained in:
+6
@@ -23,4 +23,10 @@ public class PatrolDeleteCreateTaskRequest {
|
||||
@NotEmpty
|
||||
@Schema(description = "待创建的店铺任务列表,通常由已匹配成功的店铺组成", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<PatrolDeleteTaskItemDto> items = new ArrayList<>();
|
||||
|
||||
@NotNull
|
||||
@NotEmpty
|
||||
@JsonProperty("delete_conditions")
|
||||
@Schema(description = "删除条件(如:定价问题/需要批准/缺少报价…),为空时任务无可执行内容", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Object> deleteConditions = new ArrayList<>();
|
||||
}
|
||||
|
||||
+5
@@ -280,6 +280,11 @@ public class PatrolDeleteTaskService {
|
||||
if (request.getItems() == null || request.getItems().isEmpty()) {
|
||||
throw new BusinessException("items 不能为空");
|
||||
}
|
||||
// 删除条件为空时任务没有可执行的判定规则(Python 端会无事可做、一直停在执行中),
|
||||
// 必须在此拦截;前端亦在创建前拦截,此处为服务端兜底(直调 API/旧客户端场景)
|
||||
if (request.getDeleteConditions() == null || request.getDeleteConditions().isEmpty()) {
|
||||
throw new BusinessException("删除条件不能为空,请先选择删除条件");
|
||||
}
|
||||
|
||||
List<PatrolDeleteTaskItemDto> uniqueItems = dedupeItems(request.getItems());
|
||||
if (uniqueItems.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user