出库单业务逻辑修改
This commit is contained in:
parent
4a66ac854e
commit
d0b7dae857
@ -18,6 +18,7 @@ using ZR.Service;
|
||||
using ZR.Service.Utils;
|
||||
using Aliyun.OSS;
|
||||
using Microsoft.AspNetCore.Hosting.Server;
|
||||
using System.Numerics;
|
||||
|
||||
namespace ZR.Service.mes.wms
|
||||
{
|
||||
@ -687,7 +688,7 @@ namespace ZR.Service.mes.wms
|
||||
// 5. 确保出最早批次
|
||||
string short_path = resultionPackage.PatchCode.Split('_')[0];
|
||||
// 严格规则
|
||||
return CheckRuleJudgmentFirstInFirstOut(shipment_num, short_path);
|
||||
return CheckRuleJudgmentFirstInFirstOut(shipment_num, short_path,parnumber);
|
||||
/*WmOutOrderPlan plan_item = Context.Queryable<WmOutOrderPlan>()
|
||||
.Where(it => it.FkOutOrderId == shipment_num)
|
||||
.Where(it => it.Patchcode == short_path)
|
||||
@ -764,7 +765,7 @@ namespace ZR.Service.mes.wms
|
||||
/// <param name="shortPackageCode">短批次号</param>
|
||||
/// <returns> "ok" 代表通过,其余返回错误提示</returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public string CheckRuleJudgmentFirstInFirstOut(string shipment_num, string shortPackageCode)
|
||||
public string CheckRuleJudgmentFirstInFirstOut(string shipment_num, string shortPackageCode,string parnumber)
|
||||
{
|
||||
// 1.检查是否有记录
|
||||
var exp1 = Expressionable.Create<WmOutOrderPlan>()
|
||||
@ -779,6 +780,8 @@ namespace ZR.Service.mes.wms
|
||||
return "此批次号不在出库单计划中!";
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 1.取出出库单计划
|
||||
List<WmOutOrderPlan> plans = Context.Queryable<WmOutOrderPlan>()
|
||||
.Where(it => it.FkOutOrderId == shipment_num)
|
||||
@ -786,6 +789,11 @@ namespace ZR.Service.mes.wms
|
||||
.ToList();
|
||||
foreach (WmOutOrderPlan plan in plans)
|
||||
{
|
||||
// 不是同零件号的跳过
|
||||
if (plan.MaterialCode != parnumber)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// 2.此出库单下的批次号的已出库记录
|
||||
var exp2 = Expressionable.Create<WmGoodsOutRecord>()
|
||||
.And(it => it.PackageCodeClient.Contains(plan.Patchcode))
|
||||
@ -804,6 +812,7 @@ namespace ZR.Service.mes.wms
|
||||
// 按顺序检查是否出完
|
||||
if (plan.Patchcode != shortPackageCode)
|
||||
{
|
||||
|
||||
// 检查此批次是否出完
|
||||
if (outPartnumberNum >= plan.RequireNum)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user