Murphy 2 лет назад
Родитель
Сommit
763db5fc5d

Разница между файлами не показана из-за своего большого размера
+ 1502 - 126
MicroServices/Business/Business.Application/ReplenishmentManagement/ReplenishmentAppService.cs


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

@@ -1570,7 +1570,7 @@ namespace Business.ResourceExamineManagement
             srm_Pr.icitem_name = returnlist.item_name;//物料名称
             srm_Pr.num = returnlist.num;
             
-            srm_Pr.pr_order_type = 1;//单据类型
+            srm_Pr.pr_order_type = "1";//单据类型
 
             if (plan_date != null && !IsStraight)
             {

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

@@ -68,7 +68,7 @@ namespace Business.ResourceExamineManagement
                 decimal maxRt = allOps.Max(s => s.RunTime);
                 decimal sumRt = allOps.Sum(s => s.RunTime);
                 decimal totalTime = (param.QtyOrd - 1) * maxRt + sumRt;//总计生产小时
-                return (int)(Math.Ceiling(totalTime / 7));
+                return (int)(Math.Ceiling(totalTime / 8));
             }
             return 1;
         }

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

@@ -1676,7 +1676,7 @@ namespace Business.ResourceExamineManagement
                         {
                             _workOrdMaster.Insert(workOrds);
                         }
-                        var DBworkOrdList = _workOrdMaster.Select(a => a.Domain == workOrds[0].Domain && workOrds.Select(c => c.WorkOrd).Contains(a.WorkOrd));
+                        var DBworkOrdList = _workOrdMaster.Select(a => workOrds.Count>0 && a.Domain == workOrds[0].Domain && workOrds.Select(c => c.WorkOrd).Contains(a.WorkOrd));
                         if (workOrdRoutings.Any())
                         {
                             workOrdRoutings.ForEach(c =>

+ 245 - 0
MicroServices/Business/Business.Domain/StructuredDB/Replenishment/ReplenishmentROPWeekPlan.cs

@@ -0,0 +1,245 @@
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.ComponentModel.DataAnnotations;
+
+namespace Business.Domain
+{
+    /// <summary>
+    ///补货模型ROP
+    /// </summary>
+    [Comment("补货模型ROP周计划")]
+    [Index(nameof(number), nameof(tenant_id), nameof(fversion),nameof(planmonth), nameof(factory_id), IsUnique = true)]
+    public class ReplenishmentROPWeekPlan : BaseEntity
+    {
+        /// <summary>
+        /// 物料编码
+        /// </summary>
+        [StringLength(80)]
+        [Comment("物料编码")]
+        public string number { get; set; }
+        /// <summary>
+        /// 物料名称
+        /// </summary>
+        [StringLength(200)]
+        [Comment("物料名称")]
+        public string name { get; set; }
+        /// <summary>
+        /// 规格型号
+        /// </summary>
+        [StringLength(200)]
+        [Comment("规格型号")]
+        public string model { get; set; }
+
+        /// <summary>
+        /// 生命周期    
+        /// </summary>
+        [StringLength(50)]
+        public string? lifecycle { get; set; }
+
+        /// <summary>
+        /// 市场    
+        /// </summary>
+        [StringLength(50)]
+        public string? area { get; set; }
+
+        /// <summary>
+        /// 物料属性:0.配置类 1.自制 2.委外加工 3.外购 4.虚拟件
+        /// </summary>
+        [Comment("物料属性")]
+        public int? erp_cls { get; set; }
+
+
+        /// <summary>
+        /// 版本号
+        /// </summary>
+        [StringLength(80)]
+        [Comment("版本号")]
+        public string? fversion { get; set; }
+
+
+        /// <summary>
+        /// 计划发货数量
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("发货计划")]
+        public decimal? plan_out_qty { get; set; }
+
+        /// <summary>
+        /// 月均需求
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("月均需求")]
+        public decimal? monthl_avg_demand { get; set; }
+
+
+        /// <summary>
+        /// 月均需求标准方差
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("月均需求标准方差")]
+        public decimal? monthl_avg_demand_variance { get; set; }
+
+
+        /// <summary>
+        /// 月均出库
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("月均出库")]
+        public decimal? monthl_avg_outstock { get; set; }
+
+
+
+        /// <summary>
+        /// 供应前置期参数(天)
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("供应前置期参数(天)")]
+        public decimal? supply_leadtime { get; set; }
+
+        /// <summary>
+        /// ABC分类
+        /// </summary>
+        [StringLength(8)]
+        [Comment("ABC分类")]
+        public string? abc { get; set; }
+
+        /// <summary>
+        /// FMR分类
+        /// </summary>
+        [StringLength(8)]
+        [Comment("FMR分类")]
+        public string? fmr { get; set; }
+
+        /// <summary>
+        /// Z服务水平参数
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("Z服务水平参数")]
+        public decimal? service_level_pct { get; set; }
+
+        /// <summary>
+        /// 存货周转率
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("存货周转率")]
+        public decimal? stock_turnover { get; set; }
+
+
+        /// <summary>
+        /// 最小包装
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("最小包装")]
+        public decimal? min_pack_qty { get; set; }
+
+        /// <summary>
+        /// 最小批量
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("最小批量")]
+        public decimal? moq { get; set; }
+
+        /// <summary>
+        /// 安全库存
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("安全库存")]
+        public decimal? security_stock { get; set; }
+
+        /// <summary>
+        /// 圆整后供应批量
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("圆整后供应批量")]
+        public decimal? eop { get; set; }
+
+        /// <summary>
+        /// 重新订货点
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("重新订货点")]
+        public decimal? rop_computed { get; set; }
+
+        /// <summary>
+        /// 月均出库最高库存
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("月均出库最高库存")]
+        public decimal? max_stock_level { get; set; }
+
+        /// <summary>
+        /// 修正后重新订货点
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("修正后重新订货点")]
+        public decimal? rop_revised { get; set; }
+
+        /// <summary>
+        /// 该月触发补货量
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("该月触发补货量")]
+        public decimal? montheop1 { get; set; }
+
+        /// <summary>
+        /// 该月触发安全库存补货量
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("该月触发安全库存补货量")]
+        public decimal? montheop2 { get; set; }
+
+        /// <summary>
+        /// 可用库存
+        /// </summary>
+        [Precision(20, 8)]
+        [Comment("可用库存")]
+        public decimal? avaStockQty { get; set; }
+
+        /// <summary>
+        /// 销售/渠道   
+        /// </summary>
+        [Comment("销售/渠道")]
+        public string distributionchannel { get; set; }
+
+        /// <summary>
+        /// 年份
+        /// </summary>
+        [Comment("年份")]
+        public int? year { get; set; }
+
+        /// <summary>
+        /// 月份
+        /// </summary>
+        [Comment("月份")]
+        public int? month { get; set; }
+
+        /// <summary>
+        /// 计划年月
+        /// </summary>
+        [Comment("计划年月")]
+        public string planmonth { get; set; }
+
+        /// <summary>
+        /// 产品线    
+        /// </summary>
+        [StringLength(128)]
+        [Comment("产品线")]
+        public string? ProdLine { get; set; }
+
+        /// <summary>
+        /// 产品系列    
+        /// </summary>
+        [StringLength(128)]
+        [Comment("产品系列")]
+        public string? ProdRange { get; set; }
+
+        /// <summary>
+        /// 语种    
+        /// </summary>
+        [StringLength(128)]
+        [Comment("语种")]
+        public string? Languages { get; set; }
+
+
+    }
+}

