diff --git a/BPA.SAAS.Manage.Application/DataBase/Dtos/Goods/GoodsDto.cs b/BPA.SAAS.Manage.Application/DataBase/Dtos/Goods/GoodsDto.cs
index 99d9933..95394a9 100644
--- a/BPA.SAAS.Manage.Application/DataBase/Dtos/Goods/GoodsDto.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/Dtos/Goods/GoodsDto.cs
@@ -1,4 +1,5 @@
using BPA.SAAS.Manage.Comm.Enum;
+using Npoi.Mapper.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -24,4 +25,21 @@ namespace BPA.SAAS.Manage.Application.DataBase.Dtos.Goods
public string GoodsTypeId { get; set; }
public string Status { get; set; }
}
+ public class GoodsImportDto
+ {
+ [Column("商品名称")]
+ public string Name { get; set; }
+ [Column("商品分类")]
+ public string Type { get; set; }
+ [Column("商品单位")]
+ public string Uint { get; set; }
+ [Column("商品价格")]
+ public decimal Price { get; set; }
+ [Column("是否称重")]
+ public string IsWeigh { get; set; }
+ [Column("备注")]
+ public string Descritption { get; set; }
+ [Column("图片")]
+ public object ImgUrl { get; set; }
+ }
}
diff --git a/BPA.SAAS.Manage.Application/DataBase/Dtos/Goods/GoodsTechnologyImportDto.cs b/BPA.SAAS.Manage.Application/DataBase/Dtos/Goods/GoodsTechnologyImportDto.cs
index b9fec40..08978b6 100644
--- a/BPA.SAAS.Manage.Application/DataBase/Dtos/Goods/GoodsTechnologyImportDto.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/Dtos/Goods/GoodsTechnologyImportDto.cs
@@ -11,7 +11,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Dtos.Goods
///
/// 文件
///
- public IFormFile file { get; set; }
+ public IFormFile File { get; set; }
}
public class GoodsTechnologyExportDto
@@ -29,4 +29,12 @@ namespace BPA.SAAS.Manage.Application.DataBase.Dtos.Goods
///
public string FileName { get; set; }
}
+
+ public class GoodsInfoImportDto
+ {
+ ///
+ /// 文件
+ ///
+ public IFormFile File { get; set; }
+ }
}
diff --git a/BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs b/BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs
index c88368f..6e2a373 100644
--- a/BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/GoodsServices.cs
@@ -14,12 +14,12 @@ using System.Threading.Tasks;
namespace BPA.SAAS.Manage.Application.DataBase
{
[ApiDescriptionSettings("Goods", Tag = "商品管理")]
- public class GoodsServices: IDynamicApiController, ITransient
+ public class GoodsServices : IDynamicApiController, ITransient
{
IGoodsService _goodsService;
public GoodsServices(IGoodsService goodsService)
{
- _goodsService=goodsService;
+ _goodsService = goodsService;
}
///
/// 分页查询
@@ -168,7 +168,7 @@ namespace BPA.SAAS.Manage.Application.DataBase
/////
//Task SendGoodsInfo(GoodsDatadto goodsDatadto);
[HttpPost("/api/goods/exportgood"), ApiDescriptionSettings(SplitCamelCase = false), NonUnify]
- public async Task ExportGood(IFormFile file)
+ public async Task ExportGood(IFormFile file)
{
return await _goodsService.ExportGood(file);
}
@@ -178,7 +178,7 @@ namespace BPA.SAAS.Manage.Application.DataBase
///
///
[HttpPost("/api/goods/technologytemplateexport"), NonUnify]
- public async Task TechnologyTemplateExport(string deviceId)
+ public async Task TechnologyTemplateExport(string deviceId)
{
return await _goodsService.TechnologyTemplateExport(deviceId);
}
@@ -199,19 +199,42 @@ namespace BPA.SAAS.Manage.Application.DataBase
///
///
[HttpPost("/api/goods/goodsTechnologyImport"), NonUnify]
- public async Task GoodsTechnologyImport([FromForm]GoodsTechnologyImportDto importDto)
+ public async Task GoodsTechnologyImport([FromForm] GoodsTechnologyImportDto importDto)
{
return await _goodsService.GoodsTechnologyImport(importDto);
}
///
- /// 商品工艺导出
+ /// 商品工艺模版导出
///
+ ///
///
[HttpPost("/api/goods/goodsTechnologyExport"), NonUnify]
public async Task GoodsTechnologyExport(GoodsTechnologyExportDto exportDto)
{
return await _goodsService.GoodsTechnologyExport(exportDto);
}
+
+ ///
+ /// 商品导入
+ ///
+ ///
+ ///
+ [HttpPost("/api/goods/goodsImport"), NonUnify]
+ public async Task GoodsImport([FromForm] GoodsInfoImportDto importDto)
+ {
+ return await _goodsService.GoodsImport(importDto);
+ }
+
+ ///
+ /// 商品工艺导出
+ ///
+ ///
+ ///
+ [HttpPost("/api/goods/goodsSimpleExport"), NonUnify]
+ public async Task GoodsSimpleExport(string goodName)
+ {
+ return await _goodsService.GoodsSimpleExport(goodName);
+ }
}
}
diff --git a/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs b/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs
index 29f725a..affe276 100644
--- a/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs
+++ b/BPA.SAAS.Manage.Application/DataBase/Interface/IGoodsService.cs
@@ -26,7 +26,7 @@ namespace BPA.SAAS.Manage.Application.DataBase.Interface
///
///
///
- Task