From 5c419d8da812a7f8bda5969ed5973c8f5c174bbc Mon Sep 17 00:00:00 2001 From: zhaoy <137053305@qq.com> Date: Wed, 21 Feb 2024 19:19:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=A8=A1=E5=9E=8B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Device/Services/DeviceVesionService.cs | 70 +++++++++++++++++++ .../Device/Services/ProductFunctionService.cs | 7 +- .../Product/BPA_ProductFunction.cs | 1 + .../Product/BPA_ProductFunctionAction.cs | 7 +- 4 files changed, 77 insertions(+), 8 deletions(-) diff --git a/BPA.SAAS.Manage.Application/Device/Services/DeviceVesionService.cs b/BPA.SAAS.Manage.Application/Device/Services/DeviceVesionService.cs index 2cede9e..7840734 100644 --- a/BPA.SAAS.Manage.Application/Device/Services/DeviceVesionService.cs +++ b/BPA.SAAS.Manage.Application/Device/Services/DeviceVesionService.cs @@ -99,6 +99,76 @@ namespace BPA.SAAS.Manage.Application.Device.Services list.Add(batchingpushtopics); list.Add(chnologypushtopics); await _db.Insertable(list).CallEntityMethod(m => m.Create()).ExecuteCommandAsync(); + List ProductFunctionlist = new(); + var goodsProductFunction = new BPA_ProductFunction() + { + Id=Guid.NewGuid().ToString(), + CreateAt= DateTime.Now, + DataType = "textareaary", + Type = 1, + Name = "商品数据下发", + Description = "商品数据下发", + ProductId = inputDto.ProductId, + DeviceVersionKey = res.Id, + IsDefault = true + }; + var batchingProductFunction = new BPA_ProductFunction() + { + Id = Guid.NewGuid().ToString(), + CreateAt = DateTime.Now, + DataType = "textareaary", + Type = 1, + Name = "物料数据下发", + Description = "物料数据下发", + ProductId = inputDto.ProductId, + DeviceVersionKey = res.Id, + IsDefault = true + }; + var chnologyProductFunction = new BPA_ProductFunction() + { + Id = Guid.NewGuid().ToString(), + CreateAt = DateTime.Now, + DataType = "textareaary", + Type = 1, + Name = "工艺数据下发", + Description = "工艺数据下发", + ProductId = inputDto.ProductId, + DeviceVersionKey = res.Id, + IsDefault = true + }; + ProductFunctionlist.Add(goodsProductFunction); + ProductFunctionlist.Add(batchingProductFunction); + ProductFunctionlist.Add(chnologyProductFunction); + await _db.Insertable(ProductFunctionlist).ExecuteCommandAsync(); + List ProductFunctionActionlist = new(); + var goodsProductFunctionActionlist = new BPA_ProductFunctionAction() + { + ActionType = "textareaary", + ProductFunctionId = goodsProductFunction.Id, + ActionName = "DataSoure", + ActionValue = "", + IsDefault = true + }; + var batchingProductFunctionActionlist = new BPA_ProductFunctionAction() + { + ActionType = "textareaary", + ProductFunctionId = batchingProductFunction.Id, + ActionName = "DataSoure", + ActionValue = "", + IsDefault = true + }; + var chnologyProductFunctionActionlist = new BPA_ProductFunctionAction() + { + ActionType = "textareaary", + ProductFunctionId = chnologyProductFunction.Id, + ActionName = "DataSoure", + ActionValue = "", + IsDefault = true + }; + ProductFunctionActionlist.Add(goodsProductFunctionActionlist); + ProductFunctionActionlist.Add(batchingProductFunctionActionlist); + ProductFunctionActionlist.Add(chnologyProductFunctionActionlist); + await _db.Insertable(ProductFunctionActionlist).CallEntityMethod(m => m.Create()).ExecuteCommandAsync(); _db.Ado.CommitTran(); return res != null; } diff --git a/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs b/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs index 1ce9470..2f613df 100644 --- a/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs +++ b/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs @@ -4,6 +4,7 @@ using BPA.SAAS.Manage.Comm.Const; using BPA.SAAS.Manage.Comm.Enum; using BPA.SAAS.Manage.Core.Base; using BPA.SAAS.Manage.Core.Product; +using Microsoft.AspNetCore.Server.IISIntegration; using Newtonsoft.Json; using NPOI.POIFS.Crypt.Dsig; using NPOI.Util; @@ -60,7 +61,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services BoolLabel = x.BoolLabel, ReadWrite = x.ReadWrite, Description= x.Description, - + IsDefault= x.IsDefault, }) .ToPageListAsync(inputDto.Current, inputDto.PageSize, total); return new PageUtil() @@ -222,7 +223,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services ActionType = inputDto.ActionType, ActionValue = inputDto.ActionValue, Unit = inputDto.Unit, - IsBatch = true,//inputDto.IsBatch, + // IsBatch = true,//inputDto.IsBatch, IsDeleted = 0, Sort = inputDto.Sort, }).CallEntityMethod(m => m.Create()).ExecuteCommandAsync(); ; @@ -244,7 +245,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services data.ActionType = inputDto.ActionType; data.ActionValue = inputDto.ActionValue; data.Unit = inputDto.Unit; - data.IsBatch = inputDto.IsBatch; + // data.IsBatch = inputDto.IsBatch; data.Sort = inputDto.Sort; var res = await _db.Updateable(data).ExecuteCommandAsync(); return res > 0; diff --git a/BPA.SAAS.Manage.Core/Product/BPA_ProductFunction.cs b/BPA.SAAS.Manage.Core/Product/BPA_ProductFunction.cs index 2c5e8b1..0adfda8 100644 --- a/BPA.SAAS.Manage.Core/Product/BPA_ProductFunction.cs +++ b/BPA.SAAS.Manage.Core/Product/BPA_ProductFunction.cs @@ -77,5 +77,6 @@ namespace BPA.SAAS.Manage.Core.Product public string Description { get; set; } public string ProductId { get; set; } public string DataJson { get; set; } + public bool IsDefault { get; set; } } } diff --git a/BPA.SAAS.Manage.Core/Product/BPA_ProductFunctionAction.cs b/BPA.SAAS.Manage.Core/Product/BPA_ProductFunctionAction.cs index effb20a..8348694 100644 --- a/BPA.SAAS.Manage.Core/Product/BPA_ProductFunctionAction.cs +++ b/BPA.SAAS.Manage.Core/Product/BPA_ProductFunctionAction.cs @@ -30,13 +30,10 @@ namespace BPA.SAAS.Manage.Core.Product /// public string Unit { get; set; } /// - /// 是否绑定物料 - /// - public bool? IsBatch { get; set; } - /// /// 排序 /// public int Sort { get; set; } - // public string GroupId { get; set; } + public bool IsDefault { get; set; } + // public string GroupId { get; set; } } }