fix: 修复一级需求部门撤回重新编辑任务后发布时的数据格式错误
This commit is contained in:
parent
3352469b3b
commit
d364b8173c
@ -148,8 +148,11 @@ public class TaskController {
|
||||
com.fasterxml.jackson.databind.JsonNode jsonNode = objectMapper.readTree(json);
|
||||
|
||||
// 检查是否是流水线任务格式
|
||||
if (jsonNode.has("isPipeline") && jsonNode.get("isPipeline").asBoolean() ||
|
||||
jsonNode.has("items") && jsonNode.get("items").isArray()) {
|
||||
// 只有当 isPipeline = true 或 items 非空时才判断为流水线任务
|
||||
boolean isPipeline = jsonNode.has("isPipeline") && jsonNode.get("isPipeline").asBoolean();
|
||||
boolean hasItems = jsonNode.has("items") && jsonNode.get("items").isArray() && jsonNode.get("items").size() > 0;
|
||||
|
||||
if (isPipeline || hasItems) {
|
||||
// 流水线任务更新
|
||||
com.designhub.dto.PipelineTaskDTO dto = objectMapper.convertValue(taskData, com.designhub.dto.PipelineTaskDTO.class);
|
||||
taskService.updatePipelineTask(id, dto, userId);
|
||||
|
||||
@ -1670,11 +1670,32 @@ const handleSubmit = async () => {
|
||||
|
||||
if (editMode.value && editTaskId.value) {
|
||||
// 编辑模式:更新任务并重新提交审核
|
||||
const updateData = {
|
||||
...pipelineData,
|
||||
id: editTaskId.value
|
||||
if (isPrimaryDeptWithoutDetail) {
|
||||
// 一级需求部门不填写任务明细时,使用普通任务格式
|
||||
const taskData = {
|
||||
title: formData.title,
|
||||
brandId: formData.brandId,
|
||||
platformId: formData.platformId,
|
||||
categoryId: formData.categoryId,
|
||||
spuInfo: formData.spuInfo,
|
||||
taskSubType: formData.taskSubType,
|
||||
attachmentUrl: attachmentUrl,
|
||||
remark: formData.remark || '',
|
||||
priority: formData.isUrgent ? 3 : 1,
|
||||
releaseType: formData.releaseType,
|
||||
productBarcodes: formData.productBarcodes,
|
||||
previewImage: formData.previewImage,
|
||||
id: editTaskId.value
|
||||
}
|
||||
response = await taskApi.updateTask(editTaskId.value, taskData as any)
|
||||
} else {
|
||||
// 流水线任务更新
|
||||
const updateData = {
|
||||
...pipelineData,
|
||||
id: editTaskId.value
|
||||
}
|
||||
response = await taskApi.updateTask(editTaskId.value, updateData)
|
||||
}
|
||||
response = await taskApi.updateTask(editTaskId.value, updateData)
|
||||
|
||||
if (response.code === 200) {
|
||||
message.success('任务已重新提交审核')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user