Commit c03844dc by guanzhenshan

增加导入汇率接口

parent 85cb0c22
...@@ -65,6 +65,8 @@ namespace Bailun.DC.Services.DataWareHouse ...@@ -65,6 +65,8 @@ namespace Bailun.DC.Services.DataWareHouse
public string UpdateStatus(int id, int status, string note) public string UpdateStatus(int id, int status, string note)
{ {
return ""; return "";
} }
......
...@@ -590,5 +590,48 @@ namespace Bailun.DC.Web.Controllers ...@@ -590,5 +590,48 @@ namespace Bailun.DC.Web.Controllers
return Content("OK"); return Content("OK");
} }
public JsonResult UploadExchange()
{
if (Request.Form.Files.Count == 0)
{
return Json(new
{
success = false,
msg = "请上传文件!"
});
}
//var user = HttpContextHelper.Current?.User;
var file = Request.Form.Files[0];
var errmsg = "";
Dictionary<string, DataTable> dic = Base.NpolHelper.ExcelToDataTable(file.OpenReadStream(), file.FileName, true, ref errmsg);
if (dic.Count > 0)
{
var list = new List<Models.DataWareHouse.exchange_rate_finance>();
var tb = dic.FirstOrDefault();
for (var i = 0; i < tb.Value.Rows.Count; i++)
{
var _row = tb.Value.Rows[i];
var _month = _row["月份"].ToString();
var _currency = _row["币种"].ToString();
var _exchangerate = decimal.Parse(_row["汇率"].ToString());
}
}
return Json(new {
success = true,
msg = "",
});
; }
} }
} }
\ No newline at end of file
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