Parcourir la source

计算结果存储。

tangdi il y a 3 ans
Parent
commit
7388052cda

+ 25 - 10
MicroServices/Business/Business.Application.Contracts/ResourceExamineManagement/Dto/BomChildExamineDto.cs

@@ -183,16 +183,6 @@ namespace Business.ResourceExamineManagement.Dto
         /// </summary>
         public List<ooder> subcontracting_list { get; set; }
 
-        /// <summary>
-        /// 委外占用数量
-        /// </summary>
-        public decimal subcontracting_occupy_qty { get; set; }
-
-        /// <summary>
-        /// 委外工单占用明细
-        /// </summary>
-        public List<purchase_occupy> subcontracting_occupy_list { get; set; }
-
         /// <summary>
         /// 齐套时间
         /// </summary>
@@ -264,6 +254,11 @@ namespace Business.ResourceExamineManagement.Dto
     /// </summary>
     public class moorder
     {
+        /// <summary>
+        /// 主键
+        /// </summary>
+        public long? Id { get; set; }
+
         /// <summary>
         /// 生产工单编号
         /// </summary>
@@ -319,6 +314,11 @@ namespace Business.ResourceExamineManagement.Dto
     /// </summary>
     public class mo_occupy
     {
+        /// <summary>
+        /// 主键
+        /// </summary>
+        public long? id { get; set; }
+
         /// <summary>
         /// 工单号
         /// </summary>
@@ -345,6 +345,11 @@ namespace Business.ResourceExamineManagement.Dto
     /// </summary>
     public class purchase
     {
+        /// <summary>
+        /// 主键
+        /// </summary>
+        public long? Id { get; set; }
+
         /// <summary>
         /// pr单号
         /// </summary>
@@ -405,6 +410,11 @@ namespace Business.ResourceExamineManagement.Dto
     /// </summary>
     public class purchase_occupy
     {
+        /// <summary>
+        /// 主键
+        /// </summary>
+        public long? id { get; set; }
+
         /// <summary>
         /// 采购订单单号
         /// </summary>
@@ -430,6 +440,11 @@ namespace Business.ResourceExamineManagement.Dto
     /// 委外工单信息
     /// </summary>
     public class ooder {
+        /// <summary>
+        /// 主键
+        /// </summary>
+        public long? Id { get; set; }
+
         /// <summary>
         /// 工单编号
         /// </summary>

+ 11 - 0
MicroServices/Business/Business.Application.Contracts/ResourceExamineManagement/Dto/PschedDto.cs

@@ -6,6 +6,7 @@ using Bussiness.Model.MES.IC;
 using Bussiness.Model.Production;
 using Bussiness.MongoModel.MES.IC;
 using Bussiness.MongoModel.Production;
+using Microsoft.EntityFrameworkCore;
 
 namespace Business.ResourceExamineManagement.Dto
 {
@@ -64,11 +65,21 @@ namespace Business.ResourceExamineManagement.Dto
         /// </summary>
         public long? sorderid { get; set; }
 
+        /// <summary>
+        /// 订单编号
+        /// </summary>
+        public string? bill_no { get; set; }
+
         /// <summary>
         /// 订单行id
         /// </summary>
         public long? sentry_id { get; set; }
 
+        /// <summary>
+        /// 行号
+        /// </summary>
+        public int? entry_seq { get; set; }
+
         /// <summary>
         /// 工单id
         /// </summary>

+ 24 - 0
MicroServices/Business/Business.Application/BusinessApplicationAutoMapperProfile.cs

@@ -1,5 +1,6 @@
 using AutoMapper;
 using Business.ResourceExamineManagement.Dto;
+using Bussiness.Model.Bang;
 using Bussiness.Model.MES.IC;
 using Bussiness.Model.Production;
 using Bussiness.Model.ProductionProcess;
@@ -98,6 +99,29 @@ namespace Business
             CreateMap<mes_oorder, mo_mes_oorder>()
                .ForMember(d => d.mysql_id, map => map.MapFrom(o => o.Id));
             #endregion
+
+            #region Bang
+            CreateMap<BomChildExamineDto, b_bom_child_examine>()
+                .ForMember(d => d.Id, map => map.MapFrom(o => o.id));
+
+            CreateMap<ExamineResult, b_examine_result>();
+
+            CreateMap<mo_occupy, b_mo_occupy>()
+                .ForMember(d => d.Id, map => map.MapFrom(o => o.id));
+
+            CreateMap<moorder, b_mo_order>()
+                .ForMember(d => d.Id, map => map.MapFrom(o => o.Id));
+
+            CreateMap<ooder, b_ooder>()
+                .ForMember(d => d.Id, map => map.MapFrom(o => o.Id));
+
+            CreateMap<purchase, b_purchase>()
+                .ForMember(d => d.Id, map => map.MapFrom(o => o.Id));
+
+            CreateMap<purchase_occupy, b_purchase_occupy>()
+                .ForMember(d => d.Id, map => map.MapFrom(o => o.id));
+
+            #endregion
         }
     }
 }

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

@@ -203,6 +203,7 @@ namespace Business.ResourceExamineManagement
                     mooccupylist.ForEach(s =>
                     {
                         mo_occupy mooc = new mo_occupy();
+                        mooc.id = s.id;
                         mooc.moo_mo = s.moo_mo;
                         mooc.moo_stime = s.moo_ctime;
                         mooc.moo_etime = s.moo_etime;
@@ -312,6 +313,7 @@ namespace Business.ResourceExamineManagement
                     mes_MorderDto.mes_Morders.ForEach(me =>
                     {
                         moorder mo = new moorder();
+                        mo.Id = me.id;
                         mo.moentry_stime = me.moentry_stime;
                         mo.moentry_etime = me.moentry_etime;
                         mo.moentry_wrkcname = me.moentry_wrkcname;
@@ -591,6 +593,7 @@ namespace Business.ResourceExamineManagement
                         item.subcontracting_qty = item.lack_qty;
                         item.subcontracting_list = new List<ooder>();
                         ooder oo = new ooder();
+                        oo.Id = mesorder.id;
                         oo.morder_production_number = mesorder.morder_production_number;
                         oo.production_unit = mesorder.production_unit;
                         oo.production_unit_code = mesorder.production_unit_code;
@@ -962,6 +965,7 @@ namespace Business.ResourceExamineManagement
                                 sct.subcontracting_qty = sct.lack_qty;
                                 sct.subcontracting_list = new List<ooder>();
                                 ooder oo = new ooder();
+                                oo.Id = mesorder.id;
                                 oo.morder_production_number = mesorder.morder_production_number;
                                 oo.production_unit = mesorder.production_unit;
                                 oo.production_unit_code = mesorder.production_unit_code;
@@ -1146,6 +1150,7 @@ namespace Business.ResourceExamineManagement
                 item.kitting_time = occupylist[0].etime;
                 occupylist.ForEach(s => {
                     purchase_occupy ocp = new purchase_occupy();
+                    ocp.id = s.id;
                     ocp.stime = s.stime;
                     ocp.etime = s.etime;
                     ocp.qty = s.qty;
@@ -1171,6 +1176,7 @@ namespace Business.ResourceExamineManagement
             if (SRMPRDto.srm_Pr_Main != null)
             {
                 purchase pur = new purchase();
+                pur.Id = SRMPRDto.srm_Pr_Main.id;
                 pur.pr_billno = SRMPRDto.srm_Pr_Main.pr_billno;
                 pur.pr_purchasenumber = SRMPRDto.srm_Pr_Main.pr_purchasenumber;
                 pur.pr_purchasename = SRMPRDto.srm_Pr_Main.pr_purchasename;

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

@@ -2,6 +2,7 @@ using Business.Core.Enum;
 using Business.Core.MongoDBHelper;
 using Business.Core.Utilities;
 using Business.ResourceExamineManagement.Dto;
+using Bussiness.Model.Bang;
 using Bussiness.Model.MES.IC;
 using Bussiness.Model.Production;
 using Bussiness.Model.Sale;
@@ -25,6 +26,7 @@ using Volo.Abp.Application.Services;
 using Volo.Abp.DependencyInjection;
 using Volo.Abp.Domain.Repositories;
 using Volo.Abp.MultiTenancy;
+using Volo.Abp.ObjectMapping;
 
 namespace Business.ResourceExamineManagement
 {
@@ -475,7 +477,9 @@ namespace Business.ResourceExamineManagement
                 //工单资源检查信息
                 dtl = new ExamineResult();
                 dtl.sorderid = rtn.sorderid;
+                dtl.bill_no = sorder.bill_no;
                 dtl.sentry_id = item.Id;
+                dtl.entry_seq = item.entry_seq;
                 //TODO:最早开始时间默认3天后(后期调整)
                 dtl.earliest_times = DateTime.Now.Date.AddDays(3);
 
@@ -538,10 +542,87 @@ namespace Business.ResourceExamineManagement
                 await _srm_pr_main.InsertMany(prlist);
                 rtn.srm_pr_list = _CalcBomViewAppService.SRMPRDtoList;
             }
-
             rtn.examines = examines;
             rtn.item_stockoccupy_list = sklist;
 
+            //检查结果写入数据库
+            var b_Examine_Results = ObjectMapper.Map<List<ExamineResult>, List<b_examine_result>>(rtn.examines);
+            List<b_examine_result> examineList = new List<b_examine_result>();
+            List<b_bom_child_examine> bomExamineList = new List<b_bom_child_examine>();
+            List<b_mo_occupy> mooccupyList = new List<b_mo_occupy>();
+            List<b_mo_order> moorderList = new List<b_mo_order>();
+            List<b_ooder> ooderList = new List<b_ooder>();
+            List<b_purchase> purchaseList = new List<b_purchase>();
+            List<b_purchase_occupy> purchaseoccupyList = new List<b_purchase_occupy>();
+
+            foreach (var ex in rtn.examines)
+            {
+                var b_ex = ObjectMapper.Map<ExamineResult, b_examine_result>(ex);
+                examineList.Add(b_ex);
+                ex.BomChildExamineList.ForEach(s => {
+                    var bc_ex = ObjectMapper.Map<BomChildExamineDto, b_bom_child_examine>(s);
+                    b_ex.GenerateNewId();// = help.NextId();
+                    bc_ex.examine_id = b_ex.Id;
+                    bomExamineList.Add(bc_ex);
+
+                    if(s.mo_occupy_list != null)
+                    {
+                        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; });
+                        mooccupyList.AddRange(olist);
+                    }
+                    if (s.make_list != null)
+                    {
+                        var mlist = ObjectMapper.Map<List<moorder>, List<b_mo_order>>(s.make_list);
+                        mlist.ForEach(o => { o.bom_child_examine_id = bc_ex.Id; });
+                        moorderList.AddRange(mlist);
+                    }
+                    if (s.subcontracting_list != null)
+                    {
+                        var slist = ObjectMapper.Map<List<ooder>, List<b_ooder>>(s.subcontracting_list);
+                        slist.ForEach(o => { o.bom_child_examine_id = bc_ex.Id; });
+                        ooderList.AddRange(slist);
+                    }
+                    if (s.purchase_list != null)
+                    {
+                        var plist = ObjectMapper.Map<List<purchase>, List<b_purchase>>(s.purchase_list);
+                        plist.ForEach(o => { o.bom_child_examine_id = bc_ex.Id; });
+                        purchaseList.AddRange(plist);
+                    }
+                    if (s.purchase_occupy_list != null)
+                    {
+                        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; });
+                        purchaseoccupyList.AddRange(purlist);
+                    }
+                    /*s.mo_occupy_list.ForEach(o => {
+                        var occupy = ObjectMapper.Map<mo_occupy, b_mo_occupy>(o);
+                        occupy.bom_child_examine_id = bc_ex.Id;
+                        mooccupyList.Add(occupy);
+                    });
+                    s.make_list.ForEach(m => {
+                        var order = ObjectMapper.Map<moorder, b_mo_order>(m);
+                        order.bom_child_examine_id = bc_ex.Id;
+                        moorderList.Add(order);
+                    });
+                    s.subcontracting_list.ForEach(sub => {
+                        var oo = ObjectMapper.Map<ooder, b_ooder>(sub);
+                        oo.bom_child_examine_id = bc_ex.Id;
+                        ooderList.Add(oo);
+                    });
+                    s.purchase_list.ForEach(p => {
+                        var pur = ObjectMapper.Map<purchase, b_purchase>(p);
+                        pur.bom_child_examine_id = bc_ex.Id;
+                        purchaseList.Add(pur);
+                    });
+                    s.purchase_occupy_list.ForEach(n => {
+                        var pur_occupy = ObjectMapper.Map<purchase_occupy, b_purchase_occupy>(n);
+                        pur_occupy.bom_child_examine_id = bc_ex.Id;
+                        purchaseoccupyList.Add(pur_occupy);
+                    });*/
+                });
+            }
+
             //清空快照数据
             await ClearSnapShot(bangid);
             return JsonConvert.SerializeObject(rtn);

+ 269 - 0
MicroServices/Business/Bussiness.Model/Bang/b_bom_child_examine.cs

@@ -0,0 +1,269 @@
+using Business.Core.Attributes;
+using Business.Model;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Bussiness.Model.Bang
+{
+    /// <summary>
+    /// Bom明细检查结果
+    /// </summary>
+    [CollectionName("dopbang", "b_bom_child_examine")]
+    [Comment("Bom明细检查结果")]
+    public class b_bom_child_examine : BaseEntity
+    {
+        /// <summary>
+        /// 资源检查ID
+        /// </summary>
+        [Comment("资源检查ID")]
+        public long? examine_id { get; set; }
+
+        /// <summary>
+        /// 父级id
+        /// </summary>
+        [Comment("父级id")]
+        public long? parent_id { get; set; }
+
+        /// <summary>
+        /// bom明细主键
+        /// </summary>
+        [Comment("bom明细主键")]
+        public long? bom_child_id { get; set; }
+
+        /// <summary>
+        /// 版本
+        /// </summary>
+        [StringLength(80)]
+        [Comment("版本")]
+        public string? version { get; set; }
+
+        /// <summary>
+        /// bom编号
+        /// </summary>
+        [Comment("bom编号")]
+        [StringLength(20)]
+        public string? bom_number { get; set; }
+
+        /// <summary>
+        /// 物料编号
+        /// </summary>
+        [Comment("物料编号")]
+        [StringLength(80)]
+        public string? item_number { get; set; }
+
+        /// <summary>
+        /// level
+        /// </summary>
+        [Comment("level")]
+        public int? level { get; set; }
+
+        /// <summary>
+        /// 订单行ID
+        /// </summary>
+        [Comment("订单行ID")]
+        public long? sentry_id { get; set; }
+
+        /// <summary>
+        /// BOMid
+        /// </summary>
+        [Comment("BOMid")]
+        public long? bom_id { get; set; }
+
+        /// <summary>
+        /// 项次号
+        /// </summary>
+        [Comment("项次号")]
+        [StringLength(50)]
+        public string? num { get; set; }
+
+        /// <summary>
+        /// 排序使用
+        /// </summary>
+        [Comment("排序使用")]
+        public long? num_order { get; set; }
+
+        /// <summary>
+        /// 类型 0标准件,1替代件
+        /// </summary>
+        [Comment("类型")]
+        public int? type { get; set; }
+
+        /// <summary>
+        /// 物料id
+        /// </summary>
+        [Comment("物料id")]
+        public long? item_id { get; set; }
+
+        /// <summary>
+        /// 物料名称
+        /// </summary>
+        [Comment("物料名称")]
+        [StringLength(200)]
+        public string? item_name { get; set; }
+
+        /// <summary>
+        /// 规格型号
+        /// </summary>
+        [Comment("规格型号")]
+        [StringLength(200)]
+        public string? model { get; set; }
+
+        /// <summary>
+        /// 单位
+        /// </summary>
+        [Comment("单位")]
+        [StringLength(80)]
+        public string? unit { get; set; }
+
+        /// <summary>
+        /// 物料属性 0.配置类 1.自制 2.委外加工 3.外购 4.虚拟件
+        /// </summary>
+        [Comment("物料属性")]
+        public int? erp_cls { get; set; }
+
+        /// <summary>
+        /// 物料属性名称
+        /// </summary>
+        [Comment("物料属性名称")]
+        [StringLength(80)]
+        public string? erp_cls_name { get; set; }
+
+        /// <summary>
+        /// 是否倒冲
+        /// </summary>
+        [Comment("是否倒冲")]
+        public int? backflush { get; set; }
+
+        /// <summary>
+        /// 单位用量
+        /// </summary>
+        [Comment("单位用量")]
+        public decimal? qty { get; set; }
+
+        /// <summary>
+        /// 库存数量
+        /// </summary>
+        [Comment("库存数量")]
+        public decimal? sqty { get; set; }
+
+        /// <summary>
+        /// 库存占用数量
+        /// </summary>
+        [Comment("库存占用数量")]
+        public decimal? use_qty { get; set; }
+
+        /// <summary>
+        /// 本级缺料数量
+        /// </summary>
+        [Comment("本级缺料数量")]
+        public decimal? self_lack_qty { get; set; }
+
+        /// <summary>
+        /// 缺料数量
+        /// </summary>
+        [Comment("缺料数量")]
+        public decimal? lack_qty { get; set; }
+
+        /// <summary>
+        /// 在制占用数量
+        /// </summary>
+        [Comment("在制占用数量")]
+        public decimal? mo_qty { get; set; }
+
+        /// <summary>
+        /// 自制数量
+        /// </summary>
+        [Comment("自制数量")]
+        public decimal? make_qty { get; set; }
+
+        /// <summary>
+        /// 采购数量
+        /// </summary>
+        [Comment("采购数量")]
+        public decimal? purchase_qty { get; set; }
+
+        /// <summary>
+        /// 采购明细占用数量
+        /// </summary>
+        [Comment("采购明细占用数量")]
+        public decimal? purchase_occupy_qty { get; set; }
+
+        /// <summary>
+        /// 委外数量
+        /// </summary>
+        [Comment("委外数量")]
+        public decimal? subcontracting_qty { get; set; }
+
+        /// <summary>
+        /// 齐套时间
+        /// </summary>
+        [Comment("齐套时间")]
+        public DateTime? kitting_time { get; set; }
+
+        /// <summary>
+        /// 满足时间
+        /// </summary>
+        [Comment("满足时间")]
+        public DateTime? satisfy_time { get; set; }
+
+        /// <summary>
+        /// 是否BOM
+        /// </summary>
+        [Comment("是否BOM")]
+        public int? isbom { get; set; }
+
+        /// <summary>
+        /// 存在替代关系
+        /// </summary>
+        [Comment("存在替代关系")]
+        public int? haveicsubs { get; set; }
+
+        /// <summary>
+        /// 群组代码
+        /// </summary>
+        [Comment("群组代码")]
+        [StringLength(20)]
+        public string? substitute_code { get; set; }
+
+        /// <summary>
+        /// 群组优先级
+        /// </summary>
+        [Comment("群组优先级")]
+        public int? substitute_all_num { get; set; }
+
+        /// <summary>
+        /// 替代策略
+        /// </summary>
+        [Comment("替代策略")]
+        public int? substitute_strategy { get; set; }
+
+        /// <summary>
+        /// 替代方式
+        /// </summary>
+        [Comment("替代方式")]
+        public int? substitute_mode { get; set; }
+
+        /// <summary>
+        /// 物料状态-- -1.无需求 0.缺料 1.充足 2.可制,时间满足 3.可制,时间不满足 4.采购 5.委外
+        /// </summary>
+        [Comment("物料状态")]
+        public int? stock_state { get; set; }
+
+        /// <summary>
+        /// 单个产品总需要用量
+        /// </summary>
+        [Comment("单个产品总需要用量")]
+        public decimal? needCount { get; set; }
+
+        /// <summary>
+        /// 是否使用此物料
+        /// </summary>
+        [Comment("是否使用此物料")]
+        public bool is_use { get; set; }
+    }
+}

+ 96 - 0
MicroServices/Business/Bussiness.Model/Bang/b_examine_result.cs

@@ -0,0 +1,96 @@
+using Business.Core.Attributes;
+using Business.Model;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Bussiness.Model.Bang
+{
+    /// <summary>
+    /// 资源检查
+    /// </summary>
+    [CollectionName("dopbang", "b_examine_result")]
+    [Comment("资源检查")]
+    public class b_examine_result: BaseEntity
+    {
+        /// <summary>
+        /// 订单id
+        /// </summary>
+        [Comment("订单id")]
+        public long? sorderid { get; set; }
+
+        /// <summary>
+        /// 订单编号
+        /// </summary>
+        [StringLength(50)]
+        [Comment("订单编号")]
+        public string? bill_no { get; set; }
+
+        /// <summary>
+        /// 订单行id
+        /// </summary>
+        [Comment("订单行id")]
+        public long? sentry_id { get; set; }
+
+        /// <summary>
+        /// 行号
+        /// </summary>
+        [Comment("行号")]
+        public int? entry_seq { get; set; }
+
+        /// <summary>
+        /// 工单id
+        /// </summary>
+        [Comment("工单id")]
+        public long? morder_id { get; set; }
+
+        /// <summary>
+        /// 工单号
+        /// </summary>
+        [StringLength(50)]
+        [Comment("工单号")]
+        public string? morder_no { get; set; }
+
+        /// <summary>
+        /// BOM编码
+        /// </summary>
+        [StringLength(20)]
+        [Comment("BOM编码")]
+        public string? bom_number { get; set; }
+
+        /// <summary>
+        /// 需要数量
+        /// </summary>
+        [Comment("BOM编码")]
+        [Precision(20, 8)]
+        public decimal? need_qty { get; set; }
+
+        /// <summary>
+        /// 最早开工时间
+        /// </summary>
+        [Comment("最早开工时间")]
+        public DateTime? earliest_times { get; set; }
+
+        /// <summary>
+        /// 最晚开工时间
+        /// </summary>
+        [Comment("最晚开工时间")]
+        public DateTime? latest_times { get; set; }
+
+        /// <summary>
+        /// 工单开工时间
+        /// </summary>
+        [Comment("工单开工时间")]
+        public DateTime? order_statr_time { get; set; }
+
+        /// <summary>
+        /// 物料齐套时间
+        /// </summary>
+        [Comment("物料齐套时间")]
+        public DateTime? kitting_times { get; set; }
+    }
+}

+ 51 - 0
MicroServices/Business/Bussiness.Model/Bang/b_mo_occupy.cs

@@ -0,0 +1,51 @@
+using Business.Core.Attributes;
+using Business.Model;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Bussiness.Model.Bang
+{
+    /// <summary>
+    /// 在制占用明细
+    /// </summary>
+    [CollectionName("dopbang", "b_mo_occupy")]
+    [Comment("在制占用明细")]
+    public class b_mo_occupy : BaseEntity
+    {
+        /// <summary>
+        /// 物料检查明细ID
+        /// </summary>
+        [Comment("物料检查明细ID")]
+        public long? bom_child_examine_id { get; set; }
+
+        /// <summary>
+        /// 工单号
+        /// </summary>
+        [StringLength(50)]
+        [Comment("工单号")]
+        public string? moo_mo { get; set; }
+
+        /// <summary>
+        /// 占用量
+        /// </summary>
+        [Comment("占用量")]
+        public decimal? moo_qty { get; set; }
+
+        /// <summary>
+        /// 开始时间
+        /// </summary>
+        [Comment("开始时间")]
+        public DateTime? moo_stime { get; set; }
+
+        /// <summary>
+        /// 结束时间
+        /// </summary>
+        [Comment("结束时间")]
+        public DateTime? moo_etime { get; set; }
+    }
+}

+ 90 - 0
MicroServices/Business/Bussiness.Model/Bang/b_mo_order.cs

@@ -0,0 +1,90 @@
+using Business.Core.Attributes;
+using Business.Model;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Bussiness.Model.Bang
+{
+    /// <summary>
+    /// 生产工单信息
+    /// </summary>
+    [CollectionName("dopbang", "b_mo_order")]
+    [Comment("生产工单明细")]
+    public class b_mo_order : BaseEntity
+    {
+        /// <summary>
+        /// 物料检查明细ID
+        /// </summary>
+        [Comment("物料检查明细ID")]
+        public long? bom_child_examine_id { get; set; }
+
+        /// <summary>
+        /// 生产工单编号
+        /// </summary>
+        [Comment("生产工单编号")]
+        [StringLength(50)]
+        public string? morder_no { get; set; }
+        /// <summary>
+        /// 生产组织名称
+        /// </summary>
+        [Comment("生产组织名称")]
+        [StringLength(50)]
+        public string? moentry_prdname { get; set; }
+        /// <summary>
+        /// 工作中心名称
+        /// </summary>
+        [Comment("工作中心名称")]
+        [StringLength(50)]
+        public string? moentry_wrkcname { get; set; }
+        /// <summary>
+        /// 生产工单开始日期
+        /// </summary>
+        [Comment("生产工单开始日期")]
+        public DateTime? moentry_stime { get; set; }
+        /// <summary>
+        /// 生产工单结束日期
+        /// </summary>
+        [Comment("生产工单结束日期")]
+        public DateTime? moentry_etime { get; set; }
+        /// <summary>
+        /// 系统建议开工时间
+        /// </summary>
+        [Comment("系统建议开工时间")]
+        public DateTime? moentry_sys_stime { get; set; }
+        /// <summary>
+        /// 系统建议完工时间
+        /// </summary>
+        [Comment("系统建议完工时间")]
+        public DateTime? moentry_sys_etime { get; set; }
+        /// <summary>
+        /// 实际开始时间
+        /// </summary>
+        [Comment("实际开始时间")]
+        public DateTime? reality_start_time { get; set; }
+        /// <summary>
+        /// 实际结束时间
+        /// </summary>
+        [Comment("实际结束时间")]
+        public DateTime? reality_end_time { get; set; }
+        /// <summary>
+        /// 工单所需工时
+        /// </summary>
+        [Comment("工单所需工时")]
+        public decimal? morder_need_time { get; set; }
+        /// <summary>
+        /// 工单生产数量(计划数量)
+        /// </summary>
+        [Comment("工单生产数量")]
+        public decimal? morder_production_number { get; set; }
+        /// <summary>
+        /// 需求数量
+        /// </summary>
+        [Comment("需求数量")]
+        public decimal? need_number { get; set; }
+    }
+}

+ 71 - 0
MicroServices/Business/Bussiness.Model/Bang/b_ooder.cs

@@ -0,0 +1,71 @@
+using Business.Core.Attributes;
+using Business.Model;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Bussiness.Model.Bang
+{
+    /// <summary>
+    /// 委外工单明细
+    /// </summary>
+    [CollectionName("dopbang", "b_ooder")]
+    [Comment("采购占用明细")]
+    public class b_ooder : BaseEntity
+    {
+        /// <summary>
+        /// 物料检查明细ID
+        /// </summary>
+        [Comment("物料检查明细ID")]
+        public long? bom_child_examine_id { get; set; }
+
+        /// <summary>
+        /// 工单编号
+        /// </summary>
+        [Comment("工单编号")]
+        [StringLength(50)]
+        public string? oorder_no { get; set; }
+        /// <summary>
+        /// 委外订单日期
+        /// </summary>
+        [Comment("委外订单日期")]
+        public DateTime? oorder_date { get; set; }
+        /// <summary>
+        /// 生产组织名称
+        /// </summary>
+        [Comment("生产组织名称")]
+        [StringLength(50)]
+        public string? ooentry_prdname { get; set; }
+        /// <summary>
+        /// 计划开工日期
+        /// </summary>
+        [Comment("计划开工日期")]
+        public DateTime? ooentry_stime { get; set; }
+        /// <summary>
+        /// 计划完工日期
+        /// </summary>
+        [Comment("计划完工日期")]
+        public DateTime? ooentry_etime { get; set; }
+        /// <summary>
+        /// 工单生产数量(计划数量)
+        /// </summary>
+        [Comment("工单生产数量")]
+        public decimal? morder_production_number { get; set; }
+        /// <summary>
+        /// 加工单位
+        /// </summary>
+        [Comment("加工单位")]
+        [StringLength(100)]
+        public string? production_unit { get; set; }
+        /// <summary>
+        /// 加工单位编码
+        /// </summary>
+        [Comment("加工单位编码")]
+        [StringLength(20)]
+        public string? production_unit_code { get; set; }
+    }
+}

+ 96 - 0
MicroServices/Business/Bussiness.Model/Bang/b_purchase.cs

@@ -0,0 +1,96 @@
+using Business.Core.Attributes;
+using Business.Model;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Bussiness.Model.Bang
+{
+    /// <summary>
+    /// 采购明细信息
+    /// </summary>
+    [CollectionName("dopbang", "b_purchase")]
+    [Comment("采购明细信息")]
+    public class b_purchase : BaseEntity
+    {
+        /// <summary>
+        /// 物料检查明细ID
+        /// </summary>
+        [Comment("物料检查明细ID")]
+        public long? bom_child_examine_id { get; set; }
+
+        /// <summary>
+        /// pr单号
+        /// </summary>
+        [Comment("pr单号")]
+        [StringLength(50)]
+        public string? pr_billno { get; set; }
+
+        /// <summary>
+        /// 供应商编码
+        /// </summary
+        [Comment("供应商编码")]
+        [StringLength(80)]
+        public string? pr_purchasenumber { get; set; }
+        /// <summary>
+        /// 供应商名称
+        /// </summary>
+        [Comment("供应商名称")]
+        [StringLength(80)]
+        public string? pr_purchasename { get; set; }
+        /// <summary>
+        /// 需求数量
+        /// </summary>
+        [Comment("需求数量")]
+        public decimal? pr_rqty { get; set; }
+        /// <summary>
+        /// 申请数量
+        /// </summary>
+        [Comment("申请数量")]
+        public decimal? pr_aqty { get; set; }
+        /// <summary>
+        /// 建议数量
+        /// </summary>
+        [Comment("建议数量")]
+        public decimal? pr_sqty { get; set; }
+        /// <summary>
+        /// 计划到达日期
+        /// </summary>
+        [Comment("计划到达日期")]
+        public DateTime? pr_parrive_date { get; set; }
+        /// <summary>
+        /// 需求到货日期
+        /// </summary>
+        [Comment("需求到货日期")]
+        public DateTime? pr_rarrive_date { get; set; }
+        /// <summary>
+        /// 采购确认到货日期
+        /// </summary>
+        [Comment("采购确认到货日期")]
+        public DateTime? pr_pur_affirm_date { get; set; }
+        /// <summary>
+        /// 系统价格(含税)
+        /// </summary>
+        [Comment("系统价格(含税)")]
+        public decimal? pr_sysprice { get; set; }
+        /// <summary>
+        /// 订单价格(含税)
+        /// </summary>
+        [Comment("订单价格(含税)")]
+        public decimal? pr_orderprice { get; set; }
+        /// <summary>
+        /// 采购净价(不含税)
+        /// </summary>
+        [Comment("采购净价(不含税)")]
+        public decimal? pr_price { get; set; }
+        /// <summary>
+        /// 税率
+        /// </summary>
+        [Comment("税率")]
+        public decimal? pr_rate { get; set; }
+    }
+}

+ 54 - 0
MicroServices/Business/Bussiness.Model/Bang/b_purchase_occupy.cs

@@ -0,0 +1,54 @@
+using Business.Core.Attributes;
+using Business.Model;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Bussiness.Model.Bang
+{
+    /// <summary>
+    /// 采购占用明细
+    /// </summary>
+    [CollectionName("dopbang", "b_purchase_occupy")]
+    [Comment("采购占用明细")]
+    public class b_purchase_occupy : BaseEntity
+    {
+        /// <summary>
+        /// 物料检查明细ID
+        /// </summary>
+        [Comment("物料检查明细ID")]
+        public long? bom_child_examine_id { get; set; }
+
+        /// <summary>
+        /// 采购订单单号
+        /// </summary>
+        [Comment("采购订单单号")]
+        [StringLength(80)]
+        public string? po_billno { get; set; }
+        /// <summary>
+        /// 类型
+        /// </summary>
+        [Comment("类型")]
+        [StringLength(80)]
+        public string? type { get; set; }
+        /// <summary>
+        /// 占用量
+        /// </summary>
+        [Comment("占用量")]
+        public decimal? qty { get; set; }
+        /// <summary>
+        /// 开始时间
+        /// </summary>
+        [Comment("开始时间")]
+        public DateTime? stime { get; set; }
+        /// <summary>
+        /// 结束时间
+        /// </summary>
+        [Comment("结束时间")]
+        public DateTime? etime { get; set; }
+    }
+}

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

@@ -64,7 +64,7 @@ namespace Bussiness.Model.MES.IC
         /// </summary>
         [Comment("失效日期")]
         public DateTime? end_day { get; set; }
-        /// <summary>
+        /*/// <summary>
         /// 工艺主键
         /// </summary>
         [Required]
@@ -75,7 +75,7 @@ namespace Bussiness.Model.MES.IC
         /// </summary>
         [StringLength(20)]
         [Comment("工艺名称")]
-        public string? tech_name { get; set; }
+        public string? tech_name { get; set; }*/
 
         /// <summary>
         /// 生产负责人

+ 1 - 0
MicroServices/Business/Bussiness.Model/MES/IC/ic_item.cs

@@ -75,6 +75,7 @@ namespace Bussiness.Model.MES.IC
         /// <summary>
         /// 物料属性名称
         /// </summary>
+        [StringLength(80)]
         [Comment("物料属性")]
         public string? erp_cls_name { get; set; }
         /// <summary>