using BPA.Franchisee.Application.FranchiseeCenter.GoodsServices;
using BPA.SAAS.Manage.Application.DataBase.Dtos.Goods;
using BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsAttribute;
using BPA.SAAS.Manage.Application.DataBase.Interface;
using BPA.SAAS.Manage.Core.Base;
using BPA.SAAS.Manage.Core.DataBase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BPA.SAAS.Manage.Application.DataBase
{
[ApiDescriptionSettings("Goods", Tag = "商品管理")]
public class GoodsServices: IDynamicApiController, ITransient
{
IGoodsService _goodsService;
public GoodsServices(IGoodsService goodsService)
{
_goodsService=goodsService;
}
///
/// 分页查询
///
///
///
[HttpPost("/api/goods/page")]
public async Task GetGoodsPage(GoodsQueryDto dto)
{
return await _goodsService.GetGoodsPage(dto);
}
///
/// 添加商品
///
///
///
[HttpPost("/api/goods/add")]
public async Task AddGoods(GoodsDto dto)
{
return await _goodsService.AddGoods(dto);
}
///
/// 更新商品
///
///
///
[HttpPost("/api/goods/update")]
public async Task UpdateGoods(GoodsDto dto)
{
return await _goodsService.UpdateGoods(dto);
}
///
/// 删除商品
///
///
///
[HttpGet("/api/goods/delete")]
public async Task DeleteGoods(string id)
{
return await _goodsService.DeleteGoods(id);
}
///
/// 查询商品单位
///
///
[HttpGet("/api/goods/getgoodsuintlist")]
public async Task> GetGoodsUintList()
{
return await _goodsService.GetGoodsUintList();
}
///
/// 添加商品单位
///
///
///
[HttpPost("/api/goods/addgoodsuint")]
public async Task AddGoodsUint(GoodsUintDto dto)
{
return await _goodsService.AddGoodsUint(dto);
}
///
/// 商品配方
///
///
///
[HttpPost("/api/goods/getgoodsbompage")]
public async Task GetGoodsBomPageAsync(OrtherGoodsQueryDto dto)
{
return await _goodsService.GetGoodsBomPageAsync(dto);
}
///
/// 删除商品配方
///
///
///
[HttpGet("/api/goods/delgoodsbom")]
public async Task BatchDelGoodsBomAsync(string Ids)
{
return await _goodsService.BatchDelGoodsBomAsync(Ids);
}
///
/// 添加商品配方(包含属性关系)
///
///
///
[HttpPost("/api/goods/addgoodsbomattribute")]
public async Task AddGoodsBomAttribute(GoodsBomAttributeDto dto)
{
return await _goodsService.AddGoodsBomAttribute(dto);
}
///
/// 添加商品配方
///
///
///
[HttpPost("/api/goods/addgoodsbom")]
public async Task AddGoodsBom(GoodsBomDto dto)
{
return await _goodsService.AddGoodsBom(dto);
}
///
/// 查询所有商品
///
///
[HttpGet("/api/goods/getgoodslist")]
public async Task> GetGoodsList()
{
return await _goodsService.GetGoodsList();
}
///
/// 根据id查询商品信息
///
///
///
[HttpGet("/api/goods/getbyidgoods")]
public async Task GetGoods(string id)
{
return await _goodsService.GetGoods(id);
}
/////
///// 设备上传商品数据
/////
/////
/////
//Task SendGoodsInfo(GoodsDatadto goodsDatadto);
[HttpPost("/api/goods/exportgood"), ApiDescriptionSettings(SplitCamelCase = false), NonUnify]
public async Task ExportGood(IFormFile file)
{
return await _goodsService.ExportGood(file);
}
///
/// 导出 设备工艺流程
///
///
[HttpPost("/api/goods/technologytemplateexport"), NonUnify]
public async Task TechnologyTemplateExport(string deviceId)
{
return await _goodsService.TechnologyTemplateExport(deviceId);
}
///
/// 设备 版本 工序模型导入
///
///
[HttpPost("/api/goods/goodstemplateexport"), NonUnify]
public async Task DeviceVersionTemplateImport(DeviceVersionTemplateImportInputDto inputDto)
{
return await _goodsService.DeviceVersionTemplateImport(inputDto);
}
}
}