收货时查找新建状态明细
This commit is contained in:
1 parent
a869449034
commit
eacc0551a2
5 files changed
+115
-73
No files matched your search
@@ -7,6 +7,7 @@ using HHWMS.Web.Models;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
@@ -132,11 +133,19 @@ namespace HHWMS.Web.Controllers
|
||||
[ActionDescription("Sys.Create")]
|
||||
public ActionResult CreateDetails(ReceiptDetailVM vm)
|
||||
{
|
||||
var header = _unitwork.FindSingle<ReceiptHeader>(x => x.ID == vm.Entity.ReceiptHeaderId);
|
||||
var header = _unitwork.Find<ReceiptHeader>(x => x.ID == vm.Entity.ReceiptHeaderId)
|
||||
.Include(x => x.ReceiptDetails)
|
||||
.FirstOrDefault();
|
||||
|
||||
if(header.FirstStatus != ReceiptStatusEnum.新建)
|
||||
{
|
||||
return FFResult().Alert("主单据不是新建状态,不能新建明细!");
|
||||
}
|
||||
|
||||
if (header.ReceiptDetails.Any(x => x.Status != ReceiptStatusEnum.新建))
|
||||
{
|
||||
return FFResult().Alert("主单据存在已入库的明细,不能新建明细!");
|
||||
}
|
||||
var plList = vm.Entity.MaterialCode.Split("\n");
|
||||
var slList = vm.Entity.Lot.Split("\n");
|
||||
var detailList = new List<ReceiptDetail>();
|
||||
@@ -168,7 +177,7 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
}
|
||||
var uniqueGroup = detailList.GroupBy(x => x.UniqueCode);
|
||||
|
||||
|
||||
if (uniqueGroup.Any(x => x.Count() > 1))
|
||||
{
|
||||
var codeList = uniqueGroup.Where(x => x.Count() > 1)
|
||||
|
||||
Reference in new issue
Block a user