From c3acb0bf589ba6de244e4eae737152688e5d3e61 Mon Sep 17 00:00:00 2001 From: wzp <2040239371@qq.com> Date: 星期三, 23 十一月 2022 16:41:29 +0800 Subject: [PATCH] 优化待审核页面 --- web/Dao/GwAuditCacheDao.cs | 32 +++++-- web/Lib/Dao.dll | 0 web/web/Bin/Dao.dll | 0 web/web/App_Data/PublishProfiles/FolderProfile.pubxml | 2 web/web/GwAuditCache.aspx | 104 +++++++++++++++++++++++++ web/.vs/Web/v16/.suo | 0 web/Lib/Dao.pdb | 0 web/web/Bin/Dao.pdb | 0 web/web/GwAuditCache.ashx | 45 +++++++++-- 9 files changed, 161 insertions(+), 22 deletions(-) diff --git a/web/.vs/Web/v16/.suo b/web/.vs/Web/v16/.suo index 2bb89a6..625fdab 100644 --- a/web/.vs/Web/v16/.suo +++ b/web/.vs/Web/v16/.suo Binary files differ diff --git a/web/Dao/GwAuditCacheDao.cs b/web/Dao/GwAuditCacheDao.cs index 5f16a45..c143d56 100644 --- a/web/Dao/GwAuditCacheDao.cs +++ b/web/Dao/GwAuditCacheDao.cs @@ -96,17 +96,19 @@ string OP = ""; if (opname != "") { OP = $"and op.OP_NAME='{opname}'"; } - //string str = string.Format("SELECT op.op_name,ca.SP_ID,ca.OP_ID,ca.MSG_CONTENT,ca.KEYWORD,ca.HASH_CODE,COUNT(*) CNT " + - // "FROM GW_AUDIT_CACHE ca left join gw_op op on ca.op_id=op.op_id WHERE " + - // " {0} ca.AP_SUBMIT_TIME BETWEEN :START_TIME AND :END_TIME AND (ca.MSG_CONTENT LIKE :CONTENT OR :CONTENT='%%')" + - // " AND ca.AUDITING_STATUS=:AUDITING_STATUS {1} \r\n " + - // " GROUP BY ca.SP_ID,ca.OP_ID,ca.MSG_CONTENT,ca.KEYWORD,ca.HASH_CODE,op.op_name", this.GenerateOpIDsString(spids), OP); - //鏈�鏂� - string str = string.Format("SELECT op.op_name,ca.SP_ID,ca.OP_ID,ca.MSG_CONTENT,ca.KEYWORD,ca.HASH_CODE,COUNT(*) CNT " + - "FROM GW_AUDIT_CACHE ca left join gw_op op on ca.op_id=op.op_id WHERE " + - " ca.SP_ID IN '{0}' and ca.AP_SUBMIT_TIME BETWEEN :START_TIME AND :END_TIME AND (ca.MSG_CONTENT LIKE :CONTENT OR :CONTENT='%%')" + + + string spidStr = ""; + if (!string.IsNullOrEmpty(spids)) + { + spidStr = " and ca.SP_ID ='"+spids+"'"; + } + + + string str = string.Format("SELECT op.op_name,ca.SP_ID,ca.client_id,ca.OP_ID,ca.MSG_CONTENT,ca.KEYWORD,ca.HASH_CODE,COUNT(*) CNT " + + "FROM GW_AUDIT_CACHE ca left join gw_op op on ca.op_id=op.op_id WHERE 1=1 " + + " {0} and ca.AP_SUBMIT_TIME BETWEEN :START_TIME AND :END_TIME AND (ca.MSG_CONTENT LIKE :CONTENT OR :CONTENT='%%')" + " AND ca.AUDITING_STATUS=:AUDITING_STATUS {1} \r\n " + - " GROUP BY ca.SP_ID,ca.OP_ID,ca.MSG_CONTENT,ca.KEYWORD,ca.HASH_CODE,op.op_name",spids, OP); + " GROUP BY ca.SP_ID,ca.client_id,ca.OP_ID,ca.MSG_CONTENT,ca.KEYWORD,ca.HASH_CODE,op.op_name", spidStr, OP); List<GwAuditCache> list = new List<GwAuditCache>(); OracleParameter[] parameterArray = new OracleParameter[] { new OracleParameter(":START_TIME", begin), new OracleParameter(":END_TIME", end), new OracleParameter(":CONTENT", "%" + content + "%"), new OracleParameter(":AUDITING_STATUS", status) }; @@ -195,6 +197,16 @@ OracleParameter[] parameterArray = new OracleParameter[] { new OracleParameter(":AUDITING_STATUS", (int)status), new OracleParameter(":HASH_CODE", hashCode) }; return (OracleHelper.ExecuteSql(str, OracleHelper.Connection, parameterArray) > 0); } + + //鏇存柊鍐呭 + public bool UpdateCacheContent(string hashCode, string content) + { + string str = "UPDATE GW_AUDIT_CACHE SET AP_SUBMIT_TIME=SYSDATE,MSG_CONTENT=:MSG_CONTENT WHERE HASH_CODE=:HASH_CODE"; + OracleParameter[] parameterArray = new OracleParameter[] { new OracleParameter(":MSG_CONTENT", content), new OracleParameter(":HASH_CODE", hashCode) }; + return (OracleHelper.ExecuteSql(str, OracleHelper.Connection, parameterArray) > 0); + } + + public bool UpdateCacheStatus(string hashCode, AuditingStatus status, int opID) { diff --git a/web/Lib/Dao.dll b/web/Lib/Dao.dll index 668878d..9ea0195 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 cf29b6d..57f4d97 100644 --- a/web/Lib/Dao.pdb +++ b/web/Lib/Dao.pdb Binary files differ diff --git a/web/web/App_Data/PublishProfiles/FolderProfile.pubxml b/web/web/App_Data/PublishProfiles/FolderProfile.pubxml index 6178967..2085a5e 100644 --- a/web/web/App_Data/PublishProfiles/FolderProfile.pubxml +++ b/web/web/App_Data/PublishProfiles/FolderProfile.pubxml @@ -10,7 +10,7 @@ <LastUsedPlatform>Any CPU</LastUsedPlatform> <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> <PublishProvider>FileSystem</PublishProvider> - <PublishUrl>bin\Release\Publish</PublishUrl> + <PublishUrl>C:\SMGW_Web</PublishUrl> <WebPublishMethod>FileSystem</WebPublishMethod> <SiteUrlToLaunchAfterPublish /> <PrecompileBeforePublish>True</PrecompileBeforePublish> diff --git a/web/web/Bin/Dao.dll b/web/web/Bin/Dao.dll index 668878d..9ea0195 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 cf29b6d..57f4d97 100644 --- a/web/web/Bin/Dao.pdb +++ b/web/web/Bin/Dao.pdb Binary files differ diff --git a/web/web/GwAuditCache.ashx b/web/web/GwAuditCache.ashx index af115f6..77a685c 100644 --- a/web/web/GwAuditCache.ashx +++ b/web/web/GwAuditCache.ashx @@ -27,6 +27,8 @@ return this.loadDetail(context); case "load": return this.Load(context); + case "editContent": + return this.EditContent(context); default: throw new Exception("Invalid Action=" + @string); } @@ -43,19 +45,19 @@ private JsonPageResult Load(PageContext<SysUser> context) { - DateTime dateTime1 = context.GetDateTime("StartTime"); - DateTime dateTime2 = context.GetDateTime("EndTime"); - int int1 = context.GetInt("auditingStatus"); - string string1 = context.GetString("content"); - string string2 = context.GetString("spids"); + DateTime startTime = context.GetDateTime("StartTime"); + DateTime endTime = context.GetDateTime("EndTime"); + int auditingStatus = context.GetInt("auditingStatus"); + string content = context.GetString("content"); + string spids = context.GetString("spids"); int recordCount = 0; - int int2 = context.GetInt("pageSize", 20); - int int3 = context.GetInt("pageIndex", 1); + int pageSize = context.GetInt("pageSize", 20); + int pageIndex = context.GetInt("pageIndex", 1); string opname = context.GetString("opname"); using (GwAuditCacheDao gwAuditCacheDao = new GwAuditCacheDao()) { StringBuilder stringBuilder = new StringBuilder(); - DataTable dataTable = gwAuditCacheDao.LoadCache(dateTime1, dateTime2, int1, string1, string2, out recordCount, int2, int3, opname); + DataTable dataTable = gwAuditCacheDao.LoadCache(startTime, endTime, auditingStatus, content, spids, out recordCount, pageSize, pageIndex, opname); if (dataTable.Rows.Count > 0) { foreach (DataRow row in (InternalDataCollectionBase)dataTable.Rows) @@ -64,6 +66,7 @@ stringBuilder.Append("<tr>"); stringBuilder.AppendFormat("<td><input type=\"checkbox\" name=\"hashCode\" checked value=\"{0}\" /></td>", (object)dataRowReader.GetString("HASH_CODE")); stringBuilder.Append("<td>" + dataRowReader.GetString("SP_ID") + "</td>"); + stringBuilder.Append("<td>" + dataRowReader.GetString("CLIENT_ID")+"</td>"); stringBuilder.Append("<td>" + (object)dataRowReader.GetString("OP_NAME") + "</td>"); stringBuilder.Append("<td>" + dataRowReader.GetString("MSG_CONTENT") + "</td>"); stringBuilder.Append("<td>" + dataRowReader.GetString("KEYWORD") + "</td>"); @@ -88,6 +91,32 @@ }); } } + + //鍐呭缂栬緫 + public JsonPageResult EditContent(PageContext<SysUser> context) + { + string sms = context.GetString("newSms"); + if (string.IsNullOrEmpty(sms)) + { + throw new ArgumentException("璇疯緭鍏ヤ慨鏀瑰唴瀹癸紝涓嶅厑璁镐负绌猴紒锛�"); + } + + using (GwAuditCacheDao gwAuditCacheDao = new GwAuditCacheDao()) + { + string[] strArray = JsonConvert.DeserializeObject<string[]>(context.GetString("hashCodes")); + IEnumerable<string> enumerable = Enumerable.Distinct<string>((IEnumerable<string>)strArray); + StringBuilder stringBuilder = new StringBuilder(); + foreach (string hashCode in enumerable) + { + if (!gwAuditCacheDao.UpdateCacheContent(hashCode, sms)) + stringBuilder.AppendFormat("淇敼鍐呭杩囩▼鍙戠敓閿欒锛寋0}锛氫慨鏀瑰け璐ワ紒", hashCode); + } + stringBuilder.AppendLine(); + stringBuilder.AppendFormat("鍐呭璋冩暣瀹屾垚锛屽叡" + (object)strArray.Length + "涓唴瀹癸紒"); + return new JsonPageResult(true, (object)stringBuilder.ToString()); + } + } + /// <summary> /// 鎵瑰噯锛堝甫閫氶亾锛� diff --git a/web/web/GwAuditCache.aspx b/web/web/GwAuditCache.aspx index d579477..0d8b43c 100644 --- a/web/web/GwAuditCache.aspx +++ b/web/web/GwAuditCache.aspx @@ -42,6 +42,9 @@ </div> </div> </form> + + + <div class="table-responsive"> <input class="btn btn-success action-modal-approve" data-status="4" value="鎵归噺閫氳繃(鍙慨鏀归�氶亾)" type="button" />  @@ -49,15 +52,19 @@ type="button" />  <input class="btn btn-warning action-audit-all" data-status="5" value="鐩存帴鎵归噺鎷掔粷" type="button" /> - <table class="table table-striped table-bordered table-hover" id="cacheTable"> + <input class="btn btn-primary action-edit-content" data-status="999" value="淇敼鍐呭" + type="button" /> + + <table class="table table-striped table-bordered table-hover" id="cacheTable" style="margin:10px 0 0 0;"> <thead> <tr class="header"> <th style="width: 20px"> <input type="checkbox" name='checkAll' id="checkAll" /> </th> <th style="width: 50px"> - 璐﹀彿 + 鐭俊璐﹀彿 </th> + <th>瀹㈡埛璐︽埛</th> <th> 閫氶亾 </th> @@ -79,9 +86,10 @@ </tbody> </table> </div> - <div id="pager"> + <div id="pager" style="margin:10px 0 0 0;"> </div> + <%--閫氶亾閫夋嫨--%> <div class="modal inmodal " id="opDialog" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog modal-sm"> <div class="modal-content"> @@ -103,6 +111,33 @@ </div> + <%--鍐呭淇敼--%> + <div class="modal inmodal " id="editContentDialog" tabindex="-1" role="dialog" aria-hidden="true"> + <div class="modal-dialog modal-sm"> + <div class="modal-content" style="width:450px;"> + <div class="modal-header"> + <span class="title">淇敼鍐呭</span><a class="close" data-dismiss="modal" aria-hidden="true">脳</a></div> + <div class="modal-body"> + <div style="display:flex;align-items:center;flex-direction:column;justify-content:center;"> + <div>鍘熷唴瀹癸細<textarea style="width:400px;height:200px" readonly id="oldContent"></textarea></div> + + <div style="margin:30px 0 0 0;"><span style="color:red;font-weight:bold;">淇敼鍚庣殑鍐呭锛�</span><textarea style="width:400px;height:200px" id="newContent"></textarea></div> + </div> + + + </div> + <div class="modal-footer"> + <button class="btn-warning btn" data-dismiss="modal" aria-hidden="true"> + 鍙栨秷</button> + <button class="btn-primary btn action-edit-submit"> + 纭畾</button> + </div> + </div> + </div> + </div> + + + <%--璇︽儏闈㈡澘--%> <div class="modal inmodal " id="detailDialog" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> @@ -266,6 +301,69 @@ $("#opDialog").modal("show"); }); + + + //淇敼鍐呭 + $(".action-edit-content").on("click", function () { + var hashCodes = []; + + $("input[name=hashCode]").each(function () { + if ($(this).is(":checked")) { + hashCodes.push($(this).val()); + } + }); + + $("input[type='checkbox']").each(function () { //閬嶅巻checkbox鐨勯�夋嫨鐘舵�� + if ($(this).prop("checked")) { //濡傛灉鍊间负checked琛ㄦ槑閫変腑浜� + hashCodes.push($(this).val()); + + // console.log("閫変腑璇ヨ鐨処EMI锛�"+$(this).closest('tr').find('td').eq(7).text()); + var delei = $(this).closest('tr').find('td').eq(4).text();//鑾峰彇eq涓�7鐨勯偅涓�鍒楁暟鎹紙灏辨槸绗�7鍒楋級 + console.log("閫変腑璇ヨ鐨勫垪鍊硷細" + typeof delei + '--' + delei); + + $("#oldContent").val(delei); + $("#newContent").val(delei); + + } + }); + + if (hashCodes.length == 0) { + mytek.alert("灏氭湭閫夋嫨瑕佷慨鏀圭殑鍐呭"); + return; + } + + $("#editContentDialog").modal("show"); + }); + + + //鎻愪氦淇敼鍐呭 + $(".action-edit-submit").on("click", function () { + + var hashCodes = []; + + $("input[name=hashCode]").each(function () { + if ($(this).is(":checked")) { + hashCodes.push($(this).val()); + } + }); + + if (hashCodes.length == 0) { + mytek.alert("灏氭湭閫夋嫨瑕佷慨鏀瑰唴瀹圭殑鐭俊"); + return; + } + + let newSms = $("#newContent").val(); + + + $.post("gwauditcache.ashx", { action: "editContent", hashCodes: $.toJSON(hashCodes), newSms: newSms }, + function (result) { + $("#editContentDialog").modal("hide"); + mytek.alert(result.Message, result.OK, function () { + load(); + }); + }, "json"); + }); + }); </script> </asp:Content> -- Gitblit v1.9.1