Explorar el Código

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

heteng hace 3 años
padre
commit
f8ebefd8e3

+ 4 - 0
MicroServices/Business/Business.Application/ResourceExamineManagement/CalcBomViewAppService.cs

@@ -89,6 +89,8 @@ namespace Business.ResourceExamineManagement
 
         Random rnd = new Random();
 
+        public decimal ProductionTimeDay;
+
         /// <summary>
         /// 构造函数
         /// </summary>
@@ -138,6 +140,7 @@ namespace Business.ResourceExamineManagement
         public void CalcView(List<BomChildExamineDto> returnlist, long bangid, decimal count, DateTime
             ? plan_date, List<mo_ic_item_stockoccupy> sklist, crm_seorderentry sentrys, List<mo_ic_item> icitemlist)
         {
+            ProductionTimeDay = 0;
             //第一级
             returnlist = returnlist.OrderBy(s => s.num_order).ToList();
             var level1Dto = returnlist[0];
@@ -309,6 +312,7 @@ namespace Business.ResourceExamineManagement
                         {
                             LeadTime = Day;
                         }
+                        ProductionTimeDay = LeadTime;
                         mes_Morders.moentry_sys_etime = mes_Morders.moentry_sys_stime.Value.AddDays((double)Day);
                         mes_Morders.morder_need_time = ProductiveDate;
                         //满足资源检查的时间需加上提前期

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

@@ -528,8 +528,8 @@ namespace Business.ResourceExamineManagement
 
                 //TODO:最晚开始时间
                 var curFacDtl = leadTimeList.FirstOrDefault(p => p.item_id == childBom.icitem_id);
-                //最晚开工时间=订单行客户要求交期-运输提前期-库存提前期-生产提前期-下单提前期
-                dtl.latest_times = item.plan_date.GetValueOrDefault().AddDays(-Convert.ToDouble(curFacDtl?.transportation_leadtime.GetValueOrDefault() + curFacDtl?.stock_leadtime.GetValueOrDefault() + curFacDtl?.production_leadtime.GetValueOrDefault() + curFacDtl?.order_leadtime.GetValueOrDefault()));
+                //最晚开工时间=订单行客户要求交期-运输提前期-库存提前期-生产提前期-下单提前期-生产时间
+                dtl.latest_times = item.plan_date.GetValueOrDefault().AddDays(-Convert.ToDouble(curFacDtl?.transportation_leadtime.GetValueOrDefault() + curFacDtl?.stock_leadtime.GetValueOrDefault() + curFacDtl?.production_leadtime.GetValueOrDefault() + curFacDtl?.order_leadtime.GetValueOrDefault() + _CalcBomViewAppService.ProductionTimeDay));
                 //物料齐套时间
                 dtl.kitting_times = getBomList.Where(p => p.is_use).OrderByDescending(m => m.kitting_time).First().kitting_time.GetValueOrDefault();
                 //替代关系展开list
@@ -705,8 +705,8 @@ namespace Business.ResourceExamineManagement
             }
             //清空快照数据
             await ClearSnapShot(bangid);
-            return JsonConvert.SerializeObject(rtn);
-
+            //return JsonConvert.SerializeObject(rtn);
+            return JsonConvert.SerializeObject("ok");
         }
 
         /// <summary>

+ 4 - 1
MicroServices/Business/Business.Host/Program.cs

@@ -4,6 +4,7 @@ using Business.Core.MongoDBHelper;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Hosting;
+using NLog;
 using NLog.Web;
 using Serilog;
 using Serilog.Events;
@@ -21,7 +22,9 @@ namespace Business
                 .AddEnvironmentVariables()
                 .Build();
             NLog.Extensions.Logging.ConfigSettingLayoutRenderer.DefaultConfiguration = configuration;
-
+            var appBasePath = System.IO.Directory.GetCurrentDirectory();
+            NLog.GlobalDiagnosticsContext.Set("appbasepath", appBasePath);
+            var logger = LogManager.LoadConfiguration("nlog.config").GetCurrentClassLogger();
             Log.Logger = new LoggerConfiguration()
 #if DEBUG
                 .MinimumLevel.Debug()

+ 3 - 3
MicroServices/Business/Business.Host/nlog.config

@@ -4,7 +4,7 @@
       autoReload="true"
 	  throwExceptions="true"
       internalLogLevel="Info"
-      internalLogFile="${basedir}/NLog/${date:format=yyyyMM}/Bussiness.txt">
+      internalLogFile="${gdc:item=appbasepath}\log\internal-nlog.txt">
 	<extensions>
 		<add assembly="NLog.Web.AspNetCore"/>
 	</extensions>
@@ -15,8 +15,8 @@
 		<!--把日志输出到控制台 -->
 		<target xsi:type="Console" name="lifetimeConsole" layout="${level:truncate=4:tolower=true}: ${logger}[0]${newline}      ${message}${exception:format=tostring}" />
 		<!-- 把日志记录到文件(通用) -->
-		<target xsi:type="File" name="allfile" fileName="${basedir}\..\Log\${date:format=yyyyMM}\${var:AppName}-all-${shortdate}.txt" encoding="UTF-8"
-            archiveFileName="${basedir}\..\Log\WMSAPI-all-${shortdate}.{#}.txt" archiveAboveSize="10485760"
+		<target xsi:type="File" name="allfile" fileName="${gdc:item=appbasepath}\logs\nlog-${shortdate}.log" encoding="UTF-8"
+            archiveFileName="${gdc:item=appbasepath}\logs\nlog-${shortdate}.{#}.log" archiveAboveSize="10485760"
             layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />
 		<!--把日志输出到数据库 -->
 		<target xsi:type="Database" name="database" dbProvider="MySqlConnector.MySqlConnection, MySqlConnector" connectionString="${configsetting:item=ConnectionStrings.DOPLog}">