diff --git a/DOAN.Admin.WebApi/Controllers/MES/base/material_account/BaseMaterialListController.cs b/DOAN.Admin.WebApi/Controllers/MES/base/material_account/BaseMaterialListController.cs
index 0d81279..d62fa6e 100644
--- a/DOAN.Admin.WebApi/Controllers/MES/base/material_account/BaseMaterialListController.cs
+++ b/DOAN.Admin.WebApi/Controllers/MES/base/material_account/BaseMaterialListController.cs
@@ -94,7 +94,7 @@ namespace DOAN.Admin.WebApi.Controllers
[Log(Title = "物料清单", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteBaseMaterialList(string ids)
{
- int[] idsArr = Tools.SpitIntArrary(ids);
+ string[] idsArr = Tools.SpitStrArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _BaseMaterialListService.Delete(idsArr);
diff --git a/DOAN.Common/Tools.cs b/DOAN.Common/Tools.cs
index 000b578..f49cdc6 100644
--- a/DOAN.Common/Tools.cs
+++ b/DOAN.Common/Tools.cs
@@ -29,6 +29,19 @@ namespace DOAN.Common
int[] infoIdss = Array.ConvertAll(strIds, s => int.Parse(s));
return infoIdss;
}
+ ///
+ /// 雪花id
+ ///
+ ///
+ ///
+ ///
+ public static string[] SpitStrArrary(string str, char split = ',')
+ {
+ if (string.IsNullOrEmpty(str)) { return Array.Empty(); }
+ string[] strIds = str.Split(split, (char)StringSplitOptions.RemoveEmptyEntries);
+
+ return strIds;
+ }
///
/// 根据日期获取星期几
diff --git a/DOAN.Model/MES/base/Dto/BaseMaterialListDto.cs b/DOAN.Model/MES/base/Dto/BaseMaterialListDto.cs
index 7f7c49e..9921ea6 100644
--- a/DOAN.Model/MES/base/Dto/BaseMaterialListDto.cs
+++ b/DOAN.Model/MES/base/Dto/BaseMaterialListDto.cs
@@ -27,7 +27,7 @@ namespace DOAN.Model.MES.base_.Dto
///
public class BaseMaterialListDto
{
- [Required(ErrorMessage = "雪花id不能为空")]
+
public string Id { get; set; }
public int? FkTypeId { get; set; }
diff --git a/DOAN.Service/MES/base/BaseMaterialListService.cs b/DOAN.Service/MES/base/BaseMaterialListService.cs
index be97b8b..212c40f 100644
--- a/DOAN.Service/MES/base/BaseMaterialListService.cs
+++ b/DOAN.Service/MES/base/BaseMaterialListService.cs
@@ -63,6 +63,8 @@ namespace DOAN.Service.MES.base_
///
public BaseMaterialList AddBaseMaterialList(BaseMaterialList model)
{
+ model.Id = SnowFlakeSingle.Instance.NextId().ToString();
+
return Context.Insertable(model).ExecuteReturnEntity();
}