订单Excel添加追加导入功能
This commit is contained in:
@@ -125,18 +125,19 @@ namespace DOAN.Admin.WebApi.Controllers
|
|||||||
/// 采购导入
|
/// 采购导入
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="formFile">使用IFromFile必须使用name属性否则获取不到文件</param>
|
/// <param name="formFile">使用IFromFile必须使用name属性否则获取不到文件</param>
|
||||||
|
/// <param name="uploadType">true-追加导入 false-覆盖导入</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("importData")]
|
[HttpPost("importData")]
|
||||||
[Log(Title = "采购导入", BusinessType = BusinessType.IMPORT, IsSaveRequestData = false, IsSaveResponseData = true)]
|
[Log(Title = "采购导入", BusinessType = BusinessType.IMPORT, IsSaveRequestData = false, IsSaveResponseData = true)]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public IActionResult ImportData([FromForm(Name = "file")] IFormFile formFile,bool? value)
|
public IActionResult ImportData([FromForm(Name = "file")] IFormFile formFile,bool? uploadType)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (formFile == null)
|
if (formFile == null)
|
||||||
{
|
{
|
||||||
return SUCCESS(null);
|
return SUCCESS(null);
|
||||||
}
|
}
|
||||||
int response = _OrderPurchaseService.ImportData(formFile, HttpContext.GetName(),value);
|
int response = _OrderPurchaseService.ImportData(formFile, HttpContext.GetName(), uploadType);
|
||||||
|
|
||||||
return SUCCESS(response);
|
return SUCCESS(response);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace DOAN.Service.MES.order.IService
|
|||||||
|
|
||||||
OrderPurchase GetInfo(string Id);
|
OrderPurchase GetInfo(string Id);
|
||||||
|
|
||||||
int ImportData(IFormFile formFile, string username,bool? value);
|
int ImportData(IFormFile formFile, string username,bool? uploadType);
|
||||||
OrderPurchase AddOrderPurchase(OrderPurchase parm);
|
OrderPurchase AddOrderPurchase(OrderPurchase parm);
|
||||||
int UpdateOrderPurchase(OrderPurchase parm);
|
int UpdateOrderPurchase(OrderPurchase parm);
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ namespace DOAN.Service.MES.order
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int ImportData(IFormFile formFile, string username, bool? value)
|
public int ImportData(IFormFile formFile, string username, bool? uploadType)
|
||||||
{
|
{
|
||||||
List<OrderPurchase> orderPurchases = new List<OrderPurchase>();
|
List<OrderPurchase> orderPurchases = new List<OrderPurchase>();
|
||||||
DateTime importDate = DateTime.MinValue;
|
DateTime importDate = DateTime.MinValue;
|
||||||
@@ -184,7 +184,8 @@ namespace DOAN.Service.MES.order
|
|||||||
throw new Exception(ex.Message);
|
throw new Exception(ex.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (value==true)
|
// 追加导入
|
||||||
|
if (uploadType == true)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
UseTran2(() =>
|
UseTran2(() =>
|
||||||
|
|||||||
Reference in New Issue
Block a user