Selaa lähdekoodia

数据下发

master
zhaoy 8 kuukautta sitten
vanhempi
commit
cfbfab7dc4
20 muutettua tiedostoa jossa 286 lisäystä ja 1 poistoa
  1. +20
    -0
      BPA.SAAS.Manage.Application/DataBase/BatchingServices.cs
  2. +10
    -0
      BPA.SAAS.Manage.Application/DataBase/GoodsAttributeServices.cs
  3. +10
    -0
      BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs
  4. +10
    -0
      BPA.SAAS.Manage.Application/DataBase/GoodsTypeServices.cs
  5. +2
    -0
      BPA.SAAS.Manage.Application/DataBase/Interface/IBatchingService.cs
  6. +5
    -0
      BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsAttributeService.cs
  7. +5
    -0
      BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs
  8. +1
    -0
      BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsTypeService.cs
  9. +24
    -0
      BPA.SAAS.Manage.Application/DataBase/Services/BatchingService.cs
  10. +23
    -0
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsAttributeService.cs
  11. +12
    -0
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs
  12. +13
    -0
      BPA.SAAS.Manage.Application/DataBase/Services/GoodsTypeService.cs
  13. +0
    -1
      BPA.SAAS.Manage.Application/Device/Dtos/Device/TechnologyView.cs
  14. +63
    -0
      BPA.SAAS.Manage.Application/Device/Dtos/ProductFunction/ProductFunctionView.cs
  15. +3
    -0
      BPA.SAAS.Manage.Application/Device/Interface/IProductFunctionService.cs
  16. +1
    -0
      BPA.SAAS.Manage.Application/Device/Interface/ITechnologyService.cs
  17. +21
    -0
      BPA.SAAS.Manage.Application/Device/ProductFunctionServices.cs
  18. +37
    -0
      BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs
  19. +20
    -0
      BPA.SAAS.Manage.Application/Device/Services/TechnologyService.cs
  20. +6
    -0
      BPA.SAAS.Manage.Application/Device/TechnologyServices.cs

+ 20
- 0
BPA.SAAS.Manage.Application/DataBase/BatchingServices.cs Näytä tiedosto

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


+ 10
- 0
BPA.SAAS.Manage.Application/DataBase/GoodsAttributeServices.cs Näytä tiedosto

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


+ 10
- 0
BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs Näytä tiedosto

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


+ 10
- 0
BPA.SAAS.Manage.Application/DataBase/GoodsTypeServices.cs Näytä tiedosto

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


+ 2
- 0
BPA.SAAS.Manage.Application/DataBase/Interface/IBatchingService.cs Näytä tiedosto

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

+ 5
- 0
BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsAttributeService.cs Näytä tiedosto

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


+ 5
- 0
BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs Näytä tiedosto

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


+ 1
- 0
BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsTypeService.cs Näytä tiedosto

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


+ 24
- 0
BPA.SAAS.Manage.Application/DataBase/Services/BatchingService.cs Näytä tiedosto

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


+ 23
- 0
BPA.SAAS.Manage.Application/DataBase/Services/GoodsAttributeService.cs Näytä tiedosto

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


+ 12
- 0
BPA.SAAS.Manage.Application/DataBase/Services/GoodsService.cs Näytä tiedosto

@@ -229,6 +229,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>


+ 13
- 0
BPA.SAAS.Manage.Application/DataBase/Services/GoodsTypeService.cs Näytä tiedosto

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


+ 0
- 1
BPA.SAAS.Manage.Application/Device/Dtos/Device/TechnologyView.cs Näytä tiedosto

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


+ 63
- 0
BPA.SAAS.Manage.Application/Device/Dtos/ProductFunction/ProductFunctionView.cs Näytä tiedosto

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

+ 3
- 0
BPA.SAAS.Manage.Application/Device/Interface/IProductFunctionService.cs Näytä tiedosto

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


+ 1
- 0
BPA.SAAS.Manage.Application/Device/Interface/ITechnologyService.cs Näytä tiedosto

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

+ 21
- 0
BPA.SAAS.Manage.Application/Device/ProductFunctionServices.cs Näytä tiedosto

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


+ 37
- 0
BPA.SAAS.Manage.Application/Device/Services/ProductFunctionService.cs Näytä tiedosto

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


+ 20
- 0
BPA.SAAS.Manage.Application/Device/Services/TechnologyService.cs Näytä tiedosto

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


+ 6
- 0
BPA.SAAS.Manage.Application/Device/TechnologyServices.cs Näytä tiedosto

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

Ladataan…
Peruuta
Tallenna