فهرست منبع

资源检查返回值调整

heteng 3 سال پیش
والد
کامیت
33ec3f71c7

+ 29 - 8
MicroServices/Business/Business.Application.Contracts/ResourceExamineManagement/Dto/PschedDto.cs

@@ -10,24 +10,45 @@ namespace Business.ResourceExamineManagement.Dto
     public class PschedDto
     {
         /// <summary>
-        /// 最早开工时间
+        /// 订单id
         /// </summary>
-        public DateTime EarliestTimes { get; set; }
+        public long? sorderid { get; set; }
 
         /// <summary>
-        /// 最晚开工时间
+        /// 订单行开工详细信息
         /// </summary>
-        public DateTime LatestTimes { get; set; }
+        public List<entryDtl> entryDtls { get; set; }
 
         /// <summary>
-        /// 物料齐套时间
+        /// 替代关系展开
         /// </summary>
-        public DateTime KittingTimes { get; set; }
+        public List<BomChildExamineDto> substitutes  { get; set; }
+
+    }
 
+    /// <summary>
+    /// 订单行开工详细信息
+    /// </summary>
+    public class entryDtl
+    {
         /// <summary>
-        /// 替代关系展开
+        /// 订单行id
         /// </summary>
-        public List<BomChildExamineDto> substitutes  { get; set; }
+        public long? sentry_id { get; set; }
 
+        /// <summary>
+        /// 最早开工时间
+        /// </summary>
+        public DateTime earliest_times { get; set; }
+
+        /// <summary>
+        /// 最晚开工时间
+        /// </summary>
+        public DateTime latest_times { get; set; }
+
+        /// <summary>
+        /// 物料齐套时间
+        /// </summary>
+        public DateTime kitting_times { get; set; }
     }
 }

+ 12 - 8
MicroServices/Business/Business.Application/ResourceExamineManagement/ResourceExamineAppService.cs

@@ -392,6 +392,10 @@ namespace Business.ResourceExamineManagement
         /// <exception cref="NotImplementedException"></exception>
         public async Task<PschedDto> ReceiveResult(SeorderentryDto input)
         {
+            //资源检查结果
+            PschedDto rtn = new PschedDto();
+            rtn.sorderid = input.sorderId; 
+
             //生成当前计算bangid
             SnowFlake snow = new SnowFlake();
             long bangid = snow.NextId();
@@ -404,12 +408,11 @@ namespace Business.ResourceExamineManagement
             }
             //获取订单行数据
             List<crm_seorderentry> sentrys = _mysql_crm_seorderentry.GetListAsync(p => p.tenant_id == input.tenantId && p.factory_id == input.factoryId && p.seorder_id == input.sorderId && p.IsDeleted == false).Result;
+            
+            //数据库快照-同步mysql库数据到mongoDB中
+            await SyncData(input.tenantId, input.factoryId, bangid);
 
-            string bom_number = "BOM00042070";
-            int packages = 1000;
-
-            input.tenantId = 102;
-            input.factoryId = 10201;
+            List<entryDtl> entryDtls = new List<entryDtl>();
 
             #region 
             var bomlist = _ic_bom.GetAll().Result;
@@ -427,13 +430,14 @@ namespace Business.ResourceExamineManagement
                 calcTest(getBomList, bangid, o.Id, o.qty.Value);
             }
             #endregion
+            rtn.entryDtls = entryDtls;
+            rtn.substitutes = null;
 
 
             //数据准备
             //await SaveChangesCompletedEventData()
 
-            //数据库快照-同步mysql库数据到mongoDB中
-            await SyncData(input.tenantId, input.factoryId, bangid);
+
 
             List<BomChildExamineDto> returnlist = new List<BomChildExamineDto>();
             BomChildExamineDto bomChild = new BomChildExamineDto();
@@ -458,7 +462,7 @@ namespace Business.ResourceExamineManagement
             CheckOnOrder(returnlist, 102, 10201, dateTime, bangid);
 
             //产能检查
-            await ProductiveExamine(bom_number, packages);
+            //await ProductiveExamine(bom_number, packages);
             //var id = Save(input.tenantId, input.factoryId);
             //await GenerateMorder(1736470478942093312);
             //var dateTime = DateTime.Parse("2021-09-03");