feat(工单): 添加工单缺陷数量字段并优化导入逻辑

为工单模型添加缺陷数量字段,优化Excel导入逻辑
增加必填字段校验和异常处理,完善默认值设置
This commit is contained in:
2026-02-09 16:23:13 +08:00
parent bfc0f27b18
commit 898ee3de2a
5 changed files with 58 additions and 42 deletions

View File

@@ -217,13 +217,21 @@ namespace DOAN.Admin.WebApi.Controllers
[AllowAnonymous]
public IActionResult ImportData([FromForm(Name = "file")] IFormFile formFile)
{
if (formFile == null)
try
{
return SUCCESS(null);
}
int response = _ProWorkorderService.ImportData(formFile, HttpContext.GetName());
if (formFile == null)
{
return SUCCESS(null);
}
int response = _ProWorkorderService.ImportData(formFile, HttpContext.GetName());
return SUCCESS(response);
}
catch (Exception ex)
{
return ToResponse(new ApiResult(500, ex.Message));
}
return SUCCESS(response);
}
//TODO 分批导入工单,追加工单
@@ -237,13 +245,21 @@ namespace DOAN.Admin.WebApi.Controllers
[AllowAnonymous]
public IActionResult ImportDataAppend([FromForm(Name = "file")] IFormFile formFile)
{
if (formFile == null)
try
{
return SUCCESS(null);
}
int response = _ProWorkorderService.ImportDataAppend(formFile, HttpContext.GetName());
if (formFile == null)
{
return SUCCESS(null);
}
int response = _ProWorkorderService.ImportDataAppend(formFile, HttpContext.GetName());
return SUCCESS(response);
}
catch (Exception ex)
{
return ToResponse(new ApiResult(500, ex.Message));
}
return SUCCESS(response);
}
/// <summary>