ManualMaterialRequest.cs 1.95 KB
using Hh.Mes.Service.Distribution;
using Microsoft.AspNetCore.Mvc;
using Hh.Mes.Service.SystemAuth;

namespace WebMvc.Areas.wo.Controllers
{
    #region 人工叫料

    /// <summary>
    /// 人工叫料
    /// </summary>
    [Area("distribution")]
    public class ManualMaterialRequestController : BaseController
    {
        private readonly MaterialDistributeLoadDataService  service;

        public ManualMaterialRequestController(IAuth authUtil, MaterialDistributeLoadDataService service) : base(authUtil)
        {
            this.service = service;
            var user = authUtil.GetCurrentUser();
            if (user != null)
            {
                this.service.sysWebUser = user.User;
            }          
        }

        #region 视图功能

        public IActionResult Index()
        {
            return View();
        }
        #endregion

        #region 获取数据
        /// <summary>
        /// 加载叫料头数据
        /// </summary>
        [HttpPost]
        public string LoadHead()
        {
            return Serialize(service.GteChargeAreaData("feedGroupCode"));
        }

        /// <summary>
        /// 加载叫料点
        /// </summary>
        [HttpPost]
        public string LoadData(string keys)
        {
            return Serialize(service.GteLoadingData(keys));
        }

        #endregion

        #region 提交数据

        #endregion

        #region 自定义方法
        /// <summary>
        /// 叫料操作
        /// </summary>
        [HttpPost]
        public string LoadingAsking(string locationCode)
        {
            return Serialize(service.LoadingAsking(locationCode, false));
        }

        /// <summary>
        /// 取消叫料操作
        /// </summary>
        [HttpPost]
        public string EscLoadingAsking(string locationCode)
        {
            return Serialize(service.EscLoadingAsking(locationCode));
        }
        
        #endregion

    }

    #endregion
}