heteng 3 лет назад
Родитель
Сommit
8feea93dae

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

@@ -108,6 +108,7 @@ namespace Business
 
             CreateMap<OrderResourceDto, b_order_examine_result>();
             CreateMap<OrderItemDto, b_order_detail>();
+            CreateMap<DayBulletinBoard, b_day_bulletin_board>();
 
             CreateMap<mo_occupy, b_mo_occupy>()
                 .ForMember(d => d.Id, map => map.MapFrom(o => o.id));

+ 15 - 0
MicroServices/Business/Business.Application/ResourceExamineManagement/ResourceExamineAppService.cs

@@ -1281,6 +1281,7 @@ namespace Business.ResourceExamineManagement
             //检查结果写入数据库
             List<b_order_examine_result> examineList = new List<b_order_examine_result>();
             List<b_order_detail> orderDetails = new List<b_order_detail>();
+            List<b_day_bulletin_board> daybulletinboards = new List<b_day_bulletin_board>();
 
             foreach (var ex in rtn.KittingCheckResultList)
             {
@@ -1300,6 +1301,16 @@ namespace Business.ResourceExamineManagement
                     orderDetails.Add(detail);
                 });
             }
+
+            foreach (var item in rtn.DayBulletinBoardList)
+            {
+                var detail = ObjectMapper.Map<DayBulletinBoard, b_day_bulletin_board>(item);
+                detail.GenerateNewId();
+                detail.create_time = DateTime.Now.Date;
+                detail.tenant_id = param.tenantId;
+                detail.factory_id = param.factoryId;
+                daybulletinboards.Add(detail);
+            }
             if (examineList.Any())
             {
                 await _businessBangDbContext.b_order_examine_result.BulkInsertAsync(examineList,options=>options.AutoMapOutputDirection = false);
@@ -1308,6 +1319,10 @@ namespace Business.ResourceExamineManagement
             {
                 await _businessBangDbContext.b_order_detail.BulkInsertAsync(orderDetails, options => options.AutoMapOutputDirection = false);
             }
+            if (daybulletinboards.Any())
+            {
+                await _businessBangDbContext.b_day_bulletin_board.BulkInsertAsync(daybulletinboards, options => options.AutoMapOutputDirection = false);
+            }
             
             return JsonConvert.SerializeObject(rtn);
         }

+ 2 - 0
MicroServices/Business/Business.EntityFrameworkCore/EntityFrameworkCore/Bang/BusinessBangDbContext.cs

@@ -43,6 +43,8 @@ namespace Business.EntityFrameworkCore
         public DbSet<b_order_detail> b_order_detail { get; set; }
 
         public DbSet<b_order_examine_result> b_order_examine_result { get; set; }
+
+        public DbSet<b_day_bulletin_board> b_day_bulletin_board { get; set; }
         #endregion
 
         public BusinessBangDbContext(DbContextOptions<BusinessBangDbContext> options)

+ 68 - 0
MicroServices/Business/Bussiness.Model/Bang/b_day_bulletin_board.cs

@@ -0,0 +1,68 @@
+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_day_bulletin_board")]
+    [Comment("物料齐套明细")]
+    public class b_day_bulletin_board : BaseEntity
+    {
+        /// <summary>
+        /// 日期
+        /// </summary>
+        [Comment("日期")]
+        public string? day { get; set; }
+
+        /// <summary>
+        /// 物料名称
+        /// </summary>
+        [Comment("物料名称")]
+        public string? item_name { get; set; }
+
+        /// <summary>
+        /// 物料编码
+        /// </summary>
+        [Comment("物料编码")]
+        public string? item_number { get; set; }
+
+        /// <summary>
+        /// 库存占用数量
+        /// </summary>
+        [Comment("库存占用数量")]
+        public decimal? use_qty { get; set; }
+
+        /// <summary>
+        /// 自制数量
+        /// </summary>
+        [Comment("自制数量")]
+        public decimal? make_qty { get; set; }
+
+        /// <summary>
+        /// 在制占用数量
+        /// </summary>
+        [Comment("在制占用数量")]
+        public decimal? mo_qty { get; set; }
+
+        /// <summary>
+        /// 采购占用数量
+        /// </summary>
+        [Comment("采购占用数量")]
+        public decimal? purchase_occupy_qty { get; set; }
+
+        /// <summary>
+        /// 缺料数量
+        /// </summary>
+        [Comment("缺料数量")]
+        public decimal? self_lack_qty { get; set; }
+    }
+}