提交代码

This commit is contained in:
hehaibing-1996
2024-04-23 08:31:37 +08:00
parent d40c3f253a
commit aaf7c17562
43 changed files with 2196 additions and 71 deletions

View File

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WCS.BLL.Manager;
using WCS.BLL.Services.IService;
using WCS.Model;
using WCS.Model.ApiModel.SelfCheck;
namespace WCS.BLL.Services.Service
{
public class SelfCheckService : ISelfCheckService
{
public async Task<ResponseBase> StartSelfCheckByShelfCode(StartSelfCheckByShelfCodeRequest request)
{
//获取货架
var shelfs = ShelfManager.Shelves
.Where(t => request.ShelfCodes.Contains(t.ShelfCode))
.ToList();
if (shelfs.Count < request.ShelfCodes.Count)
{
foreach (var shelf in shelfs)
{
request.ShelfCodes.RemoveAll(t => t == shelf.ShelfCode);
}
return new ResponseCommon()
{
Code = 201,
Message = $"货架{string.Join(",", request.ShelfCodes)}不存在!",
};
}
foreach (var shelf in shelfs)
{
shelf.ShelfCheck();
}
return new ResponseCommon()
{
Code = 200,
Message = $"货架{string.Join(",", request.ShelfCodes)}已开始自检!",
};
}
}
}