فهرست منبع

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

Murphy 2 سال پیش
والد
کامیت
b555326ab0
32فایلهای تغییر یافته به همراه150 افزوده شده و 144 حذف شده
  1. 1 1
      MicroServices/Business/Business.Application.Contracts/Dto/PlatformInventoryDto.cs
  2. 1 1
      MicroServices/Business/Business.Application.Contracts/ResourceExamineManagement/Dto/OrderCheckDto.cs
  3. 7 2
      MicroServices/Business/Business.Application.Contracts/ResourceExamineManagement/Dto/ResourceCheckInputDto.cs
  4. 2 2
      MicroServices/Business/Business.Application.Contracts/ResourceExamineManagement/Dto/SeorderentryDto.cs
  5. 6 6
      MicroServices/Business/Business.Application/ResourceExamineManagement/CalcBomViewAppService.cs
  6. 1 4
      MicroServices/Business/Business.Application/ResourceExamineManagement/MorderAppService.cs
  7. 1 1
      MicroServices/Business/Business.Application/ResourceExamineManagement/PurchaseOrderAppService.cs
  8. 63 65
      MicroServices/Business/Business.Application/ResourceExamineManagement/ResourceExamineAppService.cs
  9. 1 1
      MicroServices/Business/Business.Domain/MongoDB/Base/MoBaseEntity.cs
  10. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/Base/BaseEntity.cs
  11. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/MES/IC/ic_bom.cs
  12. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/MES/IC/ic_bom_child.cs
  13. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/MES/IC/ic_item.cs
  14. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/MES/IC/ic_item_stock.cs
  15. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/MES/IC/ic_item_stockoccupy.cs
  16. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/SRM/srm_po_list.cs
  17. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/SRM/srm_po_main.cs
  18. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/SRM/srm_pr_main.cs
  19. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/SRM/srm_purchase.cs
  20. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/SRM/srm_supplier.cs
  21. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/Sale/crm_customer.cs
  22. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/Sale/crm_seorder.cs
  23. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/Sale/crm_seorderentry.cs
  24. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/SaleFcst/DomesticTerminalFcst.cs
  25. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/SaleFcst/OverseasSaleFcst.cs
  26. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/SaleFcst/PlatformFcstCollect.cs
  27. 7 1
      MicroServices/Business/Business.Domain/StructuredDB/SaleFcst/StandardItemModelSet.cs
  28. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/SaleFcst/YearDemandManagement.cs
  29. 1 1
      MicroServices/Business/Business.Domain/StructuredDB/WMS/PlatformInventory.cs
  30. 30 30
      MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/BusinessDbContextModelCreatingExtensions.cs
  31. 9 9
      MicroServices/Business/Business.Host/BusinessHostModule.cs
  32. 2 2
      MicroServices/Business/Bussiness.ApplicationTest/ResourceExamineManagement/ResourceExamineAppService_Tests.cs

+ 1 - 1
MicroServices/Business/Business.Application.Contracts/Dto/PlatformInventoryDto.cs

@@ -30,6 +30,6 @@ namespace Business.Dto
         /// <summary>
         /// 有效期
         /// </summary>
-        public decimal? PeriodOfValidity { get; set; }
+        public DateTime? PeriodOfValidity { get; set; }
     }
 }

+ 1 - 1
MicroServices/Business/Business.Application.Contracts/ResourceExamineManagement/Dto/OrderCheckDto.cs

@@ -15,7 +15,7 @@ namespace Business.ResourceExamineManagement.Dto
         /// <summary>
         /// 企业id
         /// </summary>
-        public long tenantId { get; set; }
+        public long company_id { get; set; }
 
         /// <summary>
         /// 工厂id

+ 7 - 2
MicroServices/Business/Business.Application.Contracts/ResourceExamineManagement/Dto/ResourceCheckInputDto.cs

@@ -17,14 +17,19 @@ namespace Business.ResourceExamineManagement.Dto
         /// </summary>
         public List<long> sorderId { get; set; }
 
-        /// <summary>
+        /*/// <summary>
         /// 企业id
         /// </summary>
-        public long tenantId { get; set; }
+        public long tenantId { get; set; }*/
 
         /// <summary>
         /// 工厂id
         /// </summary>
         public long factoryId { get; set; }
+
+        /// <summary>
+        /// 企业id
+        /// </summary>
+        public long company_id { get; set; }
     }
 }

+ 2 - 2
MicroServices/Business/Business.Application.Contracts/ResourceExamineManagement/Dto/SeorderentryDto.cs

@@ -14,10 +14,10 @@ namespace Business.ResourceExamineManagement.Dto
         /// </summary>
         public long sorderId { get; set; }
 
-        /// <summary>
+        /*/// <summary>
         /// ×â»§id
         /// </summary>
-        public long tenantId { get; set; }
+        public long tenantId { get; set; }*/
 
         /// <summary>
         /// ¹¤³§id

+ 6 - 6
MicroServices/Business/Business.Application/ResourceExamineManagement/CalcBomViewAppService.cs

@@ -297,7 +297,7 @@ namespace Business.ResourceExamineManagement
                                     level1Dto.kitting_time = childList.Max(s => s.kitting_time);
                                 }
                                 //1.先生成委外工单。
-                                var mesorder = CreateMesOOder(level1Dto, param.tenantId, param.factoryId, bangid, leadTimeList, supplierList, plan_date.Value);
+                                var mesorder = CreateMesOOder(level1Dto, param.company_id, param.factoryId, bangid, leadTimeList, supplierList, plan_date.Value);
                                 level1Dto.subcontracting_qty = level1Dto.lack_qty;
                                 level1Dto.subcontracting_list = new List<ooder>();
                                 ooder oo = new ooder();
@@ -715,7 +715,7 @@ namespace Business.ResourceExamineManagement
                             item.kitting_time = cilList.Max(s => s.kitting_time);
                         }
                         //1.先生成委外工单。
-                        var mesorder = CreateMesOOder(item, param.tenantId, param.factoryId, bangid, leadTimeList, supplierList, plan_date.Value);
+                        var mesorder = CreateMesOOder(item, param.company_id, param.factoryId, bangid, leadTimeList, supplierList, plan_date.Value);
                         item.subcontracting_qty = item.lack_qty;
                         item.subcontracting_list = new List<ooder>();
                         ooder oo = new ooder();
@@ -1118,7 +1118,7 @@ namespace Business.ResourceExamineManagement
                                     sct.kitting_time = cilList.Max(s => s.kitting_time);
                                 }
                                 //1.先生成委外工单。
-                                var mesorder = CreateMesOOder(sct, param.tenantId, param.factoryId, bangid, leadTimeList, supplierList, plan_date.Value);
+                                var mesorder = CreateMesOOder(sct, param.company_id, param.factoryId, bangid, leadTimeList, supplierList, plan_date.Value);
                                 sct.subcontracting_qty = sct.lack_qty;
                                 sct.subcontracting_list = new List<ooder>();
                                 ooder oo = new ooder();
@@ -1231,7 +1231,7 @@ namespace Business.ResourceExamineManagement
                 srm_Pr.pr_type = orderType;//申请类型
                 srm_Pr.currencytype = x.currency_type == null ? 1 : x.currency_type.Value;//币种
                 srm_Pr.secInv_ratio = plan.secinv_ratio;//安全库存触发采购比例
-                srm_Pr.tenant_id = tenantId;
+                srm_Pr.company_id = tenantId;
                 srm_Pr.factory_id = factoryid;
                 srm_Pr.bang_id = bangId;
                 if (sentrys != null)
@@ -1313,7 +1313,7 @@ namespace Business.ResourceExamineManagement
             oOrder.production_unit = returnlist.unit;//加工单位
             oOrder.production_unit_code = "";//加工单位编码
             oOrder.need_icitem_status = 1;//所需物料是否充足  1-充足 0-缺料
-            oOrder.tenant_id = tenantId;
+            oOrder.company_id = tenantId;
             oOrder.factory_id = factoryid;
             oOrder.bang_id = bangId;
             oOrder.sentry_id = returnlist.sentry_id;
