Parcourir la source

资源检查入口获取ic_bom取数调整,物料库存表添加mongodbid

heteng il y a 3 ans
Parent
commit
f98be8bf8d

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

@@ -378,10 +378,10 @@ namespace Business.ResourceExamineManagement
             //数据库快照-同步mysql库数据到mongoDB中
             //await SyncData(input.tenantId, input.factoryId, bangid);
 
-            //通过订单行获取物料BOM数据
+            //通过订单行的产品代码获取物料BOM数据
             //FilterDefinition<ic_bom> filter = Builders<ic_bom>.Filter.In(s => s.bom_number, sentrys.Select(m => m.bom_number).ToList());
             //List<ic_bom> boms = _ic_bom.GetManyByIds(filter).Result.Where(p => p.factory_id == input.factoryId && p.tenant_id == input.tenantId && !p.IsDeleted).ToList();
-            List<ic_bom> boms = _ic_bom.Find(p=>sentrys.Select(m=>m.bom_number).Contains(p.bom_number) && p.factory_id == input.factoryId && p.tenant_id == input.tenantId && !p.IsDeleted).Result.ToList();
+            List<ic_bom> boms = _ic_bom.Find(p=>sentrys.Select(m=>m.item_number).Contains(p.item_number) && p.factory_id == input.factoryId && p.tenant_id == input.tenantId && !p.IsDeleted).Result.ToList();
             //通过物料id获取产品提前期
             List<ICItemLeadTimeDto> leadTimes = GetLeadTime(boms.Select(p => p.icitem_id).ToList(), input.tenantId, input.factoryId);
 
@@ -1269,7 +1269,7 @@ namespace Business.ResourceExamineManagement
             {
                 var seorderentry = _mysql_crm_seorderentry.FindAsync(x => x.Id == orderid).Result;
                 //生成自制工单
-                GenerateMorder(seorderentry, returnlist[0].lack_qty);
+                //GenerateMorder(seorderentry, returnlist[0].lack_qty);
             }
             foreach (var item in returnlist)
             {

+ 10 - 0
MicroServices/Business/Bussiness.Model/MES/IC/ic_item_stock.cs

@@ -1,6 +1,7 @@
 using Business.Core.Attributes;
 using Business.Model;
 using Microsoft.EntityFrameworkCore;
+using MongoDB.Bson.Serialization.Attributes;
 using System.ComponentModel;
 using System.ComponentModel.DataAnnotations;
 using System.ComponentModel.DataAnnotations.Schema;
@@ -50,5 +51,14 @@ namespace Bussiness.Model.MES.IC
         [Description("计算id")]
         [NotMapped]
         public long? bang_id { get; set; }
+
+        /// <summary>
+        /// mongodb主键-用于资源检查快照
+        /// </summary>
+        [Description("mongodb主键-用于资源检查快照")]
+        [NotMapped]
+        [BsonId]
+        [BsonRepresentation(MongoDB.Bson.BsonType.Int64)]
+        public long? mongodb_id { get; set; }
     }
 }