Просмотр исходного кода

交期处理、虚拟件调整。

tangdi 2 лет назад
Родитель
Сommit
2e56fbf263

+ 35 - 6
MicroServices/Business/Business.Application/ResourceExamineManagement/CalcBomViewAppService.cs

@@ -221,9 +221,9 @@ namespace Business.ResourceExamineManagement
             level1Dto.self_lack_qty = level1Dto.lack_qty;
             
             level1Dto.is_use = true;
+            //获取物料详情
             if (level1Dto.lack_qty > 0)
             {
-                //获取物料详情
                 var ic_item = icitemlist.Find(s => s.mysql_id == level1Dto.item_id);
                 _morderAppService.mo_Mes_Morders = mordersList;//工单
                 _morderAppService.mo_Mes_Moentry = moentriesList;//工单子表
@@ -262,6 +262,12 @@ namespace Business.ResourceExamineManagement
                     level1Dto.lack_qty = 0;
                     level1Dto.satisfy_time = mooccupylist[0].moo_etime;
                     level1Dto.kitting_time = level1Dto.satisfy_time;
+                    sentrys.sys_capacity_date = level1Dto.kitting_time.GetValueOrDefault().AddDays(1);
+                    if (ic_item != null)
+                    {
+                        double insLT = (double)Math.Ceiling(ic_item.self_inspection_date.GetValueOrDefault());
+                        sentrys.sys_capacity_date = sentrys.sys_capacity_date.GetValueOrDefault().AddDays(insLT);
+                    }
                     level1Dto.stock_state = 1;
                     return;
                 }
@@ -380,6 +386,11 @@ namespace Business.ResourceExamineManagement
                 level1Dto.kitting_time = DateTime.Now;
                 level1Dto.lack_qty = 0;
                 level1Dto.satisfy_time = DateTime.Now;
+                if (sentrys != null)
+                {
+                    //如果库存足够,则默认增加3天。
+                    sentrys.sys_capacity_date = level1Dto.satisfy_time.Value.AddDays(3);
+                }
                 level1Dto.stock_state = 1;
                 return;
             }
@@ -467,12 +478,16 @@ namespace Business.ResourceExamineManagement
                         mes_Morders.moentry_sys_etime = LeadTime;
                         TimeSpan span = ProductiveDate - mes_Morders.moentry_sys_stime.Value;
                         mes_Morders.morder_need_time = (decimal)span.TotalMinutes;*/
-
-                        //满足资源检查的时间需加上提前期
-                        level1Dto.satisfy_time = mes_Morders.moentry_sys_etime;
-                        if (sentrys != null)
+                    }
+                    //满足资源检查的时间需加上提前期
+                    level1Dto.satisfy_time = mes_Morders.moentry_sys_etime;
+                    if (sentrys != null)
+                    {
+                        sentrys.sys_capacity_date = level1Dto.satisfy_time.GetValueOrDefault().AddDays(1);
+                        if (plan != null)
                         {
-                            sentrys.sys_capacity_date = level1Dto.satisfy_time;
+                            double insLT = (double)Math.Ceiling(plan.self_inspection_date.GetValueOrDefault());
+                            sentrys.sys_capacity_date = sentrys.sys_capacity_date.GetValueOrDefault().AddDays(insLT);
                         }
                     }
                     level1Dto.make_list = new List<moorder>();
@@ -896,6 +911,13 @@ namespace Business.ResourceExamineManagement
                     {
                         CalcIcitem(cilList, returnlist, bangid, sklist, plan_date, icitemlist, sentrys, childidList);
                         item.kitting_time = cilList.Max(s => s.kitting_time);
+                        if (item.erp_cls == 4)
+                        {
+                            if (!cilList.Where(x => x.is_use == true && x.stock_state != 1).Any())
+                            {
+                                item.stock_state = 1;
+                            }
+                        }
                     }
                 }
             }
@@ -1429,6 +1451,13 @@ namespace Business.ResourceExamineManagement
                             {
                                 CalcIcitem(cilList, returnlist, bangid, sklist, plan_date, icitemlist, sentrys, childidList);
                                 sct.kitting_time = cilList.Max(s => s.kitting_time);
+                                if (sct.erp_cls == 4)
+                                {
+                                    if (!cilList.Where(x => x.is_use == true && x.stock_state != 1).Any())
+                                    {
+                                        sct.stock_state = 1;
+                                    }
+                                }
                             }
                         }
                     }

+ 1 - 1
MicroServices/Business/Business.Application/ResourceExamineManagement/ResourceExamineAppService.cs

@@ -793,7 +793,7 @@ namespace Business.ResourceExamineManagement
                 }
             }
             //计算订单行的建议交期(产能/物料)
-            CalcSuggestDate(sentrys, kittingTimes, icitemlist);
+            //CalcSuggestDate(sentrys, kittingTimes, icitemlist);
             examines.ForEach(p => {
                 var sent = sentrys.Find(s => s.Id == p.sentry_id);
                 if (sent != null)