@@ -1367,7 +1367,7 @@ namespace Business.ResourceExamineManagement
         public void PackageSRMPR(BomChildExamineDto item,long bangid, crm_seorderentry sentrys)
         {
             //采购申请
-            var SRMPRDto = CreateSRMPR(item, param.tenantId, param.factoryId, bangid, item.erp_cls, leadTimeList, supplierList, ic_item_List, sentrys);
+            var SRMPRDto = CreateSRMPR(item, param.company_id, param.factoryId, bangid, item.erp_cls, leadTimeList, supplierList, ic_item_List, sentrys);
             item.purchase_list = new List<purchase>();
             if (SRMPRDto.srm_Pr_Main != null)
             {

+ 1 - 4
MicroServices/Business/Business.Application/ResourceExamineManagement/MorderAppService.cs

@@ -184,7 +184,6 @@ namespace Business.ResourceExamineManagement
             }
 
             mes_Morder.moentry_startup_status = 0;
-            mes_Morder.tenant_id = param.tenantId;
             mes_Morder.factory_id = param.factoryId;
             mes_Morder.company_id = param.company_id;
             mes_Morder.org_id = param.org_id;
@@ -219,7 +218,6 @@ namespace Business.ResourceExamineManagement
             mes_Moentry.morder_production_number = generateMorderDto.Quantity;
             mes_Moentry.need_number = generateMorderDto.Quantity;
             mes_Moentry.remaining_number = 0;
-            mes_Moentry.tenant_id = param.tenantId;
             mes_Moentry.factory_id = param.factoryId;
             mes_Moentry.company_id = param.company_id;
             mes_Moentry.org_id = param.org_id;
@@ -499,9 +497,8 @@ namespace Business.ResourceExamineManagement
             //mes_Mooccupy.moo_cbr = string.Empty;
             //mes_Mooccupy.moo_ctime = ;
             //mes_Mooccupy.moo_creason = string.Empty;
-            mes_Mooccupy.tenant_id = param.tenantId;//取销售子表企业ID
+            mes_Mooccupy.company_id = param.company_id;//取销售子表企业ID
             mes_Mooccupy.factory_id = param.factoryId;
-            mes_Mooccupy.company_id = param.company_id;
             mes_Mooccupy.org_id = param.org_id;
             return mes_Mooccupy;
         }

+ 1 - 1
MicroServices/Business/Business.Application/ResourceExamineManagement/PurchaseOrderAppService.cs

@@ -149,7 +149,7 @@ namespace Business.ResourceExamineManagement
             srm_Po_Occupy.stime = srm_po_list.create_time;
             srm_Po_Occupy.etime = srm_po_list.rarrdate;
             srm_Po_Occupy.state = 1;
-            srm_Po_Occupy.tenant_id = param.tenantId;//取销售子表企业ID
+            srm_Po_Occupy.company_id = param.company_id;//取销售子表企业ID
             srm_Po_Occupy.factory_id = param.factoryId;
             return srm_Po_Occupy;
         }

+ 63 - 65
MicroServices/Business/Business.Application/ResourceExamineManagement/ResourceExamineAppService.cs

@@ -564,11 +564,11 @@ namespace Business.ResourceExamineManagement
                     return "订单数据不存在";
                 }
             }
-            input.tenantId = sorders[0].tenant_id;
+            input.company_id = sorders[0].company_id;
             input.factoryId = sorders[0].factory_id.GetValueOrDefault();
 
             //资源检查入参全局变量赋值
-            param.tenantId = input.tenantId;
+            param.company_id = input.company_id;
             param.factoryId = input.factoryId;
             param.checkflag = true;
 
@@ -588,7 +588,7 @@ namespace Business.ResourceExamineManagement
             await DeleteMySqlOldData(sentrys);
 
             //通过订单行的产品代码获取物料BOM数据
-            List<mo_ic_bom> boms = _ic_bom.GetListAsync(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();
+            List<mo_ic_bom> boms = _ic_bom.GetListAsync(p => sentrys.Select(m => m.item_number).Contains(p.item_number) && p.factory_id == input.factoryId && p.company_id == input.company_id && !p.IsDeleted).Result.ToList();
             //物料信息
             List<mo_ic_item> icitemlist = new List<mo_ic_item>();
             //物料库存表
@@ -612,7 +612,7 @@ namespace Business.ResourceExamineManagement
             }
 
             //数据库快照-同步mysql库数据到mongoDB中
-            await DbSnapShot(input.tenantId, input.factoryId, bangid, pretreatments);
+            await DbSnapShot(input.company_id, input.factoryId, bangid, pretreatments);
 
             //记录订单行的物料齐套时间
             List<KittingTimeDto> kittingTimes = new List<KittingTimeDto>();
@@ -620,7 +620,7 @@ namespace Business.ResourceExamineManagement
             foreach (var sorder in sorders)
             {
                 param.sorderId = sorder.Id;
-                param.tenantId = input.tenantId;
+                param.company_id = input.company_id;
                 param.factoryId = input.factoryId;
                 //param.checkflag = true;
                 _morderAppService.param = param;
@@ -744,7 +744,7 @@ namespace Business.ResourceExamineManagement
                     }
                     if (_CalcBomViewAppService.mooccupyAllInsertList.Any())
                     {
-                        _CalcBomViewAppService.mooccupyAllInsertList.ForEach(s => { s.tenant_id = param.tenantId; s.factory_id = param.factoryId; });
+                        _CalcBomViewAppService.mooccupyAllInsertList.ForEach(s => { s.company_id = param.company_id; s.factory_id = param.factoryId; });
                         await _mes_mooccupy.InsertManyAsync(_CalcBomViewAppService.mooccupyAllInsertList);
                         /*var moOccupy = ObjectMapper.Map<List<mo_mes_mooccupy>, List<mes_mooccupy>>(_CalcBomViewAppService.mooccupyAllInsertList);
                         _businessDbContext.BulkInsert(moOccupy);*/
@@ -752,14 +752,14 @@ namespace Business.ResourceExamineManagement
                     }
                     if (_CalcBomViewAppService.moentriesInsertList.Any())
                     {
-                        _CalcBomViewAppService.moentriesInsertList.ForEach(s => { s.tenant_id = param.tenantId; s.factory_id = param.factoryId; });
+                        _CalcBomViewAppService.moentriesInsertList.ForEach(s => { s.company_id = param.company_id; s.factory_id = param.factoryId; });
                         await _mes_moentry.InsertManyAsync(_CalcBomViewAppService.moentriesInsertList);
                         /*var mesmoentrys = ObjectMapper.Map<List<mo_mes_moentry>, List<mes_moentry>>(_CalcBomViewAppService.moentriesInsertList);
                         _businessDbContext.BulkInsert(mesmoentrys);*/
                     }
                     if (_CalcBomViewAppService.orderList.Any())
                     {
-                        _CalcBomViewAppService.orderList.ForEach(s => { s.tenant_id = param.tenantId; s.factory_id = param.factoryId; });
+                        _CalcBomViewAppService.orderList.ForEach(s => { s.company_id = param.company_id; s.factory_id = param.factoryId; });
                         await _mes_oorder.InsertManyAsync(_CalcBomViewAppService.orderList);
                         /*var ooders = ObjectMapper.Map<List<mo_mes_oorder>, List<mes_oorder>>(_CalcBomViewAppService.orderList);
                         _businessDbContext.BulkInsert(ooders);*/
@@ -767,12 +767,12 @@ namespace Business.ResourceExamineManagement
                     }
                     if (_CalcBomViewAppService.newStockOccList.Any())
                     {
-                        _CalcBomViewAppService.newStockOccList.ForEach(s => {s.GenerateNewId(help.NextId()); s.tenant_id = param.tenantId; s.factory_id = param.factoryId; });
+                        _CalcBomViewAppService.newStockOccList.ForEach(s => {s.GenerateNewId(help.NextId()); s.company_id = param.company_id; s.factory_id = param.factoryId; });
                         await _ic_item_stockoccupy.InsertManyAsync(_CalcBomViewAppService.newStockOccList);
                     }
                     if (_CalcBomViewAppService.srm_Po_OccupiesInsert.Any())
                     {
-                        _CalcBomViewAppService.srm_Po_OccupiesInsert.ForEach(s => { s.tenant_id = param.tenantId; s.factory_id = param.factoryId; });
+                        _CalcBomViewAppService.srm_Po_OccupiesInsert.ForEach(s => { s.company_id = param.company_id; s.factory_id = param.factoryId; });
                         await _srm_po_occupy.InsertManyAsync(_CalcBomViewAppService.srm_Po_OccupiesInsert);
                         /*var poOccupies = ObjectMapper.Map<List<mo_srm_po_occupy>, List<srm_po_occupy>>(_CalcBomViewAppService.srm_Po_OccupiesInsert);
                         _businessDbContext.BulkInsert(poOccupies);*/
@@ -818,7 +818,7 @@ namespace Business.ResourceExamineManagement
                     }
                 }
                 b_ex.create_time = DateTime.Now;
