From 6922ceb192bfcb15f840409bb5f0707d3ee448e9 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期五, 21 六月 2024 18:09:57 +0800 Subject: [PATCH] 菜单权限更新 --- Tiger.Api/Controllers/MES/MESController.Route.cs | 75 +++++++++++++++++++++++++++++++++++++ 1 files changed, 75 insertions(+), 0 deletions(-) diff --git a/Tiger.Api/Controllers/MES/MESController.Route.cs b/Tiger.Api/Controllers/MES/MESController.Route.cs index 5e835cd..91275f6 100644 --- a/Tiger.Api/Controllers/MES/MESController.Route.cs +++ b/Tiger.Api/Controllers/MES/MESController.Route.cs @@ -1,6 +1,10 @@ 锘縰sing Microsoft.AspNetCore.Mvc; using Rhea.Common; +using SqlSugar; +using System.Collections.Generic; using System.Threading.Tasks; +using System.Xml.Linq; +using Tiger.Api.iBiz; using Tiger.IBusiness; using Tiger.Model; @@ -91,5 +95,76 @@ } return Ok(response); } + + /// <summary> + /// 鍒犻櫎宸ヨ壓璺嚎 + /// </summary> + /// <param name="action"></param> + /// <returns></returns> + [HttpPost] + [Route("api/[controller]/[action]")] + public async Task<IActionResult> DeleteRoute([FromBody] ApiAction action) + { + ApiAction response = new(); + try + { + response = response.GetResponse(await DI.Resolve<IRoute>().DeleteRoute(action.Data?.ToString())); + } + catch (System.Exception ex) + { + response = response.GetResponse().CatchExceptionWithLog(ex); + } + return Ok(response); + } + + /// <summary> + /// 淇濆瓨鑺傜偣宀椾綅璧勬簮 + /// </summary> + /// <param name="action"></param> + /// <returns></returns> + [HttpPost] + [Route("api/[controller]/[action]")] + public async Task<IActionResult> SaveRouteNodePost([FromBody] ApiAction<List<MES_ROUTE_NODE_POST>> action) + { + ApiAction response = new(); + try + { + response = response.GetResponse(await DI.Resolve<IRoute>().SaveRouteNodePost(action.Data)); + } + catch (System.Exception ex) + { + response = response.GetResponse().CatchExceptionWithLog(ex); + } + return Ok(response); + } + + /// <summary> + /// 鑾峰彇宸ヨ壓璺嚎鏍戝舰缁撴瀯 + /// </summary> + /// <param name="param"></param> + /// <returns></returns> + [HttpGet] + [Route("api/[controller]/[action]")] + public async Task<IActionResult> GetRoutePTreeAsync(string param) { + var data = Biz.Db.Ado.UseStoredProcedure().SqlQuery<V_MES_ROUTE_PTREE>("SP_MES_GET_ROUTE_PTREE", new SugarParameter("@PROD_CODE", param));//杩斿洖List + return Ok(data); + } + + [HttpGet] + [Route("api/[controller]/[action]")] + public async Task<IActionResult> RouteToProd(string rotId, string prodCode) + { + ApiAction response = new(); + try + { + SugarParameter[] pars = Biz.Db.Ado.GetParameters(new { ROT_ID = rotId, PROD_CODE = prodCode }); + Biz.Db.Ado.UseStoredProcedure().ExecuteCommand("SP_MES_ROUTE2PROD", pars); ; + } + catch (System.Exception ex) + { + response = response.GetResponse().CatchExceptionWithLog(ex); + } + return Ok(response); + } } } -- Gitblit v1.9.3