修正
This commit is contained in:
parent
c267a92690
commit
66c45eaf56
@ -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);
|
||||
|
||||
@ -29,6 +29,19 @@ namespace DOAN.Common
|
||||
int[] infoIdss = Array.ConvertAll(strIds, s => int.Parse(s));
|
||||
return infoIdss;
|
||||
}
|
||||
/// <summary>
|
||||
/// 雪花id
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <param name="split"></param>
|
||||
/// <returns></returns>
|
||||
public static string[] SpitStrArrary(string str, char split = ',')
|
||||
{
|
||||
if (string.IsNullOrEmpty(str)) { return Array.Empty<string>(); }
|
||||
string[] strIds = str.Split(split, (char)StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
return strIds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据日期获取星期几
|
||||
|
||||
@ -27,7 +27,7 @@ namespace DOAN.Model.MES.base_.Dto
|
||||
/// </summary>
|
||||
public class BaseMaterialListDto
|
||||
{
|
||||
[Required(ErrorMessage = "雪花id不能为空")]
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
public int? FkTypeId { get; set; }
|
||||
|
||||
@ -63,6 +63,8 @@ namespace DOAN.Service.MES.base_
|
||||
/// <returns></returns>
|
||||
public BaseMaterialList AddBaseMaterialList(BaseMaterialList model)
|
||||
{
|
||||
model.Id = SnowFlakeSingle.Instance.NextId().ToString();
|
||||
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user