LargeScreenBoardController.cs 1.13 KB
using System;
using Hh.Mes.Common.log;
using Hh.Mes.Pojo.System;
using Hh.Mes.Service;
using Hh.Mes.Service.WebService.Equipment;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Hh.Mes.Api.Controllers
{
    /// <summary>
    /// 二号厂房数字化看板展示内容
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class LargeScreenBoardController : BaseController
    {
        private readonly LargeScreenBoardService service;
        private readonly BaseInfoCacheService baseInfo;


        public LargeScreenBoardController(LargeScreenBoardService service, BaseInfoCacheService baseInfo, IHttpContextAccessor accessor)
        {
            this.service = service;
            this.baseInfo = baseInfo;
            this.context = accessor.HttpContext;
        }

        [HttpGet]
        public string GetProjectAlarmAndProperRate(string yyyyMonth)
        {
            this.service.sysUserApiAccount = HttpContext.Items["Account"] as string;
            var result = service.GetProjectAlarmAndProperRate(yyyyMonth);
            return Serialize(result);
        }
    }
}