-                b_ex.tenant_id = param.tenantId;
+                b_ex.company_id = param.company_id;
                 b_ex.factory_id = param.factoryId;
                 examineList.Add(b_ex);
                 ex.BomChildExamineList.ForEach(s =>
@@ -826,7 +826,7 @@ namespace Business.ResourceExamineManagement
                     var bc_ex = ObjectMapper.Map<BomChildExamineDto, b_bom_child_examine>(s);
                     bc_ex.GenerateNewId(help.NextId());
                     bc_ex.examine_id = b_ex.Id;
-                    bc_ex.tenant_id = param.tenantId;
+                    bc_ex.company_id = param.company_id;
                     bc_ex.factory_id = param.factoryId;
                     bc_ex.create_time = DateTime.Now;
                     bomExamineList.Add(bc_ex);
@@ -836,7 +836,7 @@ namespace Business.ResourceExamineManagement
                         var olist = ObjectMapper.Map<List<mo_occupy>, List<b_mo_occupy>>(s.mo_occupy_list);
                         olist.ForEach(o =>
                         {
-                            o.bom_child_examine_id = bc_ex.Id; o.tenant_id = param.tenantId;
+                            o.bom_child_examine_id = bc_ex.Id; o.company_id = param.company_id;
                             o.factory_id = param.factoryId;
                         });
                         mooccupyList.AddRange(olist);
@@ -846,7 +846,7 @@ namespace Business.ResourceExamineManagement
                         var mlist = ObjectMapper.Map<List<moorder>, List<b_mo_order>>(s.make_list);
                         mlist.ForEach(o =>
                         {
-                            o.bom_child_examine_id = bc_ex.Id; o.tenant_id = param.tenantId;
+                            o.bom_child_examine_id = bc_ex.Id; o.company_id = param.company_id;
                             o.factory_id = param.factoryId;
                         });
                         moorderList.AddRange(mlist);
@@ -856,7 +856,7 @@ namespace Business.ResourceExamineManagement
                         var slist = ObjectMapper.Map<List<ooder>, List<b_ooder>>(s.subcontracting_list);
                         slist.ForEach(o =>
                         {
-                            o.bom_child_examine_id = bc_ex.Id; o.tenant_id = param.tenantId;
+                            o.bom_child_examine_id = bc_ex.Id; o.company_id = param.company_id;
                             o.factory_id = param.factoryId;
                         });
                         ooderList.AddRange(slist);
@@ -866,7 +866,7 @@ namespace Business.ResourceExamineManagement
                         var plist = ObjectMapper.Map<List<purchase>, List<b_purchase>>(s.purchase_list);
                         plist.ForEach(o =>
                         {
-                            o.bom_child_examine_id = bc_ex.Id; o.tenant_id = param.tenantId;
+                            o.bom_child_examine_id = bc_ex.Id; o.company_id = param.company_id;
                             o.factory_id = param.factoryId;
                         });
                         purchaseList.AddRange(plist);
@@ -876,7 +876,7 @@ namespace Business.ResourceExamineManagement
                         var purlist = ObjectMapper.Map<List<purchase_occupy>, List<b_purchase_occupy>>(s.purchase_occupy_list);
                         purlist.ForEach(o =>
                         {
-                            o.bom_child_examine_id = bc_ex.Id; o.tenant_id = param.tenantId;
+                            o.bom_child_examine_id = bc_ex.Id; o.company_id = param.company_id;
                             o.factory_id = param.factoryId;
                         });
                         purchaseoccupyList.AddRange(purlist);
@@ -1241,7 +1241,7 @@ namespace Business.ResourceExamineManagement
                 List<srm_supplier> itemsupplierList = _mysql_srm_supplier.GetListAsync(s => prlist.Select(c => c.pr_purchaseid).Contains(s.Id)).Result;
                 List<ic_item> ic_Items = _mysql_ic_item.GetListAsync(s => prlist.Select(c => c.icitem_id).Contains(s.Id)).Result;
                 PoActionListDto poaction = new PoActionListDto();
-                param.tenantId = prlist[0].tenant_id;
+                param.company_id = prlist[0].company_id;
                 param.factoryId = prlist[0].factory_id.GetValueOrDefault();
                 AutoCreatePOFromPR(prlist, ic_Items, itemsupplierList, purchaselist, poaction);
                 using (var unitOfWork = _unitOfWorkManager.Begin(false, true))
@@ -1322,7 +1322,7 @@ namespace Business.ResourceExamineManagement
             }
             List<ic_item> ic_Items = _mysql_ic_item.GetListAsync(s => prlist.Select(c => c.icitem_id).Contains(s.Id)).Result;
             PoActionListDto poaction = new PoActionListDto();
-            param.tenantId = prlist[0].tenant_id;
+            param.company_id = prlist[0].company_id;
             param.factoryId = prlist[0].factory_id.GetValueOrDefault();
             AutoCreatePOFromPR(prlist, ic_Items, itemsupplierList, purchaselist, poaction);
             using (var unitOfWork = _unitOfWorkManager.Begin(false, true))
@@ -1636,7 +1636,7 @@ namespace Business.ResourceExamineManagement
             }
             //获取物料bom明细数据
             //List<mo_ic_bom_child> childList = _ic_bom_child.GetManyByCondition(p => icBoms.Select(m => m.mysql_id).Contains(p.bom_id) && p.use_status == 1 && p.tenant_id == param.tenantId && p.factory_id == param.factoryId && !p.IsDeleted).Result.ToList();
-            List<mo_ic_bom_child> childList = _ic_bom_child.GetListAsync(p => icBoms.Select(m => m.mysql_id).Contains(p.bom_id) && p.tenant_id == param.tenantId && p.factory_id == param.factoryId && !p.IsDeleted).Result.ToList();
+            List<mo_ic_bom_child> childList = _ic_bom_child.GetListAsync(p => icBoms.Select(m => m.mysql_id).Contains(p.bom_id) && p.company_id == param.company_id && p.factory_id == param.factoryId && !p.IsDeleted).Result.ToList();
             //没有明细数据,终止
             if (childList.Count == 0)
             {
@@ -1650,7 +1650,7 @@ namespace Business.ResourceExamineManagement
                 }
             }
             //通过物料bom明细数据反查物料bom数据
-            var boms = _ic_bom.GetListAsync(p => childList.Select(m => m.icitem_id).ToList().Contains(p.icitem_id) && p.use_status == 1 && p.tenant_id == param.tenantId && p.factory_id == param.factoryId && !p.IsDeleted).Result.ToList();
+            var boms = _ic_bom.GetListAsync(p => childList.Select(m => m.icitem_id).ToList().Contains(p.icitem_id) && p.use_status == 1 && p.company_id == param.company_id && p.factory_id == param.factoryId && !p.IsDeleted).Result.ToList();
             foreach (var chd in childList)
             {
                 var curBoms = boms.Where(p => p.icitem_id == chd.icitem_id).ToList();
@@ -1726,7 +1726,7 @@ namespace Business.ResourceExamineManagement
                 await _ic_item_stock.InsertManyAsync(moIcitemStokc);
             }
             //在制工单占用记录表
-            var mes_mooccupy = _mysql_mes_mooccupy.GetListAsync(x => x.tenant_id == tenantId && x.factory_id == factoryId).Result;
+            var mes_mooccupy = _mysql_mes_mooccupy.GetListAsync(x => x.company_id == tenantId && x.factory_id == factoryId).Result;
             if (mes_mooccupy.Count > 0)
             {
                 mes_mooccupy.ForEach(item => { item.bang_id = bangid; });
@@ -1735,7 +1735,7 @@ namespace Business.ResourceExamineManagement
                 await _mes_mooccupy.InsertManyAsync(moMes_mooccupy);
             }
             //工单主表
-            var mes_morder = _mysql_mes_morder.GetListAsync(x => x.tenant_id == tenantId && x.factory_id == factoryId).Result;
+            var mes_morder = _mysql_mes_morder.GetListAsync(x => x.company_id == tenantId && x.factory_id == factoryId).Result;
             if (mes_morder.Count > 0)
             {
                 mes_morder.ForEach(item => { item.bang_id = bangid; });
@@ -1744,7 +1744,7 @@ namespace Business.ResourceExamineManagement
                 await _mes_morder.InsertManyAsync(moMes_morder);
             }
             //工单子表
