tangdi 3 лет назад
Родитель
Сommit
47b3050b21

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

@@ -300,7 +300,7 @@ namespace Business.ResourceExamineManagement
                         var LeadTime = 0.00m;
                         if (plan != null)
                         {
-                            LeadTime = Day + plan.self_inspection_date.Value + plan.Warehousing_date.Value;
+                            LeadTime = Day + plan.self_inspection_date.GetValueOrDefault() + plan.Warehousing_date.GetValueOrDefault();
                         }
                         else
                         {
@@ -612,6 +612,16 @@ namespace Business.ResourceExamineManagement
                         PackageSRMPR(item, bangid, plan_date);
                     }
                 }
+                else
+                {
+                    item.kitting_time = DateTime.Now;
+                    //先计算末级数据的齐套时间。
+                    if (cilList.Count() > 0)
+                    {
+                        CalcIcitem(cilList, returnlist, bangid, sklist, plan_date, icitemlist, sentrys, childidList);
+                        item.kitting_time = cilList.Max(s => s.kitting_time);
+                    }
+                }
             }
             else
             {
@@ -983,6 +993,14 @@ namespace Business.ResourceExamineManagement
                                 PackageSRMPR(sct, bangid, plan_date);
                             }
                         }
+                        else
+                        {
+                            if (cilList.Count() > 0)
+                            {
+                                CalcIcitem(cilList, returnlist, bangid, sklist, plan_date, icitemlist, sentrys, childidList);
+                                sct.kitting_time = cilList.Max(s => s.kitting_time);
+                            }
+                        }
                     }
 
                 }

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

@@ -94,7 +94,7 @@ namespace Business.ResourceExamineManagement
             dto.item_number = item.number;
             dto.model = item.model;
             dto.unit = bom.unit;
-            dto.erp_cls = item.erp_cls;
+            dto.erp_cls = item.erp_cls.GetValueOrDefault();
             dto.erp_cls_name = item.erp_cls_name;
             dto.type = type;
 
@@ -151,7 +151,7 @@ namespace Business.ResourceExamineManagement
                         childDto.num_order = order_num;
                         childDto.model = icitem.model;
                         childDto.unit = c.unit;
-                        childDto.erp_cls = icitem.erp_cls;
+                        childDto.erp_cls = icitem.erp_cls.GetValueOrDefault();
                         childDto.erp_cls_name = icitem.erp_cls_name;
                         childDto.backflush = c.backflush;
                         childDto.qty = c.qty.Value;
@@ -265,7 +265,7 @@ namespace Business.ResourceExamineManagement
             dto.num_order = toDto.num_order;
             dto.model = icitem.model;
             dto.unit = icitem.unit;
-            dto.erp_cls = icitem.erp_cls;
+            dto.erp_cls = icitem.erp_cls.GetValueOrDefault();
             dto.erp_cls_name = icitem.erp_cls_name;
             dto.backflush = toDto.backflush;
             //dto.qty = toDto.qty;

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

