修改序列号拦截
This commit is contained in:
@@ -1332,6 +1332,13 @@
|
||||
<member name="M:BarCode.Web.Domain.Infrastructure.ISerialNumbersRepositories.GetEntityListByGRIds(System.Collections.Generic.List{System.Int32})">
|
||||
根据套装码查询序列码
|
||||
</member>
|
||||
<member name="M:BarCode.Web.Domain.Infrastructure.ISerialNumbersRepositories.GetUseEntityListByGRIds(System.Collections.Generic.List{System.Int32})">
|
||||
<summary>
|
||||
获取已经使用的序列号
|
||||
</summary>
|
||||
<param name="gRIds"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:BarCode.Web.Domain.Infrastructure.ISerialNumbersRepositories.GetEntityListByGRId(System.Int32)">
|
||||
根据生成记录id查询序列码
|
||||
</member>
|
||||
|
||||
@@ -42,6 +42,13 @@ namespace BarCode.Web.Domain.Infrastructure
|
||||
Task<List<SerialNumbers>> GetEntityListBySuitNumber(string suitNumber);
|
||||
/// 根据套装码查询序列码
|
||||
Task<List<SerialNumbers>> GetEntityListByGRIds(List<int> gRIds);
|
||||
/// <summary>
|
||||
/// 获取已经使用的序列号
|
||||
/// </summary>
|
||||
/// <param name="gRIds"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<SerialNumbers>> GetUseEntityListByGRIds(List<int> gRIds);
|
||||
|
||||
/// 根据生成记录id查询序列码
|
||||
Task<List<SerialNumbers>> GetEntityListByGRId(int gRId);
|
||||
/// 根据箱号查询序列码
|
||||
|
||||
@@ -473,6 +473,15 @@ namespace BarCode.Web.Domain.Services
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<Result> TransferSn(TransferSNOneTwoTwoRequest dto)
|
||||
{
|
||||
|
||||
//先判断是否有存在使用的序列号,如果有的话,就报错。
|
||||
List<SerialNumbers> isUselist = await _serialNumbersRepositories.GetUseEntityListByGRIds(dto.ids);
|
||||
if(isUselist.Count>0)
|
||||
{
|
||||
return Result.ReFailure(ResultCodes.IsUseError);
|
||||
}
|
||||
|
||||
|
||||
//取出所有的生成记录
|
||||
var generateRecords = await _sGenerateRecordRepositories.GetEntityList(dto.ids, "0");
|
||||
for (int i = 0; i < generateRecords.Count; i++)
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace BarCode.Web.Domain.Values
|
||||
public static ValueTuple<int, string> NoOrgError = (40006, "组织信息不存在");
|
||||
public static ValueTuple<int, string> IsTwoError = (70001, "两件装产品,数量需填双数");
|
||||
public static ValueTuple<int, string> IsZeroError = (70002, "数量不能为0");
|
||||
public static ValueTuple<int, string> IsUseError = (70003, "序列码存在已使用, 请选择未使用序列码的数据 !");
|
||||
/// <summary>
|
||||
/// 没有菜单权限,无法登录
|
||||
/// </summary>
|
||||
|
||||
@@ -224,6 +224,19 @@ namespace BarCode.Web.Repositories
|
||||
.Where(f => gRIds.Contains(f.GenerateRecordId))
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据生成记录Id查询序列号
|
||||
/// </summary>
|
||||
/// <param name="gRIds"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<SerialNumbers>> GetUseEntityListByGRIds(List<int> gRIds)
|
||||
{
|
||||
return await _context.SerialNumbers.AsNoTracking()
|
||||
.Where(f => gRIds.Contains(f.GenerateRecordId) && f.IsUse==true)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据生成记录Id查询序列号
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user