Murphy 2 лет назад
Родитель
Сommit
2649aa017d

+ 14 - 14
MicroServices/Business/Business.Application/ReplenishmentManagement/ReplenishmentAppService.cs

@@ -1816,7 +1816,7 @@ namespace Business.Replenishment
                     itemQty = Math.Max(itemMasterList.Find(a => a.ItemNum == itemSeq).MinOrdSales, itemQty.GetValueOrDefault());
                     var weekTime = GetNextMonday().AddDays(28);//增加四周
                     string kMonth = $"{weekTime.Year}-{weekTime.Month.ToString("00")}";
-                    var isexist=_mysql_mes_morder.GetListAsync(a => a.product_code == itemSeq && a.moentry_sys_etime.GetValueOrDefault().Year == weekTime.Year).Result;
+                    var isexist=_mysql_mes_morder.GetListAsync(a => a.product_code == itemSeq && a.moentry_sys_etime.Value.Year == weekTime.Year).Result;
                     if(isexist.Count==0)
                     {
                         var bom = bomList.Find(b => b.item_number == itemSeq);
@@ -1975,10 +1975,10 @@ namespace Business.Replenishment
                             if(k<=3)
                             {
                                 var MonthMo = moList.Find(a => a.product_code == itemSeq && (
-                                a.moentry_sys_etime == GetNextMonday().AddDays(28) ||
-                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 7) ||
-                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 14) ||
-                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 21)));
+                                a.moentry_sys_etime == GetNextMonday().AddDays(28).AddDays(-days) ||
+                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 7).AddDays(-days) ||
+                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 14).AddDays(-days) ||
+                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 21).AddDays(-days)));
                                 if (MonthMo != null)
                                 {
                                     MonthMo.morder_production_number += Math.Ceiling(itemQty.GetValueOrDefault() / 4);
@@ -2114,10 +2114,10 @@ namespace Business.Replenishment
                             else if(k<=7)
                             {
                                 var MonthMo = moList.Find(a => a.product_code == itemSeq && (
-                                a.moentry_sys_etime == GetNextMonday().AddDays(28+28) ||
-                                a.moentry_sys_etime == GetNextMonday().AddDays(28 +35) ||
-                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 42) ||
-                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 49)));
+                                a.moentry_sys_etime == GetNextMonday().AddDays(28+28).AddDays(-days) ||
+                                a.moentry_sys_etime == GetNextMonday().AddDays(28 +35).AddDays(-days) ||
+                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 42).AddDays(-days) ||
+                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 49).AddDays(-days)));
                                 if (MonthMo != null)
                                 {
                                     MonthMo.morder_production_number += Math.Ceiling(itemQty.GetValueOrDefault() / 4);
@@ -2253,10 +2253,10 @@ namespace Business.Replenishment
                             else
                             {
                                 var MonthMo = moList.Find(a => a.product_code == itemSeq && (
-                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 56) ||
-                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 63) ||
-                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 70) ||
-                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 77)));
+                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 56).AddDays(-days) ||
+                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 63).AddDays(-days) ||
+                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 70).AddDays(-days) ||
+                                a.moentry_sys_etime == GetNextMonday().AddDays(28 + 77).AddDays(-days)));
                                 if (MonthMo != null)
                                 {
                                     MonthMo.morder_production_number += Math.Ceiling(itemQty.GetValueOrDefault() / 4);
@@ -2804,7 +2804,7 @@ namespace Business.Replenishment
         private DateTime GetNextMonday()
         {
             var preSunday = DateTime.Now.AddDays(0 - Convert.ToInt16(DateTime.Now.DayOfWeek) - 7);//上周日
-            return preSunday.AddDays(8);//上周日加八天即为下周一
+            return Convert.ToDateTime(preSunday.AddDays(8).ToString("yyyy-MM-dd 00:00:00.000"));////上周日加八天即为下周一
         }
 
         public static int WeekOfMonth(DateTime day, int WeekStart)