-            var mes_moentry = _mysql_mes_moentry.GetListAsync(x => x.tenant_id == tenantId && x.factory_id == factoryId).Result;
+            var mes_moentry = _mysql_mes_moentry.GetListAsync(x => x.company_id == tenantId && x.factory_id == factoryId).Result;
             if (mes_moentry.Count > 0)
             {
                 mes_moentry.ForEach(item => { item.bang_id = bangid; });
@@ -1755,7 +1755,7 @@ namespace Business.ResourceExamineManagement
 
             //TODO:要不要根据某些条件只同步有效的数据
             //采购订单
-            var srm_po_main = _mysql_srm_po_main.GetListAsync(x => x.tenant_id == tenantId && x.factory_id == factoryId).Result;
+            var srm_po_main = _mysql_srm_po_main.GetListAsync(x => x.company_id == tenantId && x.factory_id == factoryId).Result;
             if (srm_po_main.Count > 0)
             {
                 srm_po_main.ForEach(item => { item.bang_id = bangid; });
@@ -1765,7 +1765,7 @@ namespace Business.ResourceExamineManagement
             }
 
             //采购订单明细
-            var srm_po_list = _mysql_srm_po_list.GetListAsync(x => x.tenant_id == tenantId && x.factory_id == factoryId).Result;
+            var srm_po_list = _mysql_srm_po_list.GetListAsync(x => x.company_id == tenantId && x.factory_id == factoryId).Result;
             if (srm_po_list.Count > 0)
             {
                 srm_po_list.ForEach(item => { item.bang_id = bangid; });
@@ -1775,7 +1775,7 @@ namespace Business.ResourceExamineManagement
             }
 
             //采购订单占用详情
-            var srm_po_occupy = _mysql_srm_po_occupy.GetListAsync(x => x.tenant_id == tenantId && x.factory_id == factoryId).Result;
+            var srm_po_occupy = _mysql_srm_po_occupy.GetListAsync(x => x.company_id == tenantId && x.factory_id == factoryId).Result;
             if (srm_po_occupy.Count > 0)
             {
                 srm_po_occupy.ForEach(item => { item.bang_id = bangid; });
@@ -1822,7 +1822,7 @@ namespace Business.ResourceExamineManagement
         /// <returns></returns>
         private List<ICItemLeadTimeDto> GetLeadTime(List<mo_ic_item> icItemIds, long tenantId, long factoryid)
         {
-            return icItemIds.Where(p => p.factory_id == factoryid && p.tenant_id == tenantId && !p.IsDeleted).
+            return icItemIds.Where(p => p.factory_id == factoryid && p.company_id == tenantId && !p.IsDeleted).
                 Select(x => new ICItemLeadTimeDto
                 {
                     item_id = x.mysql_id,
@@ -1840,7 +1840,7 @@ namespace Business.ResourceExamineManagement
         //根据物料id获取物料供应商
         private List<mo_srm_purchase> GetSupplier(List<long> icItemIds, long tenantId, long factoryid)
         {
-            return _srm_purchase.GetListAsync(p => icItemIds.Contains(p.icitem_id) && p.tenant_id == tenantId && p.factory_id == factoryid && !p.IsDeleted).Result;
+            return _srm_purchase.GetListAsync(p => icItemIds.Contains(p.icitem_id) && p.company_id == tenantId && p.factory_id == factoryid && !p.IsDeleted).Result;
         }
 
         /// <summary>
@@ -1973,7 +1973,7 @@ namespace Business.ResourceExamineManagement
                 podetail.currencytype = item.currencytype;
                 podetail.create_time = DateTime.Now;
                 podetail.factory_id = param.factoryId;
-                podetail.tenant_id = param.tenantId;
+                podetail.company_id = param.company_id;
                 podetail.stock_id = 1;
                 podetaillist.Add(podetail);
                 poDto.polist.Add(podetail);
@@ -2011,7 +2011,7 @@ namespace Business.ResourceExamineManagement
                 po_Main.financialstate = 0;
                 po_Main.create_time = DateTime.Now;
                 po_Main.factory_id = param.factoryId;
-                po_Main.tenant_id = param.tenantId;
+                po_Main.company_id = param.company_id;
                 po_Main.po_delivery = 1;
                 polist.Add(po_Main);
 
@@ -2039,7 +2039,7 @@ namespace Business.ResourceExamineManagement
                                 srm_Po_Occupy.stime = p.create_time;
                                 srm_Po_Occupy.etime = p.rarrdate;
                                 srm_Po_Occupy.state = 1;
-                                srm_Po_Occupy.tenant_id = param.tenantId;//取销售子表企业ID
+                                srm_Po_Occupy.company_id = param.company_id;//取销售子表企业ID
                                 srm_Po_Occupy.factory_id = param.factoryId;
                                 srm_Po_Occupy.create_time = DateTime.Now;
                                 srm_Po_Occupy.create_by_name = "admin";
@@ -2232,7 +2232,7 @@ namespace Business.ResourceExamineManagement
                 examine.GenerateNewId(help.NextId());
                 examine.type = type;
                 examine.create_time = DateTime.Now;
-                examine.tenant_id = param.tenantId;
+                examine.company_id = param.company_id;
                 examine.factory_id = param.factoryId;
                 examine.create_time = DateTime.Now;
                 examineList.Add(examine);
@@ -2242,7 +2242,7 @@ namespace Business.ResourceExamineManagement
                     var detail = ObjectMapper.Map<OrderItemDto, b_order_detail>(s);
                     detail.GenerateNewId(help.NextId());
                     detail.order_examine_id = examine.Id;
-                    detail.tenant_id = param.tenantId;
+                    detail.company_id = param.company_id;
                     detail.factory_id = param.factoryId;
                     detail.create_time = DateTime.Now;
                     orderDetails.Add(detail);
@@ -2255,7 +2255,7 @@ namespace Business.ResourceExamineManagement
                 detail.GenerateNewId(help.NextId());
                 detail.type = type;
                 detail.create_time = DateTime.Now;
-                detail.tenant_id = param.tenantId;
+                detail.company_id = param.company_id;
                 detail.factory_id = param.factoryId;
                 daybulletinboards.Add(detail);
             }
@@ -2405,11 +2405,11 @@ namespace Business.ResourceExamineManagement
             OrderCheckDto input = new OrderCheckDto();
             if (mo_Mes_Morders.Any())
             {
-                input.tenantId = mo_Mes_Morders[0].tenant_id;
+                input.company_id = mo_Mes_Morders[0].company_id;
                 input.factoryId = mo_Mes_Morders[0].factory_id.GetValueOrDefault();
             }
             //资源检查入参全局变量赋值
-            param.tenantId = input.tenantId;
+            param.company_id = input.company_id;
             param.factoryId = input.factoryId;
             param.checkflag = false;
             param.checkPlan = planCheck;
@@ -2427,12 +2427,12 @@ namespace Business.ResourceExamineManagement
             List<mes_moentry> mo_Mes_Moentries = _mysql_mes_moentry.GetListAsync(x => mo_Mes_Morders.Select(s => s.Id).Contains(x.moentry_moid.Value)).Result;
 
             //获取订单行数据
-            List<crm_seorderentry> sentrys = _mysql_crm_seorderentry.GetListAsync(p => p.tenant_id == input.tenantId && p.factory_id == input.factoryId && !p.IsDeleted && mo_Mes_Moentries.Select(x => x.soentry_id).Contains(p.Id)).Result;
+            List<crm_seorderentry> sentrys = _mysql_crm_seorderentry.GetListAsync(p => p.company_id == input.company_id && p.factory_id == input.factoryId && !p.IsDeleted && mo_Mes_Moentries.Select(x => x.soentry_id).Contains(p.Id)).Result;
 
             //删除同步Mysql后旧数据
             await DeleteMySqlOldData(sentrys);
             
-            List<mo_ic_bom> boms = _ic_bom.GetListAsync(p => mo_Mes_Morders.Select(m => m.bom_number).Contains(p.bom_number) && p.factory_id == input.factoryId && p.tenant_id == input.tenantId && !p.IsDeleted).Result.ToList();
+            List<mo_ic_bom> boms = _ic_bom.GetListAsync(p => mo_Mes_Morders.Select(m => m.bom_number).Contains(p.bom_number) && p.factory_id == input.factoryId && p.company_id == input.company_id && !p.IsDeleted).Result.ToList();
 
             //物料bom
             List<mo_ic_bom> bomlist = new List<mo_ic_bom>();
@@ -2466,7 +2466,7 @@ namespace Business.ResourceExamineManagement
             }
 
             //数据库快照-同步mysql库数据到mongoDB中
-            await DbSnapShot(input.tenantId, input.factoryId, bangid, pretreatments);
+            await DbSnapShot(input.company_id, input.factoryId, bangid, pretreatments);
 
             DataInitialization(boms, bangid, icitemlist, stocklist, pretreatments);
             _morderAppService.param = param;
@@ -2549,8 +2549,8 @@ namespace Business.ResourceExamineManagement
                 //获取工单数据
                 var workOrdMasters = _workOrdMaster.Select(p => mo_Mes_Morders.Select(c=>c.morder_no).Contains(p.WorkOrd));
                 workOrdMasters.ForEach(s => {
-                    s.OrdDate = DateTime.Now.Date.AddDays(7);//锁定期
-                    s.DueDate = DateTime.Now.Date.AddDays(7);
+                    s.OrdDate = DateTime.Now.Date.AddDays(14);//锁定期
+                    s.DueDate = DateTime.Now.Date.AddDays(14);
                 });
                 //优先级排序
                 workOrdMasters = workOrdMasters.OrderBy(s => s.OrdDate).ToList();
@@ -2564,6 +2564,7 @@ namespace Business.ResourceExamineManagement
                     morder.moentry_sys_etime = wod.DueDate;
 
                     var exa = rtn.examines.Find(s => s.morder_no == wod.WorkOrd);
+                    exa.latest_times = morder.moentry_sys_etime.GetValueOrDefault().Date.AddDays(1);
                     //根据排产后得日期,反推PR。
                     var wkordPrList = prmainlist.Where(s => s.pr_mono == wod.WorkOrd).ToList();
 
@@ -2577,9 +2578,9 @@ namespace Business.ResourceExamineManagement
                             var bce = exa.BomChildExamineList.Find(s => s.item_id == pr.icitem_id && s.num == pr.num);
                             pr.pr_sarrive_date = morder.moentry_sys_stime.Value.AddDays((double)(0 - bce.pre_time.GetValueOrDefault() - 1 - icitem.clean_leadtime.GetValueOrDefault()));//到货还需要向前推 物料的预处理时间。到货日期必须提前一天到
                             pr.pr_ssend_date = pr.pr_sarrive_date.GetValueOrDefault().AddDays(0 - ts.Value.Days);
-                            if (pr.pr_ssend_date > DateTime.Now)
+                            if (pr.pr_ssend_date < DateTime.Now.Date.AddDays(1))
                             {
-                                pr.pr_ssend_date = DateTime.Now;
+                                pr.pr_ssend_date = DateTime.Now.Date.AddDays(1);
                             }
                         }
                     });
