using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System; using WIDESEAWCS_Core; using WIDESEAWCS_Core.BaseController; using WIDESEAWCS_Core.Helper; using WIDESEAWCS_DTO.Telescopic; using WIDESEAWCS_ITelescopicService; using WIDESEAWCS_IWMSPart; using WIDESEAWCS_Model.Models; namespace WIDESEAWCS_Server.Controllers.Telescopic { [Route("api/[controller]")] [ApiController] public class MaintenanceController : ApiBaseController { public MaintenanceController(IMaintenanceService service) : base(service) { } /// /// 查看检修管理 /// /// [HttpPost, Route("ShowMaintence"), AllowAnonymous] public WebResponseContent ShowMaintence([FromBody] PaginationDTO pagination) { return Service.ShowMaintence(pagination); } /// /// 在检修人员监控 /// /// [HttpPost, Route("PersonnelMonitoring"), AllowAnonymous] public WebResponseContent PersonnelMonitoring([FromBody] PaginationDTO pagination) { return Service.PersonnelMonitoring(pagination); } /// /// 更改状态,运行进入检修 /// /// /// [HttpPost, Route("RunOperation"), AllowAnonymous] public WebResponseContent RunOperation(int id, string ispossible) { // return Service.RunOperation(id, ispossible); } /// /// 更改状态 /// /// /// [HttpPost, Route("ChangeTasState"), AllowAnonymous] public WebResponseContent ChangeTasState(int id) { return Service.ChangeTasState(id); } /// /// 检修操作记录 /// /// [HttpPost, Route("MaintenanceOperationRecord"), AllowAnonymous] public WebResponseContent MaintenanceOperationRecord([FromBody] PaginationDTO pagination) { return Service.MaintenanceOperationRecord(pagination); } /// /// 查看登入今天账号的检修任务 /// /// /// [HttpPost, Route("MaintenanceTasksOfTheDay"), AllowAnonymous] public WebResponseContent MaintenanceTasksOfTheDay(string account) { return Service.MaintenanceTasksOfTheDay(account); } /// /// 开始检修 /// /// /// [HttpPost, Route("StartMaintenceTask"), AllowAnonymous] public WebResponseContent StartMaintenceTask(string account) { var userIp = HttpContext.GetUserIp();//用户电脑ip var reslut = userIp.Replace("::ffff:", " "); return Service.StartMaintenceTask(account, reslut); } /// /// 结束检修 /// /// /// [HttpPost, Route("StopMaintenanceTask"), AllowAnonymous] public WebResponseContent StopMaintenanceTask(string account) { return Service.StopMaintenanceTask(account); } } }