Commit 93aaf08e by guanzhenshan

匹配平台账单流水订单格式调整

parent 6c7e877d
......@@ -28,5 +28,7 @@ namespace Bailun.DC.Models.DataWareHouse
public DateTime? datatime { get; set; }
public string platformsku { get; set; }
public string createuser { get; set; }
}
}
......@@ -5,7 +5,9 @@ using System.Data;
using System.Linq;
using Microsoft.AspNetCore.Hosting;
using System.Threading.Tasks;
using Bailun.ServiceFabric.Authorize;
using Bailun.ServiceFabric.Core.Extension.HttpContext;
using Bailun.ServiceFabric.Core.Extension;
namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
{
......@@ -279,8 +281,10 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
/// <param name="platform">平台类型</param>
/// <param name="website">站点</param>
/// <returns></returns>
//[BailunAuthentication(LoginMode.Enforce)]
public JsonResult UploadOrderBilling(string platform, string website)
{
if (Request.Form.Files.Count == 0)
{
return Json(new
......@@ -290,6 +294,8 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
});
}
//var user = HttpContextHelper.Current?.User;
var file = Request.Form.Files[0];
Dictionary<string, DataTable> dic = Base.NpolHelper.ExcelToDataTable(file.OpenReadStream(), file.FileName, true);
......@@ -311,6 +317,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
website = website??"",
orderno = "",
platformsku = "",
createuser = "页面上传"
};
listOrders.Add(m);
......@@ -336,11 +343,22 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
foreach (DataRow dr in dtb.Rows)
{
System.Collections.Generic.Dictionary<string, object> drow = new System.Collections.Generic.Dictionary<string, object>();
foreach (DataColumn dc in dtb.Columns)
{
drow.Add(dc.ColumnName, dr[dc.ColumnName]);
}
dic.Add(drow);
//判断是否空行,如果null值
if (drow.ToList().Where(a => a.Value == null).Count() == drow.Count || drow.FirstOrDefault().Value == null)
{
continue;
}
else
{
dic.Add(drow);
}
}
return dic;
......
......@@ -25,6 +25,7 @@
<option value="esty">esty</option>
<option value="JD">JD</option>
<option value="Fyndiq">Fyndiq</option>
<option value="Paypal">Paypal</option>
</select>
</div>
<div class="form-group">
......
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