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

添加工序已准备时长记录

heteng 2 лет назад
Родитель
Сommit
022ce5e007

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

@@ -4553,12 +4553,12 @@ namespace Business.ResourceExamineManagement
         public async Task<string> ProductionSchedule(string domain)
         {
             //获取需要排产的工单(获取四周的工单:正常工单+已审批通过的特殊工单)
-            DateTime endDate = DateTime.Now.Date.AddDays(118).AddDays(1);
+            DateTime endDate = DateTime.Now.Date.AddDays(28).AddDays(1);
             //取数开始时间为当前天的下一天
-            DateTime startDate = DateTime.Now.Date.AddDays(1);
+            DateTime startTime = DateTime.Now;
             //尚未开始生产的工单+正在生产的工单
-            var workOrds = _workOrdMaster.Select(p => p.IsActive && p.Domain == domain && ((p.OrdDate < endDate && p.OrdDate >= startDate && (string.IsNullOrEmpty(p.Typed) || (!string.IsNullOrEmpty(p.Typed) && p.Typed.ToUpper() != "PW" && p.BusinessID > 0))) || p.Status.ToLower() == "w")).ToList();
-            string result = await _productionScheduleAppService.DoProductSchedule(workOrds, domain, 2);
+            var workOrds = _workOrdMaster.Select(p => p.IsActive && p.Domain == domain && ((p.OrdDate < endDate && p.OrdDate >= startTime && (string.IsNullOrEmpty(p.Typed) || (!string.IsNullOrEmpty(p.Typed) && p.Typed.ToUpper() != "PW" && p.BusinessID > 0))) || p.Status.ToLower() == "w")).ToList();
+            string result = await _productionScheduleAppService.DoProductSchedule(startTime,workOrds, domain, 2);
             return result;
         }
 
@@ -4583,13 +4583,13 @@ namespace Business.ResourceExamineManagement
             //获取需要排产的工单(获取四周的工单:正常工单+已审批通过的特殊工单)
             DateTime endDate = DateTime.Now.Date.AddDays(28).AddDays(1);
             //取数开始时间为当前天的下一天
-            DateTime startDate = DateTime.Now.Date.AddDays(1);
+            DateTime startTime = DateTime.Now;
             //尚未开始生产的工单+正在生产的工单
-            var workOrds = _workOrdMaster.Select(p => p.IsActive && p.Domain == input.domain && ((p.OrdDate < endDate && p.OrdDate >= startDate && (string.IsNullOrEmpty(p.Typed) || (!string.IsNullOrEmpty(p.Typed) && p.Typed.ToUpper() != "PW" && p.BusinessID > 0))) || p.Status.ToLower() == "w")).ToList();
+            var workOrds = _workOrdMaster.Select(p => p.IsActive && p.Domain == input.domain && ((p.OrdDate < endDate && p.OrdDate >= startTime && (string.IsNullOrEmpty(p.Typed) || (!string.IsNullOrEmpty(p.Typed) && p.Typed.ToUpper() != "PW" && p.BusinessID > 0))) || p.Status.ToLower() == "w")).ToList();
             //调用优先级计算算法
             workOrds = _replenishmentAppService.CalcPriority(workOrds.Select(p=>p.WorkOrd).ToList(), input.domain);
             //执行排产
-            string result = await _productionScheduleAppService.DoProductSchedule(workOrds, input.domain, 2);
+            string result = await _productionScheduleAppService.DoProductSchedule(startTime, workOrds, input.domain, 2);
             return result;
         }
 

+ 6 - 0
MicroServices/Business/Business.Domain/StructuredDB/Production/WorkOrdRouting.cs

@@ -134,5 +134,11 @@ namespace Business.Domain
         /// </summary>
         [Comment("报工批量")]
         public decimal? PackingQty { get; set; }
+
+        /// <summary>
+        /// 最新报工时间
+        /// </summary>
+        [Comment("最新报工时间")]
+        public DateTime? Last { get; set; }
     }
 }

+ 61 - 0
MicroServices/Business/Business.Domain/StructuredDB/Production/WorkOrdSetupTimeRecord.cs

@@ -0,0 +1,61 @@
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Business.StructuredDB.Production
+{
+    /// <summary>
+    /// 产线工序开始准备时间记录表
+    /// </summary>
+    [Comment("产线工序开始准备时间记录表")]
+    public class WorkOrdSetupTimeRecord
+    {
+        /// <summary>
+        /// 主键
+        /// </summary>
+        [Comment("主键")]
+        [Key]
+        public long RecID { get; set; }
+
+        /// <summary>
+        /// 域名
+        /// </summary>
+        [Comment("域名")]
+        public string Domain { get; set; }
+
+        /// <summary>
+        /// 工单编号
+        /// </summary>
+        [Comment("工单")]
+        public string WorkOrd { get; set; }
+
+        /// <summary>
+        /// 物料编码
+        /// </summary>
+        [Comment("物料编码")]
+        public string ItemNum { get; set; }
+
+        /// <summary>
+        /// 工序
+        /// </summary>
+        [Comment("工序")]
+        public int Op { get; set; }
+
+        /// <summary>
+        /// 开始准备时间
+        /// </summary>
+        [Comment("开始准备时间")]
+        public DateTime StartTime { get; set; }
+
+        /// <summary>
+        /// 创建时间
+        /// </summary>
+        [Comment("创建时间")]
+        public DateTime CreateTime { get; set; }
+
+    }
+}

+ 5 - 0
MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/DOP/BusinessDbContext.cs

@@ -54,6 +54,11 @@ namespace Business.EntityFrameworkCore
         /// </summary>
         public DbSet<ScheduleExceptionMaster> ScheduleExceptionMaster { get; set; }
 
+        /// <summary>
+        /// 产线工序开始准备时间记录表
+        /// </summary>
+        public DbSet<WorkOrdSetupTimeRecord> WorkOrdSetupTimeRecord { get; set; }
+
         #endregion
 
         #region Sale