@@ -119,6 +119,26 @@ namespace BPA.SAAS.Manage.Application.DataBase | |||
return await _batchingService.GetBatchingUintList(); | |||
} | |||
/// <summary> | |||
/// 查询物料单位(外部接口) | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet("/api/batching/getbatchinguintlist_alm")] | |||
[AllowAnonymous] | |||
public async Task<List<dynamic>> GetBatchingUintList_alm() | |||
{ | |||
return await _batchingService.GetBatchingUintList_alm(); | |||
} | |||
/// <summary> | |||
/// 查询物料分类(外部接口) | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet("/api/batching/getbatchingtypelist_alm")] | |||
[AllowAnonymous] | |||
public async Task<List<dynamic>> GetBatchingTypeList_alm() | |||
{ | |||
return await _batchingService.GetBatchingTypeList_alm(); | |||
} | |||
/// <summary> | |||
/// 添加物料物料单位 | |||
/// </summary> | |||
/// <param name="dto"></param> | |||
@@ -29,6 +29,16 @@ namespace BPA.SAAS.Manage.Application.DataBase | |||
return _goodsAttributeServices.GetGoodsAttributePageAsync(dto); | |||
} | |||
/// <summary> | |||
/// 查询商品属性(外部调用) | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet("/api/goodsattribute/getgoodsattributelist_alm")] | |||
[AllowAnonymous] | |||
public async Task<List<GoodsAttributeView>> GetGoodsAttributeList_alm() | |||
{ | |||
return await _goodsAttributeServices.GetGoodsAttributeList_alm(); | |||
} | |||
/// <summary> | |||
/// 添加/修改 | |||
/// </summary> | |||
/// <param name="dto"></param> | |||
@@ -70,6 +70,16 @@ namespace BPA.SAAS.Manage.Application.DataBase | |||
return await _goodsService.GetGoodsUintList(); | |||
} | |||
/// <summary> | |||
/// 查询商品单位(外部调用) | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet("/api/goods/getgoodsuintlist_alm")] | |||
[AllowAnonymous] | |||
public async Task<List<dynamic>> GetGoodsUintList_alm() | |||
{ | |||
return await _goodsService.GetGoodsUintList_alm(); | |||
} | |||
/// <summary> | |||
/// 添加商品单位 | |||
/// </summary> | |||
/// <param name="dto"></param> | |||
@@ -28,6 +28,16 @@ namespace BPA.SAAS.Manage.Application.DataBase | |||
return await _goodsTypeService.GetGoodsTypePage(dto); | |||
} | |||
/// <summary> | |||
/// 查询类型列表(外部调用) | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet("/api/goodstype/getgoodstypelist_alm")] | |||
[AllowAnonymous] | |||
public async Task<List<dynamic>> GetGoodsTypeList_alm() | |||
{ | |||
return await _goodsTypeService.GetGoodsTypeList_alm(); | |||
} | |||
/// <summary> | |||
/// 添加商品类型 | |||
/// </summary> | |||
/// <param name="dto"></param> | |||
@@ -24,5 +24,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Interface | |||
Task<bool> AddBatchingUint(BatchingUintDto dto); | |||
Task<bool> BatchingUintDel(string id); | |||
Task<List<BatchingView>> GetByTypeBatching(); | |||
Task<List<dynamic>> GetBatchingTypeList_alm(); | |||
Task<List<dynamic>> GetBatchingUintList_alm(); | |||
} | |||
} |
@@ -18,6 +18,11 @@ namespace BPA.SAAS.Manage.Application.DataBase.Interface | |||
/// <returns></returns> | |||
PageUtil GetGoodsAttributePageAsync(GoodsAttributeQueryDto dto); | |||
/// <summary> | |||
/// 查询商品属性(外部调用) | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<GoodsAttributeView>> GetGoodsAttributeList_alm(); | |||
/// <summary> | |||
/// 添加/修改 | |||
/// </summary> | |||
/// <param name="dto"></param> | |||
@@ -42,6 +42,11 @@ namespace BPA.SAAS.Manage.Application.DataBase.Interface | |||
/// <returns></returns> | |||
Task<List<dynamic>> GetGoodsUintList(); | |||
/// <summary> | |||
/// 查询商品单位(外部调用) | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<dynamic>> GetGoodsUintList_alm(); | |||
/// <summary> | |||
/// 添加商品单位 | |||
/// </summary> | |||
/// <param name="dto"></param> | |||
@@ -16,6 +16,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Interface | |||
/// <param name="dto"></param> | |||
/// <returns></returns> | |||
Task<PageUtil> GetGoodsTypePage(GoodsTypeQueryDto dto); | |||
Task<List<dynamic>> GetGoodsTypeList_alm(); | |||
/// <summary> | |||
/// 添加商品类型 | |||
/// </summary> | |||
@@ -9,6 +9,7 @@ using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Text.RegularExpressions; | |||
using System.Threading.Tasks; | |||
namespace BPA.SAAS.Manage.Application.DataBase.Services | |||
@@ -291,6 +292,18 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||
}) .ToListAsync(); | |||
return res; | |||
} | |||
public async Task<List<dynamic>> GetBatchingTypeList_alm() | |||
{ | |||
var groupId = App.HttpContext.Request.Headers["groupId"].ToString(); | |||
if (string.IsNullOrWhiteSpace(groupId)) throw Oops.Oh("加盟商id不能为空"); | |||
var res = await _db.Queryable<BPA_BatchingType>().Where(x=>x.GroupId== groupId).Select<dynamic>(x => new | |||
{ | |||
id = x.Id, | |||
name = x.Name | |||
}).ToListAsync(); | |||
return res; | |||
} | |||
public async Task<bool> AddBatchingType(BatchingTypeDto dto) | |||
{ | |||
var productCode = _db.Queryable<BPA_BatchingType>().Where(x => x.Name== dto.Name).ToList(); | |||
@@ -336,6 +349,17 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||
}).ToListAsync(); | |||
return res; | |||
} | |||
public async Task<List<dynamic>> GetBatchingUintList_alm() | |||
{ | |||
var groupId = App.HttpContext.Request.Headers["groupId"].ToString(); | |||
if(string.IsNullOrWhiteSpace(groupId)) throw Oops.Oh("加盟商id不能为空"); | |||
var res = await _db.Queryable<BPA_BatchingUint>().Where(x=>x.GroupId== groupId).Select<dynamic>(x => new | |||
{ | |||
id = x.Id, | |||
name = x.Name | |||
}).ToListAsync(); | |||
return res; | |||
} | |||
public async Task<bool> AddBatchingUint(BatchingUintDto dto) | |||
{ | |||
var productCode = _db.Queryable<BPA_BatchingUint>().Where(x => x.Name == dto.Name).ToList(); | |||
@@ -52,6 +52,29 @@ namespace BPA.Franchisee.Application.FranchiseeCenter.GoodsServices | |||
}; | |||
return util; | |||
} | |||
public async Task<List<GoodsAttributeView>> GetGoodsAttributeList_alm() | |||
{ | |||
List<IConditionalModel> conModels = new List<IConditionalModel>(); | |||
string groupId = App.HttpContext.Request.Headers["groupId"].ToString(); | |||
if (string.IsNullOrWhiteSpace(groupId)) throw Oops.Oh("加盟商id不能为空"); | |||
var res =await _db.Queryable<BPA_GoodsAttribute>() | |||
.Where(a => a.GroupId == groupId) | |||
.OrderBy(a => a.CreateAt, OrderByType.Desc) | |||
.Select(a => new GoodsAttributeView | |||
{ | |||
Id = a.Id, | |||
AttributeName = a.AttributeName, | |||
GoodsTypeId = a.GoodsTypeId, | |||
Sort = a.Sort, | |||
}) | |||
.Mapper(x => | |||
{ | |||
var list = _db.Queryable<BPA_GoodsAttributeValue>().Where(p => p.GoodsAttributeId == x.Id).ToList(); | |||
x.AttributeValueList = list; | |||
}) | |||
.ToListAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 添加/修改 | |||
/// </summary> | |||
@@ -231,6 +231,18 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||
}).ToListAsync(); | |||
return res; | |||
} | |||
public async Task<List<dynamic>> GetGoodsUintList_alm() | |||
{ | |||
var groupId = App.HttpContext.Request.Headers["groupId"].ToString(); | |||
if (string.IsNullOrWhiteSpace(groupId)) throw Oops.Oh("加盟商id不能为空"); | |||
var res = await _db.Queryable<BPA_GoodsUint>().Where(x=>x.GroupId== groupId).Select<dynamic>(x => new | |||
{ | |||
id = x.Id, | |||
name = x.Name | |||
}).ToListAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 添加商品单位 | |||
/// </summary> | |||
@@ -933,7 +945,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||
{ | |||
value = ""; | |||
} | |||
if (value.ToString().Trim() == goodsName.Trim()) | |||
if (value.ToString().Trim() == goodsName?.Trim()) | |||
{ | |||
//ColumnAttribute attribute = (ColumnAttribute)item2.GetCustomAttribute(typeof(ColumnAttribute), false); | |||
//return attribute?.Name; | |||
@@ -1086,7 +1098,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||
{ | |||
TechnologyExportRecode.CreateAt= DateTime.Now; | |||
TechnologyExportRecode.TemplatePath = path; | |||
await _db.Updateable(TechnologyExportRecode).ExecuteCommandAsync(); | |||
var vvv= await _db.Updateable(TechnologyExportRecode).ExecuteCommandAsync(); | |||
} | |||
else | |||
{ | |||
@@ -109,6 +109,19 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services | |||
var res =await _db.Updateable(resEntity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); | |||
return res > 0; | |||
} | |||
public async Task<List<dynamic>> GetGoodsTypeList_alm() | |||
{ | |||
var groupId = App.HttpContext.Request.Headers["groupId"].ToString(); | |||
if (string.IsNullOrWhiteSpace(groupId)) throw Oops.Oh("加盟商id不能为空"); | |||
var res = await _db.Queryable<BPA_GoodsType>().Where(x => x.GroupId == groupId).Select<dynamic>(x => new | |||
{ | |||
id = x.Id, | |||
name = x.Name, | |||
pid= x.Pid, | |||
}).ToListAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 删除商品类型 | |||
/// </summary> | |||
@@ -12,7 +12,6 @@ namespace BPA.SAAS.Manage.Application.Device.Dtos.Device | |||
{ | |||
public string Id { get; set; } | |||
public string Name { get; set; } | |||
public TechnologyEnums TechnologyType { get; set; } | |||
public string DeviceVersionId { get; set; } | |||
public string ForeignKeyRe { get; set; } | |||
public DateTime CreateAt { get; set; } | |||
@@ -0,0 +1,63 @@ | |||
using BPA.SAAS.Manage.Core.Product; | |||
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 ProductFunctionView | |||
{ | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 功能名称 | |||
/// </summary> | |||
public string Name { get; set; } | |||
public string DeviceVersionKey { get; set; } | |||
/// <summary> | |||
/// 功能类型 0属性1服务2事件 | |||
/// </summary> | |||
public string 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 decimal StepSize { get; set; } | |||
/// <summary> | |||
/// 枚举值 | |||
/// </summary> | |||
public string EnumValue { get; set; } | |||
/// <summary> | |||
/// 数据长度 | |||
/// </summary> | |||
public string DataLength { get; set; } | |||
/// <summary> | |||
/// 数据类型bool的描述 | |||
/// </summary> | |||
public string BoolLabel { get; set; } | |||
/// <summary> | |||
/// 读写类型0读写 1只读 | |||
/// </summary> | |||
public int ReadWrite { get; set; } | |||
/// <summary> | |||
/// 描述 | |||
/// </summary> | |||
public string Description { get; set; } | |||
public string ProductId { get; set; } | |||
public string DataJson { get; set; } | |||
public bool IsDefault { get; set; } | |||
public List<BPA_ProductFunctionAction> ProductFunctionValue { get; set; } | |||
} | |||
} |
@@ -22,6 +22,9 @@ namespace BPA.SAAS.Manage.Application.Device.Interface | |||
/// </summary> | |||
/// <returns></returns> | |||
Task<List<ProductFunctionDto>> GetProductFunction(); | |||
Task<List<ProductFunctionView>> GetProductFunction(string deviceId); | |||
Task<List<ProductFunctionView>> GetProductFunction_alm(string deviceId); | |||
/// <summary> | |||
/// 添加功能 | |||
/// </summary> | |||
@@ -18,5 +18,6 @@ namespace BPA.SAAS.Manage.Application.Device.Interface | |||
/// <param name="deviceId"></param> | |||
/// <returns></returns> | |||
Task<List<TechnologyView>> GetTechnologyList(string deviceId); | |||
Task<List<TechnologyView>> GetTechnologyList_alm(string deviceId); | |||
} | |||
} |
@@ -39,6 +39,27 @@ namespace BPA.SAAS.Manage.Application.Device | |||
return await _deviceTechnologyService.GetProductFunction(); | |||
} | |||
/// <summary> | |||
/// 根据设备id查询产品功能和服务 | |||
/// </summary> | |||
/// <param name="deviceId"></param> | |||
/// <returns></returns> | |||
[HttpGet("/api/productfunction/getproductfunction")] | |||
public async Task<List<ProductFunctionView>> GetProductFunction(string deviceId) | |||
{ | |||
return await _deviceTechnologyService.GetProductFunction(deviceId); | |||
} | |||
/// <summary> | |||
/// 根据设备id查询产品功能和服务(外部调用) | |||
/// </summary> | |||
/// <param name="deviceId"></param> | |||
/// <returns></returns> | |||
[HttpGet("/api/productfunction/getproductfunction_alm")] | |||
[AllowAnonymous] | |||
public async Task<List<ProductFunctionView>> GetProductFunction_alm(string deviceId) | |||
{ | |||
return await _deviceTechnologyService.GetProductFunction_alm(deviceId); | |||
} | |||
/// <summary> | |||
/// 添加功能 | |||
/// </summary> | |||
/// <param name="inputDto"></param> | |||
@@ -3,6 +3,7 @@ using BPA.SAAS.Manage.Application.Device.Interface; | |||
using BPA.SAAS.Manage.Comm.Const; | |||
using BPA.SAAS.Manage.Comm.Enum; | |||
using BPA.SAAS.Manage.Core.Base; | |||
using BPA.SAAS.Manage.Core.Device; | |||
using BPA.SAAS.Manage.Core.Product; | |||
using Microsoft.AspNetCore.Server.IISIntegration; | |||
using Newtonsoft.Json; | |||
@@ -87,6 +88,42 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||
.ToListAsync(); | |||
return res; | |||
} | |||
public async Task<List<ProductFunctionView>> GetProductFunction(string deviceId) | |||
{ | |||
var device=_db.Queryable<BPA_DeviceInfo>().Where(x => x.Id == deviceId).First(); | |||
var res = await _db.Queryable<BPA_ProductFunction>().Where(x => x.DeviceVersionKey == device.ProductVersionId) | |||
.OrderBy(i => i.CreateAt, OrderByType.Desc) | |||
.Select(x => new ProductFunctionView() | |||
{ | |||
Id = x.Id.SelectAll(), | |||
Name = x.Name, | |||
//IsBatch = SqlFunc.Subqueryable<BPA_ProductFunctionAction>().Where(p => p.ProductFunctionId == x.Id).Any() | |||
}) | |||
.Mapper(x => | |||
{ | |||
x.ProductFunctionValue = _db.Queryable<BPA_ProductFunctionAction>().Where(p => p.ProductFunctionId == x.Id).ToList(); | |||
}) | |||
.ToListAsync(); | |||
return res; | |||
} | |||
public async Task<List<ProductFunctionView>> GetProductFunction_alm(string deviceId) | |||
{ | |||
var device = _db.Queryable<BPA_DeviceInfo>().Where(x => x.Id == deviceId).First(); | |||
var res = await _db.Queryable<BPA_ProductFunction>().Where(x => x.DeviceVersionKey == device.ProductVersionId) | |||
.OrderBy(i => i.CreateAt, OrderByType.Desc) | |||
.Select(x => new ProductFunctionView() | |||
{ | |||
Id = x.Id.SelectAll(), | |||
Name = x.Name, | |||
//IsBatch = SqlFunc.Subqueryable<BPA_ProductFunctionAction>().Where(p => p.ProductFunctionId == x.Id).Any() | |||
}) | |||
.Mapper(x => | |||
{ | |||
x.ProductFunctionValue = _db.Queryable<BPA_ProductFunctionAction>().Where(p => p.ProductFunctionId == x.Id).ToList(); | |||
}) | |||
.ToListAsync(); | |||
return res; | |||
} | |||
/// <summary> | |||
/// 添加功能 | |||
/// </summary> | |||
@@ -43,7 +43,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||
ProductName = c.Name, | |||
CreateAt = a.CreateAt, | |||
DeviceVersionId = b.Id, | |||
TemplatePath=b.TemplatePath | |||
TemplatePath=a.TemplatePath | |||
}) | |||
.OrderBy(a=>a.CreateAt, OrderByType.Desc) | |||
@@ -90,6 +90,26 @@ namespace BPA.SAAS.Manage.Application.Device.Services | |||
return data; | |||
} | |||
public async Task<List<TechnologyView>> GetTechnologyList_alm(string deviceId) | |||
{ | |||
var device = _db.Queryable<BPA_DeviceInfo>().Where(x => x.Id == deviceId).First(); | |||
var data = await _db.Queryable<BPA_Technology>().Where(x => x.DeviceVersionId == device.ProductVersionId).Select(a => new TechnologyView | |||
{ | |||
Id = a.Id, | |||
Name = a.Name, | |||
DeviceVersionId = a.DeviceVersionId, | |||
CreateAt = a.CreateAt, | |||
}).OrderBy(a => a.CreateAt, OrderByType.Desc) | |||
.Mapper(x => | |||
{ | |||
//var TechnologyInfo1 = _db.Queryable<BPA_Technology>().Where(p => p.DeviceVersionId == x.DeviceVersionId).Select(f => new TechnologyInfo() { Id = f.Id, Name = f.Name, DeviceVersionId = f.DeviceVersionId }).ToList(); | |||
var TechnologyInfo = _db.Queryable<BPA_TechnologyAction>().Where(d => d.TechnologyId == x.Id).ToList(); | |||
x.TechnologyActionInfo = TechnologyInfo; | |||
}) | |||
.ToListAsync(); | |||
return data; | |||
} | |||
public async Task<bool> DeTechnologyExportRecode(string inputList) | |||
{ | |||
try | |||
@@ -48,5 +48,11 @@ namespace BPA.SAAS.Manage.Application.Device | |||
{ | |||
return await _technologyService.GetTechnologyList(deviceId); | |||
} | |||
[HttpGet("/api/technology/gettechnologylist_alm")] | |||
[AllowAnonymous] | |||
public async Task<List<TechnologyView>> GetTechnologyList__alm(string deviceId) | |||
{ | |||
return await _technologyService.GetTechnologyList_alm(deviceId); | |||
} | |||
} | |||
} |