MaterialDistributeLoadNameController.cs 4.3 KB
using Hh.Mes.Common.Request;
using Hh.Mes.POJO.Entity;
using Hh.Mes.Service;
using Hh.Mes.Service.Distribution;
using Hh.Mes.Service.SystemAuth;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;
using WebMvc.Aop;

namespace WebMvc.Areas.distribution.Controllers
{
    #region 装料模板设置

    /// <summary>
    /// 装料数据
    /// </summary>
    [Area("distribution")]
    public class MaterialDistributeLoadNameController : BaseController
    {
        private readonly MaterialDistributeLoadNameService   service;

        public MaterialDistributeLoadNameController(IAuth authUtil, MaterialDistributeLoadNameService service) : base(authUtil)
        {
            this.service = service;
            this.service.sysWebUser = authUtil.GetCurrentUser().User;
        }

        #region 视图功能
        /// <summary>
        /// 焊接工单页面
        /// </summary>
        /// <returns></returns>

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

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

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

        #region 提交数据
        /// <summary>
        /// 新增数据
        /// </summary>
        /// <param name="entity">新增实例</param>
        /// <returns></returns>
        [HttpPost]
        [ServiceFilter(typeof(OperLogFilter))]
        public string Ins(bus_material_distribute_load_header_template entity)
        {
            return Serialize(service.Ins(entity));
        }

        /// <summary>
        /// 修改数据
        /// </summary>
        /// <param name="entity">修改实例</param>
        /// <returns></returns>
        [HttpPost]
        [ServiceFilter(typeof(OperLogFilter))]
        public string Upd(bus_material_distribute_load_header_template entity)
        {
            return Serialize(service.Upd(entity));
        }

        [HttpPost]
        [ServiceFilter(typeof(OperLogFilter))]
        public string DelByIds(Guid[] ids)
        {
            return Serialize(service.DelByIds(ids));
        }


        /// <summary>
        /// 新增明细数据
        /// </summary>
        /// <param name="entity">新增实例</param>
        /// <returns></returns>
        [HttpPost]
        [ServiceFilter(typeof(OperLogFilter))]
        public string InsDesc(bus_material_distribute_load_detail_template entity)
        {
            return  Serialize(service.InsDesc(entity));
        }

        /// <summary>
        /// 修改明细数据
        /// </summary>
        /// <param name="entity">修改实例</param>
        /// <returns></returns>
        [HttpPost]
        [ServiceFilter(typeof(OperLogFilter))]
        public string UpdDesc(bus_material_distribute_load_detail_template entity)
        {
            return Serialize(service.UpdDesc(entity));
        }

        [HttpPost]
        [ServiceFilter(typeof(OperLogFilter))]
        public string DelByIdsDesc(int[] ids)
        {
            return  Serialize(service.DelByIdsDesc(ids));
        }
        #endregion

        #region 导出数据
        /// <summary>
        /// 导出数据
        /// </summary>
        /// <param name="entity">请求条件实例</param>
        /// <returns></returns>
        [HttpPost]
        public string Export(bus_material_distribute_load_header_template entity)
        {
            return Serialize(service.Export(entity));
        }
        #endregion

        #region 自定义方法


        #endregion

    }

    #endregion
}