86 lines
3.4 KiB
C#
86 lines
3.4 KiB
C#
using System.Web.Mvc;
|
|
using WX.CRM.IBLL.Base;
|
|
using WX.CRM.IBLL.Util;
|
|
using WX.CRM.Model.Enum;
|
|
using WX.CRM.WebHelper;
|
|
|
|
namespace WX.CRM.WEB.Controllers.Import
|
|
{
|
|
public class ExcelImportController : BaseController
|
|
{
|
|
|
|
IBAS_EXCELIMPORTLOG_Q excelImport_Q;
|
|
ICACHE_Q _cache_Q;
|
|
public ExcelImportController(IBAS_EXCELIMPORTLOG_Q _excelImport_Q, ICACHE_Q cache_Q)
|
|
{
|
|
this.excelImport_Q = _excelImport_Q;
|
|
this._cache_Q = cache_Q;
|
|
}
|
|
[AuthorizeToolBar(InitRights.CONST_期货导入, InitToolBar.CONST_Other1)]
|
|
public ActionResult ContinueImport(EnumExcelDataType excelType, decimal importId)
|
|
{
|
|
string actionName = string.Empty;
|
|
switch (excelType)
|
|
{
|
|
case EnumExcelDataType.Qh_Customer: actionName = "Qh_CustomerImport"; break;
|
|
case EnumExcelDataType.Qh_CustomerPositions: actionName = "Qh_CustomerPositionsImport"; break;
|
|
case EnumExcelDataType.Qh_TransactionDetail: actionName = "Qh_TransactionDetailImport"; break;
|
|
case EnumExcelDataType.Qh_DiscrepancyGold: actionName = "Qh_DiscrepancyGoldImport"; break;
|
|
//default: actionName = "CustomerImport"; break;
|
|
}
|
|
return RedirectToAction(actionName, new { importId = importId });
|
|
}
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_期货客户数据导入)]
|
|
public ActionResult Qh_CustomerImport(decimal? importId)
|
|
{
|
|
SetLayoutData(EnumExcelDataType.Qh_Customer, "客户资金账户", importId);
|
|
return View();
|
|
}
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_期货成交记录导入)]
|
|
public ActionResult Qh_TransactionDetailImport(decimal? importId)
|
|
{
|
|
SetLayoutData(EnumExcelDataType.Qh_TransactionDetail, "成交明细", importId);
|
|
return View();
|
|
}
|
|
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_期货实时持仓导入)]
|
|
public ActionResult Qh_CustomerPositionsImport(decimal? importId)
|
|
{
|
|
SetLayoutData(EnumExcelDataType.Qh_CustomerPositions, "持仓信息", importId);
|
|
return View();
|
|
}
|
|
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_期货出入金导入)]
|
|
public ActionResult Qh_DiscrepancyGoldImport(decimal? importId)
|
|
{
|
|
SetLayoutData(EnumExcelDataType.Qh_DiscrepancyGold, "出入金信息", importId);
|
|
return View();
|
|
}
|
|
|
|
private void SetLayoutData(EnumExcelDataType dataType, string name, decimal? importId)
|
|
{
|
|
string ImpTypeConfig = _cache_Q.GetValue_Parameter("ImpType_" + dataType.ToString());//查找导入模式
|
|
if (string.IsNullOrEmpty(ImpTypeConfig))
|
|
{
|
|
ImpTypeConfig = "0";
|
|
}
|
|
ViewBag.ImpTypeConfig = ImpTypeConfig;
|
|
ViewBag.dataType = dataType;
|
|
ViewBag.name = name;
|
|
string step = "1";
|
|
if (importId != null && importId != 0)
|
|
{
|
|
var log = excelImport_Q.GetModel(importId.Value);
|
|
if (log.DONESTATUS == 110 || log.DONESTATUS == 100)
|
|
{
|
|
step = "4";
|
|
}
|
|
}
|
|
else
|
|
importId = 0;
|
|
ViewBag.importId = importId;
|
|
ViewBag.step = step;
|
|
}
|
|
}
|
|
}
|