using Microsoft.AspNetCore.Mvc; using Rhea.Common; using System.Collections.Generic; using System.Threading.Tasks; using Tiger.IBusiness; using Tiger.Model; namespace Tiger.Api.Controllers.MES { public partial class MESController : ControllerBase { /// /// 获取工艺路线 /// /// /// [HttpPost] [Route("api/[controller]/[action]")] public async Task GetRoute([FromBody] ApiAction action) { ApiAction response = new(); try { response = response.GetResponse(await DI.Resolve().GetRoute(action.Data?.ToString())); } catch (System.Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } /// /// 获取工艺路线图形数据 /// /// /// [HttpPost] [Route("api/[controller]/[action]")] public async Task GetRouteData([FromBody] ApiAction action) { ApiAction response = new(); try { response = response.GetResponse(await DI.Resolve().GetRouteData(action.Data?.ToString())); } catch (System.Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } /// /// 保存工艺路线图形数据 /// /// /// [HttpPost] [Route("api/[controller]/[action]")] public async Task SaveRouteData([FromBody] ApiAction action) { ApiAction response = new(); try { response = response.GetResponse(await DI.Resolve().SaveRouteData(action.Data)); } catch (System.Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } /// /// 保存工艺路线 /// /// /// [HttpPost] [Route("api/[controller]/[action]")] public async Task SaveRoute([FromBody] ApiAction action) { ApiAction response = new(); try { response = response.GetResponse(await DI.Resolve().SaveRoute(action.Data)); } catch (System.Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } /// /// 删除工艺路线 /// /// /// [HttpPost] [Route("api/[controller]/[action]")] public async Task DeleteRoute([FromBody] ApiAction action) { ApiAction response = new(); try { response = response.GetResponse(await DI.Resolve().DeleteRoute(action.Data?.ToString())); } catch (System.Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } /// /// 保存节点岗位资源 /// /// /// [HttpPost] [Route("api/[controller]/[action]")] public async Task SaveRouteNodePost([FromBody] ApiAction> action) { ApiAction response = new(); try { response = response.GetResponse(await DI.Resolve().SaveRouteNodePost(action.Data)); } catch (System.Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } } }