From 58494b52621037c5315cd0d91686a68bd170a779 Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期二, 03 六月 2025 18:18:14 +0800 Subject: [PATCH] 客户标签 --- WebAPI/Controllers/生产管理/客户标签/Sc_CustomerTagController.cs | 169 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 169 insertions(+), 0 deletions(-) diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\345\256\242\346\210\267\346\240\207\347\255\276/Sc_CustomerTagController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\345\256\242\346\210\267\346\240\207\347\255\276/Sc_CustomerTagController.cs" index 28f39b5..4714625 100644 --- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\345\256\242\346\210\267\346\240\207\347\255\276/Sc_CustomerTagController.cs" +++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\345\256\242\346\210\267\346\240\207\347\255\276/Sc_CustomerTagController.cs" @@ -622,6 +622,69 @@ } #endregion + #region [瀹㈡埛鏍囩淇℃伅鍒犻櫎鍔熻兘] + [Route("Sc_CustomerTagInfo/Delete")] + [HttpGet] + public object Delete(string HItemSubIDs, string user) + { + try + { + DataSet Ds; + DataSet Ds2; + + if (HItemSubIDs == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "[0000-1-009]閫夋嫨瀹㈡埛鏍囩淇℃伅涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + + Ds = oCN.RunProcReturn("Select * from h_v_Sc_CustomerTagInfoList with(nolock) Where HItemSubID in (" + HItemSubIDs + ")", "h_v_Sc_CustomerTagInfoList"); + if (Ds.Tables[0].Rows.Count != 0) + { + oCN.BeginTran(); + + //鍒犻櫎瀹㈡埛鏍囩淇℃伅--瀛愯〃 + oCN.RunProc("Delete from Sc_CustomerTagInfoSub Where HItemSubID in (" + HItemSubIDs + ")"); + + //鍐欏叆绯荤粺鏃ュ織 + for (int i = 0; i < Ds.Tables[0].Rows.Count; i++) + { + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','','" + "Sc_CustomerTagInfoList鈥斺�擠elete" + "','LMES-瀹㈡埛鏍囩淇℃伅妯″潡','" + DBUtility.ClsPub.IPAddress + "','" + user + "鍒犻櫎瀹㈡埛鏍囩淇℃伅," + "瀹㈡埛鍚嶇О锛�" + Ds.Tables[0].Rows[i]["瀹㈡埛鍚嶇О"] + ",鐗╂枡浠g爜锛�" + Ds.Tables[0].Rows[i]["鐗╂枡浠g爜"] + ",鍗曟嵁鍙凤細" + Ds.Tables[0].Rows[i]["鍗曟嵁鍙�"] + "'", ref DBUtility.ClsPub.sExeReturnInfo); + } + + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "[0000-1-008]鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "[0000-1-045]鍗曟嵁鏈壘鍒�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "[0000-1-007]" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 瀹㈡埛鏍囩妗f鐢熸垚 [Route("Sc_CustomerTagBarCode/Save")] [HttpGet] @@ -672,5 +735,111 @@ } #endregion + #region 瀹㈡埛鏍囩鏉$爜 鏌ヨ-鍒嗛〉 + [Route("Sc_CustomerTagBarCode/BarPageList")] + [HttpGet] + public object BarPageList(string sWhere, string user, string Organization, int page, int size) + { + try + { + List<object> columnNameList = new List<object>(); //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺 + + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("exec h_p_Sc_CustomerTagBarCodeList " + page + "," + size + ",'" + Organization + "'," + "''", "h_p_Sc_CustomerTagBarCodeList"); + } + else + { + sWhere = sWhere.Replace("'", "''"); + ds = oCN.RunProcReturn("exec h_p_Sc_CustomerTagBarCodeList " + page + "," + size + ",'" + Organization + "','" + sWhere + "'", "h_p_Sc_CustomerTagBarCodeList"); + } + + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = "1"; + objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); + objJsonResult.Message = "Sucess锛�"; + objJsonResult.list = columnNameList; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region [瀹㈡埛鏍囩鏉$爜鍒犻櫎鍔熻兘] + [Route("Sc_CustomerTagBarCode/DeleteBarCode")] + [HttpGet] + public object DeleteBarCode(string HItemIDs,string user) + { + try + { + DataSet Ds; + + if (HItemIDs == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "[0000-1-009]閫夋嫨鏉$爜涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + + Ds = oCN.RunProcReturn("Select * from h_v_Sc_CustomerTagBarCodeList with(nolock) Where HItemID in (" + HItemIDs + ")", "h_v_Sc_CustomerTagBarCodeList"); + if (Ds.Tables[0].Rows.Count != 0) + { + oCN.BeginTran(); + + //鍒犻櫎瀹㈡埛鏍囩鏉$爜 + oCN.RunProc("Delete from Sc_CustomerTagBarCode Where HItemID in (" + HItemIDs + ")"); + + //鍐欏叆绯荤粺鏃ュ織 + for (int i = 0; i < Ds.Tables[0].Rows.Count; i++) + { + oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','','" + "Sc_CustomerTagBarCodeList鈥斺�擠elete" + "','LMES-瀹㈡埛鏍囩鏉$爜妯″潡','" + DBUtility.ClsPub.IPAddress + "','" + user + "鍒犻櫎瀹㈡埛鏍囩鏉$爜," + "鐢熶骇璁㈠崟锛�" + Ds.Tables[0].Rows[i]["鐢熶骇璁㈠崟鍙�"] + ",鐗╂枡浠g爜锛�" + Ds.Tables[0].Rows[i]["鐗╂枡浠g爜"] + ",娴佹按鍙凤細" + Ds.Tables[0].Rows[i]["娴佹按鍙�"] + "'", ref DBUtility.ClsPub.sExeReturnInfo); + } + + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "[0000-1-008]鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "[0000-1-045]鍗曟嵁鏈壘鍒�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "[0000-1-007]" + e.Message; + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + } } -- Gitblit v1.9.1