修改序列号
This commit is contained in:
@@ -476,16 +476,17 @@ namespace BarCode.Web.Domain.Services
|
|||||||
public async Task<Result> TransferSn(TransferSNOneTwoTwoRequest dto)
|
public async Task<Result> TransferSn(TransferSNOneTwoTwoRequest dto)
|
||||||
{
|
{
|
||||||
|
|
||||||
_logger.LogInformation($"获取到:dto:{JsonConvert.SerializeObject(dto)}");
|
string strMes = "";
|
||||||
|
// _logger.LogInformation($"获取到:dto:{JsonConvert.SerializeObject(dto)}");
|
||||||
//先判断是否有存在使用的序列号,如果有的话,就报错。
|
//先判断是否有存在使用的序列号,如果有的话,就报错。
|
||||||
dto.ids = dto.ids.Distinct().ToList();
|
dto.ids = dto.ids.Distinct().ToList();
|
||||||
_logger.LogInformation($"获取到:dto.ids:{JsonConvert.SerializeObject(dto.ids)}");
|
// _logger.LogInformation($"获取到:dto.ids:{JsonConvert.SerializeObject(dto.ids)}");
|
||||||
var sAll = dto.ids.Select(s => s.Id).ToList();
|
var sAll = dto.ids.Select(s => s.Id).ToList();
|
||||||
|
|
||||||
_logger.LogInformation($"获取到:sAll:{JsonConvert.SerializeObject(sAll)}");
|
// _logger.LogInformation($"获取到:sAll:{JsonConvert.SerializeObject(sAll)}");
|
||||||
|
|
||||||
List<SerialNumbers> isUselist = await _serialNumbersRepositories.GetUseEntityListByGRIds(sAll);
|
List<SerialNumbers> isUselist = await _serialNumbersRepositories.GetUseEntityListByGRIds(sAll);
|
||||||
_logger.LogInformation($"获取到:isUselist:{JsonConvert.SerializeObject(isUselist)}");
|
// _logger.LogInformation($"获取到:isUselist:{JsonConvert.SerializeObject(isUselist)}");
|
||||||
if (isUselist.Count>0)
|
if (isUselist.Count>0)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -495,37 +496,37 @@ namespace BarCode.Web.Domain.Services
|
|||||||
string spec = "";
|
string spec = "";
|
||||||
GenerateRecordIdAll.Distinct();
|
GenerateRecordIdAll.Distinct();
|
||||||
|
|
||||||
_logger.LogInformation($"获取到:GenerateRecordIdAll:{JsonConvert.SerializeObject(GenerateRecordIdAll)}");
|
// _logger.LogInformation($"获取到:GenerateRecordIdAll:{JsonConvert.SerializeObject(GenerateRecordIdAll)}");
|
||||||
|
|
||||||
foreach (int g in GenerateRecordIdAll)
|
foreach (int g in GenerateRecordIdAll)
|
||||||
{
|
{
|
||||||
var y = dto.ids.Where(x => x.Id == g).ToList();
|
var y = dto.ids.Where(x => x.Id == g).ToList();
|
||||||
_logger.LogInformation($"获取到:y:{JsonConvert.SerializeObject(y)}");
|
// _logger.LogInformation($"获取到:y:{JsonConvert.SerializeObject(y)}");
|
||||||
|
|
||||||
|
|
||||||
if (spec == "")
|
if (spec == "")
|
||||||
{
|
{
|
||||||
spec = y[0].Specifications;
|
spec = y[0].Specifications;
|
||||||
_logger.LogInformation($"获取到:specA:{y[0].Specifications}");
|
// _logger.LogInformation($"获取到:specA:{y[0].Specifications}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
spec = spec + "," + y[0].Specifications;
|
spec = spec + "," + y[0].Specifications;
|
||||||
_logger.LogInformation($"获取到:spec:{spec}");
|
// _logger.LogInformation($"获取到:spec:{spec}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
strMes = spec;// + " 序列码存在已使用, 请选择未使用序列码的数据 !";
|
||||||
|
|
||||||
|
|
||||||
|
// ValueTuple<int, string> IsUseError = (70003, spec + " 序列码存在已使用, 请选择未使用序列码的数据 !");
|
||||||
ValueTuple<int, string> IsUseError = (70003, spec + " 序列码存在已使用, 请选择未使用序列码的数据 !");
|
// return Result.ReFailure(IsUseError);
|
||||||
|
|
||||||
return Result.ReFailure(IsUseError);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//取出所有的生成记录
|
//取出所有的生成记录
|
||||||
|
string specNum = "";
|
||||||
var generateRecords = await _sGenerateRecordRepositories.GetEntityList(sAll, "0");
|
var generateRecords = await _sGenerateRecordRepositories.GetEntityList(sAll, "0");
|
||||||
for (int i = 0; i < generateRecords.Count; i++)
|
for (int i = 0; i < generateRecords.Count; i++)
|
||||||
{
|
{
|
||||||
@@ -534,8 +535,37 @@ namespace BarCode.Web.Domain.Services
|
|||||||
|
|
||||||
if (result != 0)//
|
if (result != 0)//
|
||||||
{
|
{
|
||||||
return Result.ReFailure(ResultCodes.IsTwoError);
|
//说明这条记录是单数
|
||||||
|
var y = dto.ids.Where(x => x.Id == generateRecords[i].Id).ToList();
|
||||||
|
if (specNum == "")
|
||||||
|
{
|
||||||
|
specNum = y[0].Specifications;
|
||||||
|
// _logger.LogInformation($"获取到:specA:{y[0].Specifications}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
specNum = specNum + "," + y[0].Specifications;
|
||||||
|
// _logger.LogInformation($"获取到:spec:{spec}");
|
||||||
|
}
|
||||||
|
|
||||||
|
//return Result.ReFailure(ResultCodes.IsTwoError);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (strMes != "" && specNum != "")
|
||||||
|
{
|
||||||
|
ValueTuple<int, string> IsUseError = (70003, specNum + " 两件装产品,数量需填双数 " + strMes + " 序列码存在已使用, 请选择未使用序列码的数据 !");
|
||||||
|
return Result.ReFailure(IsUseError);
|
||||||
|
}
|
||||||
|
else if (specNum != "")
|
||||||
|
{
|
||||||
|
ValueTuple<int, string> strMesError = (70005, specNum + " 两件装产品,数量需填双数!");
|
||||||
|
return Result.ReFailure(strMesError);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (strMes != "")
|
||||||
|
{
|
||||||
|
ValueTuple<int, string> strMesError = (70004, strMes + " 序列码存在已使用, 请选择未使用序列码的数据 !");
|
||||||
|
return Result.ReFailure(strMesError);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace BarCode.Web.Domain.Values
|
|||||||
public static ValueTuple<int, string> NoDateError = (40005, "数据不存在");
|
public static ValueTuple<int, string> NoDateError = (40005, "数据不存在");
|
||||||
public static ValueTuple<int, string> NoOrgError = (40006, "组织信息不存在");
|
public static ValueTuple<int, string> NoOrgError = (40006, "组织信息不存在");
|
||||||
public static ValueTuple<int, string> IsTwoError = (70001, "两件装产品,数量需填双数");
|
public static ValueTuple<int, string> IsTwoError = (70001, "两件装产品,数量需填双数");
|
||||||
public static ValueTuple<int, string> IsZeroError = (70002, "数量不能为0");
|
public static ValueTuple<int, string> IsZeroError = (70002, "两件装产品,数量需填双数");
|
||||||
public static ValueTuple<int, string> IsUseError = (70003, "序列码存在已使用, 请选择未使用序列码的数据 !");
|
public static ValueTuple<int, string> IsUseError = (70003, "序列码存在已使用, 请选择未使用序列码的数据 !");
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 没有菜单权限,无法登录
|
/// 没有菜单权限,无法登录
|
||||||
|
|||||||
Reference in New Issue
Block a user