Browse Source

Merge branch 'master' into groupmealmanage

groupmealmanage
zhaoy 8 months ago
parent
commit
9fc88893da
4 changed files with 77 additions and 8 deletions
  1. +70
    -0
      BPA.SAAS.Manage.Application/Device/Services/DeviceVesionService.cs
  2. +4
    -3
      BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs
  3. +1
    -0
      BPA.SAAS.Manage.Core/Product/BPA_ProductFunction.cs
  4. +2
    -5
      BPA.SAAS.Manage.Core/Product/BPA_ProductFunctionAction.cs

+ 70
- 0
BPA.SAAS.Manage.Application/Device/Services/DeviceVesionService.cs View File

@@ -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<BPA_ProductFunction> 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<BPA_ProductFunctionAction> 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;
}


+ 4
- 3
BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs View File

@@ -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;


+ 1
- 0
BPA.SAAS.Manage.Core/Product/BPA_ProductFunction.cs View File

@@ -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; }
}
}

+ 2
- 5
BPA.SAAS.Manage.Core/Product/BPA_ProductFunctionAction.cs View File

@@ -30,13 +30,10 @@ namespace BPA.SAAS.Manage.Core.Product
/// </summary>
public string Unit { get; set; }
/// <summary>
/// 是否绑定物料
/// </summary>
public bool? IsBatch { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
// public string GroupId { get; set; }
public bool IsDefault { get; set; }
// public string GroupId { get; set; }
}
}

Loading…
Cancel
Save