出库增加序列号字段
This commit is contained in:
@@ -831,6 +831,11 @@
|
|||||||
物料Id
|
物料Id
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.OutStockDetails.SerialNumbers">
|
||||||
|
<summary>
|
||||||
|
序列号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:WMS.Web.Domain.Entitys.OutStockDetails.StockCode">
|
<member name="P:WMS.Web.Domain.Entitys.OutStockDetails.StockCode">
|
||||||
<summary>
|
<summary>
|
||||||
仓库
|
仓库
|
||||||
@@ -1636,6 +1641,9 @@
|
|||||||
<member name="M:WMS.Web.Domain.Infrastructure.ISerialNumbersRepositories.GetEntityList(System.Collections.Generic.List{System.String})">
|
<member name="M:WMS.Web.Domain.Infrastructure.ISerialNumbersRepositories.GetEntityList(System.Collections.Generic.List{System.String})">
|
||||||
查询实体集合
|
查询实体集合
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Infrastructure.ISerialNumbersRepositories.GetEntityListByBoxId(System.Int32)">
|
||||||
|
根据箱Id查询集合
|
||||||
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.Infrastructure.ISerialNumbersRepositories.EditEntityList(System.Collections.Generic.List{WMS.Web.Domain.Entitys.SerialNumbers},System.Boolean)">
|
<member name="M:WMS.Web.Domain.Infrastructure.ISerialNumbersRepositories.EditEntityList(System.Collections.Generic.List{WMS.Web.Domain.Entitys.SerialNumbers},System.Boolean)">
|
||||||
修改实体集合
|
修改实体集合
|
||||||
</member>
|
</member>
|
||||||
@@ -1804,19 +1812,13 @@
|
|||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.IService.ISerialNumberService.ChangeBox(System.Collections.Generic.List{WMS.Web.Domain.Entitys.ChangeBoxRecord},WMS.Web.Core.Dto.Login.LoginInDto,System.Boolean)">
|
<member name="M:WMS.Web.Domain.IService.ISerialNumberService.ChangeBox(System.Collections.Generic.List{WMS.Web.Domain.Entitys.ChangeBoxRecord},WMS.Web.Core.Dto.Login.LoginInDto,System.Boolean)">
|
||||||
<summary>
|
改箱
|
||||||
操作序列号(移箱等)
|
|
||||||
</summary>
|
|
||||||
<param name="changeBoxRecords"></param>
|
|
||||||
<param name="isTransaction"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.IService.ISerialNumberService.OutStock(System.Collections.Generic.List{System.String},System.Boolean)">
|
<member name="M:WMS.Web.Domain.IService.ISerialNumberService.MoveBox(WMS.Web.Domain.Entitys.MoveBoxRecord,WMS.Web.Core.Dto.Login.LoginInDto,System.Boolean)">
|
||||||
<summary>
|
移箱
|
||||||
操作序列号(出库操作)
|
</member>
|
||||||
</summary>
|
<member name="M:WMS.Web.Domain.IService.ISerialNumberService.OutStock(WMS.Web.Domain.Entitys.OutStock,WMS.Web.Core.Dto.Login.LoginInDto,System.Boolean)">
|
||||||
<param name="serialNumbers">序列号</param>
|
出库
|
||||||
<returns></returns>
|
|
||||||
</member>
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.IService.ISerialNumberService.SerialNumberOperate(System.Collections.Generic.List{WMS.Web.Domain.Entitys.SerialNumberOperate},System.Boolean)">
|
<member name="M:WMS.Web.Domain.IService.ISerialNumberService.SerialNumberOperate(System.Collections.Generic.List{WMS.Web.Domain.Entitys.SerialNumberOperate},System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
@@ -3414,11 +3416,22 @@
|
|||||||
<param name="isTransaction"></param>
|
<param name="isTransaction"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.Services.SerialNumberService.OutStock(System.Collections.Generic.List{System.String},System.Boolean)">
|
<member name="M:WMS.Web.Domain.Services.SerialNumberService.MoveBox(WMS.Web.Domain.Entitys.MoveBoxRecord,WMS.Web.Core.Dto.Login.LoginInDto,System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
操作序列号(出库操作)
|
移箱
|
||||||
</summary>
|
</summary>
|
||||||
<param name="serialNumbers"></param>
|
<param name="moveBoxRecord"></param>
|
||||||
|
<param name="loginInfo"></param>
|
||||||
|
<param name="isTransaction"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Services.SerialNumberService.OutStock(WMS.Web.Domain.Entitys.OutStock,WMS.Web.Core.Dto.Login.LoginInDto,System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
出库
|
||||||
|
</summary>
|
||||||
|
<param name="outStock"></param>
|
||||||
|
<param name="loginInfo"></param>
|
||||||
|
<param name="isTransaction"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.Services.SerialNumberService.SerialNumberOperate(System.Collections.Generic.List{WMS.Web.Domain.Entitys.SerialNumberOperate},System.Boolean)">
|
<member name="M:WMS.Web.Domain.Services.SerialNumberService.SerialNumberOperate(System.Collections.Generic.List{WMS.Web.Domain.Entitys.SerialNumberOperate},System.Boolean)">
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ namespace WMS.Web.Domain.Entitys
|
|||||||
[Column("MaterialId")]
|
[Column("MaterialId")]
|
||||||
public int MaterialId { get; set; }
|
public int MaterialId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 序列号
|
||||||
|
/// </summary>
|
||||||
|
[Column("SerialNumbers")]
|
||||||
|
public List<string> SerialNumbers { get; set; } = new List<string>();
|
||||||
|
/// <summary>
|
||||||
/// 仓库
|
/// 仓库
|
||||||
///</summary>
|
///</summary>
|
||||||
[Column("StockCode")]
|
[Column("StockCode")]
|
||||||
|
|||||||
@@ -14,19 +14,12 @@ namespace WMS.Web.Domain.IService
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ISerialNumberService
|
public interface ISerialNumberService
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// 改箱
|
||||||
/// 操作序列号(移箱等)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="changeBoxRecords"></param>
|
|
||||||
/// <param name="isTransaction"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Result> ChangeBox(List<ChangeBoxRecord> changeBoxRecords, LoginInDto loginInfo, bool isTransaction = true);
|
Task<Result> ChangeBox(List<ChangeBoxRecord> changeBoxRecords, LoginInDto loginInfo, bool isTransaction = true);
|
||||||
/// <summary>
|
/// 移箱
|
||||||
/// 操作序列号(出库操作)
|
Task<Result> MoveBox(MoveBoxRecord moveBoxRecord, LoginInDto loginInfo, bool isTransaction = true);
|
||||||
/// </summary>
|
/// 出库
|
||||||
/// <param name="serialNumbers">序列号</param>
|
Task<Result> OutStock(OutStock outStock, LoginInDto loginInfo, bool isTransaction = true);
|
||||||
/// <returns></returns>
|
|
||||||
Task<Result> OutStock(List<string> serialNumbers, bool isTransaction = true);
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 序列号操作记录
|
/// 序列号操作记录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ namespace WMS.Web.Domain.Infrastructure
|
|||||||
Task<SerialNumbersResponse> GetSerialNumber(string serialNumber);
|
Task<SerialNumbersResponse> GetSerialNumber(string serialNumber);
|
||||||
/// 查询实体集合
|
/// 查询实体集合
|
||||||
Task<List<SerialNumbers>> GetEntityList(List<string> serialNumbers);
|
Task<List<SerialNumbers>> GetEntityList(List<string> serialNumbers);
|
||||||
|
/// 根据箱Id查询集合
|
||||||
|
Task<List<SerialNumbers>> GetEntityListByBoxId(int boxId);
|
||||||
/// 修改实体集合
|
/// 修改实体集合
|
||||||
Task<bool> EditEntityList(List<SerialNumbers> entitys, bool isTransaction = true);
|
Task<bool> EditEntityList(List<SerialNumbers> entitys, bool isTransaction = true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
isSuccess = await _changeBoxRecordRepositories.AddRange(list, false);
|
isSuccess = await _changeBoxRecordRepositories.AddRange(list, false);
|
||||||
if (!isSuccess) isRollback = true;
|
if (!isSuccess) isRollback = true;
|
||||||
var res_change = await _serialNumberService.ChangeBox(list, loginInfo, false);
|
var res_change = await _serialNumberService.ChangeBox(list, loginInfo, false);
|
||||||
if(!res_change.IsSuccess) isRollback = true;
|
if (!res_change.IsSuccess) isRollback = true;
|
||||||
isSuccess = await _boxRepositories.EditEntityList(boxList, false);
|
isSuccess = await _boxRepositories.EditEntityList(boxList, false);
|
||||||
if (!isSuccess) isRollback = true;
|
if (!isSuccess) isRollback = true;
|
||||||
|
|
||||||
@@ -122,7 +122,8 @@ namespace WMS.Web.Domain.Services
|
|||||||
bool isSuccess = true;
|
bool isSuccess = true;
|
||||||
entity = await _moveBoxRecordRepositories.Add(entity, true);
|
entity = await _moveBoxRecordRepositories.Add(entity, true);
|
||||||
if (entity == null) isRollback = true;
|
if (entity == null) isRollback = true;
|
||||||
|
var res_change = await _serialNumberService.MoveBox(entity, loginInfo, false);
|
||||||
|
if (!res_change.IsSuccess) isRollback = true;
|
||||||
//提交事务
|
//提交事务
|
||||||
isSuccess = _transactionRepositories.CommitTransaction(isRollback, _transaction);
|
isSuccess = _transactionRepositories.CommitTransaction(isRollback, _transaction);
|
||||||
if (!isSuccess)
|
if (!isSuccess)
|
||||||
|
|||||||
@@ -71,7 +71,8 @@ namespace WMS.Web.Domain.Services
|
|||||||
|
|
||||||
var outd = _mapper.Map<OutStockDetails>(tDetail);
|
var outd = _mapper.Map<OutStockDetails>(tDetail);
|
||||||
|
|
||||||
outd.Qty = outd.Qty + d.Qty;
|
outd.Qty = d.Qty;
|
||||||
|
outd.SerialNumbers = d.SerialNumbers;
|
||||||
entity.Details.Add(outd);
|
entity.Details.Add(outd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +86,8 @@ namespace WMS.Web.Domain.Services
|
|||||||
entity = await _outStockRepositories.Add(entity, false);
|
entity = await _outStockRepositories.Add(entity, false);
|
||||||
|
|
||||||
if (entity == null) isRollback = true;
|
if (entity == null) isRollback = true;
|
||||||
|
outStockTask = await _outStockTaskRepositories.Edit(outStockTask, false);
|
||||||
|
if (outStockTask == null) isRollback = true;
|
||||||
//提交事务
|
//提交事务
|
||||||
isSuccess = _transactionRepositories.CommitTransaction(isRollback, _transaction);
|
isSuccess = _transactionRepositories.CommitTransaction(isRollback, _transaction);
|
||||||
if (!isSuccess)
|
if (!isSuccess)
|
||||||
|
|||||||
@@ -94,15 +94,72 @@ namespace WMS.Web.Domain.Services
|
|||||||
return Result.ReSuccess();
|
return Result.ReSuccess();
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作序列号(出库操作)
|
/// 移箱
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="serialNumbers"></param>
|
/// <param name="moveBoxRecord"></param>
|
||||||
|
/// <param name="loginInfo"></param>
|
||||||
|
/// <param name="isTransaction"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Task<Result> OutStock(List<string> serialNumbers, bool isTransaction = true)
|
public async Task<Result> MoveBox(MoveBoxRecord moveBoxRecord, LoginInDto loginInfo, bool isTransaction = true)
|
||||||
|
{
|
||||||
|
//获取序列号信息
|
||||||
|
var entityList = await _serialNumbersRepositories.GetEntityListByBoxId(moveBoxRecord.BoxId);
|
||||||
|
var box = await _boxRepositories.Get(moveBoxRecord.BoxId);
|
||||||
|
var userName = _singleDataService.GetSingleData(SingleAction.Staffs, loginInfo.UserInfo.CompanyId, loginInfo.UserInfo.StaffId);
|
||||||
|
|
||||||
|
IDbContextTransaction _transaction = null;
|
||||||
|
if (isTransaction)
|
||||||
|
_transaction = _transactionRepositories.GetTransaction();
|
||||||
|
bool isRollback = false;
|
||||||
|
bool isSuccess = true;
|
||||||
|
List<SerialNumberOperate> sList = new List<SerialNumberOperate>();
|
||||||
|
foreach (var entity in entityList)
|
||||||
|
{
|
||||||
|
//修改序列号和箱绑定关系
|
||||||
|
entity.Operate(moveBoxRecord.BoxId);
|
||||||
|
|
||||||
|
//记录序列号操作日志
|
||||||
|
SerialNumberOperate op = new SerialNumberOperate()
|
||||||
|
{
|
||||||
|
MaterialId = entity.MaterialId,
|
||||||
|
SerialNumber = entity.SerialNumber,
|
||||||
|
OrgId = box.OrgId,
|
||||||
|
SupplierId = box.SupplierId,
|
||||||
|
OperateTime = DateTime.Now,
|
||||||
|
OperateType = SerialNumberOperateType.MoveBox,
|
||||||
|
OperateUser = userName,
|
||||||
|
Remark = "箱号:" + box.BoxBillNo
|
||||||
|
};
|
||||||
|
sList.Add(op);
|
||||||
|
}
|
||||||
|
isSuccess = await _serialNumbersRepositories.EditEntityList(entityList, false);
|
||||||
|
//序列号操作记录
|
||||||
|
var res = await this.SerialNumberOperate(sList, false);
|
||||||
|
//提交事务
|
||||||
|
if (isTransaction)
|
||||||
|
{
|
||||||
|
if (!isSuccess) isRollback = true;
|
||||||
|
if (!res.Success) isRollback = true;
|
||||||
|
isSuccess = _transactionRepositories.CommitTransaction(isRollback, _transaction);
|
||||||
|
if (!isSuccess)
|
||||||
|
return Result.ReFailure(ResultCodes.DateWriteError);
|
||||||
|
}
|
||||||
|
if (!isSuccess) return Result.ReFailure(ResultCodes.DateWriteError);
|
||||||
|
if (!res.Success) return Result.ReFailure(ResultCodes.DateWriteError);
|
||||||
|
|
||||||
|
return Result.ReSuccess();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 出库
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="outStock"></param>
|
||||||
|
/// <param name="loginInfo"></param>
|
||||||
|
/// <param name="isTransaction"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task<Result> OutStock(OutStock outStock, LoginInDto loginInfo, bool isTransaction = true)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 序列号操作记录日志
|
/// 序列号操作记录日志
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -106,6 +106,15 @@ namespace WMS.Web.Repositories
|
|||||||
return res.Clone();
|
return res.Clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<SerialNumbers>> GetEntityListByBoxId(int boxId)
|
||||||
|
{
|
||||||
|
var res = await _context.SerialNumbers
|
||||||
|
.Where(f => f.BoxId==boxId)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
return res.Clone();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据序列号
|
/// 根据序列号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user