提交代码
This commit is contained in:
46
WCS.BLL/Services/Service/SelfCheckService.cs
Normal file
46
WCS.BLL/Services/Service/SelfCheckService.cs
Normal 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)}已开始自检!",
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user