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 | 138 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 138 insertions(+), 0 deletions(-) diff --git a/Controllers/QC/IpqcController.cs b/Controllers/QC/IpqcController.cs index c4f6370..5f9fd73 100644 --- a/Controllers/QC/IpqcController.cs +++ b/Controllers/QC/IpqcController.cs @@ -14,6 +14,11 @@ { IpqcService m = new IpqcService(); + /// <summary> + /// 棣栨鍗曟嵁鏌ヨ + /// </summary> + /// <param name="queryObj"></param> + /// <returns></returns> [HttpPost("getPageSj")] public ResponseResult getPageSj([FromBody] XJPageResult queryObj) { @@ -64,5 +69,138 @@ } + /// <summary> + /// 棣栨鍗曟嵁鏌ヨ + /// </summary> + /// <param name="queryObj"></param> + /// <returns></returns> + [HttpPost("getPageXj")] + public ResponseResult getPageXj([FromBody] XJPageResult queryObj) + { + try + { + dynamic resultInfos = new ExpandoObject(); + var (item, totalCount) = m.getPageXj(queryObj); + var tbBillList = + resultInfos.tbBillList = item; + return new ResponseResult + { + status = 0, + message = "OK", + data = resultInfos, + TotalCount = totalCount + }; + } + catch (Exception ex) + { + return ResponseResult.ResponseError(ex); + } + } + + //鏇存柊妫�楠岄」鐩璇佷俊鎭� + [HttpPost("updateIpqcRzxx")] + public ResponseResult updateIpqcRzxx(LLJDto ipqcDto) + { + try + { + dynamic resultInfos = new ExpandoObject(); + var tbBillList = m.updateIpqcRzxx(ipqcDto); + resultInfos.tbBillList = tbBillList; + return new ResponseResult + { + status = 0, + message = "OK", + data = resultInfos + }; + } + catch (Exception ex) + { + return ResponseResult.ResponseError(ex); + } + } + + [HttpPost("createByWomdaa")] + public ResponseResult CreateByWomdaa(dynamic query) + { + try + { + dynamic resultInfos = new ExpandoObject(); + resultInfos.tbBillList = m.CreateByWomdaa(query); + return new ResponseResult + { + status = 0, + message = "OK", + data = resultInfos + }; + } + catch (Exception ex) + { + 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