修复bug
This commit is contained in:
@@ -65,8 +65,10 @@ namespace WMS.Web.Domain.Services
|
|||||||
public async Task<Result> ChangeBoxSave(List<SaveChangeBoxRecordRequest> dto, LoginInDto loginInfo, bool isTransaction = false, bool IsInventory = true, bool IsPDA = false)
|
public async Task<Result> ChangeBoxSave(List<SaveChangeBoxRecordRequest> dto, LoginInDto loginInfo, bool isTransaction = false, bool IsInventory = true, bool IsPDA = false)
|
||||||
{
|
{
|
||||||
_logger.LogInformation($"改箱:{JsonConvert.SerializeObject(dto)} 操作人:{loginInfo.UserInfo.StaffId}");
|
_logger.LogInformation($"改箱:{JsonConvert.SerializeObject(dto)} 操作人:{loginInfo.UserInfo.StaffId}");
|
||||||
|
bool isAddBox = false;
|
||||||
if (IsPDA)
|
if (IsPDA)
|
||||||
{
|
{
|
||||||
|
//处理目标箱不在系统的情况,需要先增加箱信息
|
||||||
var d = dto.First();
|
var d = dto.First();
|
||||||
if (d.DestBoxId == 0)
|
if (d.DestBoxId == 0)
|
||||||
{
|
{
|
||||||
@@ -75,6 +77,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
if (!res.IsSuccess) return res;
|
if (!res.IsSuccess) return res;
|
||||||
dBox = await _boxRepositories.GetByNo(d.DestBoxBillNo);
|
dBox = await _boxRepositories.GetByNo(d.DestBoxBillNo);
|
||||||
dto.First().DestBoxId = dBox.Id;
|
dto.First().DestBoxId = dBox.Id;
|
||||||
|
isAddBox = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//1.有原箱时 需要判断 物料对应的序列号是否存在
|
//1.有原箱时 需要判断 物料对应的序列号是否存在
|
||||||
@@ -136,14 +139,17 @@ namespace WMS.Web.Domain.Services
|
|||||||
res = srcBox.Out(l);
|
res = srcBox.Out(l);
|
||||||
if (!res.IsSuccess) return res;
|
if (!res.IsSuccess) return res;
|
||||||
}
|
}
|
||||||
//目标箱移入
|
|
||||||
res = destBox.In(l);
|
|
||||||
if (!res.IsSuccess) return res;
|
|
||||||
if (srcBox != null)
|
if (srcBox != null)
|
||||||
boxList.Add(srcBox);
|
boxList.Add(srcBox);
|
||||||
|
//目标箱移入
|
||||||
|
if (!isAddBox)
|
||||||
|
{
|
||||||
|
res = destBox.In(l);
|
||||||
|
if (!res.IsSuccess) return res;
|
||||||
if (destBox != null)
|
if (destBox != null)
|
||||||
boxList.Add(destBox);
|
boxList.Add(destBox);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<ChangeBoxRecord> list = new List<ChangeBoxRecord>();
|
List<ChangeBoxRecord> list = new List<ChangeBoxRecord>();
|
||||||
var subIds = dto.Select(s => s.SubStockId).ToList();
|
var subIds = dto.Select(s => s.SubStockId).ToList();
|
||||||
@@ -213,6 +219,20 @@ namespace WMS.Web.Domain.Services
|
|||||||
//增加一个空箱子
|
//增加一个空箱子
|
||||||
List<OpsBoxResponse> list = new List<OpsBoxResponse>();
|
List<OpsBoxResponse> list = new List<OpsBoxResponse>();
|
||||||
OpsBoxResponse response = new OpsBoxResponse() { BoxBillNo = dto.DestBoxBillNo };
|
OpsBoxResponse response = new OpsBoxResponse() { BoxBillNo = dto.DestBoxBillNo };
|
||||||
|
foreach (var d in dto.Details)
|
||||||
|
{
|
||||||
|
List<OpsSerialNumbersResponse> s = new List<OpsSerialNumbersResponse>();
|
||||||
|
foreach (var sd in d.SerialNumbers)
|
||||||
|
{
|
||||||
|
s.Add(new OpsSerialNumbersResponse() { SerialNumber = sd });
|
||||||
|
}
|
||||||
|
OpsBoxDetailsResponse dr = new OpsBoxDetailsResponse()
|
||||||
|
{
|
||||||
|
MaterialId = d.MaterialId,
|
||||||
|
Qty = d.Qty,
|
||||||
|
SerialNumbers = s
|
||||||
|
};
|
||||||
|
}
|
||||||
list.Add(response);
|
list.Add(response);
|
||||||
return await _boxService.Sync(list);
|
return await _boxService.Sync(list);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user