增加追加导入逻辑

This commit is contained in:
小魔仙
2025-05-13 10:44:22 +08:00
parent 0ae5525c72
commit e0425af58e
3 changed files with 17 additions and 6 deletions

View File

@@ -10,6 +10,7 @@ using NPOI.XSSF.UserModel;
using NPOI.SS.Formula.Functions;
using Aliyun.OSS;
using Mapster;
using ZXing;
namespace DOAN.Service.MES.order
{
@@ -90,7 +91,7 @@ namespace DOAN.Service.MES.order
}
public int ImportData(IFormFile formFile, string username)
public int ImportData(IFormFile formFile, string username, bool? value)
{
List<OrderPurchase> orderPurchases = new List<OrderPurchase>();
DateTime importDate = DateTime.MinValue;
@@ -183,7 +184,16 @@ namespace DOAN.Service.MES.order
throw new Exception(ex.Message);
}
}
if (value==true)
{
int result = 0;
UseTran2(() =>
{
result = Context.Insertable(orderPurchases).ExecuteCommand();
});
return result;
}
if(orderPurchases.Count>0)
{
int result = 0;
@@ -210,5 +220,6 @@ namespace DOAN.Service.MES.order
return response;
}
}
}