From 318d349fc009011a135dbce5a25e392b492c0718 Mon Sep 17 00:00:00 2001 From: yzh <snbbt@21cn.com> Date: 星期五, 20 五月 2022 16:49:20 +0800 Subject: [PATCH] 客户分配个性产品 系统数据权限隔离 --- web/App_Code/obj/Debug/App_Code.csproj.FileListAbsolute.txt | 10 web/web/Bin/Dao.dll | 0 web/web/Setting.aspx | 417 +++++++++++++++-------------- web/web/GwOrderComplete.aspx | 4 web/web/gwspupdate.aspx.cs | 1 web/Model/obj/Debug/Model.pdb | 0 web/Model/Model/GwProduct.cs | 2 web/App_Code/obj/Debug/App_Code.dll | 0 web/Dao/GwSpDao.cs | 7 web/App_Code/obj/Debug/App_Code.csproj.CoreCompileInputs.cache | 2 web/UMCLib/obj/Debug/UMCLib.csproj.FileListAbsolute.txt | 8 web/Dao/obj/Debug/Dao.dll | 0 web/Model/obj/Debug/Model.dll | 0 web/Dao/obj/Debug/Dao.csproj.AssemblyReference.cache | 0 web/Lib/Model.dll | 0 web/web/Bin/App_Code.pdb | 0 web/web/GwOrder.ashx | 20 + web/UMCLib/obj/Debug/UMCLib.csproj.CoreCompileInputs.cache | 2 web/UMCLib/obj/Debug/UMCLib.dll | 0 web/web/Bin/Dao.pdb | 0 web/Dao/GwOrderDao.cs | 5 web/UMCLib/bin/Debug/UMCLib.pdb | 0 web/web/Bin/App_Code.dll | 0 web/web/Bin/UMCLib.pdb | 0 web/App_Code/bin/Debug/App_Code.pdb | 0 web/web/GwSmResend.aspx | 4 web/App_Code/obj/Debug/App_Code.pdb | 0 web/web/ExportDocument.aspx.cs | 2 web/UMCLib/obj/Debug/UMCLib.pdb | 0 web/Lib/Model.pdb | 0 web/web/GwSm.aspx | 4 web/web/GwClient.aspx.cs | 37 ++ web/web/GwSp.ashx | 13 web/Dao/obj/Debug/Dao.pdb | 0 web/Dao/GwClientDao.cs | 63 ++++ web/Lib/Dao.dll | 0 web/web/GwClient.ashx | 74 ++++ web/App_Code/bin/Debug/App_Code.dll | 0 web/web/Bin/Model.pdb | 0 web/.vs/Web/v16/.suo | 0 web/UMCLib/bin/Debug/UMCLib.dll | 0 web/web/GwClient.aspx | 94 ++++++ web/Dao/GwProductDao.cs | 9 web/web/GwOrderAudit.aspx | 4 web/Model/obj/Debug/Model.csproj.AssemblyReference.cache | 0 web/web/Bin/Model.dll | 0 web/Lib/Dao.pdb | 0 47 files changed, 546 insertions(+), 236 deletions(-) diff --git a/web/.vs/Web/v16/.suo b/web/.vs/Web/v16/.suo index 3f0b7ae..70364d0 100644 --- a/web/.vs/Web/v16/.suo +++ b/web/.vs/Web/v16/.suo Binary files differ diff --git a/web/App_Code/bin/Debug/App_Code.dll b/web/App_Code/bin/Debug/App_Code.dll index a553b4e..f2907f5 100644 --- a/web/App_Code/bin/Debug/App_Code.dll +++ b/web/App_Code/bin/Debug/App_Code.dll Binary files differ diff --git a/web/App_Code/bin/Debug/App_Code.pdb b/web/App_Code/bin/Debug/App_Code.pdb index 78d22c1..b948e2f 100644 --- a/web/App_Code/bin/Debug/App_Code.pdb +++ b/web/App_Code/bin/Debug/App_Code.pdb Binary files differ diff --git a/web/App_Code/obj/Debug/App_Code.csproj.CoreCompileInputs.cache b/web/App_Code/obj/Debug/App_Code.csproj.CoreCompileInputs.cache index 933dd95..49fa306 100644 --- a/web/App_Code/obj/Debug/App_Code.csproj.CoreCompileInputs.cache +++ b/web/App_Code/obj/Debug/App_Code.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -73d59a519d75fba02045f94dbe09df43d113619d +148a124d533dab517de60d4081ee6b355ffb0769 diff --git a/web/App_Code/obj/Debug/App_Code.csproj.FileListAbsolute.txt b/web/App_Code/obj/Debug/App_Code.csproj.FileListAbsolute.txt index 812d105..6133d8b 100644 --- a/web/App_Code/obj/Debug/App_Code.csproj.FileListAbsolute.txt +++ b/web/App_Code/obj/Debug/App_Code.csproj.FileListAbsolute.txt @@ -8,3 +8,13 @@ D:\Company\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.csproj.CopyComplete D:\Company\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.dll D:\Company\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.pdb +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\bin\Debug\App_Code.dll +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\bin\Debug\App_Code.pdb +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\bin\Debug\Aspose.Cells.dll +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\bin\Debug\Dao.dll +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\bin\Debug\Ionic.Zip.dll +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.csproj.AssemblyReference.cache +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.csproj.CoreCompileInputs.cache +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.csproj.CopyComplete +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.dll +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\App_Code\obj\Debug\App_Code.pdb diff --git a/web/App_Code/obj/Debug/App_Code.dll b/web/App_Code/obj/Debug/App_Code.dll index a553b4e..f2907f5 100644 --- a/web/App_Code/obj/Debug/App_Code.dll +++ b/web/App_Code/obj/Debug/App_Code.dll Binary files differ diff --git a/web/App_Code/obj/Debug/App_Code.pdb b/web/App_Code/obj/Debug/App_Code.pdb index 78d22c1..b948e2f 100644 --- a/web/App_Code/obj/Debug/App_Code.pdb +++ b/web/App_Code/obj/Debug/App_Code.pdb Binary files differ diff --git a/web/Dao/GwClientDao.cs b/web/Dao/GwClientDao.cs index 460f299..d2626d9 100644 --- a/web/Dao/GwClientDao.cs +++ b/web/Dao/GwClientDao.cs @@ -25,7 +25,7 @@ /// <param name="agent">涓氬姟鍛�</param> /// <returns></returns> //public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string clientName, string telphone, string agent) - public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string clientName, string telphone, string agent, string company, string salesman, string productId) + public List<GwClient> LoadInfoList(out int recordCount, int pageIndex, int pageSizestring, string clientID, string clientName, string telphone, string agent, string company, string salesman, string productId, string permissionsSQL ) { List<GwClient> list = new List<GwClient>(); @@ -34,7 +34,7 @@ { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("from GW_CLIENT where 1=1"); - OracleParameter[] oracleParameterArray = new OracleParameter[4]; + OracleParameter[] oracleParameterArray = new OracleParameter[6]; if (clientID != null && clientID != "") { oracleParameterArray[0] = new OracleParameter(":ClientID", (OracleDbType)126); @@ -61,7 +61,7 @@ } if (salesman != null && salesman != "") { - oracleParameterArray[4] = new OracleParameter(":Salesman", (OracleDbType)112); + oracleParameterArray[4] = new OracleParameter(":Salesman", (OracleDbType)126); ((DbParameter)oracleParameterArray[4]).Value = (object)( salesman ); stringBuilder.Append(" and Salesman = :Salesman"); } @@ -76,6 +76,9 @@ { stringBuilder.Append(" and CLIENT_ID IN ( SELECT distinct CLIENT_ID FROM GW_SP WHERE PRODUCT_ID = '" + productId + "' )"); } + + //瀹㈡埛鏉冮檺SQL鑴氭湰 + stringBuilder.Append(permissionsSQL); stringBuilder.Append(" order by CREATE_TIME DESC,CLIENT_ID DESC"); using (OracleDataReader reader = OracleHelper.ExecuteReader("select count(*) as count " + stringBuilder.ToString(), OracleHelper.Connection, oracleParameterArray)) @@ -100,6 +103,10 @@ } return list; } + + /** + * 鏌ヨ缁熻鍔熻兘 + */ public List<GwClient> LoadInfoList(string clientID, string clientName, string company, string agent) { @@ -184,6 +191,23 @@ public bool UpdateClientAmount(int AddBalance, int payAmount, string clientId ) { return OracleHelper.ExecuteSql("UPDATE GW_CLIENT SET BALANCE=(BALANCE + :BALANCE), TOP_UP_AMOUNT_TOTAL=(TOP_UP_AMOUNT_TOTAL + :TOP_UP_AMOUNT_TOTAL) WHERE CLIENT_ID=:CLIENT_ID", OracleHelper.Connection, new OracleParameter(":BALANCE", (object)AddBalance), new OracleParameter(":TOP_UP_AMOUNT_TOTAL", (object)payAmount), new OracleParameter(":CLIENT_ID", (object)clientId)) > 0; + } + + public bool UpdateClientProduct(string clientId, string productId) + { + List<KeyValuePair<string, OracleParameter[]>> list = new List<KeyValuePair<string, OracleParameter[]>>(); + if (string.IsNullOrEmpty(productId) ) + { + string key = "UPDATE GW_CLIENT_PRODUCT SET PRODUCT_ID=:PRODUCT_ID WHERE CLIENT_ID=:CLIENT_ID"; + OracleParameter[] oracleParameterArray = new OracleParameter[2] + { + new OracleParameter(":PRODUCT_ID", (object) productId), + new OracleParameter(":CLIENT_ID", (object) clientId) + }; + list.Add(new KeyValuePair<string, OracleParameter[]>(key, oracleParameterArray)); + } + OracleHelper.ExecuteSqlTran(list, OracleHelper.Connection); + return true; } /// <summary> @@ -369,6 +393,39 @@ } return true; } + + + /** + * 鍑芥暟鎻忚堪锛� 鏍规嵁绯荤粺鐢ㄦ埛鑾峰彇鏈夋潈闄愬鎴� + * userId: 鐢ㄦ埛ID + * userType: 鐢ㄦ埛绫诲瀷锛�1-绠$悊鍛�;2-涓氬姟鍛�--鍏ㄥ憳;3-涓氬姟涓荤;4-涓氬姟鎬荤洃;5-瀹㈡湇浜哄憳;6-璐㈠姟浜哄憳;99-鍏朵粬 + * return: SQL瀛楃涓� + * */ + public string GetClientPermissions(int userId, int userType, string alias) + { + if (!string.IsNullOrEmpty(alias)) + { + alias += "."; + } + + string sqlStr = ""; + //涓氬姟鍛樺拰鍏朵粬 + if(userType==2 || userType == 99) + { + sqlStr += " AND " + alias + "CLIENT_ID IN (SELECT CLIENT_ID FROM GW_CLIENT WHERE IS_ENABLE=1 AND (SALESMAN='" + userId + "' ) ) "; + } + //涓氬姟涓荤 + else if (userType == 3) + { + sqlStr += " AND " + alias + "CLIENT_ID IN (SELECT CLIENT_ID FROM GW_CLIENT WHERE IS_ENABLE=1 AND (SALESMAN='" + userId + "' or CUSTOMER_MANAGER='" + userId + "' ) ) "; + } + else + { + //sqlStr += " AND CLIENT_ID IN (SELECT CLIENT_ID FROM GW_CLIENT WHERE IS_ENABLE=1 ) "; + } + + return sqlStr ; + } } } diff --git a/web/Dao/GwOrderDao.cs b/web/Dao/GwOrderDao.cs index 5c5090f..973f0f3 100644 --- a/web/Dao/GwOrderDao.cs +++ b/web/Dao/GwOrderDao.cs @@ -32,7 +32,7 @@ //flag: 0-寰呭鏍歌鍗�(宸叉彁浜ゃ�佸鏍镐腑)锛�1-宸插畬鎴愯鍗曪紙瀹℃牳閫氳繃銆佸鏍镐笉閫氳繃銆佸彇娑堬級 - public List<GwOrder> LoadInfoList(string spId, string clientId, string clientName, int flag, DateTime startDate, DateTime endDate, int pageSize, int PageIndex, out int recordcount) + public List<GwOrder> LoadInfoList(string spId, string clientId, string clientName, int flag, DateTime startDate, DateTime endDate, int pageSize, int PageIndex, string permissionsSQL, out int recordcount) { List<GwOrder> list = new List<GwOrder>(); @@ -85,6 +85,9 @@ { stringBuilder.Append(" and GWC.CLIENT_NAME like '%" + clientName + "%'"); } + //瀹㈡埛鏉冮檺SQL鑴氭湰 + stringBuilder.Append(permissionsSQL); + stringBuilder.Append(" ) T "); OracleParameter[] parameterArray = new OracleParameter[] { new OracleParameter(":START_TIME", startDate), new OracleParameter(":END_TIME", endDate) }; diff --git a/web/Dao/GwProductDao.cs b/web/Dao/GwProductDao.cs index ab48b89..4e0cc18 100644 --- a/web/Dao/GwProductDao.cs +++ b/web/Dao/GwProductDao.cs @@ -343,6 +343,14 @@ return OracleHelper.ExecuteSql("UPDATE GW_PRODUCT SET IS_ENABLE=:IS_ENABLE where ID=:ID", OracleHelper.Connection, new OracleParameter(":IS_ENABLE", (object)isEnable), new OracleParameter(":ID", (object)id)) > 0; } + //鏇存柊鍒嗛厤涓�т骇鍝佸鎴� + public bool UpdateClientIds(string clientIds, string id) + { + if (string.IsNullOrEmpty(id)) + return false; + return OracleHelper.ExecuteSql("UPDATE GW_PRODUCT SET CLIENT_IDS=:CLIENT_IDS where ID=:ID", OracleHelper.Connection, new OracleParameter(":CLIENT_IDS", (object)clientIds), new OracleParameter(":ID", (object)id)) > 0; + } + //鏇存柊鍏宠仈鐨勪骇鍝佽矾寰凱ATH public bool UpdatePath(string id, string path) { @@ -422,6 +430,7 @@ o.CtExtParams = oracleReaderWrapper.GetString("CT_EXT_PARAMS", ""); o.Price = oracleReaderWrapper.GetInt("PRICE", 0); o.GivingNum = oracleReaderWrapper.GetInt("GIVING_NUM", 0); + o.ClientIds = oracleReaderWrapper.GetString("CLIENT_IDS", ""); o.Remark = oracleReaderWrapper.GetString("REMARK", ""); o.CreateTime = oracleReaderWrapper.GetDateTime("CREATE_TIME"); o.Creator = oracleReaderWrapper.GetString("CREATOR", ""); diff --git a/web/Dao/GwSpDao.cs b/web/Dao/GwSpDao.cs index 848425f..7bfd4a5 100644 --- a/web/Dao/GwSpDao.cs +++ b/web/Dao/GwSpDao.cs @@ -245,7 +245,8 @@ return list1; } - public List<GwSp> LoadInfoList(string spId, string apId, string clientId, string clientName, int routerType, string opID, int chargeType, int pageIndex, int pageSize, string resendStatus, out int recordCount, string productId ) + public List<GwSp> LoadInfoList(string spId, string apId, string clientId, string clientName, int routerType, string opID, int chargeType, int pageIndex, int pageSize + , string resendStatus, string productId, string permissionsSQL, out int recordCount ) { List<GwSp> list1 = new List<GwSp>(); recordCount = 0; @@ -326,6 +327,10 @@ list2.Add(new OracleParameter(":ProductId", (object)productId)); stringBuilder.Append(" and Product_Id=:ProductId"); } + + //瀹㈡埛鏉冮檺SQL鑴氭湰 + stringBuilder.Append(permissionsSQL); + stringBuilder.Append(" order by ID DESC"); using (OracleDataReader reader = OracleHelper.ExecuteReader("select count(*) as count " + stringBuilder.ToString(), OracleHelper.Connection, list2.ToArray())) { diff --git a/web/Dao/obj/Debug/Dao.csproj.AssemblyReference.cache b/web/Dao/obj/Debug/Dao.csproj.AssemblyReference.cache index 7c1a453..e082746 100644 --- a/web/Dao/obj/Debug/Dao.csproj.AssemblyReference.cache +++ b/web/Dao/obj/Debug/Dao.csproj.AssemblyReference.cache Binary files differ diff --git a/web/Dao/obj/Debug/Dao.dll b/web/Dao/obj/Debug/Dao.dll index c42f89d..e567808 100644 --- a/web/Dao/obj/Debug/Dao.dll +++ b/web/Dao/obj/Debug/Dao.dll Binary files differ diff --git a/web/Dao/obj/Debug/Dao.pdb b/web/Dao/obj/Debug/Dao.pdb index a15d707..cb1f233 100644 --- a/web/Dao/obj/Debug/Dao.pdb +++ b/web/Dao/obj/Debug/Dao.pdb Binary files differ diff --git a/web/Lib/Dao.dll b/web/Lib/Dao.dll index c42f89d..e567808 100644 --- a/web/Lib/Dao.dll +++ b/web/Lib/Dao.dll Binary files differ diff --git a/web/Lib/Dao.pdb b/web/Lib/Dao.pdb index a15d707..cb1f233 100644 --- a/web/Lib/Dao.pdb +++ b/web/Lib/Dao.pdb Binary files differ diff --git a/web/Lib/Model.dll b/web/Lib/Model.dll index 7bd65d4..b1414dd 100644 --- a/web/Lib/Model.dll +++ b/web/Lib/Model.dll Binary files differ diff --git a/web/Lib/Model.pdb b/web/Lib/Model.pdb index a1c121f..561d13f 100644 --- a/web/Lib/Model.pdb +++ b/web/Lib/Model.pdb Binary files differ diff --git a/web/Model/Model/GwProduct.cs b/web/Model/Model/GwProduct.cs index e7258b9..02d0e51 100644 --- a/web/Model/Model/GwProduct.cs +++ b/web/Model/Model/GwProduct.cs @@ -49,6 +49,8 @@ public int GivingNum { get; set; } + public string ClientIds { get; set; } + public string Remark { get; set; } public DateTime CreateTime { get; set; } diff --git a/web/Model/obj/Debug/Model.csproj.AssemblyReference.cache b/web/Model/obj/Debug/Model.csproj.AssemblyReference.cache index 93b4e16..0fe5c78 100644 --- a/web/Model/obj/Debug/Model.csproj.AssemblyReference.cache +++ b/web/Model/obj/Debug/Model.csproj.AssemblyReference.cache Binary files differ diff --git a/web/Model/obj/Debug/Model.dll b/web/Model/obj/Debug/Model.dll index 7bd65d4..b1414dd 100644 --- a/web/Model/obj/Debug/Model.dll +++ b/web/Model/obj/Debug/Model.dll Binary files differ diff --git a/web/Model/obj/Debug/Model.pdb b/web/Model/obj/Debug/Model.pdb index a1c121f..561d13f 100644 --- a/web/Model/obj/Debug/Model.pdb +++ b/web/Model/obj/Debug/Model.pdb Binary files differ diff --git a/web/UMCLib/bin/Debug/UMCLib.dll b/web/UMCLib/bin/Debug/UMCLib.dll index 2ea71a8..8121779 100644 --- a/web/UMCLib/bin/Debug/UMCLib.dll +++ b/web/UMCLib/bin/Debug/UMCLib.dll Binary files differ diff --git a/web/UMCLib/bin/Debug/UMCLib.pdb b/web/UMCLib/bin/Debug/UMCLib.pdb index ba0e4f7..48cc582 100644 --- a/web/UMCLib/bin/Debug/UMCLib.pdb +++ b/web/UMCLib/bin/Debug/UMCLib.pdb Binary files differ diff --git a/web/UMCLib/obj/Debug/UMCLib.csproj.CoreCompileInputs.cache b/web/UMCLib/obj/Debug/UMCLib.csproj.CoreCompileInputs.cache index 40c0a9e..3bf9622 100644 --- a/web/UMCLib/obj/Debug/UMCLib.csproj.CoreCompileInputs.cache +++ b/web/UMCLib/obj/Debug/UMCLib.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -c546f08e5171d2ea11491af4c442ff223c9bb58c +27f9b4fb5d36be9c155fb6557fe17e62c41ec4da diff --git a/web/UMCLib/obj/Debug/UMCLib.csproj.FileListAbsolute.txt b/web/UMCLib/obj/Debug/UMCLib.csproj.FileListAbsolute.txt index 9f816a9..80184c7 100644 --- a/web/UMCLib/obj/Debug/UMCLib.csproj.FileListAbsolute.txt +++ b/web/UMCLib/obj/Debug/UMCLib.csproj.FileListAbsolute.txt @@ -6,3 +6,11 @@ D:\Company\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.csproj.CopyComplete D:\Company\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.dll D:\Company\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.pdb +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\bin\Debug\UMCLib.dll +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\bin\Debug\UMCLib.pdb +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\bin\Debug\Newtonsoft.Json.dll +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.csproj.AssemblyReference.cache +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.csproj.CoreCompileInputs.cache +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.csproj.CopyComplete +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.dll +C:\AYZH\work\Git_Rep\SMGW_NewWeb\web\UMCLib\obj\Debug\UMCLib.pdb diff --git a/web/UMCLib/obj/Debug/UMCLib.dll b/web/UMCLib/obj/Debug/UMCLib.dll index 2ea71a8..8121779 100644 --- a/web/UMCLib/obj/Debug/UMCLib.dll +++ b/web/UMCLib/obj/Debug/UMCLib.dll Binary files differ diff --git a/web/UMCLib/obj/Debug/UMCLib.pdb b/web/UMCLib/obj/Debug/UMCLib.pdb index ba0e4f7..48cc582 100644 --- a/web/UMCLib/obj/Debug/UMCLib.pdb +++ b/web/UMCLib/obj/Debug/UMCLib.pdb Binary files differ diff --git a/web/web/Bin/App_Code.dll b/web/web/Bin/App_Code.dll index a553b4e..f2907f5 100644 --- a/web/web/Bin/App_Code.dll +++ b/web/web/Bin/App_Code.dll Binary files differ diff --git a/web/web/Bin/App_Code.pdb b/web/web/Bin/App_Code.pdb index 78d22c1..b948e2f 100644 --- a/web/web/Bin/App_Code.pdb +++ b/web/web/Bin/App_Code.pdb Binary files differ diff --git a/web/web/Bin/Dao.dll b/web/web/Bin/Dao.dll index c42f89d..e567808 100644 --- a/web/web/Bin/Dao.dll +++ b/web/web/Bin/Dao.dll Binary files differ diff --git a/web/web/Bin/Dao.pdb b/web/web/Bin/Dao.pdb index a15d707..cb1f233 100644 --- a/web/web/Bin/Dao.pdb +++ b/web/web/Bin/Dao.pdb Binary files differ diff --git a/web/web/Bin/Model.dll b/web/web/Bin/Model.dll index 7bd65d4..b1414dd 100644 --- a/web/web/Bin/Model.dll +++ b/web/web/Bin/Model.dll Binary files differ diff --git a/web/web/Bin/Model.pdb b/web/web/Bin/Model.pdb index a1c121f..561d13f 100644 --- a/web/web/Bin/Model.pdb +++ b/web/web/Bin/Model.pdb Binary files differ diff --git a/web/web/Bin/UMCLib.pdb b/web/web/Bin/UMCLib.pdb index ba0e4f7..48cc582 100644 --- a/web/web/Bin/UMCLib.pdb +++ b/web/web/Bin/UMCLib.pdb Binary files differ diff --git a/web/web/ExportDocument.aspx.cs b/web/web/ExportDocument.aspx.cs index 0d28a08..cb43a1c 100644 --- a/web/web/ExportDocument.aspx.cs +++ b/web/web/ExportDocument.aspx.cs @@ -307,7 +307,7 @@ WebTool webTool = new WebTool(); Dictionary<string, string> dictionary = new Dictionary<string, string>(); dictionary["AP娑堟伅ID"] = "AP_MID"; - dictionary["浠g悊鍟�"] = "CLIENT_ID"; + dictionary["瀹㈡埛ID"] = "CLIENT_ID"; dictionary["璐﹀彿"] = "SP_ID"; dictionary["鎺ュ叆鐐笽D"] = "AP_ID"; dictionary["閫氶亾鍚�"] = "OP_NAME"; diff --git a/web/web/GwClient.ashx b/web/web/GwClient.ashx index 181efcc..667d11a 100644 --- a/web/web/GwClient.ashx +++ b/web/web/GwClient.ashx @@ -1,5 +1,6 @@ 锘�<%@ WebHandler Language="C#" Class="GwClientHandler" %> using System; +using System.Linq; using System.Web; using Dao; using Model; @@ -9,6 +10,7 @@ using System.Text; using System.Text.RegularExpressions; using System.IO; +using Newtonsoft.Json; @@ -19,9 +21,17 @@ private UserDao _SysUserDao = new UserDao(); private List<SysUser> _SysUserList; + private int _userId = -1; + private int _userType = -1; + private string _account = ""; + public override JsonPageResult ProcessRequestInternal(PageContext<Model.SysUser> context) { string action = context.GetString("action"); + + _userId = context.SessionObject.UserID; + _userType = context.SessionObject.UserType; + _account = context.SessionObject.Account; switch (action) { @@ -53,6 +63,9 @@ case "updateBlack": return UpdateBlack(context); + //鎵归噺鍒嗛厤瀹㈡埛鐨勪釜鎬т骇鍝� + case "batchUpdateClientProduct": + return BatchUpdateClientProduct(context); default: throw new Exception("Invalid Action=" + action); @@ -82,10 +95,12 @@ int pageSize = context.GetInt("pageSize", 20); string serverIp = ConfigurationManager.AppSettings["serverIp"]; string clientPort = ConfigurationManager.AppSettings["clientPort"]; + string str = ""; using (GwClientDao dao = new GwClientDao()) { - var list = dao.LoadInfoList(out recordCount, pageIndex, pageSize, ClientID, ClientName, Telephone, Agent, Company, Salesman, ProductId); + string permissionsSQL = dao.GetClientPermissions(_userId, _userType, null); + var list = dao.LoadInfoList(out recordCount, pageIndex, pageSize, ClientID, ClientName, Telephone, Agent, Company, Salesman, ProductId, permissionsSQL); if (list != null && list.Count > 0) { @@ -99,7 +114,7 @@ //edit:yangzh by 20220511 //str += @"<tr ><td>" + item.ClientID + "</td><td>" + item.Company + "</td><td>" + item.ClientName + "</td><td>" + item.Telephone + "</td><td>" + item.Top_up_Amount_Total + "鍏�</td><td>" + item.Agent + "</td><td>" + Certification_StatusResult + "</td>"; //str += @"<tr ><td>" + item.ClientID + "</td><td>" + item.Company + "</td><td>" + item.ClientName + "</td><td>" + item.Telephone + "</td><td>" + item.Balance/1000 + "鍏�</td><td>" + item.Top_up_Amount_Total/1000 + "鍏�</td><td>" + item.Agent + "</td><td>" + Certification_StatusResult + "</td>"; - str += @"<tr ><td>" + item.ClientID + "</td><td>" + item.Company + "</td><td>" + item.ClientName + "</td><td>" + item.Telephone + "</td><td>" + item.Balance/1000 + "鍏�</td><td>" + item.Top_up_Amount_Total/1000 + "鍏�</td><td>" + SysUserName(string.IsNullOrEmpty(item.Salesman)? 0: int.Parse(item.Salesman) ) + "</td><td>" + Certification_StatusResult + "</td>"; + str += @"<tr ><td rowspan='1' ><input type='checkbox' name='checkbox' value='" + item.ClientID + "'/></td><td>" + item.ClientID + "</td><td>" + item.Company + "</td><td>" + item.ClientName + "</td><td>" + item.Telephone + "</td><td>" + item.Balance/1000 + "鍏�</td><td>" + item.Top_up_Amount_Total/1000 + "鍏�</td><td>" + SysUserName(string.IsNullOrEmpty(item.Salesman)? 0: int.Parse(item.Salesman) ) + "</td><td>" + Certification_StatusResult + "</td>"; str += @"<td>"; @@ -128,7 +143,7 @@ } else { - str += @"<tr><td colspan=""9"">鏆傛棤淇℃伅</td></tr>"; + str += @"<tr><td colspan=""10"">鏆傛棤淇℃伅</td></tr>"; } } @@ -334,13 +349,13 @@ client.Company = company; //client.Password = password; client.Password = savePassword; - + client.ClientName = clientName; client.Address = address; client.Remark = remark; client.Telephone = telephone; client.Agent = agent; - + client.CustomerManager = customerManager; client.Salesman = salesman; client.SupportStaff = supportStaff; @@ -534,6 +549,55 @@ return new JsonPageResult(true, "鍒涘缓璐︽埛鎴愬姛锛�"); } + //鍒嗛厤瀹㈡埛鐨勪釜鎬т骇鍝� + private JsonPageResult BatchUpdateClientProduct(PageContext<SysUser> context) + { + string productId = context.GetString("productId"); + string idArray = context.GetString("idArray"); + if (string.IsNullOrEmpty(productId)) + { + + throw new ArgumentException("涓�т骇鍝佷笉鑳戒负绌猴紝璇烽�夋嫨锛�"); + } + + Model.GwProduct gwProduct = new GwProductDao().Get(productId); + if (gwProduct == null) + { + throw new ArgumentException("鎸囧畾鐨勪釜鎬т骇鍝佷笉瀛樺湪锛岃閲嶆柊閫夋嫨锛�"); + } + string clientIds = gwProduct.ClientIds; + + List<string> tmpList = new List<string>(); + if(!string.IsNullOrEmpty(clientIds)) + { //瀛楃涓茶浆鏁扮粍锛屽啀鏁扮粍鍚堝苟 + tmpList.AddRange( clientIds.Split(',') ); + } + //鏁扮粍鍚堝苟 + tmpList.AddRange( JsonConvert.DeserializeObject<string[]>(context.GetString("idArray")) ); + + //鏁扮粍鍘婚噸 + string[] tmpArray = DelRepeatData(tmpList.ToArray() ); + clientIds = string.Join(",", tmpArray) ; + + if (!string.IsNullOrEmpty(clientIds)) + { + new GwProductDao().UpdateClientIds(clientIds, productId); + } + + + return new JsonPageResult(true, (object)"鎵归噺鍒嗛厤瀹㈡埛涓�т骇鍝佹垚鍔燂紒"); + } + + /// <summary> + /// 绉婚櫎鏁扮粍涓噸澶嶆暟鎹� + /// </summary> + /// <param name="array">闇�瑕侀櫎閲嶇殑鏁扮粍</param> + /// <returns>涓嶉噸澶嶆暟缁�</returns> + public static string[] DelRepeatData(string[] array) + { + return array.GroupBy(p => p).Select(p => p.Key).ToArray(); + } + //鑾峰彇绠$悊绔处鎴峰垪琛� diff --git a/web/web/GwClient.aspx b/web/web/GwClient.aspx index 9b9d919..0c8c2fc 100644 --- a/web/web/GwClient.aspx +++ b/web/web/GwClient.aspx @@ -72,8 +72,8 @@ $("#clientDialog #mmsStatusReport").val(""); $("#clientDialog #customerManager").val(""); $("#clientDialog #salesman").val(""); - $("#clientDialog #supportStaff").val(r.Message.SupportStaff); - $("#clientDialog #financialStaff").val(r.Message.FinancialStaff); + $("#clientDialog #supportStaff").val(""); + $("#clientDialog #financialStaff").val(""); $("#clientDialog #remark").val(""); $("#clientDialog input[name=permissionData]").iCheck("uncheck"); @@ -185,6 +185,60 @@ } }); }) + + //鍏ㄩ�� + $("#checkAll").click(function () { + $("input[name='checkbox']").prop("checked", $(this).is(":checked")); + }); + + //鎵归噺鍒嗛厤涓�т骇鍝� + $(document).on("click", ".action-modal-setProduct", function () { + var idArray = []; + + $("input[name='checkbox']:checkbox:checked").each(function () { + var id = $(this).val(); + idArray.push(id); + }); + + if (idArray.length == 0) { + mytek.alert("璇烽�夋嫨瑕佸垎閰嶄釜鎬т骇鍝佺殑瀹㈡埛锛�", false); + return; + } + + $("#selected-op-box").text(idArray.join(",")); + + $("#setProductDialog").modal("show"); + }); + + //鎵归噺鍒嗛厤瀹㈡埛涓�т骇鍝�--纭淇敼 + $(document).on("click", ".action-update-setProduct", function () { + var idArray = []; + + $("input[name='checkbox']:checkbox:checked").each(function () { + var id = $(this).val(); + idArray.push(id); + }); + + if (idArray.length == 0) { + mytek.alert("璇烽�夋嫨瑕佸垎閰嶄釜鎬т骇鍝佺殑瀹㈡埛锛�", false); + return; + } + + var productId = $("#productId").val(); + + $.ajax({ + url: "GwClient.ashx", + method: "POST", + data: { idArray: $.toJSON(idArray), productId: productId, action: "batchUpdateClientProduct" }, + success: function (result) { + mytek.alert(result.Message, result.OK, function () { + $("#setProductDialog #productId").val(""); + $("#setProductDialog").modal("hide"); + loadPageList(); + }); + } + }); + }); @@ -495,7 +549,8 @@ <div class="form-group"> <div class="input-group m-b"> <input type="button" value="鏌ヨ" class="btn btn-primary action-query" />  - <input class="btn btn-success action-modal-create" value="鍒涘缓瀹㈡埛" type="button" /> + <input class="btn btn-success action-modal-create" value="鍒涘缓瀹㈡埛" type="button" />  + <input class="btn btn-danger action-modal-setProduct" value="鎵归噺鍒嗛厤涓�т骇鍝�" type="button" /> </div> </div> @@ -505,6 +560,9 @@ <table class="table table-striped table-bordered table-hover" id="gwclientTable"> <thead> <tr class="header"> + <th> + <input type='checkbox' name='checkAll' id='checkAll' /> + </th> <th>瀹㈡埛璐﹀彿 </th> <th>鍏徃鍚嶇О</th> @@ -533,6 +591,36 @@ <div id="pager"> </div> + + <div class="modal inmodal fade" id="setProductDialog" tabindex="-1" role="dialog" aria-hidden="true"> + <div class="modal-dialog form-horizontal"> + <div class="modal-content animated "> + <div class="modal-header"> + <h3> + 鎵归噺鍒嗛厤涓�т骇鍝�</h3> + </span><a class="close" data-dismiss="modal" aria-hidden="true">脳</a> <span class="text-muted"> + 鎵归噺鍒嗛厤涓�т骇鍝佸皢浼氭洿鏂版墍鏈夐�変腑鐨勮处鍙风殑瀹㈡埛锛�<br /> + 纭畾鍒嗛厤涓嶈兘鍙栨秷锛岃璋ㄦ厧鎿嶄綔锛�<br /> + </div> + <div class="modal-body"> + <div class="form-group"> + <label class="col-sm-2 control-label"> + 涓�т骇鍝� + </label> + <div class="col-sm-10"> + <select name="productId" id="productId" class="form-control"> + <%=GetPersonalityProductOptions("")%> + </select> + </div> + </div> + </div> + <div class="modal-footer"> + <button class="btn-default btn" data-dismiss="modal" aria-hidden="true"> + 鍙栨秷</button> + <input class="btn btn-primary action-update-setProduct" value="纭畾淇敼" type="button" /> + </div> + </div> + </div> </asp:Content> diff --git a/web/web/GwClient.aspx.cs b/web/web/GwClient.aspx.cs index d4a533f..e579884 100644 --- a/web/web/GwClient.aspx.cs +++ b/web/web/GwClient.aspx.cs @@ -36,6 +36,7 @@ { GwProduct bean = new GwProduct(); bean.Classes = 1; + bean.IsDefault = -1; bean.IsEnable = -1; this.GwProductList = gwProductDao.getAllList(bean); } @@ -160,7 +161,7 @@ { StringBuilder stringBuilder = new StringBuilder(); if (this.GwProductList.Count == 0) - return "<option value='0'>鏃�</option>"; + return "<option value=''>鏃�</option>"; stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)"", (object)"鏃�"); foreach (GwProduct bean in this.GwProductList) { @@ -184,4 +185,38 @@ } + //鑾峰彇涓�т骇鍝佷俊鎭� + public string GetPersonalityProductOptions(string productId) + { + StringBuilder stringBuilder = new StringBuilder(); + if (this.GwProductList.Count == 0) + return "<option value=''>鏃�</option>"; + stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)"", (object)"鏃�"); + foreach (GwProduct bean in this.GwProductList) + { + //鍋滅敤鐨勪骇鍝佸垎绫讳笉鍐嶆樉绀� + if (bean.IsEnable == 0) + { + continue; + } + //杩囨护浜у搧绫诲埆 + if (bean.Classes == 0) + { + continue; + } + //杩囨护鎺ㄥ箍鏂瑰紡 + if (bean.IsDefault == 1) + { + continue; + } + + if (productId.Equals(bean.Id)) + stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.Id, (object)bean.Name); + else + stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.Id, (object)bean.Name); + } + return stringBuilder.ToString(); + } + + } diff --git a/web/web/GwOrder.ashx b/web/web/GwOrder.ashx index 99c1784..cdb1c66 100644 --- a/web/web/GwOrder.ashx +++ b/web/web/GwOrder.ashx @@ -23,10 +23,18 @@ private List<GwOpGroup> _GroupList; private List<GwProduct> _ProductList; //浜у搧鍙婁骇鍝佸垎绫� //private List<GwProduct> _ProductClassList; //浜у搧鍒嗙被 + + private int _userId = -1; + private int _userType = -1; + private string _account = ""; public override JsonPageResult ProcessRequestInternal(PageContext<SysUser> context) { string @string = context.GetString("action"); + _userId = context.SessionObject.UserID; + _userType = context.SessionObject.UserType; + _account = context.SessionObject.Account; + switch (@string) { case "delete": @@ -67,8 +75,10 @@ int recordCount = 0; int pageSize = context.GetInt("pageSize", 50); int pageIndex = context.GetInt("pageIndex", 1); + + string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, "GWC"); - List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, out recordCount); + List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, permissionsSQL, out recordCount); string str1 = ""; if (list != null && list.Count > 0) @@ -125,8 +135,10 @@ int recordCount = 0; int pageSize = context.GetInt("pageSize", 50); int pageIndex = context.GetInt("pageIndex", 1); + + string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, "GWC"); - List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, out recordCount); + List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, permissionsSQL, out recordCount); string str1 = ""; if (list != null && list.Count > 0) @@ -201,9 +213,11 @@ int recordCount = 0; int pageSize = context.GetInt("pageSize", 50); int pageIndex = context.GetInt("pageIndex", 1); + + string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, "GWC"); //List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, Convert.ToDateTime(startDate), Convert.ToDateTime(endDate).AddDays(1.0), pageSize, pageIndex, out recordCount); - List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate.AddDays(1.0), pageSize, pageIndex, out recordCount); + List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate.AddDays(1.0), pageSize, pageIndex, permissionsSQL, out recordCount); string str1 = ""; if (list != null && list.Count > 0) diff --git a/web/web/GwOrderAudit.aspx b/web/web/GwOrderAudit.aspx index 9f54f76..693a9a5 100644 --- a/web/web/GwOrderAudit.aspx +++ b/web/web/GwOrderAudit.aspx @@ -199,13 +199,13 @@ <div class="m-b"> <div class="form-group"> <div class="input-group m-b"> - <span class="input-group-addon">浠g悊鍟嗗鎴疯处鎴�</span> + <span class="input-group-addon">瀹㈡埛璐︽埛</span> <input type="text" name="ClientId" id="ClientId" class="form-control col-md-2" /> </div> </div> <div class="form-group"> <div class="input-group m-b"> - <span class="input-group-addon">浠g悊鍟嗗鎴峰悕绉�</span> + <span class="input-group-addon">瀹㈡埛鍚嶇О</span> <input type="text" name="ClientName" id="ClientName" class="form-control col-md-2" /> </div> </div> diff --git a/web/web/GwOrderComplete.aspx b/web/web/GwOrderComplete.aspx index 4db6f61..3af1a0e 100644 --- a/web/web/GwOrderComplete.aspx +++ b/web/web/GwOrderComplete.aspx @@ -93,13 +93,13 @@ <div class="m-b"> <div class="form-group"> <div class="input-group m-b"> - <span class="input-group-addon">浠g悊鍟嗗鎴疯处鎴�</span> + <span class="input-group-addon">瀹㈡埛璐︽埛</span> <input type="text" name="ClientId" id="ClientId" class="form-control col-md-2" /> </div> </div> <div class="form-group"> <div class="input-group m-b"> - <span class="input-group-addon">浠g悊鍟嗗鎴峰悕绉�</span> + <span class="input-group-addon">瀹㈡埛鍚嶇О</span> <input type="text" name="ClientName" id="ClientName" class="form-control col-md-2" /> </div> </div> diff --git a/web/web/GwSm.aspx b/web/web/GwSm.aspx index 38d6034..f0fa087 100644 --- a/web/web/GwSm.aspx +++ b/web/web/GwSm.aspx @@ -96,7 +96,7 @@ </div> <div class="form-group"> <div class="input-group m-b"> - <span class="input-group-addon">浠g悊鍟�</span> + <span class="input-group-addon">瀹㈡埛ID</span> <input type="text" class="form-control" name="ClientID" id="ClientID" /> </div> </div> @@ -185,7 +185,7 @@ AP/OP娑堟伅MsgID </th> <th> - 浠g悊鍟�-鐭俊璐﹀彿 + 瀹㈡埛-鐭俊璐﹀彿 </th> <th> 瀹㈡埛鎺ュ叆鍗忚-鍙戦�侀�氶亾 diff --git a/web/web/GwSmResend.aspx b/web/web/GwSmResend.aspx index c1f7736..e842506 100644 --- a/web/web/GwSmResend.aspx +++ b/web/web/GwSmResend.aspx @@ -96,7 +96,7 @@ </div> <div class="form-group"> <div class="input-group m-b"> - <span class="input-group-addon">浠g悊鍟�</span> + <span class="input-group-addon">瀹㈡埛ID</span> <input type="text" class="form-control" name="ClientID" id="ClientID" /> </div> </div> @@ -185,7 +185,7 @@ AP/OP娑堟伅MsgID </th> <th> - 浠g悊鍟�-鐭俊璐﹀彿 + 瀹㈡埛-鐭俊璐﹀彿 </th> <th> 瀹㈡埛鎺ュ叆鍗忚-鍙戦�侀�氶亾 diff --git a/web/web/GwSp.ashx b/web/web/GwSp.ashx index 1c5f53f..885c466 100644 --- a/web/web/GwSp.ashx +++ b/web/web/GwSp.ashx @@ -21,6 +21,10 @@ private List<GwStrategy> _StrategyList; private List<GwProduct> _ProductList; + private int _userId = -1; + private int _userType = -1; + private string _account = ""; + private List<GwOp> OpList { get @@ -121,6 +125,10 @@ public override JsonPageResult ProcessRequestInternal(PageContext<SysUser> context) { string @string = context.GetString("action"); + _userId = context.SessionObject.UserID; + _userType = context.SessionObject.UserType; + _account = context.SessionObject.Account; + switch (@string) { case "updateSpStatus": @@ -314,8 +322,11 @@ apId = string1; //if (string.IsNullOrEmpty(clientId) && !string.IsNullOrEmpty(string4)) // clientId = new GwClientDao().GetClientName(string4).ClientID; + + string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, null); + //鍔犺浇璐﹀彿鍒楄〃淇℃伅 - List<GwSp> list = gwSpDao.LoadInfoList(string2, apId, clientId, string4, int1, string3, int2, int4, int3, int5.ToString(),out recordCount, productId); + List<GwSp> list = gwSpDao.LoadInfoList(string2, apId, clientId, string4, int1, string3, int2, int4, int3, int5.ToString(), productId, permissionsSQL, out recordCount); string str1 = ""; if (list != null && list.Count > 0) { diff --git a/web/web/Setting.aspx b/web/web/Setting.aspx index 2c3c34a..392c5e9 100644 --- a/web/web/Setting.aspx +++ b/web/web/Setting.aspx @@ -1,207 +1,210 @@ -锘�<%@ Page Language="C#" masterpagefile="~/Main.master" AutoEventWireup="true" CodeFile="Setting.aspx.cs" Inherits="SettingPage" %> -<asp:Content ID="Content3" ContentPlaceHolderID="title" runat="Server"> - 鍛婅鍙傛暟璁剧疆 -</asp:Content> -<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"> - <script> - $(function () { - var setting = <%=Newtonsoft.Json.JsonConvert.SerializeObject(this.Setting) %> - - var smtpProfile = $.evalJSON(setting.SmtpProfile); - var wxProfile = $.evalJSON(setting.WxProfile); - var sms57Profile = $.evalJSON(setting.SmsProfile); - - $("#SmtpServer").val(smtpProfile.SmtpServer); - $("#SmtpPort").val(smtpProfile.SmtpPort); - $("#SmtpUsername").val(smtpProfile.Username); - $("#SmtpPassword").val(smtpProfile.Password); - $("#SmtpSenderAddress").val(smtpProfile.SenderAddress); - $("#SmtpSSL").iCheck(smtpProfile.SSL ? "check": "uncheck"); - - $("#WxAppID").val(wxProfile.AppID); - $("#WxAppSecret").val(wxProfile.AppSecret); - $("#WxMsgTemplateID").val(wxProfile.MsgTemplateID); - - $("#SmsUserID").val( sms57Profile.UserID); - $("#SmsAccount").val(sms57Profile.Account ); - $("#SmsPassword").val(sms57Profile.Password ); - $("#SmsMTURL").val(sms57Profile.MTURL); - $("#SmsExtNo").val(sms57Profile.ExtNo); - $("#CmSegments").val(setting.CmSegments); - $("#CuSegments").val(setting.CuSegments); - $("#CtSegments").val(setting.CtSegments); - $("#GwName").val(setting.GwName); - $("#BlackMoContent").val(setting.BlackMoContent); - - - $(".action-save").on("click", function () { - smtpProfile.SmtpServer = $("#SmtpServer").val(); - smtpProfile.SmtpPort = $("#SmtpPort").val(); - smtpProfile.Username = $("#SmtpUsername").val(); - smtpProfile.Password = $("#SmtpPassword").val(); - smtpProfile.SenderAddress = $("#SmtpSenderAddress").val(); - smtpProfile.SSL = $("#SmtpSSL").is(":checked") ? 1 : 0; - - wxProfile.AppID = $("#WxAppID").val(); - wxProfile.AppSecret = $("#WxAppSecret").val(); - wxProfile.MsgTemplateID = $("#WxMsgTemplateID").val(); - sms57Profile.UserID = $("#SmsUserID").val(); - sms57Profile.Account = $("#SmsAccount").val(); - sms57Profile.Password = $("#SmsPassword").val(); - sms57Profile.MTURL = $("#SmsMTURL").val(); - sms57Profile.ExtNo = $("#SmsExtNo").val(); - - $.ajax({ - url: "setting.ashx", - method: "POST", - data: { action: "save", - "smsProfile": $.toJSON(sms57Profile), - "smtpProfile": $.toJSON(smtpProfile), - "wxProfile": $.toJSON(wxProfile), - "cmSegments":$("#CmSegments").val(), - "cuSegments":$("#CuSegments").val(), - "ctSegments":$("#CtSegments").val(), - "gwName":$("#GwName").val(), - "blackMoContent":$("#BlackMoContent").val() - }, - success: function (result) { - if (result.OK) { - mytek.alert(result.Message,"success"); - } else { - mytek.alert(result.Message,"warning"); - } - } - }); - }); - }); - </script> -</asp:Content> -<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server"> - <form name="DefaultForm" method="post" action="GwSpUpdate.aspx" id="DefaultForm" - class="form-horizontal"> - <div class="col-sm-12"> - <div class="ibox float-e-margins"> - <div class="ibox-title"> - 鍩虹璁剧疆 - </div> - - - - <div class="ibox-content"> - <div class="form-group"> - <label class="control-label"> - 缃戝叧鏄剧ず鍚嶇О - </label> - <div> - <input type="text" name="GwName" id="GwName" value="" class="form-control" /> - </div> - </div> - <div class="form-group hide"> - <label class="control-label"> - 鐗堟潈淇℃伅 - </label> - <div> - <input type="text" name="CopyRights" id="CopyRights" value="" class="form-control" /> - </div> - </div> - <div class="form-group hide"> - <label class="control-label"> - 娆㈣繋淇℃伅 - </label> - <div> - <input type="text" name="WelcomeMessage" id="WelcomeMessage" value="" class="form-control" /> - </div> - </div> - - <div class="form-group"> - <label class="control-label"> - 鎵嬫満涓婅鑷姩鍔犻粦锛堝涓笂琛屽唴瀹逛箣闂寸敤鑻辨枃鍒嗗彿" ; "鍒嗗壊锛屽唴瀹逛腑鍙互浣跨敤閫氶厤绗�" * ",姣忎釜 * 鍙蜂唬琛�0-10涓瓧绗︼級 - </label> - <div> - <input type="text" value="" maxlength="1000" name="BlackMoContent" id="BlackMoContent" class="form-control" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')" - onpaste="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')" oncontextmenu = "value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')" /> - </div> - </div> - - </div> - </div> - </div> - <div class="col-sm-6 "> - <div class="ibox float-e-margins"> - <div class="ibox-title"> - 鐭俊鍛婅璁剧疆 - </div> - <div class="ibox-content"> - <div class="form-group"> - <label class="control-label"> - USERID锛堟帴鏈琒MGW缃戝叧骞冲彴锛岃鍊间负0锛�</label> - <input type="text" value="" name="SmsUserID" id="SmsUserID" class="form-control" /> - </div> - <div class="form-group"> - <label class="control-label"> - 璐﹀彿</label> - <input type="text" value="" name="SmsAccount" id="SmsAccount" class="form-control" /> - </div> - <div class="form-group"> - <label class="control-label"> - 瀵嗙爜</label> - <input type="password" value="" name="SmsPassword" id="SmsPassword" class="form-control" /> - </div> - <div class="form-group"> - <label class="control-label"> - 涓嬪彂鍙风爜锛堟垨鎵╁睍鐮侊級</label> - <input type="text" value="" name="SmsExtNo" id="SmsExtNo" class="form-control" /> - </div> - <div class="form-group"> - <label class="control-label"> - 鐭俊鎻愪氦鍦板潃</label> - <input type="text" value="" name="SmsMTURL" id="SmsMTURL" class="form-control" /> - </div> - </div> - </div> - </div> - <div class="col-sm-6 "> - <div class="ibox float-e-margins"> - <div class="ibox-title"> - 閭欢鍛婅璁剧疆 - </div> - <div class="ibox-content"> - <div class="form-group "> - <label class="control-label"> - SMTP鏈嶅姟鍣�</label> - <input type="text" value="" name="SmtpServer" id="SmtpServer" class="form-control" /> - </div> - <div class="form-group"> - <label class="control-label"> - SMTP绔彛</label> - <input type="text" value="" name="SmtpPort" id="SmtpPort" class="form-control" /> - </div> - <div class="form-group"> - <label class="control-label"> - 鍙戦�佹柟閭欢鍦板潃</label><input type="text" value="" name="SmtpSenderAddress" id="SmtpSenderAddress" - class="form-control" /> - </div> - <div class="form-group"> - <label class="control-label"> - 鐧诲綍璐﹀彿</label><input type="text" value="" name="SmtpUsername" id="SmtpUsername" class="form-control" /> - </div> - <div class="form-group "> - <label class="control-label"> - 鐧诲綍瀵嗙爜</label> - <input type="password" value="" name="SmtpPassword" id="SmtpPassword" class="form-control" /> - </div> - <div class="form-group "> - <label class="control-label"> - 鏄惁鏀寔SSL</label> - <input type="checkbox" value="" name="SmtpSSL" id="SmtpSSL" class="form-control icheck-me" /> - </div> - </div> - </div> - </div> - <div class="ibox"> - <div class="ibox-content"> - <input class="action-save btn btn-primary pull-right" value="淇濆瓨" type="button" /> - </div> - </div> - </form> -</asp:Content> +锘�<%@ Page Language="C#" masterpagefile="~/Main.master" AutoEventWireup="true" CodeFile="Setting.aspx.cs" Inherits="SettingPage" %> +<asp:Content ID="Content3" ContentPlaceHolderID="title" runat="Server"> + 鍛婅鍙傛暟璁剧疆 +</asp:Content> +<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"> + <script> + $(function () { + var setting = <%=Newtonsoft.Json.JsonConvert.SerializeObject(this.Setting) %> + + var smtpProfile = $.evalJSON(setting.SmtpProfile); + var wxProfile = $.evalJSON(setting.WxProfile); + var sms57Profile = $.evalJSON(setting.SmsProfile); + + $("#SmtpServer").val(smtpProfile.SmtpServer); + $("#SmtpPort").val(smtpProfile.SmtpPort); + $("#SmtpUsername").val(smtpProfile.Username); + $("#SmtpPassword").val(smtpProfile.Password); + $("#SmtpSenderAddress").val(smtpProfile.SenderAddress); + $("#SmtpSSL").iCheck(smtpProfile.SSL ? "check": "uncheck"); + + $("#WxAppID").val(wxProfile.AppID); + $("#WxAppSecret").val(wxProfile.AppSecret); + $("#WxMsgTemplateID").val(wxProfile.MsgTemplateID); + + $("#SmsUserID").val( sms57Profile.UserID); + $("#SmsAccount").val(sms57Profile.Account ); + $("#SmsPassword").val(sms57Profile.Password ); + $("#SmsMTURL").val(sms57Profile.MTURL); + $("#SmsExtNo").val(sms57Profile.ExtNo); + $("#CmSegments").val(setting.CmSegments); + $("#CuSegments").val(setting.CuSegments); + $("#CtSegments").val(setting.CtSegments); + $("#GwName").val(setting.GwName); + $("#BlackMoContent").val(setting.BlackMoContent); + + + + $(".action-save").on("click", function () { + smtpProfile.SmtpServer = $("#SmtpServer").val(); + smtpProfile.SmtpPort = $("#SmtpPort").val(); + smtpProfile.Username = $("#SmtpUsername").val(); + smtpProfile.Password = $("#SmtpPassword").val(); + smtpProfile.SenderAddress = $("#SmtpSenderAddress").val(); + smtpProfile.SSL = $("#SmtpSSL").is(":checked") ? 1 : 0; + + wxProfile.AppID = $("#WxAppID").val(); + wxProfile.AppSecret = $("#WxAppSecret").val(); + wxProfile.MsgTemplateID = $("#WxMsgTemplateID").val(); + sms57Profile.UserID = $("#SmsUserID").val(); + sms57Profile.Account = $("#SmsAccount").val(); + sms57Profile.Password = $("#SmsPassword").val(); + sms57Profile.MTURL = $("#SmsMTURL").val(); + sms57Profile.ExtNo = $("#SmsExtNo").val(); + + $.ajax({ + url: "setting.ashx", + method: "POST", + data: { action: "save", + "smsProfile": $.toJSON(sms57Profile), + "smtpProfile": $.toJSON(smtpProfile), + "wxProfile": $.toJSON(wxProfile), + "cmSegments":$("#CmSegments").val(), + "cuSegments":$("#CuSegments").val(), + "ctSegments":$("#CtSegments").val(), + "gwName":$("#GwName").val(), + "blackMoContent":$("#BlackMoContent").val() + + }, + success: function (result) { + if (result.OK) { + mytek.alert(result.Message,"success"); + } else { + mytek.alert(result.Message,"warning"); + } + } + }); + }); + }); + </script> +</asp:Content> +<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server"> + <form name="DefaultForm" method="post" action="GwSpUpdate.aspx" id="DefaultForm" + class="form-horizontal"> + <div class="col-sm-12"> + <div class="ibox float-e-margins"> + <div class="ibox-title"> + 鍩虹璁剧疆 + </div> + + + + + <div class="ibox-content"> + <div class="form-group"> + <label class="control-label"> + 缃戝叧鏄剧ず鍚嶇О + </label> + <div> + <input type="text" name="GwName" id="GwName" value="" class="form-control" /> + </div> + </div> + <div class="form-group hide"> + <label class="control-label"> + 鐗堟潈淇℃伅 + </label> + <div> + <input type="text" name="CopyRights" id="CopyRights" value="" class="form-control" /> + </div> + </div> + <div class="form-group hide"> + <label class="control-label"> + 娆㈣繋淇℃伅 + </label> + <div> + <input type="text" name="WelcomeMessage" id="WelcomeMessage" value="" class="form-control" /> + </div> + </div> + + <div class="form-group"> + <label class="control-label"> + 鎵嬫満涓婅鑷姩鍔犻粦锛堝涓笂琛屽唴瀹逛箣闂寸敤鑻辨枃鍒嗗彿" ; "鍒嗗壊锛屽唴瀹逛腑鍙互浣跨敤閫氶厤绗�" * ",姣忎釜 * 鍙蜂唬琛�0-10涓瓧绗︼級 + </label> + <div> + <input type="text" value="" maxlength="1000" name="BlackMoContent" id="BlackMoContent" class="form-control" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')" + onpaste="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')" oncontextmenu = "value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\*\;\ ]/g,'')" /> + </div> + </div> + + </div> + </div> + </div> + <div class="col-sm-6 "> + <div class="ibox float-e-margins"> + <div class="ibox-title"> + 鐭俊鍛婅璁剧疆 + </div> + <div class="ibox-content"> + <div class="form-group"> + <label class="control-label"> + USERID锛堟帴鏈琒MGW缃戝叧骞冲彴锛岃鍊间负0锛�</label> + <input type="text" value="" name="SmsUserID" id="SmsUserID" class="form-control" /> + </div> + <div class="form-group"> + <label class="control-label"> + 璐﹀彿</label> + <input type="text" value="" name="SmsAccount" id="SmsAccount" class="form-control" /> + </div> + <div class="form-group"> + <label class="control-label"> + 瀵嗙爜</label> + <input type="password" value="" name="SmsPassword" id="SmsPassword" class="form-control" /> + </div> + <div class="form-group"> + <label class="control-label"> + 涓嬪彂鍙风爜锛堟垨鎵╁睍鐮侊級</label> + <input type="text" value="" name="SmsExtNo" id="SmsExtNo" class="form-control" /> + </div> + <div class="form-group"> + <label class="control-label"> + 鐭俊鎻愪氦鍦板潃</label> + <input type="text" value="" name="SmsMTURL" id="SmsMTURL" class="form-control" /> + </div> + </div> + </div> + </div> + <div class="col-sm-6 "> + <div class="ibox float-e-margins"> + <div class="ibox-title"> + 閭欢鍛婅璁剧疆 + </div> + <div class="ibox-content"> + <div class="form-group "> + <label class="control-label"> + SMTP鏈嶅姟鍣�</label> + <input type="text" value="" name="SmtpServer" id="SmtpServer" class="form-control" /> + </div> + <div class="form-group"> + <label class="control-label"> + SMTP绔彛</label> + <input type="text" value="" name="SmtpPort" id="SmtpPort" class="form-control" /> + </div> + <div class="form-group"> + <label class="control-label"> + 鍙戦�佹柟閭欢鍦板潃</label><input type="text" value="" name="SmtpSenderAddress" id="SmtpSenderAddress" + class="form-control" /> + </div> + <div class="form-group"> + <label class="control-label"> + 鐧诲綍璐﹀彿</label><input type="text" value="" name="SmtpUsername" id="SmtpUsername" class="form-control" /> + </div> + <div class="form-group "> + <label class="control-label"> + 鐧诲綍瀵嗙爜</label> + <input type="password" value="" name="SmtpPassword" id="SmtpPassword" class="form-control" /> + </div> + <div class="form-group "> + <label class="control-label"> + 鏄惁鏀寔SSL</label> + <input type="checkbox" value="" name="SmtpSSL" id="SmtpSSL" class="form-control icheck-me" /> + </div> + </div> + </div> + </div> + <div class="ibox"> + <div class="ibox-content"> + <input class="action-save btn btn-primary pull-right" value="淇濆瓨" type="button" /> + </div> + </div> + </form> +</asp:Content> diff --git a/web/web/gwspupdate.aspx.cs b/web/web/gwspupdate.aspx.cs index 656e0ef..3eedc3b 100644 --- a/web/web/gwspupdate.aspx.cs +++ b/web/web/gwspupdate.aspx.cs @@ -80,6 +80,7 @@ { GwProduct bean = new GwProduct(); bean.Classes = 1; + bean.IsDefault = -1; bean.IsEnable = -1; this.GwProductList = gwProductDao.getAllList(bean); } -- Gitblit v1.9.1