tangdi пре 2 година
родитељ
комит
c94dc3d8f8

+ 12 - 3
MicroServices/Business/Business.Application/ResourceExamineManagement/CalcBomViewAppService.cs

@@ -51,7 +51,7 @@ namespace Business.ResourceExamineManagement
         /// <summary>
         /// 是否正排
         /// </summary>
-        public bool IsStraight = true;
+        public bool IsStraight = false;
 
         /// <summary>
         /// 工单类型
@@ -449,7 +449,8 @@ namespace Business.ResourceExamineManagement
                     if (plan != null)
                     {
                         //减去提前期
-                        LeadTime = plan.self_inspection_date.GetValueOrDefault() + plan.Warehousing_date.GetValueOrDefault() + plan.Shipping_date.GetValueOrDefault();
+                        //LeadTime = plan.self_inspection_date.GetValueOrDefault() + plan.Warehousing_date.GetValueOrDefault() + plan.Shipping_date.GetValueOrDefault();
+                        LeadTime = plan.self_inspection_date.GetValueOrDefault() + plan.PurLT;
                     }
                     mes_Morders.moentry_sys_etime = plan_date.GetValueOrDefault().AddDays(-(int)Math.Ceiling(LeadTime));
 
@@ -461,6 +462,14 @@ namespace Business.ResourceExamineManagement
                         mes_Morders.moentry_sys_stime = childList.Max(s => s.kitting_time.GetValueOrDefault()).AddDays(1).Date;//数据齐套完成后隔天开始生产;
                         mes_Morders.moentry_sys_etime = mes_Morders.moentry_sys_stime.GetValueOrDefault().AddDays(make_time);
                     }
+                    if (mes_Morders.moentry_sys_etime < DateTime.Now.Date)
+                    {
+                        mes_Morders.moentry_sys_etime = DateTime.Now.Date;
+                    }
+                    if (mes_Morders.moentry_sys_stime < DateTime.Now.Date)
+                    {
+                        mes_Morders.moentry_sys_stime = DateTime.Now.Date;
+                    }
                     if (!string.IsNullOrEmpty(mes_Morders.bom_number))
                     {
                         mes_Morders.mat_start_date = childList.Max(s => s.kitting_time.GetValueOrDefault()).AddDays(1).Date;//数据齐套完成后隔天开始生产;
@@ -487,7 +496,7 @@ namespace Business.ResourceExamineManagement
                         mes_Morders.morder_need_time = (decimal)span.TotalMinutes;*/
                     }
                     //满足资源检查的时间需加上提前期
-                    level1Dto.satisfy_time = mes_Morders.moentry_sys_etime;
+                    level1Dto.satisfy_time = childList.Max(s => s.kitting_time.GetValueOrDefault()).AddDays(make_time).Date;
                     if (sentrys != null)
                     {
                         sentrys.sys_capacity_date = level1Dto.satisfy_time.GetValueOrDefault().AddDays(1);