| | |
| | | /// 上下刀操作(上刀type=0,下刀type=1) |
| | | /// </summary> |
| | | [HttpPost("SubmitToolAction")] |
| | | public IActionResult SubmitToolAction([FromBody] dynamic data) |
| | | public IActionResult SubmitToolAction( |
| | | [FromForm] string workOrderNo, |
| | | [FromForm] string machineNo, |
| | | [FromForm] string toolNo, |
| | | [FromForm] string type, // string 类型 |
| | | [FromForm] int? useLimit |
| | | ) |
| | | { |
| | | string workOrderNo = data.workOrderNo; |
| | | string machineNo = data.machineNo; |
| | | string toolNo = data.toolNo; |
| | | string type = data.type; |
| | | int? useLimit = data.useLimit; |
| | | |
| | | try |
| | | { |
| | | var result = m.SubmitToolAction(workOrderNo, machineNo, toolNo, type, useLimit); |
| | | return Ok(new ResponseResult |
| | | { |
| | |
| | | data = result |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return Ok(ResponseResult.ResponseError(ex)); |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Text; |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using System.Data; |
| | | |
| | | namespace PadApplication.Services; |
| | | |
| | |
| | | /// 上下刀操作(上刀type=0,下刀type=1) |
| | | /// 仅负责参数转发,所有数据写入由存储过程完成。 |
| | | /// </summary> |
| | | /// <param name="workOrderNo">工单号</param> |
| | | /// <param name="machineNo">机台编号</param> |
| | | /// <param name="toolNo">刀具编号</param> |
| | | /// <param name="type">操作类型(上刀、下刀)</param> |
| | |
| | | new SugarParameter("V_MACHINE_NO", machineNo), |
| | | new SugarParameter("V_TOOL_NO", toolNo), |
| | | new SugarParameter("V_TYPE", type), |
| | | new SugarParameter("V_USE_LIMIT", useLimit ?? (object)DBNull.Value) |
| | | new SugarParameter("V_USE_LIMIT", useLimit ?? (object)DBNull.Value), |
| | | new SugarParameter("PO_OUTMSG", null) { Direction = ParameterDirection.Output, DbType = System.Data.DbType.String, Size = 200 }, |
| | | new SugarParameter("PO_OUTSUM", null) { Direction = ParameterDirection.Output, DbType = System.Data.DbType.Int32 } |
| | | }; |
| | | try |
| | | { |
| | | var result = Db.Ado.SqlQuery<object>( |
| | | "CALL PROC_TOOL_ACTION(:V_WORK_ORDER_NO, :V_MACHINE_NO, :V_TOOL_NO, :V_TYPE, :V_USE_LIMIT)", parameters); |
| | | return result; |
| | | Db.Ado.UseStoredProcedure().SqlQuery<object>( |
| | | "PROC_TOOL_ACTION", parameters); |
| | | var outMsg = parameters[5].Value?.ToString(); |
| | | var outSum = parameters[6].Value; |
| | | return new { outMsg, outSum }; |
| | | } |
| | | catch (Exception ex) |
| | | { |