diff --git a/BPA.SAAS.Manage.Application/DataBase/BatchingServices.cs b/BPA.SAAS.Manage.Application/DataBase/BatchingServices.cs
index d9eb323..aeb4301 100644
--- a/BPA.SAAS.Manage.Application/DataBase/BatchingServices.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/BatchingServices.cs
@@ -119,6 +119,26 @@ namespace BPA.SAAS.Manage.Application.DataBase
return await _batchingService.GetBatchingUintList();
}
///
+ /// 查询物料单位(外部接口)
+ ///
+ ///
+ [HttpGet("/api/batching/getbatchinguintlist_alm")]
+ [AllowAnonymous]
+ public async Task> GetBatchingUintList_alm()
+ {
+ return await _batchingService.GetBatchingUintList_alm();
+ }
+ ///
+ /// 查询物料分类(外部接口)
+ ///
+ ///
+ [HttpGet("/api/batching/getbatchingtypelist_alm")]
+ [AllowAnonymous]
+ public async Task> GetBatchingTypeList_alm()
+ {
+ return await _batchingService.GetBatchingTypeList_alm();
+ }
+ ///
/// 添加物料物料单位
///
///
diff --git a/BPA.SAAS.Manage.Application/DataBase/GoodsAttributeServices.cs b/BPA.SAAS.Manage.Application/DataBase/GoodsAttributeServices.cs
index 713e37f..ad6d86a 100644
--- a/BPA.SAAS.Manage.Application/DataBase/GoodsAttributeServices.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/GoodsAttributeServices.cs
@@ -29,6 +29,16 @@ namespace BPA.SAAS.Manage.Application.DataBase
return _goodsAttributeServices.GetGoodsAttributePageAsync(dto);
}
///
+ /// 查询商品属性(外部调用)
+ ///
+ ///
+ [HttpGet("/api/goodsattribute/getgoodsattributelist_alm")]
+ [AllowAnonymous]
+ public async Task> GetGoodsAttributeList_alm()
+ {
+ return await _goodsAttributeServices.GetGoodsAttributeList_alm();
+ }
+ ///
/// 添加/修改
///
///
diff --git a/BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs b/BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs
index cff1fb8..9d7604c 100644
--- a/BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs
@@ -70,6 +70,16 @@ namespace BPA.SAAS.Manage.Application.DataBase
return await _goodsService.GetGoodsUintList();
}
///
+ /// 查询商品单位(外部调用)
+ ///
+ ///
+ [HttpGet("/api/goods/getgoodsuintlist_alm")]
+ [AllowAnonymous]
+ public async Task> GetGoodsUintList_alm()
+ {
+ return await _goodsService.GetGoodsUintList_alm();
+ }
+ ///
/// 添加商品单位
///
///
diff --git a/BPA.SAAS.Manage.Application/DataBase/GoodsTypeServices.cs b/BPA.SAAS.Manage.Application/DataBase/GoodsTypeServices.cs
index 2583dac..2994d0f 100644
--- a/BPA.SAAS.Manage.Application/DataBase/GoodsTypeServices.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/GoodsTypeServices.cs
@@ -28,6 +28,16 @@ namespace BPA.SAAS.Manage.Application.DataBase
return await _goodsTypeService.GetGoodsTypePage(dto);
}
///
+ /// 查询类型列表(外部调用)
+ ///
+ ///
+ [HttpGet("/api/goodstype/getgoodstypelist_alm")]
+ [AllowAnonymous]
+ public async Task> GetGoodsTypeList_alm()
+ {
+ return await _goodsTypeService.GetGoodsTypeList_alm();
+ }
+ ///
/// 添加商品类型
///
///
diff --git a/BPA.SAAS.Manage.Application/DataBase/Interface/IBatchingService.cs b/BPA.SAAS.Manage.Application/DataBase/Interface/IBatchingService.cs
index 2215132..056fa22 100644
--- a/BPA.SAAS.Manage.Application/DataBase/Interface/IBatchingService.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/Interface/IBatchingService.cs
@@ -24,5 +24,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Interface
Task AddBatchingUint(BatchingUintDto dto);
Task BatchingUintDel(string id);
Task> GetByTypeBatching();
+ Task> GetBatchingTypeList_alm();
+ Task> GetBatchingUintList_alm();
}
}
diff --git a/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsAttributeService.cs b/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsAttributeService.cs
index 1d41184..1ad1260 100644
--- a/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsAttributeService.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsAttributeService.cs
@@ -18,6 +18,11 @@ namespace BPA.SAAS.Manage.Application.DataBase.Interface
///
PageUtil GetGoodsAttributePageAsync(GoodsAttributeQueryDto dto);
///
+ /// 查询商品属性(外部调用)
+ ///
+ ///
+ Task> GetGoodsAttributeList_alm();
+ ///
/// 添加/修改
///
///
diff --git a/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs b/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs
index 7d9202e..dca4283 100644
--- a/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs
@@ -42,6 +42,11 @@ namespace BPA.SAAS.Manage.Application.DataBase.Interface
///
Task> GetGoodsUintList();
///
+ /// 查询商品单位(外部调用)
+ ///
+ ///
+ Task> GetGoodsUintList_alm();
+ ///
/// 添加商品单位
///
///
diff --git a/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsTypeService.cs b/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsTypeService.cs
index de0cffc..f67cb3f 100644
--- a/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsTypeService.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsTypeService.cs
@@ -16,6 +16,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Interface
///
///
Task GetGoodsTypePage(GoodsTypeQueryDto dto);
+ Task> GetGoodsTypeList_alm();
///
/// 添加商品类型
///
diff --git a/BPA.SAAS.Manage.Application/DataBase/Services/BatchingService.cs b/BPA.SAAS.Manage.Application/DataBase/Services/BatchingService.cs
index 426b688..544aca6 100644
--- a/BPA.SAAS.Manage.Application/DataBase/Services/BatchingService.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/Services/BatchingService.cs
@@ -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> GetBatchingTypeList_alm()
+ {
+ var groupId = App.HttpContext.Request.Headers["groupId"].ToString();
+ if (string.IsNullOrWhiteSpace(groupId)) throw Oops.Oh("加盟商id不能为空");
+ var res = await _db.Queryable().Where(x=>x.GroupId== groupId).Select(x => new
+
+ {
+ id = x.Id,
+ name = x.Name
+ }).ToListAsync();
+ return res;
+ }
public async Task AddBatchingType(BatchingTypeDto dto)
{
var productCode = _db.Queryable().Where(x => x.Name== dto.Name).ToList();
@@ -336,6 +349,17 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services
}).ToListAsync();
return res;
}
+ public async Task> GetBatchingUintList_alm()
+ {
+ var groupId = App.HttpContext.Request.Headers["groupId"].ToString();
+ if(string.IsNullOrWhiteSpace(groupId)) throw Oops.Oh("加盟商id不能为空");
+ var res = await _db.Queryable().Where(x=>x.GroupId== groupId).Select(x => new
+ {
+ id = x.Id,
+ name = x.Name
+ }).ToListAsync();
+ return res;
+ }
public async Task AddBatchingUint(BatchingUintDto dto)
{
var productCode = _db.Queryable().Where(x => x.Name == dto.Name).ToList();
diff --git a/BPA.SAAS.Manage.Application/DataBase/Services/GoodsAttributeService.cs b/BPA.SAAS.Manage.Application/DataBase/Services/GoodsAttributeService.cs
index 50655e4..14d9255 100644
--- a/BPA.SAAS.Manage.Application/DataBase/Services/GoodsAttributeService.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/Services/GoodsAttributeService.cs
@@ -52,6 +52,29 @@ namespace BPA.Franchisee.Application.FranchiseeCenter.GoodsServices
};
return util;
}
+ public async Task> GetGoodsAttributeList_alm()
+ {
+ List conModels = new List();
+ string groupId = App.HttpContext.Request.Headers["groupId"].ToString();
+ if (string.IsNullOrWhiteSpace(groupId)) throw Oops.Oh("加盟商id不能为空");
+ var res =await _db.Queryable()
+ .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().Where(p => p.GoodsAttributeId == x.Id).ToList();
+ x.AttributeValueList = list;
+ })
+ .ToListAsync();
+ return res;
+ }
///
/// 添加/修改
///
diff --git a/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs b/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs
index c3dcc15..6adc674 100644
--- a/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs
@@ -231,6 +231,18 @@ namespace BPA.SAAS.Manage.Application.DataBase.Services
}).ToListAsync();
return res;
}
+ public async Task> GetGoodsUintList_alm()
+ {
+ var groupId = App.HttpContext.Request.Headers["groupId"].ToString();
+ if (string.IsNullOrWhiteSpace(groupId)) throw Oops.Oh("加盟商id不能为空");
+ var res = await _db.Queryable().Where(x=>x.GroupId== groupId).Select(x => new
+
+ {
+ id = x.Id,
+ name = x.Name
+ }).ToListAsync();
+ return res;
+ }
///
/// 添加商品单位
///
@@ -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
{
diff --git a/BPA.SAAS.Manage.Application/DataBase/Services/GoodsTypeService.cs b/BPA.SAAS.Manage.Application/DataBase/Services/GoodsTypeService.cs
index ed2dd8a..5cde192 100644
--- a/BPA.SAAS.Manage.Application/DataBase/Services/GoodsTypeService.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/Services/GoodsTypeService.cs
@@ -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> GetGoodsTypeList_alm()
+ {
+ var groupId = App.HttpContext.Request.Headers["groupId"].ToString();
+ if (string.IsNullOrWhiteSpace(groupId)) throw Oops.Oh("加盟商id不能为空");
+ var res = await _db.Queryable().Where(x => x.GroupId == groupId).Select(x => new
+
+ {
+ id = x.Id,
+ name = x.Name,
+ pid= x.Pid,
+ }).ToListAsync();
+ return res;
+ }
///
/// 删除商品类型
///
diff --git a/BPA.SAAS.Manage.Application/Device/Dtos/Device/TechnologyView.cs b/BPA.SAAS.Manage.Application/Device/Dtos/Device/TechnologyView.cs
index e39ec8b..947d3d6 100644
--- a/BPA.SAAS.Manage.Application/Device/Dtos/Device/TechnologyView.cs
+++ b/BPA.SAAS.Manage.Application/Device/Dtos/Device/TechnologyView.cs
@@ -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; }
diff --git a/BPA.SAAS.Manage.Application/Device/Dtos/ProductFunction/ProductFunctionView.cs b/BPA.SAAS.Manage.Application/Device/Dtos/ProductFunction/ProductFunctionView.cs
new file mode 100644
index 0000000..0d6dc28
--- /dev/null
+++ b/BPA.SAAS.Manage.Application/Device/Dtos/ProductFunction/ProductFunctionView.cs
@@ -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; }
+ ///
+ /// 功能名称
+ ///
+ public string Name { get; set; }
+ public string DeviceVersionKey { get; set; }
+ ///
+ /// 功能类型 0属性1服务2事件
+ ///
+ public string Type { get; set; }
+ ///
+ /// 数据类型
+ ///
+ public string DataType { get; set; }
+ ///
+ /// 取值范围
+ ///
+ public string DataRange { get; set; }
+ ///
+ /// 单位
+ ///
+ public string Unit { get; set; }
+ ///
+ /// 步长
+ ///
+ public decimal StepSize { get; set; }
+ ///
+ /// 枚举值
+ ///
+ public string EnumValue { get; set; }
+ ///
+ /// 数据长度
+ ///
+ public string DataLength { get; set; }
+ ///
+ /// 数据类型bool的描述
+ ///
+ public string BoolLabel { get; set; }
+ ///
+ /// 读写类型0读写 1只读
+ ///
+ public int ReadWrite { get; set; }
+ ///
+ /// 描述
+ ///
+ public string Description { get; set; }
+ public string ProductId { get; set; }
+ public string DataJson { get; set; }
+ public bool IsDefault { get; set; }
+ public List ProductFunctionValue { get; set; }
+ }
+}
diff --git a/BPA.SAAS.Manage.Application/Device/Interface/IProductFunctionService.cs b/BPA.SAAS.Manage.Application/Device/Interface/IProductFunctionService.cs
index e54c6e5..17c50ae 100644
--- a/BPA.SAAS.Manage.Application/Device/Interface/IProductFunctionService.cs
+++ b/BPA.SAAS.Manage.Application/Device/Interface/IProductFunctionService.cs
@@ -22,6 +22,9 @@ namespace BPA.SAAS.Manage.Application.Device.Interface
///
///
Task> GetProductFunction();
+ Task> GetProductFunction(string deviceId);
+ Task> GetProductFunction_alm(string deviceId);
+
///
/// 添加功能
///
diff --git a/BPA.SAAS.Manage.Application/Device/Interface/ITechnologyService.cs b/BPA.SAAS.Manage.Application/Device/Interface/ITechnologyService.cs
index b6bf247..3594ab7 100644
--- a/BPA.SAAS.Manage.Application/Device/Interface/ITechnologyService.cs
+++ b/BPA.SAAS.Manage.Application/Device/Interface/ITechnologyService.cs
@@ -18,5 +18,6 @@ namespace BPA.SAAS.Manage.Application.Device.Interface
///
///
Task> GetTechnologyList(string deviceId);
+ Task> GetTechnologyList_alm(string deviceId);
}
}
diff --git a/BPA.SAAS.Manage.Application/Device/ProductFunctionServices.cs b/BPA.SAAS.Manage.Application/Device/ProductFunctionServices.cs
index 39610b8..307bd44 100644
--- a/BPA.SAAS.Manage.Application/Device/ProductFunctionServices.cs
+++ b/BPA.SAAS.Manage.Application/Device/ProductFunctionServices.cs
@@ -39,6 +39,27 @@ namespace BPA.SAAS.Manage.Application.Device
return await _deviceTechnologyService.GetProductFunction();
}
///
+ /// 根据设备id查询产品功能和服务
+ ///
+ ///
+ ///
+ [HttpGet("/api/productfunction/getproductfunction")]
+ public async Task> GetProductFunction(string deviceId)
+ {
+ return await _deviceTechnologyService.GetProductFunction(deviceId);
+ }
+ ///
+ /// 根据设备id查询产品功能和服务(外部调用)
+ ///
+ ///
+ ///
+ [HttpGet("/api/productfunction/getproductfunction_alm")]
+ [AllowAnonymous]
+ public async Task> GetProductFunction_alm(string deviceId)
+ {
+ return await _deviceTechnologyService.GetProductFunction_alm(deviceId);
+ }
+ ///
/// 添加功能
///
///
diff --git a/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs b/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs
index 2f613df..954bfff 100644
--- a/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs
+++ b/BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs
@@ -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> GetProductFunction(string deviceId)
+ {
+ var device=_db.Queryable().Where(x => x.Id == deviceId).First();
+ var res = await _db.Queryable().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().Where(p => p.ProductFunctionId == x.Id).Any()
+ })
+ .Mapper(x =>
+ {
+ x.ProductFunctionValue = _db.Queryable().Where(p => p.ProductFunctionId == x.Id).ToList();
+ })
+ .ToListAsync();
+ return res;
+ }
+ public async Task> GetProductFunction_alm(string deviceId)
+ {
+ var device = _db.Queryable().Where(x => x.Id == deviceId).First();
+ var res = await _db.Queryable().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().Where(p => p.ProductFunctionId == x.Id).Any()
+ })
+ .Mapper(x =>
+ {
+ x.ProductFunctionValue = _db.Queryable().Where(p => p.ProductFunctionId == x.Id).ToList();
+ })
+ .ToListAsync();
+ return res;
+ }
///
/// 添加功能
///
diff --git a/BPA.SAAS.Manage.Application/Device/Services/TechnologyService.cs b/BPA.SAAS.Manage.Application/Device/Services/TechnologyService.cs
index b21d399..dc23814 100644
--- a/BPA.SAAS.Manage.Application/Device/Services/TechnologyService.cs
+++ b/BPA.SAAS.Manage.Application/Device/Services/TechnologyService.cs
@@ -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> GetTechnologyList_alm(string deviceId)
+ {
+ var device = _db.Queryable().Where(x => x.Id == deviceId).First();
+ var data = await _db.Queryable().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().Where(p => p.DeviceVersionId == x.DeviceVersionId).Select(f => new TechnologyInfo() { Id = f.Id, Name = f.Name, DeviceVersionId = f.DeviceVersionId }).ToList();
+ var TechnologyInfo = _db.Queryable().Where(d => d.TechnologyId == x.Id).ToList();
+ x.TechnologyActionInfo = TechnologyInfo;
+ })
+ .ToListAsync();
+
+ return data;
+ }
public async Task DeTechnologyExportRecode(string inputList)
{
try
diff --git a/BPA.SAAS.Manage.Application/Device/TechnologyServices.cs b/BPA.SAAS.Manage.Application/Device/TechnologyServices.cs
index 50c8f06..cd0a835 100644
--- a/BPA.SAAS.Manage.Application/Device/TechnologyServices.cs
+++ b/BPA.SAAS.Manage.Application/Device/TechnologyServices.cs
@@ -48,5 +48,11 @@ namespace BPA.SAAS.Manage.Application.Device
{
return await _technologyService.GetTechnologyList(deviceId);
}
+ [HttpGet("/api/technology/gettechnologylist_alm")]
+ [AllowAnonymous]
+ public async Task> GetTechnologyList__alm(string deviceId)
+ {
+ return await _technologyService.GetTechnologyList_alm(deviceId);
+ }
}
}