改箱服务调整
This commit is contained in:
@@ -45,25 +45,31 @@ namespace WMS.Web.Repositories
|
||||
/// </summary>
|
||||
/// <param name="BoxBillNo"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<BoxDetailResponse>> GetDetails(string BoxBillNo)
|
||||
public async Task<BoxResponse> GetBox(string BoxBillNo)
|
||||
{
|
||||
return await _context.BoxDetails
|
||||
.GroupJoin(_context.Box, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
|
||||
.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
|
||||
.Where(w => w.order.BoxBillNo.Equals(BoxBillNo))
|
||||
.Select(s => new BoxDetailResponse()
|
||||
{
|
||||
Fid = s.detail.Fid,
|
||||
BoxId = s.order.OpsBoxId,
|
||||
MaterialId = s.detail.MaterialId,
|
||||
MaterialName = "",
|
||||
MaterialNumber = "",
|
||||
Specifications = "",
|
||||
SerialNumbers = s.detail.SerialNumbers,
|
||||
SupplierId = s.detail.SupplierId,
|
||||
Qty = s.detail.Qty
|
||||
})
|
||||
.ToListAsync();
|
||||
var entity = await _context.Box.FirstOrDefaultAsync(f => f.BoxBillNo.Equals(BoxBillNo));
|
||||
if (entity == null) return null;
|
||||
BoxResponse result = new BoxResponse()
|
||||
{
|
||||
Id = entity.Id,
|
||||
BoxId = entity.OpsBoxId
|
||||
};
|
||||
result.Details = await _context.BoxDetails
|
||||
.GroupJoin(_context.Box, detail => detail.Fid, order => order.Id, (detail, orders) => new { detail, orders })
|
||||
.SelectMany(x => x.orders.DefaultIfEmpty(), (p, order) => new { p.detail, order })
|
||||
.Where(w => w.order.BoxBillNo.Equals(BoxBillNo))
|
||||
.Select(s => new BoxDetailResponse()
|
||||
{
|
||||
MaterialId = s.detail.MaterialId,
|
||||
MaterialName = "",
|
||||
MaterialNumber = "",
|
||||
Specifications = "",
|
||||
SerialNumbers = s.detail.SerialNumbers,
|
||||
SupplierId = s.detail.SupplierId,
|
||||
Qty = s.detail.Qty
|
||||
})
|
||||
.ToListAsync();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging.Debug;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using WMS.Web.Domain.Entitys;
|
||||
using WMS.Web.Repositories.Configuration.Log;
|
||||
|
||||
@@ -35,6 +37,10 @@ namespace WMS.Web.Repositories.Configuration
|
||||
{
|
||||
ent.ToTable("t_wms_changebox_record");
|
||||
ent.HasKey(x => x.Id);
|
||||
|
||||
ent.Property(f => f.SerialNumbers).HasConversion(
|
||||
v => JsonConvert.SerializeObject(v),
|
||||
v => JsonConvert.DeserializeObject<List<string>>(v));
|
||||
});
|
||||
//移箱
|
||||
builder.Entity<MoveBoxRecord>(ent =>
|
||||
@@ -197,6 +203,10 @@ namespace WMS.Web.Repositories.Configuration
|
||||
{
|
||||
ent.ToTable("t_ops_box_details");
|
||||
ent.HasKey(x => x.Id);
|
||||
|
||||
ent.Property(f => f.SerialNumbers).HasConversion(
|
||||
v => JsonConvert.SerializeObject(v),
|
||||
v => JsonConvert.DeserializeObject<List<string>>(v));
|
||||
});
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user