测试
This commit is contained in:
@@ -23,6 +23,7 @@ using Org.BouncyCastle.Crypto;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -475,15 +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)}");
|
||||||
//先判断是否有存在使用的序列号,如果有的话,就报错。
|
//先判断是否有存在使用的序列号,如果有的话,就报错。
|
||||||
dto.ids = dto.ids.Distinct().ToList();
|
dto.ids = dto.ids.Distinct().ToList();
|
||||||
|
_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)}");
|
||||||
|
|
||||||
List<SerialNumbers> isUselist = await _serialNumbersRepositories.GetUseEntityListByGRIds(sAll);
|
List<SerialNumbers> isUselist = await _serialNumbersRepositories.GetUseEntityListByGRIds(sAll);
|
||||||
if(isUselist.Count>0)
|
_logger.LogInformation($"获取到:isUselist:{JsonConvert.SerializeObject(isUselist)}");
|
||||||
|
if (isUselist.Count>0)
|
||||||
{
|
{
|
||||||
|
|
||||||
//取出所有GenerateRecordId
|
//取出所有GenerateRecordId
|
||||||
@@ -491,16 +494,24 @@ namespace BarCode.Web.Domain.Services
|
|||||||
var GenerateRecordIdAll= isUselist.Select (s=>s.GenerateRecordId).ToList();
|
var GenerateRecordIdAll= isUselist.Select (s=>s.GenerateRecordId).ToList();
|
||||||
string spec = "";
|
string spec = "";
|
||||||
GenerateRecordIdAll.Distinct();
|
GenerateRecordIdAll.Distinct();
|
||||||
|
|
||||||
|
_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)}");
|
||||||
|
|
||||||
|
|
||||||
if (spec == "")
|
if (spec == "")
|
||||||
{
|
{
|
||||||
spec = y[0].Specifications;
|
spec = 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}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user