FactoryCalendarController.cs 1.77 KB
using Hh.Mes.POJO.Entity;
using Hh.Mes.Service;
using Hh.Mes.Service.Planned;
using Hh.Mes.Service.SystemAuth;
using Microsoft.AspNetCore.Mvc;


namespace WebMvc.Areas.Planned.Controllers
{
    /// <summary>
    /// 工厂日历
    /// </summary>
    [Area("Planned")]
    public class FactoryCalendarController : BaseController
    {
        private readonly FactoryCalendarService factoryCalendarService;

        public FactoryCalendarController(IAuth authUtil, FactoryCalendarService service) : base(authUtil)
        {
            factoryCalendarService = service;
            factoryCalendarService.sysWebUser = authUtil.GetCurrentUser().User;
        }
        /// <summary>
        /// 工厂日历查看
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public string Ins(base_factory_calendar entity)
        {
            var result = factoryCalendarService.Ins(entity);
            return Serialize(result);
        }

        [HttpPost]
        public string Edit(base_factory_calendar entity)
        {
            var result = factoryCalendarService.Edit(entity);
            return Serialize(result);
        }


        [HttpPost]
        public string GetFactoryCalendarList(string datetime, string condition)
        {
            return Serialize(factoryCalendarService.GetCalendarLineList(datetime, condition));
        }

        /// <summary>
        /// 设置工作线体
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public string SetCalendarLineList(string datetime, string lineCode, bool Weekday)
        {
            return Serialize(factoryCalendarService.CalendarLineList(datetime, lineCode, Weekday).Result);
        }
    }
}