Sfoglia il codice sorgente

调整优先级校验逻辑修改

Murphy 2 anni fa
parent
commit
d0cd7745b6

+ 8 - 3
MicroServices/Business/Business.Application/ReplenishmentManagement/ReplenishmentAppService.cs

@@ -4424,9 +4424,14 @@ namespace Business.Replenishment
                 long factoryid=Convert.ToInt64(factory_id);
                 long companyid=Convert.ToInt64(company_id);
                 var weekPlan=_replenishmentWeekPlan.FindAsync(a => a.Id == id && a.tenant_id == tenantid && a.factory_id == factoryid && a.company_id == companyid).Result;
-                var isExistSamePriority = _replenishmentWeekPlan.GetListAsync(a => a.Id != id && a.Week == weekPlan.Week && a.Priority == newpriority).Result;
-                if(isExistSamePriority.Any())
-                    return "优先级重复,请重新调整。";
+                //周计划没有生成周工单的不校验优先级重复
+                if(weekPlan!=null && !string.IsNullOrEmpty(weekPlan.ProductionOrder))
+                {
+                    var isExistSamePriority = _workOrdMaster.Select(a => a.WorkOrd !=weekPlan.ProductionOrder && (string.IsNullOrEmpty(a.Status) || a.Status.ToUpper()=="P") && a.Priority == newpriority);
+                    if (isExistSamePriority.Any())
+                        return "优先级重复,请重新调整。";
+                }
+                
 
                 weekPlan.Priority= newpriority;
                 weekPlan.Qty= newqty;