|
|
@@ -66,7 +66,7 @@ namespace Business.ResourceExamineManagement
|
|
|
/// <summary>
|
|
|
/// 检查在途订单
|
|
|
/// </summary>
|
|
|
- public List<mo_srm_po_occupy> CheckPurchaseOrder(crm_seorderentry seorderentry, long icitem_id, decimal Quantity, DateTime DeliverDate, ic_plan ic_Plan, long bang_id)
|
|
|
+ public List<mo_srm_po_occupy> CheckPurchaseOrder(crm_seorderentry seorderentry, long icitem_id, decimal Quantity, DateTime DeliverDate, ic_plan ic_Plan, long bang_id)
|
|
|
{
|
|
|
if (seorderentry == null)
|
|
|
{
|
|
|
@@ -75,9 +75,9 @@ namespace Business.ResourceExamineManagement
|
|
|
List<mo_srm_po_occupy> occupyList = new List<mo_srm_po_occupy>();
|
|
|
|
|
|
//查询出对应物料采购订单明细 --数据未被停用 && 评审通过后
|
|
|
- var poDetailList = _mo_srm_po_list.GetManyByCondition(x => x.icitem_id == icitem_id && x.state == 1 && x.rstate == 1).Result;
|
|
|
+ var poDetailList = _mo_srm_po_list.GetManyByCondition(x => x.icitem_id == icitem_id && x.state == 1 && x.rstate == 1).Result;
|
|
|
//采购订单占用数据
|
|
|
- var poOccupys = _mo_srm_po_occupy.GetManyByCondition(x => poDetailList.Select(p => p.id).ToList().Contains(x.polist_id.GetValueOrDefault())).Result;
|
|
|
+ var poOccupys = _mo_srm_po_occupy.GetManyByCondition(x => poDetailList.Select(p => p.id).ToList().Contains(x.polist_id.GetValueOrDefault())).Result;
|
|
|
//先查询出满足日期,并且数量可满足占用的数据
|
|
|
var poDetails = poDetailList.Where(x => x.rarrdate.GetValueOrDefault().AddDays(-(int)ic_Plan.self_inspection_date.GetValueOrDefault()) < DeliverDate && x.qty - x.rqty - x.esqty -
|
|
|
poOccupys.Where(p => p.polist_id.GetValueOrDefault() == x.mysql_id)?.Sum(m => m.qty) > Quantity).OrderByDescending(x => x.rarrdate).ToList();
|