@@ -2597,7 +2598,7 @@ namespace Business.ResourceExamineManagement
                         }
                         if (_CalcBomViewAppService.srm_Po_OccupiesInsert.Any())
                         {
-                            _CalcBomViewAppService.srm_Po_OccupiesInsert.ForEach(s => { s.tenant_id = param.tenantId; s.factory_id = param.factoryId; });
+                            _CalcBomViewAppService.srm_Po_OccupiesInsert.ForEach(s => { s.company_id = param.company_id; s.factory_id = param.factoryId; });
                             await _srm_po_occupy.InsertManyAsync(_CalcBomViewAppService.srm_Po_OccupiesInsert);
                         }
                         await unitOfWork.CompleteAsync();
@@ -2637,7 +2638,7 @@ namespace Business.ResourceExamineManagement
                         }
                     }
                     b_ex.create_time = DateTime.Now;
-                    b_ex.tenant_id = param.tenantId;
+                    b_ex.company_id = param.company_id;
                     b_ex.factory_id = param.factoryId;
                     examineList.Add(b_ex);
                     ex.BomChildExamineList.ForEach(s =>
@@ -2645,7 +2646,7 @@ namespace Business.ResourceExamineManagement
                         var bc_ex = ObjectMapper.Map<BomChildExamineDto, b_bom_child_examine>(s);
                         bc_ex.GenerateNewId(help.NextId());
                         bc_ex.examine_id = b_ex.Id;
-                        bc_ex.tenant_id = param.tenantId;
+                        bc_ex.company_id = param.company_id;
                         bc_ex.factory_id = param.factoryId;
                         bc_ex.create_time = DateTime.Now;
                         bomExamineList.Add(bc_ex);
@@ -2655,7 +2656,7 @@ namespace Business.ResourceExamineManagement
                             var olist = ObjectMapper.Map<List<mo_occupy>, List<b_mo_occupy>>(s.mo_occupy_list);
                             olist.ForEach(o =>
                             {
-                                o.bom_child_examine_id = bc_ex.Id; o.tenant_id = param.tenantId;
+                                o.bom_child_examine_id = bc_ex.Id; o.company_id = param.company_id;
                                 o.factory_id = param.factoryId;
                             });
                             mooccupyList.AddRange(olist);
@@ -2665,7 +2666,7 @@ namespace Business.ResourceExamineManagement
                             var mlist = ObjectMapper.Map<List<moorder>, List<b_mo_order>>(s.make_list);
                             mlist.ForEach(o =>
                             {
-                                o.bom_child_examine_id = bc_ex.Id; o.tenant_id = param.tenantId;
+                                o.bom_child_examine_id = bc_ex.Id; o.company_id = param.company_id;
                                 o.factory_id = param.factoryId;
                             });
                             moorderList.AddRange(mlist);
@@ -2675,7 +2676,7 @@ namespace Business.ResourceExamineManagement
                             var slist = ObjectMapper.Map<List<ooder>, List<b_ooder>>(s.subcontracting_list);
                             slist.ForEach(o =>
                             {
-                                o.bom_child_examine_id = bc_ex.Id; o.tenant_id = param.tenantId;
+                                o.bom_child_examine_id = bc_ex.Id; o.company_id = param.company_id;
                                 o.factory_id = param.factoryId;
                             });
                             ooderList.AddRange(slist);
@@ -2685,7 +2686,7 @@ namespace Business.ResourceExamineManagement
                             var plist = ObjectMapper.Map<List<purchase>, List<b_purchase>>(s.purchase_list);
                             plist.ForEach(o =>
                             {
-                                o.bom_child_examine_id = bc_ex.Id; o.tenant_id = param.tenantId;
+                                o.bom_child_examine_id = bc_ex.Id; o.company_id = param.company_id;
                                 o.factory_id = param.factoryId;
                             });
                             purchaseList.AddRange(plist);
@@ -2695,7 +2696,7 @@ namespace Business.ResourceExamineManagement
                             var purlist = ObjectMapper.Map<List<purchase_occupy>, List<b_purchase_occupy>>(s.purchase_occupy_list);
                             purlist.ForEach(o =>
                             {
-                                o.bom_child_examine_id = bc_ex.Id; o.tenant_id = param.tenantId;
+                                o.bom_child_examine_id = bc_ex.Id; o.company_id = param.company_id;
                                 o.factory_id = param.factoryId;
                             });
                             purchaseoccupyList.AddRange(purlist);
@@ -2786,11 +2787,11 @@ namespace Business.ResourceExamineManagement
 
             //主工单
             List<mo_mes_morder> mo_Mes_Morders = _mes_morder.GetListAsync(x => boms.Select(p => p.bom_number).Contains(x.bom_number) && (x.morder_state != MorderEnum.Accomplish_state || x.morder_state != MorderEnum.Close_state
-          && x.morder_icitem_type != MorderEnum.XgwyMorder) && x.tenant_id == param.tenantId && x.bang_id == bangid).Result;
+          && x.morder_icitem_type != MorderEnum.XgwyMorder) && x.company_id == param.company_id && x.bang_id == bangid).Result;
             List<long> moids = mo_Mes_Morders.Select(p => p.mysql_id).ToList();
             List<mo_mes_moentry> mo_Mes_Moentry = _mes_moentry.GetListAsync(x => moids.Contains(x.moentry_moid)).Result;
             //工单占用表
-            List<mo_mes_mooccupy> mes_mooccupyList = _mes_mooccupy.GetListAsync(x => x.moo_state == 1 && !x.IsDeleted && x.tenant_id == param.tenantId
+            List<mo_mes_mooccupy> mes_mooccupyList = _mes_mooccupy.GetListAsync(x => x.moo_state == 1 && !x.IsDeleted && x.company_id == param.company_id
           && boms.Select(p => p.item_number).Contains(x.fitem_number) && x.bang_id == bangid).Result;
 
             //物料采购订单明细
@@ -2805,8 +2806,8 @@ namespace Business.ResourceExamineManagement
             stocklist.AddRange(_ic_item_stock.GetListAsync(p => p.factory_id == param.factoryId && p.bang_id == bangid && itemIds.Contains(p.icitem_id)).Result);
 
             //物料提前期
-            leadTimeList = GetLeadTime(icitemlist, param.tenantId, param.factoryId);//提前期列表
-            supplierList = GetSupplier(itemIds, param.tenantId, param.factoryId);//供应商列表
+            leadTimeList = GetLeadTime(icitemlist, param.company_id, param.factoryId);//提前期列表
+            supplierList = GetSupplier(itemIds, param.company_id, param.factoryId);//供应商列表
 
             _CalcBomViewAppService.leadTimeList = leadTimeList;
             _CalcBomViewAppService.supplierList = supplierList;
@@ -2877,7 +2878,7 @@ namespace Business.ResourceExamineManagement
         /// </summary>
         public void AutoCreateBomBill(List<mo_ic_bom> ic_Boms = null)
         {
-            ic_Boms ??= _ic_bom.GetListAsync(p => p.factory_id == 10101 && p.tenant_id == 101 && !p.IsDeleted).Result.ToList();
+            ic_Boms ??= _ic_bom.GetListAsync(p => p.factory_id == 10101 && p.company_id == 101 && !p.IsDeleted).Result.ToList();
             var pretreatment = _mysql_b_bom_pretreatment.GetListAsync(s => ic_Boms.Select(c => c.mysql_id).ToList().Contains(s.sourceid)).Result;
 
             //物料bom
@@ -3037,9 +3038,6 @@ namespace Business.ResourceExamineManagement
                         }
                     });
                     List<string> itemKeys = dictItemQty.Keys.ToList();
