WmsSnController.cs 1.88 KB
using Hh.Mes.Common.Request;
using Hh.Mes.POJO.WMSEntity;
using Hh.Mes.Service.SystemAuth;
using Hh.Mes.Service.WmsService;
using Microsoft.AspNetCore.Mvc;
using WebMvc.Aop;

namespace WebMvc.Areas.configure.Controllers
{
    /// <summary>
    /// WMS SN信息
    /// </summary>
    [Area("configure")]
    public class WmsSnController : BaseController
    {
        private readonly WmsSnPartService _service;

        public WmsSnController(IAuth authUtil, WmsSnPartService service) : base(authUtil)
        {
            _service = service;
        }

        /// <summary>
        /// 默认视图Action
        /// </summary>
        /// <returns></returns>
        [Authenticate]
        [ServiceFilter(typeof(OperLogFilter))]
        public ActionResult Index()
        {
            if (_loginInfo == null) return Redirect("/Login/Index");
            return View();
        }

        [Authenticate]
        [ServiceFilter(typeof(OperLogFilter))]
        public IActionResult Detail([FromQuery] string snCode)
        {
            return View(_service.GetSnPartDetailHistory(snCode));
        }

        /// <summary>
        /// 加载及分页查询
        /// </summary>
        /// <param name="pageRequest">表单请求信息</param>
        /// <param name="entity">请求条件实例</param>
        /// <returns></returns>
        [HttpPost]
        public string Load(PageReq pageRequest, Sn entity)
        {
            return Serialize(_service.Load(pageRequest, entity));
        }

        /// <summary>
        /// //获取明细列表 支持导出查询
        /// </summary>
        public string LoadDesc(PageReq pageReq, SnPartDetail model)
        {
            return Serialize(_service.LoadDesc(pageReq, model));
        }

        [HttpGet]
        public string GetTreeList()
        {
            var data = _service.GetTreeList();
            return Serialize(data);
        }
    }
}