Commit 175f3db3 by 泽锋 李

fix

parent ba4a2532
......@@ -39,8 +39,8 @@ namespace AutoTurnOver.DB
throw new Exception("sku必填");
}
var old_data = conn.QuerySingleOrDefault<dc_auto_first_order_sku>(" select * from dc_auto_first_order_sku where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new { bailun_sku = item, warehouse_code = input_data.warehouse_code });
if (old_data != null) throw new Exception($" sku {item} , 仓库编码 :{ input_data.warehouse_code} 已存在 ");
var old_data = conn.QuerySingleOrDefault<dc_auto_first_order_sku>(" select * from dc_auto_first_order_sku where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new { bailun_sku = item.bailun_sku, warehouse_code = input_data.warehouse_code });
if (old_data != null) throw new Exception($" sku {item.bailun_sku} , 仓库编码 :{ input_data.warehouse_code} 已存在 ");
conn.Insert(new dc_auto_first_order_sku
{
bailun_sku = item.bailun_sku,
......
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoTurnOver.Common;
using AutoTurnOver.Models;
using AutoTurnOver.Services;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using AutoTurnOver.Utility;
namespace AutoTurnOver.Controllers
{
......@@ -86,19 +83,13 @@ namespace AutoTurnOver.Controllers
}
[HttpPost("FirstOrderSkuAdd")]
public async Task<JsonResult> FirstOrderSkuAdd()
public JsonResult FirstOrderSkuAdd([FromBody]dc_auto_first_order_sku_input_dto inputData)
{
try
{
var result = string.Empty;
using (var reader = new StreamReader(Request.Body, Encoding.UTF8))
{
result = await reader.ReadToEndAsync();
new FirstOrderService().Add(result.ToObj<dc_auto_first_order_sku_input_dto>());
}
new FirstOrderService().Add(inputData);
return new JsonResult(new
{
success = true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment