|
|
using Estsh.Core.Controllers;
|
|
|
using Estsh.Core.Model.Result;
|
|
|
using Estsh.Core.Models;
|
|
|
using Estsh.Core.Services.IServices;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using System.Collections;
|
|
|
|
|
|
/***************************************************************************************************
|
|
|
*
|
|
|
* 更新人:sitong.dong
|
|
|
* 描述:
|
|
|
* 修改时间:2022.06.22
|
|
|
* 修改日志:系统迭代升级
|
|
|
*
|
|
|
**************************************************************************************************/
|
|
|
namespace Estsh.Core.Web.Controllers
|
|
|
{
|
|
|
public class SystemController : BaseController
|
|
|
{
|
|
|
private ICommonService service;
|
|
|
public SystemController(ICommonService _service)
|
|
|
{
|
|
|
service = _service;
|
|
|
}
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
public IActionResult Index()
|
|
|
{
|
|
|
return View();
|
|
|
}
|
|
|
[AllowAnonymous]
|
|
|
public IActionResult Login()
|
|
|
{
|
|
|
List<KeyValueResult> menuList = this.service.getFactoryInfo();
|
|
|
if (menuList.Count>0)
|
|
|
{
|
|
|
ViewData.Add("factoryId", menuList[0].value);
|
|
|
}
|
|
|
return View();
|
|
|
}
|
|
|
public IActionResult Home()
|
|
|
{
|
|
|
if (CurrentEmp != null)
|
|
|
{
|
|
|
ViewData.Add("empNo", CurrentEmp.EmpNo);
|
|
|
ViewData.Add("factoryCode", CurrentEmp.FactoryCode);
|
|
|
|
|
|
List<SysWebMenu> webMenus = this.service.GetWebMenus(CurrentEmp.EmpId, CurrentEmp.FactoryId);
|
|
|
if (webMenus != null && webMenus.Count > 0)
|
|
|
{
|
|
|
ViewData.Add("webMenuList", webMenus);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
return View();
|
|
|
}
|
|
|
public IActionResult Main()
|
|
|
{
|
|
|
return View();
|
|
|
}
|
|
|
public IActionResult MainTab()
|
|
|
{
|
|
|
if (CurrentEmp != null)
|
|
|
{
|
|
|
ViewData.Add("empNo", CurrentEmp.EmpNo);
|
|
|
ViewData.Add("factoryCode", CurrentEmp.FactoryCode);
|
|
|
}
|
|
|
if (HttpContext.Request.HasFormContentType)
|
|
|
{
|
|
|
ViewData.Add("menuId", HttpContext.Request.Form["menuId"].ToString());
|
|
|
}
|
|
|
|
|
|
return View();
|
|
|
}
|
|
|
public IActionResult Left()
|
|
|
{
|
|
|
return View();
|
|
|
}
|
|
|
public IActionResult LeftTab()
|
|
|
{
|
|
|
return View();
|
|
|
}
|
|
|
public IActionResult Nav()
|
|
|
{
|
|
|
return View();
|
|
|
}
|
|
|
public IActionResult Open()
|
|
|
{
|
|
|
return View();
|
|
|
}
|
|
|
public IActionResult EditPassword()
|
|
|
{
|
|
|
if (CurrentEmp != null)
|
|
|
{
|
|
|
ViewData.Add("empId", CurrentEmp.EmpId);
|
|
|
ViewData.Add("empName", CurrentEmp.EmpName);
|
|
|
}
|
|
|
return View();
|
|
|
}
|
|
|
[AllowAnonymous]
|
|
|
public IActionResult getSelectFactory()
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
List<KeyValueResult> menuList = this.service.getFactoryInfo();
|
|
|
result.Add("list", menuList);
|
|
|
return Json(result);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|