增加配置库位编码接口
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Kdbndp;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using SqlSugar;
|
||||
using WCS.BLL.DbModels;
|
||||
@ -786,5 +787,55 @@ namespace WCS.WebApi.Controllers
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 配置库位编码
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[Route("setStoreCode")]
|
||||
[HttpPost(Name = "setStoreCode")]
|
||||
public async Task<ResponseBase> setStoreCode(SetBoardIdRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
var errorList = new List<string>();
|
||||
//1.获取所有液晶标签货架
|
||||
var shelfs = ShelfManager.Shelves.Where(t => t.ShelfTypeName == "液晶标签货架")
|
||||
.WhereIF(!string.IsNullOrEmpty(request.IPPort), t => t.ClientIp == request.IPPort)
|
||||
.Select(t => t as MXL4Shelf)
|
||||
.ToList();
|
||||
shelfs.ForEach(t =>
|
||||
{
|
||||
t.MXL4Modules.ForEach(m =>
|
||||
{
|
||||
try
|
||||
{
|
||||
m.SendStoreCode(m.ModuleCode, t.TcpCleint);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorList.Add($"模组{m.ModuleCode}更新库位ID失败!原因:{ex.Message}");
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
return new ResponseCommon
|
||||
{
|
||||
Code = 200,
|
||||
Message = "success",
|
||||
Data = errorList
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseCommon
|
||||
{
|
||||
Code = 300,
|
||||
Message = "操作失败:" + ex.Message,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user