1.增加刷新库位显示库存接口

2.增加任务物料唯一码的保存
This commit is contained in:
hehaibing-1996
2024-11-27 17:38:01 +08:00
parent 3fc9f8a0c9
commit cfbf6a81c8
7 changed files with 106 additions and 0 deletions

View File

@ -122,5 +122,45 @@ namespace WCS.BLL.Services.Service
};
}
}
public async Task<ResponseCommon> refreshInventoryRequest(RefreshInventoryRequest request)
{
try
{
//第一步:校验库位在数据库中是否都存在
var storeCodeList = request.StoreCodes.Distinct()
.ToList();
var stores = DbHelp.db.Queryable<StoreInfo>()
.LeftJoin<ShelfTypeInfo>((si, sti) => si.ShelfTypeId == sti.Id)
.Where((si, sti) => sti.ShelfTypeName == "液晶货架")
.Where((si, sti) => storeCodeList.Contains(si.StoreCode))
.Select((st, sti) => st)
.ToList();
if (stores.Count < storeCodeList.Count)
{
var storeCodesInDB = stores.Select(t => t.StoreCode).ToList();
storeCodeList.RemoveAll(t => storeCodesInDB.Contains(t));
return new ResponseCommon
{
Code = 200,
Message = $"操作失败:库位【{string.Join(",", storeCodeList)}】不存在!",
};
}
//向WMS系统获取对应库位最新的库存信息、更新至电子标签
return new ResponseCommon
{
Code = 200,
Message = "success"
};
}
catch (Exception ex)
{
return new ResponseCommon
{
Code = 200,
Message = "操作失败:" + ex.Message,
};
}
}
}
}