@@ -731,7 +731,8 @@ namespace Business.ResourceExamineManagement
             //添加物料bom数据
             bomlist.AddRange(icBoms);
             //获取物料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.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.GetManyByCondition(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();
             //没有明细数据,终止
             if (childList.Count == 0)
             {
@@ -1468,7 +1469,6 @@ namespace Business.ResourceExamineManagement
         {
             //获取物料bom,物料bom明细
             GetIcBomData(boms, bomlist, bomchildlist);
-
             //根据明细集合查出所有得替代关系表数据集合
             List<string> codeList = bomchildlist.Select(c => c.substitute_code).ToList();
             sublist.AddRange(_ic_substitute.GetManyByCondition(p => codeList.Contains(p.substitute_code) && !p.IsDeleted).Result);

+ 2 - 3
MicroServices/Business/Bussiness.Model/MES/IC/ic_bom_child.cs

@@ -19,7 +19,7 @@ namespace Bussiness.Model.MES.IC
         /// </summary>
         [Required]
         [Comment("bom主键")]
-        public long bom_id { get; set; }
+        public long? bom_id { get; set; }
         /// <summary>
         /// bom单编号
         /// </summary>
@@ -29,7 +29,6 @@ namespace Bussiness.Model.MES.IC
         /// <summary>
         /// 是否是BOM
         /// </summary>
-        [Required]
         [Comment("是否是BOM")]
         public int? is_bom { get; set; }
         /// <summary>
@@ -37,7 +36,7 @@ namespace Bussiness.Model.MES.IC
         /// </summary>
         [Required]
         [Comment("物料id")]
-        public long icitem_id { get; set; }
+        public long? icitem_id { get; set; }
         /// <summary>
         /// 物料代码
         /// </summary>

+ 2 - 2
MicroServices/Business/Bussiness.Model/MES/IC/ic_item_pur.cs

@@ -32,8 +32,9 @@ namespace Bussiness.Model.MES.IC
         /// <summary>
         /// 采购计划id
         /// </summary>
+        [StringLength(24)]
         [Comment("采购计划id")]
-        public long? ic_plan_id { get; set; }
+        public string? ic_plan_id { get; set; }
         /// <summary>
         /// 供应商id
         /// </summary>
@@ -84,7 +85,6 @@ namespace Bussiness.Model.MES.IC
         /// <summary>
         /// 币种
         /// </summary>
-        [Required]
         [Comment("币种")]
         public long? currency_type { get; set; }
 

+ 9 - 0
MicroServices/Business/Bussiness.Model/MES/IC/ic_substitute_all_dtl.cs

@@ -38,6 +38,15 @@ namespace Bussiness.Model.MES.IC
         [Required]
         [Comment("物料主键")]
         public long icitem_id { get; set; }
+
+        /// <summary>
+        /// 物料编码
+        /// </summary>]
+        [StringLength(20)]
+        [Comment("物料编码")]
+        public string? icitem_number { get; set; }
+
+
         /// <summary>
         /// 主/替
         /// </summary>

+ 16 - 20
MicroServices/Business/Bussiness.MongoModel/MES/IC/mo_ic_item.cs

@@ -71,10 +71,11 @@ namespace Bussiness.MongoModel.MES.IC
         /// 物料属性
         /// </summary>
         [Comment("物料属性")]
-        public int erp_cls { get; set; }
+        public int? erp_cls { get; set; }
         /// <summary>
         /// 物料属性名称
         /// </summary>
+        [StringLength(80)]
         [Comment("物料属性")]
         public string? erp_cls_name { get; set; }
         /// <summary>
@@ -86,15 +87,13 @@ namespace Bussiness.MongoModel.MES.IC
         /// <summary>
         /// 物料等级
         /// </summary>
-        [Required]
         [Comment("物料等级")]
-        public long item_level { get; set; }
+        public long? item_level { get; set; }
         /// <summary>
         /// 环保等级
         /// </summary>
-        [Required]
         [Comment("环保等级")]
-        public long hb_level { get; set; }
+        public long? hb_level { get; set; }
         /// <summary>
         /// 单位标准工时_小时
         /// </summary>
@@ -117,7 +116,7 @@ namespace Bussiness.MongoModel.MES.IC
         /// 是否为设备
         /// </summary>
         [Comment("是否为设备")]
-        public int is_equipment { get; set; }
+        public int? is_equipment { get; set; }
         /// <summary>
         /// 单位包装数量
         /// </summary>
@@ -134,7 +133,7 @@ namespace Bussiness.MongoModel.MES.IC
         /// 是否关键件
         /// </summary>
         [Comment("是否关键件")]
-        public int iskeyitem { get; set; }
+        public int? iskeyitem { get; set; }
         /// <summary>
         /// 毛重
         /// </summary>
@@ -186,39 +185,38 @@ namespace Bussiness.MongoModel.MES.IC
         /// <summary>
         /// 物料类别
         /// </summary>
-        [Required]
         [Comment("物料类别")]
-        public long matatt { get; set; }
+        public long? matatt { get; set; }
         /// <summary>
         /// 允许采购
         /// </summary>
         [Comment("允许采购")]
-        public int allowpur { get; set; }
+        public int? allowpur { get; set; }
         /// <summary>
         /// 允许销售
         /// </summary>
         [Comment("允许销售")]
-        public int allowsale { get; set; }
+        public int? allowsale { get; set; }
         /// <summary>
         /// 允许生产
         /// </summary>
         [Comment("允许生产")]
-        public int allowmanu { get; set; }
+        public int? allowmanu { get; set; }
         /// <summary>
         /// 允许委外
         /// </summary>
         [Comment("允许委外")]
-        public int allowout { get; set; }
+        public int? allowout { get; set; }
         /// <summary>
         /// 批号管理
         /// </summary>
         [Comment("批号管理")]
-        public int allowbatch { get; set; }
+        public int? allowbatch { get; set; }
         /// <summary>
         /// 序列号管理
         /// </summary>
         [Comment("序列号管理")]
-        public int allowserial { get; set; }
+        public int? allowserial { get; set; }
         /// <summary>
         /// 图片
         /// </summary>
@@ -228,19 +226,17 @@ namespace Bussiness.MongoModel.MES.IC
         /// <summary>
         /// 领料类型
         /// </summary>
-        [Required]
         [Comment("领料类型")]
-        public long picktype { get; set; }
+        public long? picktype { get; set; }
         /// <summary>
         /// 出库类型
         /// </summary>
-        [Required]
         [Comment("出库类型")]
-        public long output_type_id { get; set; }
+        public long? output_type_id { get; set; }
         /// <summary>
         /// 启用预警
         /// </summary>
         [Comment("启用预警")]
-        public int enable_warning { get; set; }
+        public int? enable_warning { get; set; }
     }
 }

+ 2 - 3
MicroServices/Business/Bussiness.MongoModel/MES/IC/mo_ic_item_pur.cs

@@ -29,9 +29,9 @@ namespace Bussiness.MongoModel.MES.IC
         /// <summary>
         /// 采购计划id
         /// </summary>
-        [Required]
+        [StringLength(24)]
         [Comment("采购计划id")]
-        public long ic_plan_id { get; set; }
+        public string? ic_plan_id { get; set; }
         /// <summary>
         /// 供应商id
         /// </summary>
@@ -83,7 +83,6 @@ namespace Bussiness.MongoModel.MES.IC
         /// <summary>
         /// 币种
         /// </summary>
-        [Required]
         [Comment("币种")]
         public long? currency_type { get; set; }
     }