齐套搭配方案,查询接口代码调整
This commit is contained in:
@@ -3,10 +3,11 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using JNPF.Common.Filter;
|
||||||
|
|
||||||
namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
||||||
{
|
{
|
||||||
public class MESCollocationSchemeQueryInput
|
public class MESCollocationSchemeQueryInput : PageInputBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 齐套出库主表
|
/// 齐套出库主表
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Org.BouncyCastle.Asn1.Mozilla;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Tnb.WarehouseMgr.Entities.Dto.Outputs
|
namespace Tnb.WarehouseMgr.Entities.Dto.Outputs
|
||||||
@@ -64,7 +65,12 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Outputs
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 齐套明细输出
|
/// 齐套明细输出
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public List<CollocationSchemeDOutput>? CollocationSchemeDs { get; set; }
|
public List<CollocationSchemeDOutput>? CollocationSchemeDs { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 齐套明细Json
|
||||||
|
/// </summary>
|
||||||
|
public string CollocationSchemeDsJson { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<WmsCollocationSchemeD>? list { get; set; }
|
public List<WmsCollocationSchemeD>? list { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,6 @@ namespace Tnb.WarehouseMgr.Interfaces
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<dynamic> MESCollocationSchemeQuery(MESCollocationSchemeQueryInput input);
|
Task<dynamic?> MESCollocationSchemeQuery(MESCollocationSchemeQueryInput input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using Aop.Api.Domain;
|
|||||||
using Aspose.Cells.Drawing;
|
using Aspose.Cells.Drawing;
|
||||||
using JNPF.Common.Dtos.VisualDev;
|
using JNPF.Common.Dtos.VisualDev;
|
||||||
using JNPF.Common.Extension;
|
using JNPF.Common.Extension;
|
||||||
|
using JNPF.Common.Filter;
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.FriendlyException;
|
using JNPF.FriendlyException;
|
||||||
@@ -15,6 +16,7 @@ using JNPF.VisualDev.Entitys;
|
|||||||
using JNPF.VisualDev.Interfaces;
|
using JNPF.VisualDev.Interfaces;
|
||||||
using Mapster;
|
using Mapster;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.WarehouseMgr.Entities;
|
using Tnb.WarehouseMgr.Entities;
|
||||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||||
@@ -89,25 +91,25 @@ namespace Tnb.WarehouseMgr
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
//[NonUnify]
|
//[NonUnify]
|
||||||
public async Task<dynamic> MESCollocationSchemeQuery(MESCollocationSchemeQueryInput input)
|
public async Task<dynamic?> MESCollocationSchemeQuery(MESCollocationSchemeQueryInput input)
|
||||||
{
|
{
|
||||||
if (input.IsNull()) throw new ArgumentNullException("input");
|
if (input.IsNull()) throw new ArgumentNullException("input");
|
||||||
var data = new List<CollocationSchemeOutput>();
|
SqlSugarPagedList<CollocationSchemeOutput> pageData = new();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
data = await _db.Queryable<WmsCollocationSchemeH>()
|
pageData = await _db.Queryable<WmsCollocationSchemeH>()
|
||||||
.Where(a => a.material_id == input.material_id)
|
.Where(a => a.material_id == input.material_id)
|
||||||
.Select(a => new CollocationSchemeOutput
|
.Select(a => new CollocationSchemeOutput
|
||||||
{
|
{
|
||||||
list = SqlFunc.Subqueryable<WmsCollocationSchemeD>().Where(b => b.bill_id == a.id).ToList(),
|
list = SqlFunc.Subqueryable<WmsCollocationSchemeD>().Where(b => b.bill_id == a.id).ToList(),
|
||||||
}, true)
|
}, true)
|
||||||
.Mapper(it => it.CollocationSchemeDs = it.list?.Adapt<List<CollocationSchemeDOutput>>())
|
.Mapper(it => it.CollocationSchemeDsJson = JsonConvert.SerializeObject(it.list))
|
||||||
.ToListAsync();
|
.ToPagedListAsync(input.currentPage, input.pageSize);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
return data;
|
return pageData == null ? Enumerable.Empty<dynamic>() : PageResult<CollocationSchemeOutput>.SqlSugarPageResult(pageData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -314,7 +314,6 @@ namespace Tnb.WarehouseMgr
|
|||||||
await _db.Updateable(curSortingDetails).ExecuteCommandAsync();
|
await _db.Updateable(curSortingDetails).ExecuteCommandAsync();
|
||||||
if (curSortingDetails.All(it => it.line_status == WmsWareHouseConst.BILLSTATUS_COMPLETE_ID))
|
if (curSortingDetails.All(it => it.line_status == WmsWareHouseConst.BILLSTATUS_COMPLETE_ID))
|
||||||
{
|
{
|
||||||
|
|
||||||
await _db.Updateable<WmsSetsortingH>().SetColumns(it => new WmsSetsortingH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync();
|
await _db.Updateable<WmsSetsortingH>().SetColumns(it => new WmsSetsortingH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == carryId);
|
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.id == carryId);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using System.Linq;
|
|||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Transactions;
|
||||||
using Aop.Api.Domain;
|
using Aop.Api.Domain;
|
||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
using JNPF.Common.Dtos.VisualDev;
|
using JNPF.Common.Dtos.VisualDev;
|
||||||
@@ -304,7 +305,7 @@ namespace Tnb.WarehouseMgr
|
|||||||
carrys.Add(carry);
|
carrys.Add(carry);
|
||||||
if (carrys?.Count > 0)
|
if (carrys?.Count > 0)
|
||||||
{
|
{
|
||||||
await _db.Ado.BeginTranAsync();
|
await _db.Ado.BeginTranAsync();
|
||||||
var tasks = new List<Task<int>>();
|
var tasks = new List<Task<int>>();
|
||||||
foreach (var carryIt in carrys)
|
foreach (var carryIt in carrys)
|
||||||
{
|
{
|
||||||
@@ -313,7 +314,9 @@ namespace Tnb.WarehouseMgr
|
|||||||
var all = await Task.WhenAll(tasks);
|
var all = await Task.WhenAll(tasks);
|
||||||
await _db.Ado.CommitTranAsync();
|
await _db.Ado.CommitTranAsync();
|
||||||
if (all.All(x => x > 0))
|
if (all.All(x => x > 0))
|
||||||
|
{
|
||||||
isOk = all?.Length > 0;
|
isOk = all?.Length > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
|
if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
|
||||||
|
|||||||
Reference in New Issue
Block a user