@@ -747,7 +747,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||||
#endregion | #endregion | ||||
//添加 工艺_{商品名称} | |||||
//添加 功能_{商品名称} | |||||
var tableName = ExcelToShtteName(file.OpenReadStream(), Path.GetExtension(file.FileName)); | var tableName = ExcelToShtteName(file.OpenReadStream(), Path.GetExtension(file.FileName)); | ||||
#region 添加 工艺_{商品名称} | #region 添加 工艺_{商品名称} | ||||
@@ -780,11 +780,11 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||||
var thisName = goodTechnologyModel[i].Name == null ? cName : goodTechnologyModel[i].Name; | var thisName = goodTechnologyModel[i].Name == null ? cName : goodTechnologyModel[i].Name; | ||||
var data = await _db.Queryable<BPA_DeviceTechnology>() | |||||
.Where(x => x.Name == thisName && x.DeviceVersionKey == device.DeviceVersionKey).FirstAsync(); | |||||
var data = await _db.Queryable<BPA_ProductFunction>() | |||||
.Where(x => x.Name == thisName && x.DeviceVersionKey == device.ProductVersionId).FirstAsync(); | |||||
var data2 = await _db.Queryable<BPA_DeviceTechnologyAction>() | |||||
.Where(x => x.ActionName == goodTechnologyModel[i].Configuration && x.DevicetechnologyId == data.Id).FirstAsync(); | |||||
var data2 = await _db.Queryable<BPA_ProductFunctionAction>() | |||||
.Where(x => x.ActionName == goodTechnologyModel[i].Configuration && x.ProductFunctionId == data.Id).FirstAsync(); | |||||
var batching = new BPA_Batching(); | var batching = new BPA_Batching(); | ||||
@@ -849,8 +849,8 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||||
{ | { | ||||
var v1 = json.FirstOrDefault(x => x.actionName == "主料名称"); | var v1 = json.FirstOrDefault(x => x.actionName == "主料名称"); | ||||
var v2 = deviceGoodsPosition.FirstOrDefault(x => x.GoodsName == name2 && x.DeviceName == name1); | var v2 = deviceGoodsPosition.FirstOrDefault(x => x.GoodsName == name2 && x.DeviceName == name1); | ||||
var jsondb = await _db.Queryable<BPA_DeviceTechnologyAction>() | |||||
.Where(x => x.DevicetechnologyId == thisItem.ChnologyId) | |||||
var jsondb = await _db.Queryable<BPA_ProductFunctionAction>() | |||||
.Where(x => x.ProductFunctionId == thisItem.ChnologyId) | |||||
.ToListAsync(); | .ToListAsync(); | ||||
foreach (var item in from item in jsondb let insertableJsondb = json.FirstOrDefault(x => x.technologyactionId == item.Id) where insertableJsondb == null select item) | foreach (var item in from item in jsondb let insertableJsondb = json.FirstOrDefault(x => x.technologyactionId == item.Id) where insertableJsondb == null select item) | ||||
@@ -859,7 +859,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||||
{ | { | ||||
actionName = item.ActionName, | actionName = item.ActionName, | ||||
actionValue = item.ActionName == "主料重量" ? "0" : item.ActionValue, | actionValue = item.ActionName == "主料重量" ? "0" : item.ActionValue, | ||||
chnologyId = item.DevicetechnologyId, | |||||
chnologyId = item.ProductFunctionId, | |||||
index = thisItem.Index, | index = thisItem.Index, | ||||
technologyactionId = item.Id | technologyactionId = item.Id | ||||
@@ -943,7 +943,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||||
var device = await _db.Queryable<BPA_DeviceInfo>().FirstAsync(x => x.Id == deviceId); | var device = await _db.Queryable<BPA_DeviceInfo>().FirstAsync(x => x.Id == deviceId); | ||||
//设备类型 | //设备类型 | ||||
var dictData = await _db.Queryable<BPA_DeviceVesion>().FirstAsync(x => x.Id == device.DeviceVersionKey); | |||||
var dictData = await _db.Queryable<BPA_DeviceVesion>().FirstAsync(x => x.Id == device.ProductVersionId); | |||||
return dictData?.TemplatePath ?? ""; | return dictData?.TemplatePath ?? ""; | ||||
} | } | ||||
@@ -972,14 +972,14 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||||
var source = file.OpenReadStream(); | var source = file.OpenReadStream(); | ||||
var mapper = new Mapper(source); | var mapper = new Mapper(source); | ||||
var deviceVersion = await _db.Queryable<BPA_DeviceVesion>().FirstAsync(x => x.DeviceTypeKey == inputDto.DeviceClientType && x.Vesion == inputDto.Version); | |||||
var deviceVersion = await _db.Queryable<BPA_DeviceVesion>().FirstAsync(x => x.ProductId == inputDto.DeviceClientType && x.Vesion == inputDto.Version); | |||||
//添加 设备_烹饪工序模型 | //添加 设备_烹饪工序模型 | ||||
#region 添加 设备_烹饪工序模型 | #region 添加 设备_烹饪工序模型 | ||||
ReadExcel<GoodstechnologyModel> readGoodstechnologyExcel = new(); | ReadExcel<GoodstechnologyModel> readGoodstechnologyExcel = new(); | ||||
var GoodstechnologyModellist = readGoodstechnologyExcel.ExcelToList(source, mapper); | var GoodstechnologyModellist = readGoodstechnologyExcel.ExcelToList(source, mapper); | ||||
List<BPA_DeviceTechnology> GoodsTechnologyList = new(); | |||||
List<BPA_DeviceTechnologyAction> GoodsTechnologyActionList = new(); | |||||
var GoodsTechnologyListDB = await _db.Queryable<BPA_DeviceTechnology>() | |||||
List<BPA_ProductFunction> GoodsTechnologyList = new(); | |||||
List<BPA_ProductFunctionAction> GoodsTechnologyActionList = new(); | |||||
var GoodsTechnologyListDB = await _db.Queryable<BPA_ProductFunction>() | |||||
.Where(x => x.DeviceVersionKey == deviceVersion.Id).ToListAsync(); | .Where(x => x.DeviceVersionKey == deviceVersion.Id).ToListAsync(); | ||||
string currennaid = ""; | string currennaid = ""; | ||||
string currennaname = ""; | string currennaname = ""; | ||||
@@ -990,7 +990,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||||
if (!string.IsNullOrWhiteSpace(GoodstechnologyModellist[i].Name)) | if (!string.IsNullOrWhiteSpace(GoodstechnologyModellist[i].Name)) | ||||
{ | { | ||||
BPA_DeviceTechnology item = new BPA_DeviceTechnology() | |||||
BPA_ProductFunction item = new BPA_ProductFunction() | |||||
{ | { | ||||
Id = goodsTechnologyId == null ? Guid.NewGuid().ToString() : goodsTechnologyId.Id, | Id = goodsTechnologyId == null ? Guid.NewGuid().ToString() : goodsTechnologyId.Id, | ||||
Name = GoodstechnologyModellist[i].Name, | Name = GoodstechnologyModellist[i].Name, | ||||
@@ -1007,10 +1007,10 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||||
{ | { | ||||
throw Oops.Oh($"类型错误"); | throw Oops.Oh($"类型错误"); | ||||
} | } | ||||
BPA_DeviceTechnologyAction technologyAction = new() | |||||
BPA_ProductFunctionAction technologyAction = new() | |||||
{ | { | ||||
Id = Guid.NewGuid().ToString(), | Id = Guid.NewGuid().ToString(), | ||||
DevicetechnologyId = currennaid, | |||||
ProductFunctionId = currennaid, | |||||
ActionName = GoodstechnologyModellist[i].ActionName, | ActionName = GoodstechnologyModellist[i].ActionName, | ||||
ActionType = CharacterConversion(GoodstechnologyModellist[i].ActionType), | ActionType = CharacterConversion(GoodstechnologyModellist[i].ActionType), | ||||
Sort = i, | Sort = i, | ||||
@@ -1048,12 +1048,12 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||||
//修改添从表 | //修改添从表 | ||||
GoodsTechnologyActionList = GoodsTechnologyActionList.Where(x => !string.IsNullOrEmpty(x.ActionName)).ToList(); | GoodsTechnologyActionList = GoodsTechnologyActionList.Where(x => !string.IsNullOrEmpty(x.ActionName)).ToList(); | ||||
var goodstechnologyIds = GoodsTechnologyList.Select(x => x.Id).ToList(); | var goodstechnologyIds = GoodsTechnologyList.Select(x => x.Id).ToList(); | ||||
var GoodsTechnologyActionListDb = await _db.Queryable<BPA_DeviceTechnologyAction>() | |||||
.Where(x => goodstechnologyIds.Contains(x.DevicetechnologyId)).ToListAsync(); | |||||
var GoodsTechnologyActionListDb = await _db.Queryable<BPA_ProductFunctionAction>() | |||||
.Where(x => goodstechnologyIds.Contains(x.ProductFunctionId)).ToListAsync(); | |||||
foreach (var item in GoodsTechnologyActionList) | foreach (var item in GoodsTechnologyActionList) | ||||
{ | { | ||||
var thisitem = GoodsTechnologyActionListDb.FirstOrDefault(x => item.DevicetechnologyId == x.DevicetechnologyId && item.ActionName == x.ActionName); | |||||
var thisitem = GoodsTechnologyActionListDb.FirstOrDefault(x => item.ProductFunctionId == x.ProductFunctionId && item.ActionName == x.ActionName); | |||||
if (thisitem != null) | if (thisitem != null) | ||||
{ | { | ||||
item.Id = thisitem.Id; | item.Id = thisitem.Id; | ||||
@@ -456,7 +456,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||||
Id = x.Id.SelectAll(), | Id = x.Id.SelectAll(), | ||||
}).Mapper(a => | }).Mapper(a => | ||||
{ | { | ||||
a.GoodsTechnologyInfo = _db.Queryable<BPA_DeviceTechnology>().Where(d => d.DeviceVersionKey == a.DeviceVersionKey).Select(d => new GoodsTechnologyInfo() | |||||
a.GoodsTechnologyInfo = _db.Queryable<BPA_ProductFunction>().Where(d => d.DeviceVersionKey == a.ProductVersionId).Select(d => new GoodsTechnologyInfo() | |||||
{ | { | ||||
DeviceTechnologyId = d.Id, | DeviceTechnologyId = d.Id, | ||||
DeviceVersionKey = d.DeviceVersionKey, | DeviceVersionKey = d.DeviceVersionKey, | ||||
@@ -1,120 +0,0 @@ | |||||
using BPA.SAAS.Manage.Application.Device.Dtos.DeviceTechnology; | |||||
using BPA.SAAS.Manage.Application.Device.Interface; | |||||
using BPA.SAAS.Manage.Core.Base; | |||||
using BPA.SAAS.Manage.Core.Device; | |||||
using Microsoft.AspNetCore.Components.Forms; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Application.Device | |||||
{ | |||||
[ApiDescriptionSettings("Device", Tag = "设备基础工艺信息管理")] | |||||
public class DeviceTechnologyServices: IDynamicApiController, ITransient | |||||
{ | |||||
IDeviceTechnologyService _deviceTechnologyService; | |||||
public DeviceTechnologyServices(IDeviceTechnologyService deviceTechnologyService) | |||||
{ | |||||
_deviceTechnologyService= deviceTechnologyService; | |||||
} | |||||
/// <summary> | |||||
/// 获取工艺基础信息列表 | |||||
/// </summary> | |||||
/// <param name="inputDto"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/devicetechnology/page")] | |||||
public async Task<PageUtil> GetDeviceTechnologyPage(DeviceTechnologyPageBase inputDto) | |||||
{ | |||||
return await _deviceTechnologyService.GetDeviceTechnologyPage(inputDto); | |||||
} | |||||
/// <summary> | |||||
/// 查询所有工艺信息 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet("/api/devicetechnology/getdevicetechnology")] | |||||
public async Task<List<DeviceTechnologyDto>> GetDeviceTechnology() | |||||
{ | |||||
return await _deviceTechnologyService.GetDeviceTechnology(); | |||||
} | |||||
/// <summary> | |||||
/// 添加工艺 | |||||
/// </summary> | |||||
/// <param name="inputDto"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/devicetechnology/add")] | |||||
public async Task<bool> AddDeviceTechnology(DeviceTechnologyBaseDto inputDto) | |||||
{ | |||||
return await _deviceTechnologyService.AddDeviceTechnology(inputDto); | |||||
} | |||||
/// <summary> | |||||
/// 修改工艺 | |||||
/// </summary> | |||||
/// <param name="inputDto"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/devicetechnology/update")] | |||||
public async Task<bool> UpdateDeviceTechnology(DeviceTechnologyBaseDto inputDto) | |||||
{ | |||||
return await _deviceTechnologyService.UpdateDeviceTechnology(inputDto); | |||||
} | |||||
/// <summary> | |||||
/// 删除配方工艺 | |||||
/// </summary> | |||||
/// <param name="ids"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/devicetechnology/delete")] | |||||
public async Task<bool> DeleteDeviceTechnology(List<string> ids) | |||||
{ | |||||
return await _deviceTechnologyService.DeleteDeviceTechnology(ids); | |||||
} | |||||
/// <summary> | |||||
/// 根据工艺id查询工艺模型 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet("/api/devicetechnology/gettechnologyaction")] | |||||
public async Task<List<BPA_DeviceTechnologyAction>> GetTechnologyActionList(string devicetechnologyId) | |||||
{ | |||||
return await _deviceTechnologyService.GetTechnologyActionList(devicetechnologyId); | |||||
} | |||||
/// <summary> | |||||
/// 查询所有工艺模型 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet("/api/devicetechnology/gettechnologyactionlist")] | |||||
public async Task<List<BPA_DeviceTechnologyAction>> GetTechnologyActionList() | |||||
{ | |||||
return await _deviceTechnologyService.GetTechnologyActionList(); | |||||
} | |||||
/// <summary> | |||||
/// 添加工艺模型 | |||||
/// </summary> | |||||
/// <param name="inputDto"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/devicetechnology/adddevicetechnologyaction")] | |||||
public async Task<bool> AddDeviceTechnologyAction(DeviceTechnologyActionBaseDto inputDto) | |||||
{ | |||||
return await _deviceTechnologyService.AddDeviceTechnologyAction(inputDto); | |||||
} | |||||
/// <summary> | |||||
/// 修改工艺模型 | |||||
/// </summary> | |||||
/// <param name="inputDto"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/devicetechnology/updatedevicetechnologyaction")] | |||||
public async Task<bool> UpdateBomTechnology(DeviceTechnologyActionBaseDto inputDto) | |||||
{ | |||||
return await _deviceTechnologyService.UpdateBomTechnology(inputDto); | |||||
} | |||||
/// <summary> | |||||
/// 删除工艺模型 | |||||
/// </summary> | |||||
/// <param name="ids"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/devicetechnology/deldevicetechnologyaction")] | |||||
public async Task<bool> DeleteTechnologyAction(List<string> ids) | |||||
{ | |||||
return await _deviceTechnologyService.DeleteTechnologyAction(ids); | |||||
} | |||||
} | |||||
} |
@@ -74,9 +74,9 @@ namespace BPA.SAAS.Manage.Application.Device | |||||
/// <param name="Code"></param> | /// <param name="Code"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
[HttpGet("/api/devicevesion/getdevicevesion")] | [HttpGet("/api/devicevesion/getdevicevesion")] | ||||
public async Task<List<BPA_DeviceVesion>> GetDeviceVesion(string code) | |||||
public async Task<List<BPA_DeviceVesion>> GetDeviceVesion(string productId) | |||||
{ | { | ||||
return await _deviceVesionService.GetDeviceVesion(code); | |||||
return await _deviceVesionService.GetDeviceVesion(productId); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 查询版本列表 | /// 查询版本列表 | ||||
@@ -1,4 +1,5 @@ | |||||
using System; | |||||
using BPA.SAAS.Manage.Comm.Enum; | |||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | using System.Text; | ||||
@@ -23,12 +24,18 @@ namespace BPA.SAAS.Manage.Application.Device.Dtos.Device | |||||
/// </summary> | /// </summary> | ||||
public string OrgId { get; set; } | public string OrgId { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 设备类型 | |||||
/// 所属产品 | |||||
/// </summary> | /// </summary> | ||||
public string DeviceTypeKey { get; set; } | |||||
public string ProductId { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 设备版本 | |||||
/// 产品标签 | |||||
/// </summary> | /// </summary> | ||||
public string DeviceVersionKey { get; set; } | |||||
public string ProductCode { get; set; } | |||||
/// <summary> | |||||
/// 产品版本 | |||||
/// </summary> | |||||
public string ProductVersionId { get; set; } | |||||
public CommonStatus Status { get; set; } | |||||
public int TechnologyOrBom { get; set; } | |||||
} | } | ||||
} | } |
@@ -1,4 +1,5 @@ | |||||
using System; | |||||
using BPA.SAAS.Manage.Comm.Enum; | |||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | using System.Text; | ||||
@@ -23,9 +24,17 @@ namespace BPA.SAAS.Manage.Application.Device.Dtos.Device | |||||
/// </summary> | /// </summary> | ||||
public string OrgId { get; set; } | public string OrgId { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 设备类型 | |||||
/// 所属产品 | |||||
/// </summary> | /// </summary> | ||||
public string DeviceTypeKey { get; set; } | |||||
public string ProductId { get; set; } | |||||
/// <summary> | |||||
/// 所属产品名称 | |||||
/// </summary> | |||||
public string ProductName { get; set; } | |||||
/// <summary> | |||||
/// 所属产品标签 | |||||
/// </summary> | |||||
public string ProductCode { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 设备AutoKey 唯一用于mqtt消息推送标识 | /// 设备AutoKey 唯一用于mqtt消息推送标识 | ||||
/// </summary> | /// </summary> | ||||
@@ -34,8 +43,10 @@ namespace BPA.SAAS.Manage.Application.Device.Dtos.Device | |||||
/// <summary> | /// <summary> | ||||
/// 设备版本 | /// 设备版本 | ||||
/// </summary> | /// </summary> | ||||
public string DeviceVersionKey { get; set; } | |||||
public string ProductVersionId { get; set; } | |||||
public CommonStatus Status { get; set; } | |||||
public string OrgKey { get; set; } | public string OrgKey { get; set; } | ||||
public string DeviceVersionName { get; set; } | |||||
public string ProductVersionName { get; set; } | |||||
public int TechnologyOrBom { get; set; } | |||||
} | } | ||||
} | } |
@@ -10,6 +10,7 @@ namespace BPA.SAAS.Manage.Application.Device.Dtos.Device | |||||
{ | { | ||||
public string Id { get; set; } | public string Id { get; set; } | ||||
public string Name { get; set; } | public string Name { get; set; } | ||||
public string Code { get; set; } | |||||
public string Key { get; set; } | public string Key { get; set; } | ||||
public string Remark { get; set; } | public string Remark { get; set; } | ||||
} | } | ||||
@@ -1,20 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Application.Device.Dtos.DeviceTechnology | |||||
{ | |||||
public class DeviceTechnologyBaseDto | |||||
{ | |||||
public string Id { get; set; } | |||||
public string Name { get; set; } | |||||
/// <summary> | |||||
/// 状态 0启用 1禁用 | |||||
/// </summary> | |||||
public int Status { get; set; } | |||||
public string ForeignKeyRe { get; set; } | |||||
public string DeviceVersionKey { get; set; } | |||||
} | |||||
} |
@@ -10,7 +10,7 @@ namespace BPA.SAAS.Manage.Application.Device.Dtos.DeviceVesion | |||||
{ | { | ||||
public string Id { get; set; } | public string Id { get; set; } | ||||
public string Vesion { get; set; } | public string Vesion { get; set; } | ||||
public string DeviceTypeKey { get; set; } | |||||
public string ProductId { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 模版路径 | /// 模版路径 | ||||
@@ -0,0 +1,35 @@ | |||||
using BPA.SAAS.Manage.Comm.Enum; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Application.Device.Dtos.DeviceVesion | |||||
{ | |||||
public class DeviceVesionModel | |||||
{ | |||||
public string Id { get; set; } | |||||
public string Vesion { get; set; } | |||||
/// <summary> | |||||
/// 所属产品 | |||||
/// </summary> | |||||
public string ProductId { get; set; } | |||||
/// <summary> | |||||
/// 产品名称 | |||||
/// </summary> | |||||
public string ProductName { get; set; } | |||||
/// <summary> | |||||
/// 产品标签 | |||||
/// </summary> | |||||
public string ProductCode { get; set; } | |||||
/// <summary> | |||||
/// 模版路径 | |||||
/// </summary> | |||||
public string TemplatePath { get; set; } | |||||
/// <summary> | |||||
/// 状态 0启用 1禁用 | |||||
/// </summary> | |||||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE; | |||||
} | |||||
} |
@@ -9,6 +9,6 @@ namespace BPA.SAAS.Manage.Application.Device.Dtos.DeviceVesion | |||||
{ | { | ||||
public class DeviceVesionQueryInputDto : PageInputBase | public class DeviceVesionQueryInputDto : PageInputBase | ||||
{ | { | ||||
public string DeviceTypeKey { get; set; } | |||||
public string ProductId { get; set; } | |||||
} | } | ||||
} | } |
@@ -4,15 +4,15 @@ using System.Linq; | |||||
using System.Text; | using System.Text; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
namespace BPA.SAAS.Manage.Application.Device.Dtos.DeviceTechnology | |||||
namespace BPA.SAAS.Manage.Application.Device.Dtos.ProductFunction | |||||
{ | { | ||||
public class DeviceTechnologyActionBaseDto | |||||
public class ProductFunctionActionBaseDto | |||||
{ | { | ||||
public string Id { get; set; } | public string Id { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 工艺id | |||||
/// 功能id | |||||
/// </summary> | /// </summary> | ||||
public string DevicetechnologyId { get; set; } | |||||
public string ProductFunctionId { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 动作名称 | /// 动作名称 | ||||
/// </summary> | /// </summary> |
@@ -0,0 +1,45 @@ | |||||
using BPA.SAAS.Manage.Comm.Enum; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Application.Device.Dtos.ProductFunction | |||||
{ | |||||
public class ProductFunctionBaseDto | |||||
{ | |||||
public string Id { get; set; } | |||||
public string Name { get; set; } | |||||
/// <summary> | |||||
/// 状态 0启用 1禁用 | |||||
/// </summary> | |||||
public int Status { get; set; } | |||||
public string ForeignKeyRe { get; set; } | |||||
public string DeviceVersionKey { get; set; } | |||||
/// <summary> | |||||
/// 功能类型 0属性1服务2事件 | |||||
/// </summary> | |||||
public int Type { get; set; } | |||||
/// <summary> | |||||
/// 数据类型 | |||||
/// </summary> | |||||
public string DataType { get; set; } | |||||
/// <summary> | |||||
/// 取值范围 | |||||
/// </summary> | |||||
public string DataRange { get; set; } | |||||
/// <summary> | |||||
/// 单位 | |||||
/// </summary> | |||||
public string Unit { get; set; } | |||||
/// <summary> | |||||
/// 步长 | |||||
/// </summary> | |||||
public int StepSize { get; set; } | |||||
/// <summary> | |||||
/// 枚举值 | |||||
/// </summary> | |||||
public string EnumValue { get; set; } | |||||
} | |||||
} |
@@ -4,9 +4,9 @@ using System.Linq; | |||||
using System.Text; | using System.Text; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
namespace BPA.SAAS.Manage.Application.Device.Dtos.DeviceTechnology | |||||
namespace BPA.SAAS.Manage.Application.Device.Dtos.ProductFunction | |||||
{ | { | ||||
public class DeviceTechnologyDto | |||||
public class ProductFunctionDto | |||||
{ | { | ||||
public string Id { get; set; } | public string Id { get; set; } | ||||
public string Name { get; set; } | public string Name { get; set; } |
@@ -5,13 +5,16 @@ using System.Linq; | |||||
using System.Text; | using System.Text; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
namespace BPA.SAAS.Manage.Application.Device.Dtos.DeviceTechnology | |||||
namespace BPA.SAAS.Manage.Application.Device.Dtos.ProductFunction | |||||
{ | { | ||||
public class DeviceTechnologyPageBase | |||||
public class ProductFunctionPageBase | |||||
{ | { | ||||
public int Current { get; set; } | public int Current { get; set; } | ||||
public int PageSize { get; set; } | public int PageSize { get; set; } | ||||
public string Name { get; set; } | public string Name { get; set; } | ||||
public string Type { get; set; } | |||||
public string Vesion { get; set; } | |||||
public string DeviceTypeKey { get; set; } | |||||
public CommonStatus? Status { get; set; } | public CommonStatus? Status { get; set; } | ||||
} | } | ||||
} | } |
@@ -16,7 +16,7 @@ namespace BPA.SAAS.Manage.Application.Device.Interface | |||||
Task<bool> DelDeviceVesionAsync(List<string> inputList); | Task<bool> DelDeviceVesionAsync(List<string> inputList); | ||||
Task<bool> UpdateDeviceVesionAsync(DeviceVesionBaseDto inputDto); | Task<bool> UpdateDeviceVesionAsync(DeviceVesionBaseDto inputDto); | ||||
Task<bool> UpdateDeviceVesionSatatus(DeviceVesionSatatusDto inputDto); | Task<bool> UpdateDeviceVesionSatatus(DeviceVesionSatatusDto inputDto); | ||||
Task<List<BPA_DeviceVesion>> GetDeviceVesion(string Code); | |||||
Task<List<BPA_DeviceVesion>> GetDeviceVesion(string ProductId); | |||||
Task<List<BPA_DeviceVesion>> GetDeviceVesionList(); | Task<List<BPA_DeviceVesion>> GetDeviceVesionList(); | ||||
} | } | ||||
} | } |
@@ -1,4 +1,4 @@ | |||||
using BPA.SAAS.Manage.Application.Device.Dtos.DeviceTechnology; | |||||
using BPA.SAAS.Manage.Application.Device.Dtos.ProductFunction; | |||||
using BPA.SAAS.Manage.Core.Base; | using BPA.SAAS.Manage.Core.Base; | ||||
using BPA.SAAS.Manage.Core.Device; | using BPA.SAAS.Manage.Core.Device; | ||||
using System; | using System; | ||||
@@ -9,64 +9,64 @@ using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Application.Device.Interface | namespace BPA.SAAS.Manage.Application.Device.Interface | ||||
{ | { | ||||
public interface IDeviceTechnologyService | |||||
public interface IProductFunctionService | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 获取工艺基础信息列表 | |||||
/// 获取功能基础信息列表 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="inputDto"></param> | /// <param name="inputDto"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<PageUtil> GetDeviceTechnologyPage(DeviceTechnologyPageBase inputDto); | |||||
Task<PageUtil> GetProductFunctionPage(ProductFunctionPageBase inputDto); | |||||
/// <summary> | /// <summary> | ||||
/// 查询所有工艺信息 | |||||
/// 查询所有功能信息 | |||||
/// </summary> | /// </summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<List<DeviceTechnologyDto>> GetDeviceTechnology(); | |||||
Task<List<ProductFunctionDto>> GetProductFunction(); | |||||
/// <summary> | /// <summary> | ||||
/// 添加工艺 | |||||
/// 添加功能 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="inputDto"></param> | /// <param name="inputDto"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<bool> AddDeviceTechnology(DeviceTechnologyBaseDto inputDto); | |||||
Task<bool> AddProductFunction(ProductFunctionBaseDto inputDto); | |||||
/// <summary> | /// <summary> | ||||
/// 修改工艺 | |||||
/// 修改功能 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="inputDto"></param> | /// <param name="inputDto"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<bool> UpdateDeviceTechnology(DeviceTechnologyBaseDto inputDto); | |||||
Task<bool> UpdateProductFunction(ProductFunctionBaseDto inputDto); | |||||
/// <summary> | /// <summary> | ||||
/// 删除工艺 | |||||
/// 删除功能 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="ids"></param> | /// <param name="ids"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<bool> DeleteDeviceTechnology(List<string> ids); | |||||
Task<bool> DeleteProductFunction(List<string> ids); | |||||
/// <summary> | /// <summary> | ||||
/// 根据工艺id查询工艺模型 | |||||
/// 根据功能id查询功能参数 | |||||
/// </summary> | /// </summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<List<BPA_DeviceTechnologyAction>> GetTechnologyActionList(string devicetechnologyId); | |||||
Task<List<BPA_ProductFunctionAction>> GetProductFunctionActionList(string productFunctionId); | |||||
/// <summary> | /// <summary> | ||||
/// 查询所有工艺模型 | |||||
/// 查询所有功能参数 | |||||
/// </summary> | /// </summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<List<BPA_DeviceTechnologyAction>> GetTechnologyActionList(); | |||||
Task<List<BPA_ProductFunctionAction>> GetProductFunctionActionList(); | |||||
/// <summary> | /// <summary> | ||||
/// 添加工艺模型 | |||||
/// 添加功能参数 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="inputDto"></param> | /// <param name="inputDto"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<bool> AddDeviceTechnologyAction(DeviceTechnologyActionBaseDto inputDto); | |||||
Task<bool> AddProductFunctionAction(ProductFunctionActionBaseDto inputDto); | |||||
/// <summary> | /// <summary> | ||||
/// 修改工艺模型 | |||||
/// 修改功能参数 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="inputDto"></param> | /// <param name="inputDto"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<bool> UpdateBomTechnology(DeviceTechnologyActionBaseDto inputDto); | |||||
Task<bool> UpdateProductFunctionAction(ProductFunctionActionBaseDto inputDto); | |||||
/// <summary> | /// <summary> | ||||
/// 删除工艺模型 | |||||
/// 删除功能参数 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="ids"></param> | /// <param name="ids"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
Task<bool> DeleteTechnologyAction(List<string> ids); | |||||
Task<bool> DeleteProductFunctionAction(List<string> ids); | |||||
} | } | ||||
} | } |
@@ -0,0 +1,120 @@ | |||||
using BPA.SAAS.Manage.Application.Device.Dtos.ProductFunction; | |||||
using BPA.SAAS.Manage.Application.Device.Interface; | |||||
using BPA.SAAS.Manage.Core.Base; | |||||
using BPA.SAAS.Manage.Core.Device; | |||||
using Microsoft.AspNetCore.Components.Forms; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Application.Device | |||||
{ | |||||
[ApiDescriptionSettings("Device", Tag = "设备基础工艺信息管理")] | |||||
public class ProductFunctionServices: IDynamicApiController, ITransient | |||||
{ | |||||
IProductFunctionService _deviceTechnologyService; | |||||
public ProductFunctionServices(IProductFunctionService deviceTechnologyService) | |||||
{ | |||||
_deviceTechnologyService= deviceTechnologyService; | |||||
} | |||||
/// <summary> | |||||
/// 获取功能基础信息列表 | |||||
/// </summary> | |||||
/// <param name="inputDto"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/productfunction/page")] | |||||
public async Task<PageUtil> GetProductFunctionPage(ProductFunctionPageBase inputDto) | |||||
{ | |||||
return await _deviceTechnologyService.GetProductFunctionPage(inputDto); | |||||
} | |||||
/// <summary> | |||||
/// 查询所有功能信息 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet("/api/productfunction/getdevicetechnology")] | |||||
public async Task<List<ProductFunctionDto>> GetProductFunction() | |||||
{ | |||||
return await _deviceTechnologyService.GetProductFunction(); | |||||
} | |||||
/// <summary> | |||||
/// 添加功能 | |||||
/// </summary> | |||||
/// <param name="inputDto"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/productfunction/add")] | |||||
public async Task<bool> AddProductFunction(ProductFunctionBaseDto inputDto) | |||||
{ | |||||
return await _deviceTechnologyService.AddProductFunction(inputDto); | |||||
} | |||||
/// <summary> | |||||
/// 修改功能 | |||||
/// </summary> | |||||
/// <param name="inputDto"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/productfunction/update")] | |||||
public async Task<bool> UpdateProductFunction(ProductFunctionBaseDto inputDto) | |||||
{ | |||||
return await _deviceTechnologyService.UpdateProductFunction(inputDto); | |||||
} | |||||
/// <summary> | |||||
/// 删除功能 | |||||
/// </summary> | |||||
/// <param name="ids"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/productfunction/delete")] | |||||
public async Task<bool> DeleteProductFunction(List<string> ids) | |||||
{ | |||||
return await _deviceTechnologyService.DeleteProductFunction(ids); | |||||
} | |||||
/// <summary> | |||||
/// 根据功能id查询功能参数 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet("/api/productfunction/getproductfunctionaction")] | |||||
public async Task<List<BPA_ProductFunctionAction>> GetProductFunctionActionList(string productFunctionId) | |||||
{ | |||||
return await _deviceTechnologyService.GetProductFunctionActionList(productFunctionId); | |||||
} | |||||
/// <summary> | |||||
/// 查询所有功能参数 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet("/api/productfunction/getproductfunctionactionlist")] | |||||
public async Task<List<BPA_ProductFunctionAction>> GetProductFunctionActionList() | |||||
{ | |||||
return await _deviceTechnologyService.GetProductFunctionActionList(); | |||||
} | |||||
/// <summary> | |||||
/// 添加功能参数 | |||||
/// </summary> | |||||
/// <param name="inputDto"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/productfunction/addproductfunctionaction")] | |||||
public async Task<bool> AddProductFunctionAction(ProductFunctionActionBaseDto inputDto) | |||||
{ | |||||
return await _deviceTechnologyService.AddProductFunctionAction(inputDto); | |||||
} | |||||
/// <summary> | |||||
/// 修改功能参数 | |||||
/// </summary> | |||||
/// <param name="inputDto"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/productfunction/updateproductfunctionaction")] | |||||
public async Task<bool> UpdateProductFunctionAction(ProductFunctionActionBaseDto inputDto) | |||||
{ | |||||
return await _deviceTechnologyService.UpdateProductFunctionAction(inputDto); | |||||
} | |||||
/// <summary> | |||||
/// 删除功能参数 | |||||
/// </summary> | |||||
/// <param name="ids"></param> | |||||
/// <returns></returns> | |||||
[HttpPost("/api/productfunction/delproductfunctionaction")] | |||||
public async Task<bool> DeleteProductFunctionAction(List<string> ids) | |||||
{ | |||||
return await _deviceTechnologyService.DeleteProductFunctionAction(ids); | |||||
} | |||||
} | |||||
} |
@@ -32,22 +32,23 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
public async Task<PageUtil> GetDeviceInfoPage(DeviceQueryInputDto inputDto) | public async Task<PageUtil> GetDeviceInfoPage(DeviceQueryInputDto inputDto) | ||||
{ | { | ||||
RefAsync<int> total =0; | RefAsync<int> total =0; | ||||
var data = await _db.Queryable<BPA_DeviceInfo, BPA_Organize>((a, b) => | |||||
new JoinQueryInfos(JoinType.Inner, a.OrgId == b.Id)) | |||||
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.StoreId), a => a.OrgId == inputDto.StoreId) | |||||
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.DeviceName), a => a.DeviceName.Contains(inputDto.DeviceName)) | |||||
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.DeviceTypeId), a => a.DeviceTypeId == inputDto.DeviceTypeId) | |||||
var data = await _db.Queryable<BPA_DeviceInfo, BPA_Product>((a, b) => new JoinQueryInfos(JoinType.Left, b.Id == a.ProductId)) | |||||
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.StoreId), (a, b) => a.OrgId == inputDto.StoreId) | |||||
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.DeviceName), (a, b) => a.DeviceName.Contains(inputDto.DeviceName)) | |||||
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.DeviceTypeId), (a, b) => a.DeviceTypeId == inputDto.DeviceTypeId) | |||||
.OrderBy((a, b) => a.CreateAt, OrderByType.Desc) | .OrderBy((a, b) => a.CreateAt, OrderByType.Desc) | ||||
.Select((a, b) => new DeviceInfoQueryDto | .Select((a, b) => new DeviceInfoQueryDto | ||||
{ | { | ||||
Id = a.Id.SelectAll(), | Id = a.Id.SelectAll(), | ||||
OrgKey = b.AutoKey, | |||||
DeviceVersionName = "" | |||||
ProductName=b.Name, | |||||
ProductCode=b.Code, | |||||
ProductVersionName = "" | |||||
}) | }) | ||||
.Mapper(x => | .Mapper(x => | ||||
{ | { | ||||
var Vesion = _db.Queryable<BPA_DeviceVesion>().Where(c => c.Id == x.DeviceVersionKey).First(); | |||||
x.DeviceVersionName = Vesion?.Vesion; | |||||
var Vesion = _db.Queryable<BPA_DeviceVesion>().Where(c => c.Id == x.ProductVersionId).First(); | |||||
x.ProductVersionName = Vesion?.Vesion; | |||||
}) | }) | ||||
.ToPageListAsync(inputDto.Current, inputDto.PageSize, total); | .ToPageListAsync(inputDto.Current, inputDto.PageSize, total); | ||||
return new PageUtil() | return new PageUtil() | ||||
@@ -79,9 +80,11 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
public async Task<bool> AddDevice(DeviceInfoBaseDto inputDto) | public async Task<bool> AddDevice(DeviceInfoBaseDto inputDto) | ||||
{ | { | ||||
BPA_DeviceInfo bPA_DeviceInfo = inputDto.Adapt<BPA_DeviceInfo>(); | BPA_DeviceInfo bPA_DeviceInfo = inputDto.Adapt<BPA_DeviceInfo>(); | ||||
var product=_db.Queryable<BPA_Product>().Where(x => x.Id == inputDto.ProductId).First(); | |||||
bPA_DeviceInfo.Status = CommonStatus.ENABLE; | bPA_DeviceInfo.Status = CommonStatus.ENABLE; | ||||
bPA_DeviceInfo.ProductCode= product?.Code; | |||||
var res =await _db.Insertable(bPA_DeviceInfo) .CallEntityMethod(m => m.Create()).ExecuteReturnEntityAsync(); | var res =await _db.Insertable(bPA_DeviceInfo) .CallEntityMethod(m => m.Create()).ExecuteReturnEntityAsync(); | ||||
mqttsub(res.AutoKey, res.DeviceTypeKey); | |||||
mqttsub(res.AutoKey, res.ProductCode); | |||||
return res != null; | return res != null; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -95,18 +98,21 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
if (data != null) | if (data != null) | ||||
{ | { | ||||
mqttsub(data.AutoKey, data.DeviceTypeKey); | |||||
mqttsub(data.AutoKey, data.ProductCode); | |||||
var product = _db.Queryable<BPA_Product>().Where(x => x.Id == inputDto.ProductId).First(); | |||||
var inputData = inputDto.Adapt<BPA_DeviceInfo>(); | var inputData = inputDto.Adapt<BPA_DeviceInfo>(); | ||||
inputData.CreateBy = data.CreateBy; | |||||
inputData.ProductCode = product?.Code; | |||||
var res = await _db.Updateable(inputData) | var res = await _db.Updateable(inputData) | ||||
.UpdateColumns(x => new | .UpdateColumns(x => new | ||||
{ | { | ||||
x.DeviceName, | x.DeviceName, | ||||
x.DeviceTypeId, | x.DeviceTypeId, | ||||
x.OrgId, | x.OrgId, | ||||
x.DeviceTypeKey, | |||||
x.ProductId, | |||||
x.ProductCode, | |||||
x.Status, | x.Status, | ||||
x.DeviceVersionKey | |||||
x.ProductVersionId, | |||||
x.TechnologyOrBom | |||||
}) | }) | ||||
.Where(x => x.Id == inputDto.Id).ExecuteCommandAsync(); | .Where(x => x.Id == inputDto.Id).ExecuteCommandAsync(); | ||||
@@ -27,9 +27,15 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
public async Task<PageUtil> GetDeviceVesionPageAsync(DeviceVesionQueryInputDto inputDto) | public async Task<PageUtil> GetDeviceVesionPageAsync(DeviceVesionQueryInputDto inputDto) | ||||
{ | { | ||||
var total = new RefAsync<int>(); | var total = new RefAsync<int>(); | ||||
var data = await _db.Queryable<BPA_DeviceVesion>().Where((x) => x.IsDeleted == 0) | |||||
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.DeviceTypeKey), x => x.DeviceTypeKey.Contains(inputDto.DeviceTypeKey)) | |||||
.OrderBy(x => x.CreateAt, OrderByType.Desc) | |||||
var data = await _db.Queryable<BPA_DeviceVesion,BPA_Product>((a, b) => new JoinQueryInfos(JoinType.Left, b.Id == a.ProductId)) | |||||
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.ProductId), x => x.ProductId.Contains(inputDto.ProductId)) | |||||
.OrderBy(a => a.CreateAt, OrderByType.Desc) | |||||
.Select((a,b)=>new DeviceVesionModel() | |||||
{ | |||||
Id=a.Id.SelectAll(), | |||||
ProductName=b.Name, | |||||
ProductCode=b.Code, | |||||
}) | |||||
.ToPageListAsync(inputDto.Current, inputDto.PageSize, total); | .ToPageListAsync(inputDto.Current, inputDto.PageSize, total); | ||||
return new PageUtil() | return new PageUtil() | ||||
@@ -50,7 +56,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
var res = await _db.Insertable(new BPA_DeviceVesion | var res = await _db.Insertable(new BPA_DeviceVesion | ||||
{ | { | ||||
Vesion = inputDto.Vesion, | Vesion = inputDto.Vesion, | ||||
DeviceTypeKey = inputDto.DeviceTypeKey, | |||||
ProductId = inputDto.ProductId, | |||||
TemplatePath = inputDto.TemplatePath, | TemplatePath = inputDto.TemplatePath, | ||||
Status = CommonStatus.ENABLE | Status = CommonStatus.ENABLE | ||||
}).CallEntityMethod(m => m.Create()).ExecuteCommandAsync(); | }).CallEntityMethod(m => m.Create()).ExecuteCommandAsync(); | ||||
@@ -63,7 +69,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<bool> DelDeviceVesionAsync(List<string> inputList) | public async Task<bool> DelDeviceVesionAsync(List<string> inputList) | ||||
{ | { | ||||
var data = await _db.Queryable<BPA_DeviceInfo>().Where(x => inputList.Contains(x.DeviceVersionKey)).ToListAsync(); | |||||
var data = await _db.Queryable<BPA_DeviceInfo>().Where(x => inputList.Contains(x.ProductVersionId)).ToListAsync(); | |||||
if (data.Count > 0) | if (data.Count > 0) | ||||
{ | { | ||||
throw Oops.Oh("当前设备类型已使用,无法删除"); | throw Oops.Oh("当前设备类型已使用,无法删除"); | ||||
@@ -86,7 +92,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
{ | { | ||||
var res = _db.Updateable<BPA_DeviceVesion>().SetColumns(t => t.Vesion == inputDto.Vesion) | var res = _db.Updateable<BPA_DeviceVesion>().SetColumns(t => t.Vesion == inputDto.Vesion) | ||||
.SetColumns(t => t.TemplatePath == inputDto.TemplatePath) | .SetColumns(t => t.TemplatePath == inputDto.TemplatePath) | ||||
.SetColumns(t => t.DeviceTypeKey == inputDto.DeviceTypeKey) | |||||
.SetColumns(t => t.ProductId == inputDto.ProductId) | |||||
.SetColumns(t => t.Status == (CommonStatus)inputDto.Status).Where(t => t.Id == inputDto.Id) | .SetColumns(t => t.Status == (CommonStatus)inputDto.Status).Where(t => t.Id == inputDto.Id) | ||||
.ExecuteCommandHasChange(); | .ExecuteCommandHasChange(); | ||||
@@ -116,13 +122,13 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
return false; | return false; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 根据设备编码查询版本 | |||||
/// 根据产品查询版本 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="Code"></param> | /// <param name="Code"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<List<BPA_DeviceVesion>> GetDeviceVesion(string Code) | |||||
public async Task<List<BPA_DeviceVesion>> GetDeviceVesion(string ProductId) | |||||
{ | { | ||||
var resEntity =await _db.Queryable<BPA_DeviceVesion>().Where(a => a.DeviceTypeKey == Code).Select(a => new BPA_DeviceVesion() { Id = a.Id.SelectAll() }).ToListAsync(); | |||||
var resEntity =await _db.Queryable<BPA_DeviceVesion>().Where(a => a.ProductId == ProductId && a.Status==0).Select(a => new BPA_DeviceVesion() { Id = a.Id.SelectAll() }).ToListAsync(); | |||||
return resEntity; | return resEntity; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -1,9 +1,10 @@ | |||||
using BPA.SAAS.Manage.Application.Device.Dtos.DeviceTechnology; | |||||
using BPA.SAAS.Manage.Application.Device.Dtos.ProductFunction; | |||||
using BPA.SAAS.Manage.Application.Device.Interface; | using BPA.SAAS.Manage.Application.Device.Interface; | ||||
using BPA.SAAS.Manage.Comm.Const; | using BPA.SAAS.Manage.Comm.Const; | ||||
using BPA.SAAS.Manage.Comm.Enum; | using BPA.SAAS.Manage.Comm.Enum; | ||||
using BPA.SAAS.Manage.Core.Base; | using BPA.SAAS.Manage.Core.Base; | ||||
using BPA.SAAS.Manage.Core.Device; | using BPA.SAAS.Manage.Core.Device; | ||||
using NPOI.Util; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | using System.Linq; | ||||
@@ -13,27 +14,29 @@ using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Application.Device.Services | namespace BPA.SAAS.Manage.Application.Device.Services | ||||
{ | { | ||||
public class DeviceTechnologyService: IDeviceTechnologyService, ITransient | |||||
public class ProductFunctionService: IProductFunctionService, ITransient | |||||
{ | { | ||||
ISqlSugarClient _db; | ISqlSugarClient _db; | ||||
public DeviceTechnologyService(ISqlSugarClient db) | |||||
public ProductFunctionService(ISqlSugarClient db) | |||||
{ | { | ||||
_db = db; | _db = db; | ||||
} | } | ||||
#region 工艺基础信息 | |||||
#region 产品功能 | |||||
/// <summary> | /// <summary> | ||||
/// 获取工艺基础信息列表 | |||||
/// 获取功能基础信息列表 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="inputDto"></param> | /// <param name="inputDto"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<PageUtil> GetDeviceTechnologyPage(DeviceTechnologyPageBase inputDto) | |||||
public async Task<PageUtil> GetProductFunctionPage(ProductFunctionPageBase inputDto) | |||||
{ | { | ||||
RefAsync<int> total = 0; | RefAsync<int> total = 0; | ||||
var res = await _db.Queryable<BPA_DeviceTechnology, BPA_DeviceVesion>((x, b) => new JoinQueryInfos(JoinType.Left, b.Id == x.DeviceVersionKey)) | |||||
.OrderBy((x, b) => x.CreateAt, OrderByType.Desc) | |||||
var res = await _db.Queryable<BPA_ProductFunction, BPA_DeviceVesion>((x, b) => new JoinQueryInfos(JoinType.Left, b.Id == x.DeviceVersionKey)) | |||||
.Where((x,b)=>b.ProductId == inputDto.DeviceTypeKey) | |||||
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.Name), (x, b) => x.Name.Contains(inputDto.Name)) | .WhereIF(!string.IsNullOrWhiteSpace(inputDto.Name), (x, b) => x.Name.Contains(inputDto.Name)) | ||||
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.Type), (x, b) => x.Type==Convert.ToInt32(inputDto.Type)) | |||||
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.Vesion), (x, b) => x.DeviceVersionKey == inputDto.Vesion) | |||||
.WhereIF(inputDto.Status != null, (x, b) => x.Status == inputDto.Status) | .WhereIF(inputDto.Status != null, (x, b) => x.Status == inputDto.Status) | ||||
.OrderBy((x, b) => x.CreateAt, OrderByType.Desc) | |||||
.Select((x, b) => new | .Select((x, b) => new | ||||
{ | { | ||||
Name = x.Name, | Name = x.Name, | ||||
@@ -42,9 +45,15 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
x.GroupId, | x.GroupId, | ||||
x.ForeignKeyRe, | x.ForeignKeyRe, | ||||
x.DeviceVersionKey, | x.DeviceVersionKey, | ||||
DeviceTypeKey = b.DeviceTypeKey, | |||||
Vesion = b.Vesion | |||||
DeviceTypeKey = b.ProductId, | |||||
Vesion = b.Vesion, | |||||
CreateAt=x.CreateAt, | |||||
Type= x.Type, | |||||
DataType= x.DataType, | |||||
DataRange= x.DataRange, | |||||
Unit= x.Unit, | |||||
StepSize= x.StepSize, | |||||
EnumValue= x.EnumValue, | |||||
}) | }) | ||||
.ToPageListAsync(inputDto.Current, inputDto.PageSize, total); | .ToPageListAsync(inputDto.Current, inputDto.PageSize, total); | ||||
return new PageUtil() | return new PageUtil() | ||||
@@ -54,75 +63,87 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
}; | }; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 查询所有工艺信息 | |||||
/// 查询所有功能信息 | |||||
/// </summary> | /// </summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<List<DeviceTechnologyDto>> GetDeviceTechnology() | |||||
public async Task<List<ProductFunctionDto>> GetProductFunction() | |||||
{ | { | ||||
var res =await _db.Queryable<BPA_DeviceTechnology>().Where(x => x.Status == 0) | |||||
var res =await _db.Queryable<BPA_ProductFunction>().Where(x => x.Status == 0) | |||||
.OrderBy(i => i.CreateAt, OrderByType.Desc) | .OrderBy(i => i.CreateAt, OrderByType.Desc) | ||||
.Select(x => new DeviceTechnologyDto() | |||||
.Select(x => new ProductFunctionDto() | |||||
{ | { | ||||
Id = x.Id, | Id = x.Id, | ||||
Name = x.Name, | Name = x.Name, | ||||
IsBatch = SqlFunc.Subqueryable<BPA_DeviceTechnologyAction>().Where(p => p.DevicetechnologyId == x.Id).Any() | |||||
IsBatch = SqlFunc.Subqueryable<BPA_ProductFunctionAction>().Where(p => p.ProductFunctionId == x.Id).Any() | |||||
}) | }) | ||||
.ToListAsync(); | .ToListAsync(); | ||||
return res; | return res; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 添加工艺 | |||||
/// 添加功能 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="inputDto"></param> | /// <param name="inputDto"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<bool> AddDeviceTechnology(DeviceTechnologyBaseDto inputDto) | |||||
public async Task<bool> AddProductFunction(ProductFunctionBaseDto inputDto) | |||||
{ | { | ||||
var data = _db.Queryable<BPA_DeviceTechnology>() | |||||
var data = _db.Queryable<BPA_ProductFunction>() | |||||
.Where(a => a.Name == inputDto.Name).ToList(); | .Where(a => a.Name == inputDto.Name).ToList(); | ||||
if (data.Count > 0) | if (data.Count > 0) | ||||
{ | { | ||||
throw Oops.Oh("工艺名称已存在"); | |||||
throw Oops.Oh("功能名称已存在"); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
var res =await _db.Insertable(new BPA_DeviceTechnology() | |||||
var res =await _db.Insertable(new BPA_ProductFunction() | |||||
{ | { | ||||
Id = Guid.NewGuid().ToString(), | Id = Guid.NewGuid().ToString(), | ||||
Name = inputDto.Name, | Name = inputDto.Name, | ||||
Status = CommonStatus.ENABLE, | Status = CommonStatus.ENABLE, | ||||
CreateAt = DateTime.Now, | CreateAt = DateTime.Now, | ||||
IsDeleted = 0, | IsDeleted = 0, | ||||
Type= inputDto.Type, | |||||
ForeignKeyRe = inputDto.ForeignKeyRe, | ForeignKeyRe = inputDto.ForeignKeyRe, | ||||
DeviceVersionKey = inputDto.DeviceVersionKey | |||||
DeviceVersionKey = inputDto.DeviceVersionKey, | |||||
DataType = inputDto.DataType, | |||||
DataRange = inputDto.DataRange, | |||||
Unit =inputDto.Unit, | |||||
StepSize = inputDto.StepSize, | |||||
EnumValue = inputDto.EnumValue, | |||||
}).CallEntityMethod(m => m.Create()).ExecuteCommandAsync(); | }).CallEntityMethod(m => m.Create()).ExecuteCommandAsync(); | ||||
return res > 0; | return res > 0; | ||||
} | } | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 修改工艺 | |||||
/// 修改功能 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="inputDto"></param> | /// <param name="inputDto"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<bool> UpdateDeviceTechnology(DeviceTechnologyBaseDto inputDto) | |||||
public async Task<bool> UpdateProductFunction(ProductFunctionBaseDto inputDto) | |||||
{ | { | ||||
var check = _db.Queryable<BPA_DeviceTechnology>().Any(a => a.Id != inputDto.Id && a.Name == inputDto.Name); | |||||
if (check) throw Oops.Oh("工艺名称已存在"); | |||||
var data = _db.Queryable<BPA_DeviceTechnology>().Where(a => a.Id == inputDto.Id).First(); | |||||
var check = _db.Queryable<BPA_ProductFunction>().Any(a => a.Id != inputDto.Id && a.Name == inputDto.Name); | |||||
if (check) throw Oops.Oh("功能名称已存在"); | |||||
var data = _db.Queryable<BPA_ProductFunction>().Where(a => a.Id == inputDto.Id).First(); | |||||
data.Name = inputDto.Name; | data.Name = inputDto.Name; | ||||
data.DeviceVersionKey = inputDto.DeviceVersionKey; | data.DeviceVersionKey = inputDto.DeviceVersionKey; | ||||
data.ForeignKeyRe = inputDto.ForeignKeyRe; | data.ForeignKeyRe = inputDto.ForeignKeyRe; | ||||
data.DataType = inputDto.DataType; | |||||
data.DataRange = inputDto.DataRange; | |||||
data.Unit = inputDto.Unit; | |||||
data.StepSize = inputDto.StepSize; | |||||
data.EnumValue = inputDto.EnumValue; | |||||
data.Status = (CommonStatus)Enum.ToObject(typeof(CommonStatus), inputDto.Status); | |||||
var res =await _db.Updateable(data).ExecuteCommandAsync(); | var res =await _db.Updateable(data).ExecuteCommandAsync(); | ||||
return res > 0; | return res > 0; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 删除配方工艺 | |||||
/// 删除功能 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="ids"></param> | /// <param name="ids"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<bool> DeleteDeviceTechnology(List<string> ids) | |||||
public async Task<bool> DeleteProductFunction(List<string> ids) | |||||
{ | { | ||||
var resEntity = _db.Queryable<BPA_DeviceTechnology>().Where(x => ids.Contains(x.Id)).ToList(); | |||||
var resEntity = _db.Queryable<BPA_ProductFunction>().Where(x => ids.Contains(x.Id)).ToList(); | |||||
foreach (var item in resEntity) | foreach (var item in resEntity) | ||||
{ | { | ||||
item.IsDeleted = 1; | item.IsDeleted = 1; | ||||
@@ -131,49 +152,49 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
return res > 0; | return res > 0; | ||||
} | } | ||||
#endregion | #endregion | ||||
#region 工艺模型 | |||||
#region 功能参数 | |||||
/// <summary> | /// <summary> | ||||
/// 根据工艺id查询工艺模型 | |||||
/// 根据功能id查询功能参数 | |||||
/// </summary> | /// </summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<List<BPA_DeviceTechnologyAction>> GetTechnologyActionList(string devicetechnologyId) | |||||
public async Task<List<BPA_ProductFunctionAction>> GetProductFunctionActionList(string productFunctionId) | |||||
{ | { | ||||
var res = await _db.Queryable<BPA_DeviceTechnologyAction>().Where(x => x.IsDeleted == 0 && x.DevicetechnologyId == devicetechnologyId ) | |||||
var res = await _db.Queryable<BPA_ProductFunctionAction>().Where(x => x.IsDeleted == 0 && x.ProductFunctionId == productFunctionId) | |||||
.OrderBy(i => i.Sort, OrderByType.Asc) | .OrderBy(i => i.Sort, OrderByType.Asc) | ||||
.ToListAsync(); | .ToListAsync(); | ||||
return res; | return res; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 查询所有工艺模型 | |||||
/// 查询所功能参数 | |||||
/// </summary> | /// </summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<List<BPA_DeviceTechnologyAction>> GetTechnologyActionList() | |||||
public async Task<List<BPA_ProductFunctionAction>> GetProductFunctionActionList() | |||||
{ | { | ||||
var res = await _db.Queryable<BPA_DeviceTechnologyAction>().Where(x => x.IsDeleted == 0) | |||||
var res = await _db.Queryable<BPA_ProductFunctionAction>().Where(x => x.IsDeleted == 0) | |||||
.OrderBy(i => i.Sort, OrderByType.Asc) | .OrderBy(i => i.Sort, OrderByType.Asc) | ||||
.ToListAsync(); | .ToListAsync(); | ||||
return res; | return res; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 添加工艺模型 | |||||
/// 添加功能参数 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="inputDto"></param> | /// <param name="inputDto"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<bool> AddDeviceTechnologyAction(DeviceTechnologyActionBaseDto inputDto) | |||||
public async Task<bool> AddProductFunctionAction(ProductFunctionActionBaseDto inputDto) | |||||
{ | { | ||||
var check = _db.Queryable<BPA_DeviceTechnologyAction>() | |||||
.Any(a => a.DevicetechnologyId == inputDto.DevicetechnologyId && a.IsDeleted == 0 && a.ActionName == inputDto.ActionName && a.ActionType == inputDto.ActionType); | |||||
var check = _db.Queryable<BPA_ProductFunctionAction>() | |||||
.Any(a => a.ProductFunctionId == inputDto.ProductFunctionId && a.IsDeleted == 0 && a.ActionName == inputDto.ActionName && a.ActionType == inputDto.ActionType); | |||||
if (check) | if (check) | ||||
{ | { | ||||
throw Oops.Oh("工艺流程动作已存在"); | |||||
throw Oops.Oh("功能参数已存在"); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
var res = await _db.Insertable(new BPA_DeviceTechnologyAction() | |||||
var res = await _db.Insertable(new BPA_ProductFunctionAction() | |||||
{ | { | ||||
DevicetechnologyId = inputDto.DevicetechnologyId, | |||||
ProductFunctionId = inputDto.ProductFunctionId, | |||||
ActionName = inputDto.ActionName, | ActionName = inputDto.ActionName, | ||||
ActionType = inputDto.ActionType, | ActionType = inputDto.ActionType, | ||||
ActionValue = inputDto.ActionValue, | ActionValue = inputDto.ActionValue, | ||||
@@ -186,16 +207,16 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
} | } | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 修改工艺模型 | |||||
/// 修改功能参数 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="inputDto"></param> | /// <param name="inputDto"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<bool> UpdateBomTechnology(DeviceTechnologyActionBaseDto inputDto) | |||||
public async Task<bool> UpdateProductFunctionAction(ProductFunctionActionBaseDto inputDto) | |||||
{ | { | ||||
var check = _db.Queryable<BPA_DeviceTechnologyAction>().Any(a => a.DevicetechnologyId == inputDto.DevicetechnologyId && a.ActionName == inputDto.ActionName && a.ActionType == inputDto.ActionType && a.Id != inputDto.Id); | |||||
if (check) throw Oops.Oh("工艺流程动作已存在"); | |||||
var data = _db.Queryable<BPA_DeviceTechnologyAction>().Where(a => a.Id == inputDto.Id).First(); | |||||
if (data == null) throw Oops.Oh("工艺流程动作不存在"); | |||||
var check = _db.Queryable<BPA_ProductFunctionAction>().Any(a => a.ProductFunctionId == inputDto.ProductFunctionId && a.ActionName == inputDto.ActionName && a.ActionType == inputDto.ActionType && a.Id != inputDto.Id); | |||||
if (check) throw Oops.Oh("功能参数已存在"); | |||||
var data = _db.Queryable<BPA_ProductFunctionAction>().Where(a => a.Id == inputDto.Id).First(); | |||||
if (data == null) throw Oops.Oh("功能参数不存在"); | |||||
data.ActionName = inputDto.ActionName; | data.ActionName = inputDto.ActionName; | ||||
data.ActionType = inputDto.ActionType; | data.ActionType = inputDto.ActionType; | ||||
data.ActionValue = inputDto.ActionValue; | data.ActionValue = inputDto.ActionValue; | ||||
@@ -206,13 +227,13 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
return res > 0; | return res > 0; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 删除工艺模型 | |||||
/// 删除功能参数 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="ids"></param> | /// <param name="ids"></param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<bool> DeleteTechnologyAction(List<string> ids) | |||||
public async Task<bool> DeleteProductFunctionAction(List<string> ids) | |||||
{ | { | ||||
var resEntity = _db.Queryable<BPA_DeviceTechnologyAction>().Where(x => ids.Contains(x.Id)).ToList(); | |||||
var resEntity = _db.Queryable<BPA_ProductFunctionAction>().Where(x => ids.Contains(x.Id)).ToList(); | |||||
foreach (var item in resEntity) | foreach (var item in resEntity) | ||||
{ | { | ||||
item.IsDeleted = 1; | item.IsDeleted = 1; |
@@ -47,7 +47,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
/// <returns></returns> | /// <returns></returns> | ||||
public async Task<List<BPA_Product>> GetProductList() | public async Task<List<BPA_Product>> GetProductList() | ||||
{ | { | ||||
var data = await _db.Queryable<BPA_Product>() .ToListAsync(); | |||||
var data = await _db.Queryable<BPA_Product>().Where(x=>x.Status==0) .ToListAsync(); | |||||
return data; | return data; | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -63,6 +63,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
Name = inputDto.Name, | Name = inputDto.Name, | ||||
Key = GetNumber2(count), | Key = GetNumber2(count), | ||||
Remark=inputDto.Remark, | Remark=inputDto.Remark, | ||||
Code= inputDto.Code, | |||||
Status = CommonStatus.ENABLE | Status = CommonStatus.ENABLE | ||||
}).CallEntityMethod(m => m.Create()).ExecuteCommandAsync(); | }).CallEntityMethod(m => m.Create()).ExecuteCommandAsync(); | ||||
return res > 0; | return res > 0; | ||||
@@ -92,6 +93,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||||
{ | { | ||||
var res = _db.Updateable<BPA_Product>() | var res = _db.Updateable<BPA_Product>() | ||||
.SetColumns(t => t.Name == inputDto.Name) | .SetColumns(t => t.Name == inputDto.Name) | ||||
.SetColumns(t => t.Code == inputDto.Code) | |||||
.SetColumns(t => t.Remark == inputDto.Remark).Where(t => t.Id == inputDto.Id) | .SetColumns(t => t.Remark == inputDto.Remark).Where(t => t.Id == inputDto.Id) | ||||
.ExecuteCommandHasChange(); | .ExecuteCommandHasChange(); | ||||
@@ -0,0 +1,17 @@ | |||||
using BPA.SAAS.Manage.Comm.Enum; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Core.Base | |||||
{ | |||||
public interface IStatus | |||||
{ | |||||
/// <summary> | |||||
/// 状态 0启用 1禁用 | |||||
/// </summary> | |||||
public CommonStatus Status { get; set; } | |||||
} | |||||
} |
@@ -53,6 +53,7 @@ namespace BPA.SAAS.Manage.Core | |||||
{ | { | ||||
//过滤已删除数据 | //过滤已删除数据 | ||||
db.QueryFilter.AddTableFilter<IDeleted>(it => it.IsDeleted == 0); | db.QueryFilter.AddTableFilter<IDeleted>(it => it.IsDeleted == 0); | ||||
//db.QueryFilter.AddTableFilter<IStatus>(it => it.Status == 0); | |||||
if (!IsSuperAdmin()) | if (!IsSuperAdmin()) | ||||
{ | { | ||||
//非管理员账户过滤加盟商数据 | //非管理员账户过滤加盟商数据 | ||||
@@ -28,9 +28,13 @@ namespace BPA.SAAS.Manage.Core.Device | |||||
/// </summary> | /// </summary> | ||||
public string OrgId { get; set; } | public string OrgId { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 设备类型 | |||||
/// 所属产品 | |||||
/// </summary> | /// </summary> | ||||
public string DeviceTypeKey { get; set; } | |||||
public string ProductId { get; set; } | |||||
/// <summary> | |||||
/// 产品标签 | |||||
/// </summary> | |||||
public string ProductCode { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 状态 【正常 停用】默认 正常 | /// 状态 【正常 停用】默认 正常 | ||||
/// </summary> | /// </summary> | ||||
@@ -42,9 +46,9 @@ namespace BPA.SAAS.Manage.Core.Device | |||||
[SugarColumn(IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true, IsIdentity = true)] | [SugarColumn(IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true, IsIdentity = true)] | ||||
public int AutoKey { get; set; } | public int AutoKey { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 设备版本 | |||||
/// 产品版本 | |||||
/// </summary> | /// </summary> | ||||
public string DeviceVersionKey { get; set; } | |||||
public string ProductVersionId { get; set; } | |||||
public string GroupId { get; set; } | public string GroupId { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 支持工艺还是配方 0工艺 1配方 | /// 支持工艺还是配方 0工艺 1配方 | ||||
@@ -1,31 +0,0 @@ | |||||
using BPA.SAAS.Manage.Comm.Enum; | |||||
using BPA.SAAS.Manage.Core.Base; | |||||
using SqlSugar; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Core.Device | |||||
{ | |||||
[SugarTable("bpa_devicetechnology")] | |||||
public class BPA_DeviceTechnology : IBaseEntity, IGroupId | |||||
{ | |||||
/// <summary> | |||||
/// 工艺名称 | |||||
/// </summary> | |||||
public string Name { get; set; } | |||||
/// <summary> | |||||
/// 状态 0启用 1禁用 | |||||
/// </summary> | |||||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE; | |||||
public string GroupId { get; set; } | |||||
[SugarColumn(ColumnDataType = "Nvarchar(255)", IsNullable = true)] | |||||
public string ForeignKeyRe { get; set; } | |||||
/// <summary> | |||||
/// 设备版本 | |||||
/// </summary> | |||||
public string DeviceVersionKey { get; set; } | |||||
} | |||||
} |
@@ -13,7 +13,10 @@ namespace BPA.SAAS.Manage.Core.Device | |||||
public class BPA_DeviceVesion : IBaseEntity, IGroupId | public class BPA_DeviceVesion : IBaseEntity, IGroupId | ||||
{ | { | ||||
public string Vesion { get; set; } | public string Vesion { get; set; } | ||||
public string DeviceTypeKey { get; set; } | |||||
/// <summary> | |||||
/// 所属产品 | |||||
/// </summary> | |||||
public string ProductId { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 模版路径 | /// 模版路径 | ||||
/// </summary> | /// </summary> | ||||
@@ -19,6 +19,7 @@ namespace BPA.SAAS.Manage.Core.Device | |||||
/// </summary> | /// </summary> | ||||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE; | public CommonStatus Status { get; set; } = CommonStatus.ENABLE; | ||||
public string GroupId { get; set; } | public string GroupId { get; set; } | ||||
public string Code { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 备注 | /// 备注 | ||||
/// </summary> | /// </summary> | ||||
@@ -0,0 +1,63 @@ | |||||
using BPA.SAAS.Manage.Comm.Enum; | |||||
using BPA.SAAS.Manage.Core.Base; | |||||
using SqlSugar; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Core.Device | |||||
{ | |||||
/// <summary> | |||||
///产品功能 | |||||
/// </summary> | |||||
[SugarTable("bpa_productfunction")] | |||||
public class BPA_ProductFunction : IBaseEntity, IGroupId | |||||
{ | |||||
/// <summary> | |||||
/// 功能名称 | |||||
/// </summary> | |||||
public string Name { get; set; } | |||||
/// <summary> | |||||
/// 状态 0启用 1禁用 | |||||
/// </summary> | |||||
public CommonStatus Status { get; set; } = CommonStatus.ENABLE; | |||||
/// <summary> | |||||
/// 加盟商id | |||||
/// </summary> | |||||
public string GroupId { get; set; } | |||||
/// <summary> | |||||
/// 外键 | |||||
/// </summary> | |||||
public string ForeignKeyRe { get; set; } | |||||
/// <summary> | |||||
/// 设备版本 | |||||
/// </summary> | |||||
public string DeviceVersionKey { get; set; } | |||||
/// <summary> | |||||
/// 功能类型 0属性1服务2事件 | |||||
/// </summary> | |||||
public int Type { get; set; } | |||||
/// <summary> | |||||
/// 数据类型 | |||||
/// </summary> | |||||
public string DataType { get; set; } | |||||
/// <summary> | |||||
/// 取值范围 | |||||
/// </summary> | |||||
public string DataRange { get; set; } | |||||
/// <summary> | |||||
/// 单位 | |||||
/// </summary> | |||||
public string Unit { get; set; } | |||||
/// <summary> | |||||
/// 步长 | |||||
/// </summary> | |||||
public int StepSize { get; set; } | |||||
/// <summary> | |||||
/// 枚举值 | |||||
/// </summary> | |||||
public string EnumValue { get; set; } | |||||
} | |||||
} |
@@ -7,12 +7,12 @@ using System.Threading.Tasks; | |||||
namespace BPA.SAAS.Manage.Core.Device | namespace BPA.SAAS.Manage.Core.Device | ||||
{ | { | ||||
public class BPA_DeviceTechnologyAction: IBaseEntity, IGroupId | |||||
public class BPA_ProductFunctionAction: IBaseEntity, IGroupId | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 工艺id | |||||
/// 功能id | |||||
/// </summary> | /// </summary> | ||||
public string DevicetechnologyId { get; set; } | |||||
public string ProductFunctionId { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 动作名称 | /// 动作名称 | ||||
/// </summary> | /// </summary> |