12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.CodeAnalysis.Operations;
- using ProductionLineMonitor.Core.Dtos;
- using ProductionLineMonitor.Core.IRepositories;
- using ProductionLineMonitor.Core.Services;
- namespace ProductionLineMonitor.Web.Controllers
- {
- public class ProductionLineController : BaseController
- {
- private readonly IProductionLineCoreService _productionLineService;
- private readonly IUnitOfWork _unitOfWork;
- public ProductionLineController(
- IProductionLineCoreService productionLineService,
- IUnitOfWork unitOfWork)
- {
- _productionLineService = productionLineService;
- _unitOfWork = unitOfWork;
- }
- [HttpGet]
- public IActionResult Index()
- {
- return View();
- }
- [HttpGet]
- public IActionResult GetProductionLines()
- {
- return Ok(_productionLineService.GetProductionLines());
- }
- [HttpGet]
- public IActionResult GetProductionLineTree()
- {
- return Ok(_productionLineService.GetProductionLineTree().Nodes);
- }
- [HttpGet]
- public IActionResult GetProductionLineMachineTree()
- {
- return Ok(_productionLineService.GetProductionLineMachineTree().Nodes);
- }
- /// <summary>
- ///带汇总
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- public IActionResult GetProductionLineMachineTreeV1()
- {
- return Ok(_productionLineService.GetProductionLineMachineTreeV1().Nodes);
- }
- [HttpPost]
- public IActionResult GetMachineDayData([FromBody]ReadDayDto dto)
- {
- return Ok(_productionLineService.GetMachineDayData(dto.Id, dto.DateTime));
- }
- [HttpPost]
- public IActionResult GetProductionLineDayData([FromBody] ReadDayDto dto)
- {
- return Ok(_productionLineService.GetProductionLineDayData(dto.Id, dto.DateTime));
- }
- }
- }
|