From 0455bf50d8721a65437c1e9a5477d64499761502 Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期五, 30 五月 2025 14:46:17 +0800 Subject: [PATCH] 1.首检功能”制热性能“表格生成。 --- Controllers/QC/IpqcController.cs | 65 ++++++++++++++++++++++++++++++++ 1 files changed, 65 insertions(+), 0 deletions(-) diff --git a/Controllers/QC/IpqcController.cs b/Controllers/QC/IpqcController.cs index 234f36e..5f9fd73 100644 --- a/Controllers/QC/IpqcController.cs +++ b/Controllers/QC/IpqcController.cs @@ -138,4 +138,69 @@ return ResponseResult.ResponseError(ex); } } + + [HttpPost("GetTableConfig")] + public ResponseResult GetTableConfig([FromBody] dynamic query) + { + try + { + if (query.mxguid == null) + throw new ArgumentException("鏄庣粏璁板綍GUID涓嶈兘涓虹┖"); + + var configData = m.GetTableConfig(query.mxguid?.ToString()); + + if (configData == null) + throw new Exception("鏈壘鍒扮浉鍏抽厤缃俊鎭�"); + + dynamic resultInfos = new ExpandoObject(); + resultInfos.selectedWater = configData.ipqc_zrxn_sel1; + resultInfos.selectedFlow = configData.ipqc_zrxn_sel2; + resultInfos.tableData = configData.ipqc_zrxn_table; + + return new ResponseResult + { + status = 0, + message = "OK", + data = resultInfos + }; + } + catch (Exception ex) + { + return ResponseResult.ResponseError(ex); + } + } + + [HttpPost("SaveTableConfig")] + public ResponseResult SaveTableConfig([FromBody] dynamic query) + { + try + { + // 鍙傛暟鏍¢獙 + if (query.mxguid == null) + throw new ArgumentException("鏄庣粏璁板綍GUID涓嶈兘涓虹┖"); + if (query.selectedWater == null || query.selectedFlow == null) + throw new ArgumentException("妫�娴嬮」鐩厤缃笉鑳戒负绌�"); + + // 鎵цSQL鏇存柊 + var affectedRows = m.UpdateTableConfig( + query.selectedWater?.ToString(), + query.selectedFlow?.ToString(), + Newtonsoft.Json.JsonConvert.SerializeObject(query.tableData), + query.mxguid?.ToString() + ); + + return new ResponseResult + { + status = affectedRows > 0 ? 0 : 1, + message = affectedRows > 0 ? "閰嶇疆淇濆瓨鎴愬姛" : "鏃犳暟鎹洿鏂�", + data = new { updated = affectedRows } + }; + } + catch (Exception ex) + { + return ResponseResult.ResponseError(ex); + } + } + + } \ No newline at end of file -- Gitblit v1.9.3