修复bug

This commit is contained in:
18942506660
2024-08-06 15:13:30 +08:00
parent d68792fd10
commit 27d8caaa49
5 changed files with 18 additions and 8 deletions

View File

@@ -88,6 +88,9 @@ namespace WMS.Web.Api.Controllers
[Route("hj")] [Route("hj")]
public async Task<string> TestHJ() public async Task<string> TestHJ()
{ {
// List<int> boxIds = new List<int>();
// boxIds.Add(5324);
//var b= await _inStockService.UnBind(boxIds, true);
//var b= await _boxService.Sync(null); //var b= await _boxService.Sync(null);
//var list = await _outStockTaskRepositories.GetEntityList(new List<int> { 14321 }); //var list = await _outStockTaskRepositories.GetEntityList(new List<int> { 14321 });

View File

@@ -134,6 +134,6 @@ namespace WMS.Web.Domain.Infrastructure
/// </summary> /// </summary>
/// <param name="boxIds"></param> /// <param name="boxIds"></param>
/// <returns></returns> /// <returns></returns>
Task<List<InStockDetails>> GetListBy(List<int> boxIds); Task<List<InStock>> GetListBy(List<int> boxIds);
} }
} }

View File

@@ -4,6 +4,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Newtonsoft.Json; using Newtonsoft.Json;
using Npoi.Mapper;
using StackExchange.Redis; using StackExchange.Redis;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
@@ -1135,7 +1136,9 @@ namespace WMS.Web.Domain.Services
var list = await _inStockRepositories.GetListBy(t_boxIds); var list = await _inStockRepositories.GetListBy(t_boxIds);
//解绑 //解绑
list.ForEach(x => { x.UnBind = true; }); list.SelectMany(s => s.Details)
.Where(w => t_boxIds.Contains(w.BoxId))
.ForEach(f => f.UnBind = true);
if (list.Count != 0) if (list.Count != 0)
{ {

View File

@@ -1,6 +1,7 @@
using AutoMapper; using AutoMapper;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Storage;
using Org.BouncyCastle.Crypto;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -502,12 +503,15 @@ namespace WMS.Web.Repositories
.Where(x => boxIds.Contains(x.detail.BoxId) && x.order.Type != InstockType.Purchase && (x.detail.UnBind == null || x.detail.UnBind == false)).Select(s => s.detail.BoxId).ToListAsync(); .Where(x => boxIds.Contains(x.detail.BoxId) && x.order.Type != InstockType.Purchase && (x.detail.UnBind == null || x.detail.UnBind == false)).Select(s => s.detail.BoxId).ToListAsync();
} }
public async Task<List<InStockDetails>> GetListBy(List<int> boxIds) public async Task<List<InStock>> GetListBy(List<int> boxIds)
{ {
var entitys = await _context.InStockDetails.AsNoTracking() var res = await _context.Instock
.Where(x => boxIds.Contains(x.BoxId) && (x.UnBind == null || x.UnBind == false)) .Include(s => s.Details)
.Include(s => s.ErpDetails)
.Where(f => f.Details.Where(w => boxIds.Contains(w.BoxId)).Count() > 0)
.ToListAsync(); .ToListAsync();
return entitys;
return res.Clone();
} }
} }
} }