Переглянути джерело

Merge branch 'dev' of http://123.60.180.165:4647/ZZYDOP/DOPCore into dev

Murphy 2 роки тому
батько
коміт
e4525ca615

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

@@ -221,9 +221,9 @@ namespace Business.ResourceExamineManagement
             level1Dto.self_lack_qty = level1Dto.lack_qty;
             level1Dto.self_lack_qty = level1Dto.lack_qty;
             
             
             level1Dto.is_use = true;
             level1Dto.is_use = true;
+            //获取物料详情
             if (level1Dto.lack_qty > 0)
             if (level1Dto.lack_qty > 0)
             {
             {
-                //获取物料详情
                 var ic_item = icitemlist.Find(s => s.mysql_id == level1Dto.item_id);
                 var ic_item = icitemlist.Find(s => s.mysql_id == level1Dto.item_id);
                 _morderAppService.mo_Mes_Morders = mordersList;//工单
                 _morderAppService.mo_Mes_Morders = mordersList;//工单
                 _morderAppService.mo_Mes_Moentry = moentriesList;//工单子表
                 _morderAppService.mo_Mes_Moentry = moentriesList;//工单子表
@@ -262,6 +262,12 @@ namespace Business.ResourceExamineManagement
                     level1Dto.lack_qty = 0;
                     level1Dto.lack_qty = 0;
                     level1Dto.satisfy_time = mooccupylist[0].moo_etime;
                     level1Dto.satisfy_time = mooccupylist[0].moo_etime;
                     level1Dto.kitting_time = level1Dto.satisfy_time;
                     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;
                     level1Dto.stock_state = 1;
                     return;
                     return;
                 }
                 }
@@ -380,6 +386,11 @@ namespace Business.ResourceExamineManagement
                 level1Dto.kitting_time = DateTime.Now;
                 level1Dto.kitting_time = DateTime.Now;
                 level1Dto.lack_qty = 0;
                 level1Dto.lack_qty = 0;
                 level1Dto.satisfy_time = DateTime.Now;
                 level1Dto.satisfy_time = DateTime.Now;
+                if (sentrys != null)
+                {
+                    //如果库存足够,则默认增加3天。
+                    sentrys.sys_capacity_date = level1Dto.satisfy_time.Value.AddDays(3);
+                }
                 level1Dto.stock_state = 1;
                 level1Dto.stock_state = 1;
                 return;
                 return;
             }
             }
@@ -467,12 +478,16 @@ namespace Business.ResourceExamineManagement
                         mes_Morders.moentry_sys_etime = LeadTime;
                         mes_Morders.moentry_sys_etime = LeadTime;
                         TimeSpan span = ProductiveDate - mes_Morders.moentry_sys_stime.Value;
                         TimeSpan span = ProductiveDate - mes_Morders.moentry_sys_stime.Value;
                         mes_Morders.morder_need_time = (decimal)span.TotalMinutes;*/
                         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>();
                     level1Dto.make_list = new List<moorder>();
@@ -896,6 +911,13 @@ namespace Business.ResourceExamineManagement
                     {
                     {
                         CalcIcitem(cilList, returnlist, bangid, sklist, plan_date, icitemlist, sentrys, childidList);
                         CalcIcitem(cilList, returnlist, bangid, sklist, plan_date, icitemlist, sentrys, childidList);
                         item.kitting_time = cilList.Max(s => s.kitting_time);
                         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);
                                 CalcIcitem(cilList, returnlist, bangid, sklist, plan_date, icitemlist, sentrys, childidList);
                                 sct.kitting_time = cilList.Max(s => s.kitting_time);
                                 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;
+                                    }
+                                }
                             }
                             }
                         }
                         }
                     }
                     }

+ 4 - 2
MicroServices/Business/Business.Application/ResourceExamineManagement/ResourceExamineAppService.cs

@@ -597,7 +597,9 @@ namespace Business.ResourceExamineManagement
         /// <returns></returns>
         /// <returns></returns>
         public async Task<string> receiveresultControllerApi(string companyid)
         public async Task<string> receiveresultControllerApi(string companyid)
         {
         {
-            var seorders = _mysql_crm_seorder.GetListAsync(s => s.company_id.ToString() == companyid).Result;
+            //获取订单行数据
+            var sentrys = await _mysql_crm_seorderentry.GetListAsync(p => (p.progress == "1" || p.progress == "2") && p.company_id.ToString() == companyid && !p.IsDeleted);
+            var seorders = _mysql_crm_seorder.GetListAsync(s => sentrys.Select(x => x.seorder_id.GetValueOrDefault()).Contains(s.Id) && s.company_id.ToString() == companyid).Result;
             string ids = string.Join(',', seorders.Select(x => x.Id));
             string ids = string.Join(',', seorders.Select(x => x.Id));
             var rtn = await ReceiveResult(ids, 0, companyid);
             var rtn = await ReceiveResult(ids, 0, companyid);
             if (rtn == "ok")
             if (rtn == "ok")
@@ -791,7 +793,7 @@ namespace Business.ResourceExamineManagement
                 }
                 }
             }
             }
             //计算订单行的建议交期(产能/物料)
             //计算订单行的建议交期(产能/物料)
-            CalcSuggestDate(sentrys, kittingTimes, icitemlist);
+            //CalcSuggestDate(sentrys, kittingTimes, icitemlist);
             examines.ForEach(p => {
             examines.ForEach(p => {
                 var sent = sentrys.Find(s => s.Id == p.sentry_id);
                 var sent = sentrys.Find(s => s.Id == p.sentry_id);
                 if (sent != null)
                 if (sent != null)

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Bang/b_bom_child_examine.cs

@@ -79,7 +79,7 @@ namespace Business.Domain
         /// 项次号
         /// 项次号
         /// </summary>
         /// </summary>
         [Comment("项次号")]
         [Comment("项次号")]
-        [StringLength(50)]
+        [StringLength(100)]
         public string num { get; set; }
         public string num { get; set; }
 
 
         /// <summary>
         /// <summary>

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Bang/b_bom_pretreatment.cs

@@ -85,7 +85,7 @@ namespace Business.Domain
         /// 项次号
         /// 项次号
         /// </summary>
         /// </summary>
         [Comment("项次号")]
         [Comment("项次号")]
-        [StringLength(20)]
+        [StringLength(100)]
         public string num { get; set; }
         public string num { get; set; }
 
 
         /// <summary>
         /// <summary>