服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
6 天以前 bdf6174b1065a24877f16bba68921772a9586b48
Tiger.Controllers.MES/Controllers/MESController.BIZ_MES_WO.cs
@@ -264,6 +264,24 @@
            return Ok(response);
        }
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetWoNodeBatchCount([FromBody] ApiAction<GetWoNodeBatchCountInput> action)
        {
            ApiAction response = new();
            try
            {
                SugarParameter[] pars = Biz.Db.Ado.GetParameters(new { BATCH = action.Data.BatchNo, NodeIdOrName=action.Data.NodeName });
                var dt = Biz.Db.Ado.UseStoredProcedure().GetDataTable("SP_MES_GET_NODE_BATCH_COUNT", pars);
                response.Data = dt;
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
        /// <summary>
        /// 生成入库获取条码工单信息及包装信息
        /// </summary>
@@ -284,5 +302,47 @@
            }
            return Ok(response);
        }
        /// <summary>
        /// 获取工单备料信息
        /// </summary>
        /// <param name="action"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("api/[controller]/[action]")]
        public async Task<IActionResult> GetWoPickList([FromBody] ApiAction action)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(await DI.Resolve<IBIZ_MES_WO>().GetWoPickList(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> CheckCode([FromBody] ApiAction action)
        {
            ApiAction response = new();
            try
            {
                response = response.GetResponse(await DI.Resolve<IBIZ_MES_WO>().CheckCode(action.Data?.ToString()));
            }
            catch (System.Exception ex)
            {
                response = response.GetResponse().CatchExceptionWithLog(ex);
            }
            return Ok(response);
        }
    }
}