更改了非采购上架

This commit is contained in:
2025-05-12 11:26:23 +08:00
parent bdfbd1468e
commit c447f4bbf3
8 changed files with 85 additions and 4 deletions

View File

@@ -227,6 +227,15 @@ namespace WMS.Web.Repositories.Configuration
(c1, c2) => c1.SequenceEqual(c2),
c => c.Aggregate(0, (a, v) => HashCode.Combine(a, v.GetHashCode())),
c => (List<string>)c.ToList()));
ent.Property(f => f.TwoSerialNumbers).HasConversion(
v => JsonConvert.SerializeObject(v),
v => JsonConvert.DeserializeObject<List<string>>(v),
new ValueComparer<List<string>>(
(c1, c2) => c1.SequenceEqual(c2),
c => c.Aggregate(0, (a, v) => HashCode.Combine(a, v.GetHashCode())),
c => (List<string>)c.ToList()));
});
builder.Entity<InStockErpDetails>(ent =>
{

View File

@@ -1,6 +1,7 @@
using AutoMapper;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;
using NPOI.POIFS.FileSystem;
using Org.BouncyCastle.Crypto;
using System;
using System.Collections.Generic;
@@ -153,6 +154,25 @@ namespace WMS.Web.Repositories
{
if (entitys != null && entitys.Count != 0)
{
// entitys[0].SerialNumbers = entitys[0].SerialNumbers.Add(entitys[0].TwoSerialNumbers);
//List<InStockTotalDetails> entitys2=new List<InStockTotalDetails>();
//for (int i = 0; i < entitys.Count; i++)
//{
// entitys[i].SerialNumbers = entitys[i].SerialNumbers.AddRange();
//}
//赋值序列号
entitys.ForEach(x =>
{
if (x.TwoSerialNumbers != null)
{
x.SerialNumbers.AddRange(x.TwoSerialNumbers);
}
});
await _context.InStockTotalDetails.AddRangeAsync(entitys);
await _context.SaveChangesAsync();
}