移箱支持多个
This commit is contained in:
@@ -104,15 +104,16 @@ namespace WMS.Web.Domain.Services
|
||||
/// <summary>
|
||||
/// 移箱
|
||||
/// </summary>
|
||||
/// <param name="moveBoxRecord"></param>
|
||||
/// <param name="moveBoxRecords"></param>
|
||||
/// <param name="loginInfo"></param>
|
||||
/// <param name="isTransaction"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Result> MoveBox(MoveBoxRecord moveBoxRecord, LoginInDto loginInfo, bool isTransaction = true)
|
||||
public async Task<Result> MoveBox(List<MoveBoxRecord> moveBoxRecords, LoginInDto loginInfo, bool isTransaction = true)
|
||||
{
|
||||
//获取序列号信息
|
||||
var entityList = await _serialNumbersRepositories.GetEntityListByBoxId(moveBoxRecord.BoxId);
|
||||
var box = await _boxRepositories.Get(moveBoxRecord.BoxId);
|
||||
var boxids = moveBoxRecords.Select(s => s.BoxId).ToList();
|
||||
var entityList = await _serialNumbersRepositories.GetEntityListByBoxIds(boxids);
|
||||
var boxList = await _boxRepositories.GetEntityList(boxids);
|
||||
var userName = _singleDataService.GetSingleData(SingleAction.Staffs, loginInfo.UserInfo.CompanyId, loginInfo.UserInfo.StaffId);
|
||||
|
||||
IDbContextTransaction _transaction = null;
|
||||
@@ -123,8 +124,10 @@ namespace WMS.Web.Domain.Services
|
||||
List<SerialNumberOperate> sList = new List<SerialNumberOperate>();
|
||||
foreach (var entity in entityList)
|
||||
{
|
||||
var box = boxList.FirstOrDefault(f => f.Id == entity.BoxId);
|
||||
var moveBoxRecord = moveBoxRecords.FirstOrDefault(f => f.BoxId == entity.BoxId);
|
||||
//修改序列号和箱绑定关系
|
||||
entity.Bind(moveBoxRecord.BoxId);
|
||||
//entity.Bind(moveBoxRecord.BoxId);
|
||||
|
||||
//记录序列号操作日志
|
||||
SerialNumberOperate op = new SerialNumberOperate()
|
||||
@@ -201,7 +204,7 @@ namespace WMS.Web.Domain.Services
|
||||
OperateTime = DateTime.Now,
|
||||
OperateType = OutStockTypeConvert(outStock.Type),
|
||||
OperateUser = userName,
|
||||
Remark = "来源单号:" + string.Join(",",outstockDetail.SourceBillNos) + "\r\n" + "出库单号:" + outStock.BillNo
|
||||
Remark = "来源单号:" + string.Join(",", outstockDetail.SourceBillNos) + "\r\n" + "出库单号:" + outStock.BillNo
|
||||
};
|
||||
if (outStock.Type == OutStockType.Sal)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user