-                    //var items = _mysql_ic_item.GetListAsync(a => itemKeys.Contains(a.number) && a.factory_id == 1001 && a.tenant_id == 1000).Result;
-                    //var itemIds = items.Select(b => b.Id).ToList();
-                    //var leadTimes = GetLeadTime(itemIds, 1000, 1001).Max(a=>a.ordissu_days.GetValueOrDefault());
                     decimal leadTimes = itemLocList.Select(a => a.MFGMTTR).Max();
                     //没有维护备料提前期,默认取7天
                     if (leadTimes > 0)
@@ -3078,14 +3076,14 @@ namespace Business.ResourceExamineManagement
             {
                 itemChildList.AddRange(GetChildItemNumber(a, new List<string>()));
             });
-            var stockList = _locationDetail.Select(a => a.Domain == "1001" && a.IsActive && itemChildList.Distinct().Contains(a.ItemNum));
+            var stockList = _locationDetail.Select(a => a.Domain == param.factoryId.ToString() && a.IsActive && itemChildList.Distinct().Contains(a.ItemNum));
             var groupList = stockList.
                 GroupBy(m => new { m.ItemNum }).
                 Select(a => new { ItemNum = a.Key.ItemNum, Qty = a.Sum(c => c.QtyOnHand) }).ToList();
             var itemNums = groupList.Select(b => b.ItemNum).ToList();//需要处理的dop物料编码集合
-            var items = _mysql_ic_item.GetListAsync(a => itemNums.Contains(a.number) && a.factory_id == 1001 && a.tenant_id == 1000).Result;
+            var items = _mysql_ic_item.GetListAsync(a => itemNums.Contains(a.number) && a.factory_id == param.factoryId && a.company_id == param.company_id).Result;
             var itemIds = items.Select(b => b.Id).ToList();//需要处理的dop物料id集合
-            List<ic_item_stock> mysqlStock = _mysql_ic_item_stock.GetListAsync(a => itemIds.Contains(a.Id) && a.factory_id == 1001 && a.tenant_id == 1000).Result;
+            List<ic_item_stock> mysqlStock = _mysql_ic_item_stock.GetListAsync(a => itemIds.Contains(a.Id) && a.factory_id == param.factoryId && a.company_id == param.company_id).Result;
             List<ic_item_stock> needAddList = new List<ic_item_stock>();
 
             foreach (var stockWMS in groupList)
