From a50fb2af1d614e5651eeb2f063703b95dc81a5f7 Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期五, 13 十二月 2024 21:21:15 +0800 Subject: [PATCH] 生产领料单的扫码接口,待扫物料和已扫物料的展示接口,条码拆分的接口 --- service/Warehouse/WomdaaManager.cs | 60 +++++++++++++++++++++++++++++ Dto/service/WarehouseQuery.cs | 2 + Controllers/Warehouse/WomdaaController.cs | 21 ++++++++++ 3 files changed, 82 insertions(+), 1 deletions(-) diff --git a/Controllers/Warehouse/WomdaaController.cs b/Controllers/Warehouse/WomdaaController.cs index 84f5d32..9de2fe2 100644 --- a/Controllers/Warehouse/WomdaaController.cs +++ b/Controllers/Warehouse/WomdaaController.cs @@ -86,6 +86,27 @@ } } + //ScanCodeCF + [HttpPost("ScanCodeCF")] + public ResponseResult ScanCodeCF(WarehouseQuery query) + { + try + { + dynamic resultInfos = new ExpandoObject(); + resultInfos.tbBillList = m.ScanCodeCF(query); + return new ResponseResult + { + status = 0, + message = "OK", + data = resultInfos + }; + } + catch (Exception ex) + { + return ResponseResult.ResponseError(ex); + } + } + /// <summary> /// 鑾峰彇鎵�鏈� /// </summary> diff --git a/Dto/service/WarehouseQuery.cs b/Dto/service/WarehouseQuery.cs index cf21cc1..2ef685f 100644 --- a/Dto/service/WarehouseQuery.cs +++ b/Dto/service/WarehouseQuery.cs @@ -36,4 +36,6 @@ public string? daa001 { get; set; } public decimal? Num { get; set; } + + public string? num { get; set; } } \ No newline at end of file diff --git a/service/Warehouse/WomdaaManager.cs b/service/Warehouse/WomdaaManager.cs index b6ad5b0..e08cc88 100644 --- a/service/Warehouse/WomdaaManager.cs +++ b/service/Warehouse/WomdaaManager.cs @@ -35,7 +35,7 @@ string _intSum = ""; using (var conn = new SqlConnection(DbHelperSQL.strConn)) { - using (var cmd =new SqlCommand("[prc_sys_role_set_menuOrAction]", conn)) + using (var cmd =new SqlCommand("[prc_pda_SCLL]", conn)) { try { @@ -93,6 +93,64 @@ } } + //prC_pda_SCLL_CF + public ProductionPickDto ScanCodeCF(WarehouseQuery query) + { + string _strMsg = ""; + string _intSum = ""; + using (var conn = new SqlConnection(DbHelperSQL.strConn)) + { + using (var cmd =new SqlCommand("[prc_pda_SCLL_CF]", conn)) + { + try + { + conn.Open(); + cmd.CommandType = CommandType.StoredProcedure; + SqlParameter[] parameters = + { + new("@outMsg", SqlDbType.NVarChar, 300), + new("@outSum", SqlDbType.NVarChar, 300), + new("@c_User", query.userName), + new("@p_biLL_no", query.daa001), + new("@p_item_barcode", query.barcode), + new("@num", query.num), + }; + parameters[0].Direction = ParameterDirection.Output; + parameters[1].Direction = ParameterDirection.Output; + foreach (var parameter in parameters) + cmd.Parameters.Add(parameter); + cmd.ExecuteNonQuery(); + _strMsg = parameters[0].Value.ToString(); + _intSum = parameters[1].Value.ToString(); + + + var result = Convert.ToInt32(_intSum); + if (result <= 0) + { + throw new Exception(_strMsg); + } + + var dto = new ProductionPickDto + { + daa001 = query.daa001, + barcode = query.barcode + }; + + return dto; + + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + finally + { + conn.Close(); + } + } + } + } + private ProductionPickDto getDaa001(WarehouseQuery query) { if (string.IsNullOrEmpty(query.daa001)) throw new Exception("宸ュ崟鍙蜂负绌�"); -- Gitblit v1.9.3