根据id获取组织扩展属性接口
This commit is contained in:
@@ -1041,23 +1041,23 @@ namespace Tnb.ProductionMgr
|
||||
var list = await db.Queryable<PrdMoTask>().Where(it => input.TaskIds.Contains(it.id)).Select(it => it).ToListAsync();
|
||||
if (behavior == PrdTaskBehavior.Compled)
|
||||
{
|
||||
if (list?.Count > 0)
|
||||
{
|
||||
// var schedQtySum = list.Sum(x => x.scheduled_qty);
|
||||
// var planQtySum = list.Sum(x => x.plan_qty);
|
||||
// if (schedQtySum < planQtySum)
|
||||
// {
|
||||
// throw new AppFriendlyException("任务数量必须大于等于生产计划数量,才可完成", 500);
|
||||
// }
|
||||
|
||||
int reportedWorkQty = list.Sum(x => x.reported_work_qty) ?? 0;
|
||||
int scrapQty = list.Sum(x => x.scrap_qty) ?? 0;
|
||||
int scheduledQty = list.Sum(x => x.scheduled_qty) ?? 0;
|
||||
if (scheduledQty >= reportedWorkQty+scrapQty)
|
||||
{
|
||||
throw new AppFriendlyException("已完成数量大于等于任务单数量,才可完成", 500);
|
||||
}
|
||||
}
|
||||
// if (list?.Count > 0)
|
||||
// {
|
||||
// // var schedQtySum = list.Sum(x => x.scheduled_qty);
|
||||
// // var planQtySum = list.Sum(x => x.plan_qty);
|
||||
// // if (schedQtySum < planQtySum)
|
||||
// // {
|
||||
// // throw new AppFriendlyException("任务数量必须大于等于生产计划数量,才可完成", 500);
|
||||
// // }
|
||||
//
|
||||
// int reportedWorkQty = list.Sum(x => x.last_process_complete_qty) ?? 0;
|
||||
// int scrapQty = list.Sum(x => x.scrap_qty) ?? 0;
|
||||
// int scheduledQty = list.Sum(x => x.scheduled_qty) ?? 0;
|
||||
// if (scheduledQty >= reportedWorkQty+scrapQty)
|
||||
// {
|
||||
// throw new AppFriendlyException("已完成数量大于等于任务单数量,才可完成", 500);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
var taskReportLogs = new List<PrdMoTask>();
|
||||
|
||||
Reference in New Issue
Block a user