+ 17 - 0
MicroServices/Business/Business.Domain/StructuredDB/Replenishment/ReplenishmentWeekPlan.cs

@@ -42,6 +42,13 @@ namespace Business.StructuredDB.Replenishment
         [Comment("开工日期星期")]
         public string? Week { get; set; }
 
+        /// <summary>
+        /// 计算星期(标识已经计算的周次)
+        /// </summary>
+        [StringLength(128)]
+        [Comment("计算星期")]
+        public string? CalcWeek { get; set; }
+
         /// <summary>
         /// 订单号
         /// </summary>
@@ -200,5 +207,15 @@ namespace Business.StructuredDB.Replenishment
         /// 是否为周补货计划,Y/N
         /// </summary>
         public string IsReplenishmentModel { get; set; }
+
+        //周生产计划的年
+        public int? Year { get; set; }  
+        //周生产计划的月份
+        public int? Month { get; set; }
+        //周生产计划在月份中的周次,0,1,2,3
+        public int? WeekSeq { get; set; }
+
+        //计划年月
+        public string? PlanMonth { get; set; }
     }
 }

+ 7 - 0
MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/BusinessDbContextModelCreatingExtensions.cs

@@ -291,6 +291,13 @@ namespace Business.EntityFrameworkCore
                 b.ConfigureByConvention();
             });
 
+            builder.Entity<ReplenishmentROPWeekPlan>(b =>
+            {
+                b.ToTable("ReplenishmentROPWeekPlan");
+                b.HasIndex(b => new { b.number, b.fversion, b.planmonth, b.tenant_id, b.company_id, b.factory_id });
+                b.ConfigureByConvention();
+            });
+
             //Code generation...
 
             //添加表名字段名描述属性,请放在最后,会导致NotMap不生效

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

@@ -267,6 +267,7 @@ namespace Business.EntityFrameworkCore
         public DbSet<WMS_PlatformSpecificationComparison> WMS_PlatformSpecificationComparison { get; set; }
 
         public DbSet<ReplenishmentROP> ReplenishmentROP { get; set; }
+        public DbSet<ReplenishmentROPWeekPlan> ReplenishmentROPWeekPlan { get; set; }
 
         public DbSet<ASNBOLShipperDetail> ASNBOLShipperDetail { get; set; }
 

Некоторые файлы не были показаны из-за большого количества измененных файлов