| | |
| | | return Ok(response); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Reset(ApiAction) |
| | | /// 重置工序操作 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Route("api/[controller]/TestNode/Reset")] |
| | | public async Task<IActionResult> TestNode_ResetAsync([FromBody] ApiAction action) |
| | | { |
| | | ApiAction response; |
| | | ITestNode trans = null; |
| | | try |
| | | { |
| | | if (iBiz.MES.Context.GetTransDic().ContainsKey(action.ID)) |
| | | { |
| | | trans = iBiz.MES.Context.GetTransDic()[action.ID] as ITestNode; |
| | | if (!trans.IsFinished) |
| | | { |
| | | lock (trans.TransLock) { response = action.GetResponse(trans.Reset()); } |
| | | } |
| | | else |
| | | { |
| | | response = action.GetResponse($"Transaction Error: 岗位[{trans.PostCode}]的测试工序事务[ID:{action.ID}]已经关闭", false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | response = action.GetResponse($"Transaction Error: 岗位的测试工序事务[ID:{action.ID}]已经被关闭", false); |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | response = action.GetResponse().CatchExceptionWithLog(ex); |
| | | } |
| | | trans?.AddHistory(Request, action); |
| | | return Ok(response); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// SelectWO(ApiAction(Data:{WoInput})) |