From ed670b6b4a44a11060a7527809c84ff4c32ba6a6 Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期六, 12 七月 2025 15:39:52 +0800 Subject: [PATCH] 1.AGV接口开发 2.采购扫描验退 --- Controllers/QC/IpqcController.cs | 215 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 213 insertions(+), 2 deletions(-) diff --git a/Controllers/QC/IpqcController.cs b/Controllers/QC/IpqcController.cs index 234f36e..5d5eb0d 100644 --- a/Controllers/QC/IpqcController.cs +++ b/Controllers/QC/IpqcController.cs @@ -99,7 +99,7 @@ //鏇存柊妫�楠岄」鐩璇佷俊鎭� [HttpPost("updateIpqcRzxx")] - public ResponseResult updateIpqcRzxx(LLJDto ipqcDto) + public ResponseResult updateIpqcRzxx(dynamic ipqcDto) { try { @@ -118,7 +118,9 @@ return ResponseResult.ResponseError(ex); } } - + /// <summary> + /// 棣栨鍗曟嵁鏌ヨ + /// </summary> [HttpPost("createByWomdaa")] public ResponseResult CreateByWomdaa(dynamic query) { @@ -138,4 +140,213 @@ return ResponseResult.ResponseError(ex); } } + /// <summary> + /// 鑾峰彇琛ㄦ牸閰嶇疆 + /// </summary> + [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); + } + } + /// <summary> + /// 淇濆瓨琛ㄦ牸閰嶇疆 + /// </summary> + [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); + } + } + /// <summary> + /// 鑾峰彇璁よ瘉淇℃伅鍒楄〃 + /// </summary> + [HttpPost("GetRzxxList")] + public ResponseResult GetRzxxList([FromBody] dynamic query) + { + try + { + if (query.mxguid == null) + throw new ArgumentException("妫�楠岄」鐩瓽UID涓嶈兘涓虹┖"); + + var rzxxList = m.GetRzxxList(query.mxguid?.ToString()); + + dynamic resultInfos = new ExpandoObject(); + resultInfos.tbBillList = rzxxList; + + return new ResponseResult + { + status = 0, + message = "OK", + data = resultInfos + }; + } + catch (Exception ex) + { + return ResponseResult.ResponseError(ex); + } + } + /// <summary> + /// 鏇存柊璁よ瘉淇℃伅_鐢熶骇鏃ユ湡 + /// </summary> + [HttpPost("updateScDate")] + public ResponseResult UpdateScDate([FromBody] dynamic query) + { + try + { + if (query.mxguid == null) + throw new ArgumentException("妫�楠岄」鐩瓽UID涓嶈兘涓虹┖"); + if (query.scDateValue == null) + throw new ArgumentException("鏃ユ湡鍙傛暟涓嶈兘涓虹┖"); + + var affectedRows = m.UpdateScDate( + query.scDateValue?.ToString(), + 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); + } + } + + /// <summary> + /// 淇濆瓨璁よ瘉淇℃伅鐩稿叧浣跨敤鏁伴噺 + /// </summary> + [HttpPost("saveIpqcrzxxNum")] + public ResponseResult SaveIpqcrzxxNum([FromBody] dynamic query) + { + try + { + if (query.guid == null || query.ipqcrzxxNum == null) + throw new ArgumentException("鍙傛暟涓嶈兘涓虹┖"); + + var affectedRows = m.UpdateRzxxNum( + query.ipqcrzxxNum?.ToString(), + query.guid?.ToString() + ); + + return new ResponseResult + { + status = affectedRows > 0 ? 0 : 1, + message = affectedRows > 0 ? "鏁伴噺鏇存柊鎴愬姛" : "鏃犳暟鎹洿鏂�", + data = new { updated = affectedRows } + }; + } + catch (Exception ex) + { + return ResponseResult.ResponseError(ex); + } + } + /// <summary> + /// 淇濆瓨鍝佹按娴嬭瘯鏄惁鏈夊紓鍛� + /// </summary> + [HttpPost("saveIpqCpscs")] + public ResponseResult SaveIpqCpscs([FromBody] dynamic query) + { + try + { + if (query.guid == null || query.ipqCpscs == null) + throw new ArgumentException("鍙傛暟涓嶈兘涓虹┖"); + + var affectedRows = m.UpdateCpscs( + query.ipqCpscs?.ToString(), + query.guid?.ToString() + ); + + return new ResponseResult + { + status = affectedRows > 0 ? 0 : 1, + message = affectedRows > 0 ? "鏄惁鏈夋棤寮傚懗鏇存柊鎴愬姛" : "鏃犳暟鎹洿鏂�", + data = new { updated = affectedRows } + }; + } + catch (Exception ex) + { + return ResponseResult.ResponseError(ex); + } + } + + + /// <summary> + /// 鐜板満鏀舵枡鑾峰彇鍙�夊伐鍗曚俊鎭� + /// </summary> + /// <param name="query"></param> + /// <returns></returns> + [HttpPost("GetIpqcXjDaa")] + public ResponseResult GetIpqcXjDaa([FromBody] dynamic query) + { + try + { + dynamic resultInfos = new ExpandoObject(); + resultInfos.tbBillList = m.GetIpqcXjDaa(query); + return new ResponseResult + { + status = 0, + message = "OK", + data = resultInfos + }; + } + catch (Exception ex) + { + return ResponseResult.ResponseError(ex); + } + } + } \ No newline at end of file -- Gitblit v1.9.3