@@ -3103,8 +3101,8 @@ namespace Business.ResourceExamineManagement
                         {
                             ic_item_stock stock = new ic_item_stock();
                             stock.GenerateNewId(help.NextId());
-                            stock.factory_id = 1001;
-                            stock.tenant_id = 1000;
+                            stock.factory_id = param.factoryId;
+                            stock.company_id = param.company_id;
                             stock.icitem_id = num.Id;
                             stock.icitem_name = num.name;
                             stock.sqty = groupList.First(a => a.ItemNum == num.number).Qty;

+ 1 - 1
MicroServices/Business/Business.Domain/MongoDB/Base/MoBaseEntity.cs

@@ -72,7 +72,7 @@ namespace Business.Domain
         /// </summary>
         [Required]
         [Comment("租户ID")]
-        public virtual long tenant_id { get; set; }
+        public virtual long? tenant_id { get; set; }
         /// <summary>
         /// 公司ID
         /// </summary>

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Base/BaseEntity.cs

@@ -67,7 +67,7 @@ namespace Business.Domain
         /// </summary>
         [Required]
         [Comment("租户ID")]
-        public virtual long tenant_id { get; set; }
+        public virtual long? tenant_id { get; set; }
 
         /// <summary>
         /// 公司ID

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/MES/IC/ic_bom.cs

@@ -10,7 +10,7 @@ namespace Business.Domain
     /// </summary>
     [CollectionName("dopbase", "ic_bom")]
     [Comment("物料BOM")]
-    [Index(nameof(bom_number), nameof(item_number), nameof(version), nameof(tenant_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(bom_number), nameof(item_number), nameof(version), nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class ic_bom : BaseEntity
     {
         public ic_bom(long Id) : base(Id)

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/MES/IC/ic_bom_child.cs

@@ -10,7 +10,7 @@ namespace Business.Domain
     /// </summary>
     [CollectionName("dopbase", "ic_bom_child")]
     [Comment("物料BOM明细")]
-    [Index(nameof(bom_number), nameof(item_number), nameof(version), nameof(tenant_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(bom_number), nameof(item_number), nameof(version), nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class ic_bom_child : BaseEntity
     {
         public ic_bom_child(long Id) : base(Id)

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/MES/IC/ic_item.cs

@@ -10,7 +10,7 @@ namespace Business.Domain
     /// </summary>
     [CollectionName("dopbase", "ic_item")]
     [Comment("物料详情")]
-    [Index(nameof(number), nameof(fversion), nameof(tenant_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(number), nameof(fversion), nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class ic_item : BaseEntity
     {
         public ic_item(long Id) : base(Id)

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/MES/IC/ic_item_stock.cs

@@ -10,7 +10,7 @@ namespace Business.Domain
     /// </summary>
     [CollectionName("dopbase", "ic_item_stock")]
     [Comment("物料库存表")]
-    [Index(nameof(icitem_number), nameof(fversion), nameof(tenant_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(icitem_number), nameof(fversion), nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class ic_item_stock : BaseEntity
     {
         /// <summary>

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/MES/IC/ic_item_stockoccupy.cs

@@ -10,7 +10,7 @@ namespace Business.Domain
     /// </summary>
     [CollectionName("dopbase", "ic_item_stockoccupy")]
     [Comment("资源检查物料占用明细表")]
-    [Index(nameof(orderentry_id), nameof(icitem_number), nameof(fversion), nameof(tenant_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(orderentry_id), nameof(icitem_number), nameof(fversion), nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class ic_item_stockoccupy : BaseEntity
     {
         /// <summary>

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/SRM/srm_po_list.cs

@@ -11,7 +11,7 @@ namespace Business.Domain
     /// </summary>
     [CollectionName("dopbase", "srm_po_list")]
     [Comment("采购订单明细详情")]
-    [Index(nameof(po_billno), nameof(polist_row), nameof(tenant_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(po_billno), nameof(polist_row), nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class srm_po_list : BaseEntity
     {
         /// <summary>

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/SRM/srm_po_main.cs

@@ -11,7 +11,7 @@ namespace Business.Domain
     /// </summary>
     [CollectionName("dopbase", "srm_po_main")]
     [Comment("采购订单")]
-    [Index(nameof(po_billno), nameof(tenant_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(po_billno), nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class srm_po_main : BaseEntity
     {
         /// <summary>

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/SRM/srm_pr_main.cs

@@ -11,7 +11,7 @@ namespace Business.Domain
     /// </summary>
     [CollectionName("dopbase", "srm_pr_main")]
     [Comment("采购申请单")]
-    [Index(nameof(pr_billno), nameof(tenant_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(pr_billno), nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class srm_pr_main : BaseEntity
     {
         /// <summary>

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/SRM/srm_purchase.cs

@@ -10,7 +10,7 @@ namespace Business.Domain
     /// </summary>
     [CollectionName("dopbase", "srm_purchase")]
     [Comment("物料采购报价单")]
-    [Index(nameof(number), nameof(supplier_number), nameof(tenant_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(number), nameof(supplier_number), nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class srm_purchase : BaseEntity
     {
 

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/SRM/srm_supplier.cs

@@ -11,7 +11,7 @@ namespace Business.Domain
     /// </summary>
     [Comment("供应商")]
     [CollectionName("dopbase", "srm_supplier")]
-    [Index(nameof(supplier_no), nameof(tenant_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(supplier_no), nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class srm_supplier : BaseEntity
     {
         ///// <summary>

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Sale/crm_customer.cs

@@ -10,7 +10,7 @@ namespace Business.Domain
     /// </summary>
     [Comment("客户")]
     [CollectionName("dopbase", "crm_customer")]
-    [Index(nameof(customer_no), nameof(tenant_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(customer_no), nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class crm_customer : BaseEntity
     {
         ///// <summary>

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Sale/crm_seorder.cs

@@ -12,7 +12,7 @@ namespace Business.Domain
     /// </summary>
     [Comment("销售订单表")]
     [CollectionName("dopbase", "crm_seorder")]
-    [Index(nameof(bill_no), nameof(tenant_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(bill_no), nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class crm_seorder : BaseEntity
     {
         ///// <summary>

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/Sale/crm_seorderentry.cs

@@ -12,7 +12,7 @@ namespace Business.Domain
     /// </summary>
     [Comment("销售订单明细表")]
     [CollectionName("dopbase", "crm_seorderentry")]
-    [Index(nameof(bill_no), nameof(entry_seq), nameof(tenant_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(bill_no), nameof(entry_seq), nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class crm_seorderentry : BaseEntity
     {
         ///// <summary>

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/SaleFcst/DomesticTerminalFcst.cs

@@ -13,7 +13,7 @@ namespace Business.Domain
     /// 国内终端预测表
     /// </summary>
     [Comment("国内终端预测表")]
-    [Index(nameof(Year), nameof(Month), nameof(ProdLine), nameof(Model),nameof(TypeEnum),nameof(PlanMonth),nameof(tenant_id), nameof(company_id),nameof(factory_id), IsUnique = true)]
+    [Index(nameof(Year), nameof(Month), nameof(ProdLine), nameof(Model),nameof(TypeEnum),nameof(PlanMonth),nameof(company_id), nameof(company_id),nameof(factory_id), IsUnique = true)]
     public class DomesticTerminalFcst:BaseEntity
     {
         /// <summary>

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/SaleFcst/OverseasSaleFcst.cs

@@ -13,7 +13,7 @@ namespace Business.Domain
     /// 海外销售预测表
     /// </summary>
     [Comment("海外销售预测表")]
-    [Index(nameof(Year), nameof(Month), nameof(ProdLine), nameof(Model),nameof(Language),nameof(PlanMonth),nameof(tenant_id),nameof(company_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(Year), nameof(Month), nameof(ProdLine), nameof(Model),nameof(Language),nameof(PlanMonth),nameof(company_id),nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class OverseasSaleFcst : BaseEntity
     {
         /// <summary>

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/SaleFcst/PlatformFcstCollect.cs

@@ -13,7 +13,7 @@ namespace Business.Domain
     /// 平台预测收集表
     /// </summary>
     [Comment("平台预测收集表")]
-    [Index(nameof(Year), nameof(Month), nameof(Platform), nameof(Model),nameof(ProdType),nameof(PlanMonth),nameof(tenant_id),nameof(company_id),nameof(factory_id), IsUnique = true)]
+    [Index(nameof(Year), nameof(Month), nameof(Platform), nameof(Model),nameof(ProdType),nameof(PlanMonth),nameof(company_id),nameof(company_id),nameof(factory_id), IsUnique = true)]
     public class PlatformFcstCollect : BaseEntity
     {
         /// <summary>

+ 7 - 1
MicroServices/Business/Business.Domain/StructuredDB/SaleFcst/StandardItemModelSet.cs

@@ -14,7 +14,7 @@ namespace Business.Domain
     /// 标准物料规格型号设置表
     /// </summary>
     [Comment("标准物料规格型号设置表")]
-    [Index(nameof(Model),nameof(ItemNumber), nameof(tenant_id),nameof(company_id), nameof(factory_id), IsUnique = true)]
+    [Index(nameof(Model),nameof(ItemNumber), nameof(company_id),nameof(company_id), nameof(factory_id), IsUnique = true)]
     public class StandardItemModelSet:BaseEntity
     {
         /// <summary>
@@ -28,5 +28,11 @@ namespace Business.Domain
         /// </summary>
         [Comment("物料编码")]
         public string ItemNumber { get; set; }
+
+        /// <summary>
+        /// 补货周期
+        /// </summary>
+        [Comment("补货周期")]
+        public decimal ReplenishCycle { get; set; }
     }
 }

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/SaleFcst/YearDemandManagement.cs

@@ -13,7 +13,7 @@ namespace Business.Domain
     /// 年度生产需求管理表
     /// </summary>
     [Comment("年度生产需求管理表")]
-    [Index(nameof(Year), nameof(Area), nameof(ProdLine),nameof(ProdRange), nameof(Line),nameof(Model),nameof(PlanMonth),nameof(tenant_id), nameof(company_id),nameof(factory_id), IsUnique = true)]
+    [Index(nameof(Year), nameof(Area), nameof(ProdLine),nameof(ProdRange), nameof(Line),nameof(Model),nameof(PlanMonth),nameof(company_id), nameof(company_id),nameof(factory_id), IsUnique = true)]
     public class YearDemandManagement:BaseEntity
     {
         /// <summary>

+ 1 - 1
MicroServices/Business/Business.Domain/StructuredDB/WMS/PlatformInventory.cs

@@ -38,7 +38,7 @@ namespace Business.StructuredDB.WMS
         /// 有效期
         /// </summary>
         [Comment("有效期")]
-        public decimal? PeriodOfValidity { get; set; }
+        public DateTime? PeriodOfValidity { get; set; }
         /// <summary>
         /// 编码
         /// </summary>

+ 30 - 30
MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/BusinessDbContextModelCreatingExtensions.cs

@@ -14,7 +14,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<ic_bom>(b =>
             {
                 b.ToTable("ic_bom");
-                b.HasIndex(b => new { b.bom_number, b.item_number,b.version, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.bom_number, b.item_number,b.version, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -22,7 +22,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<ic_bom_child>(b =>
             {
                 b.ToTable("ic_bom_child");
-                b.HasIndex(b => new { b.bom_id,b.bom_number, b.item_number, b.version, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.bom_id,b.bom_number, b.item_number, b.version, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -30,7 +30,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<ic_item>(b =>
             {
                 b.ToTable("ic_item");
-                b.HasIndex(b => new { b.number, b.name,b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.number, b.name,b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -38,7 +38,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<ic_item_stock>(b =>
             {
                 b.ToTable("ic_item_stock");
-                b.HasIndex(b => new { b.icitem_id, b.icitem_name, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.icitem_id, b.icitem_name, b.company_id, b.factory_id });
                 //不映射到数据库中
                 b.Ignore(x => x.bang_id);
                 b.ConfigureByConvention();
@@ -48,7 +48,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<ic_substitute>(b =>
             {
                 b.ToTable("ic_substitute");
-                b.HasIndex(b => new { b.substitute_code, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.substitute_code, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -56,7 +56,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<ic_substitute_group>(b =>
             {
                 b.ToTable("ic_substitute_group");
-                b.HasIndex(b => new { b.substitute_code, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.substitute_code, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -64,7 +64,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<ic_substitute_group_detail>(b =>
             {
                 b.ToTable("ic_substitute_group_detail");
-                b.HasIndex(b => new { b.substitute_code,b.icitem_number, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.substitute_code,b.icitem_number, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -72,7 +72,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<srm_po_list>(b =>
             {
                 b.ToTable("srm_po_list");
-                b.HasIndex(b => new { b.po_billno, b.number, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.po_billno, b.number, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -80,7 +80,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<srm_po_main>(b =>
             {
                 b.ToTable("srm_po_main");
-                b.HasIndex(b => new { b.po_billno, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.po_billno, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -88,7 +88,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<srm_purchase>(b =>
             {
                 b.ToTable("srm_purchase");
-                b.HasIndex(b => new {b.icitem_id, b.supplier_number, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new {b.icitem_id, b.supplier_number, b.company_id, b.factory_id });
                 b.Ignore(x => x.bang_id);
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
@@ -97,7 +97,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<srm_po_occupy>(b =>
             {
                 b.ToTable("srm_po_occupy");
-                b.HasIndex(b => new { b.polist_id, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.polist_id, b.company_id, b.factory_id });
                 b.Ignore(v => v.bang_id);
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
@@ -106,7 +106,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<srm_pr_main>(b =>
             {
                 b.ToTable("srm_pr_main");
-                b.HasIndex(b => new { b.pr_billno,b.pr_purchasenumber,b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.pr_billno,b.pr_purchasenumber,b.company_id, b.factory_id });
                 b.Ignore(v => v.bang_id);
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
@@ -115,7 +115,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<mes_moentry>(b =>
             {
                 b.ToTable("mes_moentry");
-                b.HasIndex(b => new { b.moentry_moid, b.moentry_mono, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.moentry_moid, b.moentry_mono, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -123,7 +123,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<mes_mooccupy>(b =>
             {
                 b.ToTable("mes_mooccupy");
-                b.HasIndex(b => new { b.moo_id_billid, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.moo_id_billid, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -131,7 +131,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<mes_morder>(b =>
             {
                 b.ToTable("mes_morder");
-                b.HasIndex(b => new { b.morder_no, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.morder_no, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -147,7 +147,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<mes_stockoccupy>(b =>
             {
                 b.ToTable("mes_stockoccupy");
-                b.HasIndex(b => new { b.fbill_no,b.fitem_number, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.fbill_no,b.fitem_number, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -157,7 +157,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<crm_seorder>(b =>
             {
                 b.ToTable("crm_seorder");
-                b.HasIndex(b => new { b.bill_no, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.bill_no, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -165,7 +165,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<crm_seorderentry>(b =>
             {
                 b.ToTable("crm_seorderentry");
-                b.HasIndex(b => new { b.seorder_id, b.bill_no,b.item_number,b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.seorder_id, b.bill_no,b.item_number,b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -173,7 +173,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<crm_customer>(b =>
             {
                 b.ToTable("crm_customer");
-                b.HasIndex(b => new { b.customer_no, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.customer_no, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -181,7 +181,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<srm_supplier>(b =>
             {
                 b.ToTable("srm_supplier");
-                b.HasIndex(b => new { b.supplier_no, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.supplier_no, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -267,63 +267,63 @@ namespace Business.EntityFrameworkCore
             builder.Entity<b_bom_child_examine>(b =>
             {
                 b.ToTable("b_bom_child_examine");
-                b.HasIndex(b => new { b.examine_id,b.bom_number,b.item_number, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.examine_id,b.bom_number,b.item_number, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
             builder.Entity<b_examine_result>(b =>
             {
                 b.ToTable("b_examine_result");
-                b.HasIndex(b => new { b.bill_no, b.bom_number, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.bill_no, b.bom_number, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
             builder.Entity<b_mo_occupy>(b =>
             {
                 b.ToTable("b_mo_occupy");
-                b.HasIndex(b => new { b.bom_child_examine_id, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.bom_child_examine_id, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
             builder.Entity<b_mo_order>(b =>
             {
                 b.ToTable("b_mo_order");
-                b.HasIndex(b => new { b.bom_child_examine_id, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.bom_child_examine_id, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
             builder.Entity<b_ooder>(b =>
             {
                 b.ToTable("b_ooder");
-                b.HasIndex(b => new { b.bom_child_examine_id, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.bom_child_examine_id, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
             builder.Entity<b_purchase>(b =>
             {
                 b.ToTable("b_purchase");
-                b.HasIndex(b => new { b.bom_child_examine_id, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.bom_child_examine_id, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
             builder.Entity<b_purchase_occupy>(b =>
             {
                 b.ToTable("b_purchase_occupy");
-                b.HasIndex(b => new { b.bom_child_examine_id, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.bom_child_examine_id, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
             builder.Entity<b_order_detail>(b =>
             {
                 b.ToTable("b_order_detail");
-                b.HasIndex(b => new { b.order_examine_id,b.bom_number,b.item_number, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.order_examine_id,b.bom_number,b.item_number, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
             builder.Entity<b_order_examine_result>(b =>
             {
                 b.ToTable("b_order_examine_result");
-                b.HasIndex(b => new { b.bom_number, b.order_no, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.bom_number, b.order_no, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });
@@ -331,7 +331,7 @@ namespace Business.EntityFrameworkCore
             builder.Entity<b_day_bulletin_board>(b =>
             {
                 b.ToTable("b_day_bulletin_board");
-                b.HasIndex(b => new { b.item_number, b.tenant_id, b.factory_id });
+                b.HasIndex(b => new { b.item_number, b.company_id, b.factory_id });
                 b.ConfigureByConvention();
                 b.Property(x => x.Id).ValueGeneratedNever();//迁移sqlserver默认是自增,需要配置一下
             });

+ 9 - 9
MicroServices/Business/Business.Host/BusinessHostModule.cs

@@ -165,7 +165,7 @@ namespace Business
                Ascending(_ => _.bom_number).
                Ascending(_ => _.item_number).
                Ascending(_ => _.version).
-               Ascending(_ => _.tenant_id).
+               Ascending(_ => _.company_id).
                Ascending(_ => _.factory_id)
                , new CreateIndexOptions
                {
@@ -183,7 +183,7 @@ namespace Business
                Ascending(_ => _.bom_number).
                Ascending(_ => _.item_number).
                Ascending(_ => _.version).
-               Ascending(_ => _.tenant_id).
+               Ascending(_ => _.company_id).
                Ascending(_ => _.factory_id)
                , new CreateIndexOptions
                {
@@ -200,7 +200,7 @@ namespace Business
                Builders<mo_ic_item>.IndexKeys.
                Ascending(_ => _.number).
                Ascending(_ => _.fversion).
-               Ascending(_ => _.tenant_id).
+               Ascending(_ => _.company_id).
                Ascending(_ => _.factory_id)
                , new CreateIndexOptions
                {
@@ -217,7 +217,7 @@ namespace Business
                Builders<mo_ic_item_stock>.IndexKeys.
                Ascending(_ => _.icitem_number).
                Ascending(_ => _.fversion).
-               Ascending(_ => _.tenant_id).
+               Ascending(_ => _.company_id).
                Ascending(_ => _.factory_id).
                Ascending(_ => _.bang_id)
                , new CreateIndexOptions
@@ -236,7 +236,7 @@ namespace Business
                Builders<mo_srm_po_list>.IndexKeys.
                Ascending(_ => _.po_billno).
                Ascending(_ => _.polist_row).
-               Ascending(_ => _.tenant_id).
+               Ascending(_ => _.company_id).
                Ascending(_ => _.factory_id).
                Ascending(_ => _.bang_id)
                , new CreateIndexOptions
@@ -253,7 +253,7 @@ namespace Business
             CreateIndexModel<mo_srm_po_main> indexModel_mo_srm_po_main = new CreateIndexModel<mo_srm_po_main>(
                Builders<mo_srm_po_main>.IndexKeys.
                Ascending(_ => _.po_billno).
-               Ascending(_ => _.tenant_id).
+               Ascending(_ => _.company_id).
                Ascending(_ => _.factory_id).
                Ascending(_ => _.bang_id)
                , new CreateIndexOptions
@@ -270,7 +270,7 @@ namespace Business
             CreateIndexModel<mo_srm_pr_main> indexModel_mo_srm_pr_main = new CreateIndexModel<mo_srm_pr_main>(
                Builders<mo_srm_pr_main>.IndexKeys.
                Ascending(_ => _.pr_billno).
-               Ascending(_ => _.tenant_id).
+               Ascending(_ => _.company_id).
                Ascending(_ => _.factory_id).
                Ascending(_ => _.bang_id)
                , new CreateIndexOptions
@@ -288,7 +288,7 @@ namespace Business
                Builders<mo_srm_purchase>.IndexKeys.
                Ascending(_ => _.number).
                Ascending(_ => _.supplier_number).
-               Ascending(_ => _.tenant_id).
+               Ascending(_ => _.company_id).
                Ascending(_ => _.factory_id).
                Ascending(_ => _.bang_id)
                , new CreateIndexOptions
@@ -305,7 +305,7 @@ namespace Business
             CreateIndexModel<mo_srm_supplier> indexModel_mo_srm_supplier = new CreateIndexModel<mo_srm_supplier>(
                Builders<mo_srm_supplier>.IndexKeys.
                Ascending(_ => _.supplier_no).
-               Ascending(_ => _.tenant_id).
+               Ascending(_ => _.company_id).
                Ascending(_ => _.factory_id)
                , new CreateIndexOptions
                {

+ 2 - 2
MicroServices/Business/Bussiness.ApplicationTest/ResourceExamineManagement/ResourceExamineAppService_Tests.cs

@@ -24,7 +24,7 @@ namespace Bussiness.ApplicationTest.ResourceExamineManagement
         [Fact]
         public async Task Should_ThrowExcetion()
         {
-            var testInput = new ResourceCheckInputDto { factoryId = 10201, sorderId = new List<long> { 111111 }, tenantId = 102 };
+            var testInput = new ResourceCheckInputDto { factoryId = 10201, sorderId = new List<long> { 111111 }, company_id = 102 };
             await Xunit.Assert.ThrowsAsync<NotImplementedException>(async () => await _resourceExamineAppService.ReceiveResult("111111",0));
         }
 
@@ -32,7 +32,7 @@ namespace Bussiness.ApplicationTest.ResourceExamineManagement
         [ExpectedException(typeof(NotImplementedException))]
         public async Task Should_ThrowExcetion_Second()
         {
-            var testInput = new ResourceCheckInputDto { factoryId = 10201, sorderId = new List<long> { 111111 }, tenantId = 102 };
+            var testInput = new ResourceCheckInputDto { factoryId = 10201, sorderId = new List<long> { 111111 }, company_id = 102 };
             await _resourceExamineAppService.ReceiveResult("111111",0);
         }
     }