using DOAN.Model.MES.recipe; using DOAN.Model.MES.recipe.Dto; using DOAN.Service.MES.recipe.IService; using DOAN.ServiceCore.Middleware; using Infrastructure; using Infrastructure.Attribute; using Infrastructure.Controllers; using Infrastructure.Enums; using Mapster; using MDM.Models.Flow; using MDM.Models.Session; using MDM.Services.Session.IService; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace MDM.Controllers.Session { /// /// 回会管理 /// [Route("mes/session_managemer")] [AllowAnonymous] public class SessionManagerController : BaseController { /// /// 会话管理接口 /// private readonly ISessionManagerService _ISessionManagerService; public SessionManagerController(ISessionManagerService ISessionManagerService) { _ISessionManagerService = ISessionManagerService; } //TODO 开工申请 /// /// 开工申请 /// /// 过程码 /// 当前工单号 /// 当前产线码 /// 当前组码 /// 1:开工成功 0:异常 -1:重复开工 -2 参数异常 [HttpGet("start_work_apply")] public IActionResult StartWorkApply(string ProcessCode,string WorkOrder,string LineCode,string GroupCode) { if(string.IsNullOrEmpty(ProcessCode)||string.IsNullOrEmpty(WorkOrder)||string.IsNullOrEmpty(GroupCode)) { return SUCCESS(-2); } int result= _ISessionManagerService.StartWorkApply(ProcessCode, WorkOrder, LineCode, GroupCode); return SUCCESS(result); } //TODO 入站申请 /// /// 入站申请 /// /// [HttpGet("in_station_apply")] public IActionResult InStationApply(string OperationCode, string ProcessCode) { InStationApplyResult result = _ISessionManagerService.InStationApply(OperationCode, ProcessCode); return SUCCESS(result); } //TODO 出站申请 [HttpGet("out_station_apply")] public IActionResult OutStationApply(string OperationCode, string ProcessCode) { InStationApplyResult result = _ISessionManagerService.OutStationApply(OperationCode, ProcessCode); return SUCCESS(result); } } }