Commit 8114d792 by 罗绍泽

论坛更新

parent 55fc0dab
...@@ -30,18 +30,18 @@ ...@@ -30,18 +30,18 @@
</tr> </tr>
<tr> <tr>
<td style="width: 15%;" class="tableStyleLable"> <td style="width: 15%;" class="tableStyleLable">
<span>版块描述:</span> <span>版块排序:</span>
</td> </td>
<td style="width: 85%"> <td style="width: 85%">
<input class="easyui-textbox" id="DESCRIPTION" name="FIELD_DESCRIPTION" style="width:500px" value="${is_row.DESCRIPTION}"/> <input class="easyui-textbox" id="SORT" name="FIELD_SORT" style="width:500px" value="${is_row.SORT}"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="width: 15%;" class="tableStyleLable"> <td style="width: 15%;" class="tableStyleLable">
<span>版块排序:</span> <span>版块描述:</span>
</td> </td>
<td style="width: 85%"> <td style="width: 85%">
<input class="easyui-textbox" id="SORT" name="FIELD_SORT" style="width:500px" value="${is_row.SORT}"/> <input class="easyui-textbox" id="DESCRIPTION" name="FIELD_DESCRIPTION" style="width:500px" value="${is_row.DESCRIPTION}"/>
</td> </td>
</tr> </tr>
</table> </table>
......
...@@ -229,7 +229,7 @@ function deleteBatchRow(){ ...@@ -229,7 +229,7 @@ function deleteBatchRow(){
**/ **/
function refreshRow(){ function refreshRow(){
$('#list').datagrid('load',{}); $('#list').datagrid('load',{});
$("#topicDetail_searchForm")[0].reset(); $("#replyDetail_searchForm")[0].reset();
} }
/****/ /****/
...@@ -244,9 +244,9 @@ function refreshRow(){ ...@@ -244,9 +244,9 @@ function refreshRow(){
* 备注:需更改 * 备注:需更改
**/ **/
function searchRow(){ function searchRow(){
var v_query = $("#topicDetail_searchForm").getFormVal(); var v_query = $("#replyDetail_searchForm").getFormVal();
$('#list').datagrid('load',v_query); $('#list').datagrid('load',v_query);
renderDATAFORM(v_query,$("#topicDetail_searchForm")); renderDATAFORM(v_query,$("#replyDetail_searchForm"));
} }
/****/ /****/
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<td style="width: 85%">${is_row.POST_TIME}</td> <td style="width: 85%">${is_row.POST_TIME}</td>
</tr> </tr>
</table> --%> </table> --%>
<div id="topicDetailTab"> <div id="replyDetailTab">
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_body.css" charset="utf-8"></link> <link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_body.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_table.css" charset="utf-8"></link> <link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_table.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_input.css" charset="utf-8"></link> <link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_input.css" charset="utf-8"></link>
...@@ -42,8 +42,9 @@ ...@@ -42,8 +42,9 @@
</div> </div>
</form> </form>
<div id="tb"> <div id="tb">
<form id="topicDetail_searchForm" style="float:left"> <form id="replyDetail_searchForm" style="float:left">
内容: <input id="FIELD_CONTENT" name="FIELD_TITLE" type="text" style="width: 200px" class="tableInput-easyui"> <input type="hidden" name="FIELD_TOPIC_ID" value="${is_row.UUID}">
内容: <input id="FIELD_CONTENT" name="FIELD_CONTENT" type="text" style="width: 200px" class="tableInput-easyui">
</form> </form>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="javascript:searchRow()">查询</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="javascript:searchRow()">查询</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="javascript:refreshRow()">刷新</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="javascript:refreshRow()">刷新</a>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<span>标题:</span> <span>标题:</span>
</td> </td>
<td style="width: 85%"> <td style="width: 85%">
<input class="easyui-textbox" id="TITLE" name="FIELD_TITLE" style="width:500px" value="${is_row.TITLE}"/> <input class="easyui-textbox" id="TITLE" name="FIELD_TITLE" data-options="required:true" style="width:500px" value="${is_row.TITLE}"/>
</td> </td>
</tr> </tr>
<tr> <tr>
......
...@@ -60,7 +60,7 @@ var v_yesnoquery_data = standardModel.dataAction.listAllCache(v_yesnoquery); ...@@ -60,7 +60,7 @@ var v_yesnoquery_data = standardModel.dataAction.listAllCache(v_yesnoquery);
//定义grid列表 //定义grid列表
var ls_title="敏感词管理"; var ls_title="敏感词管理";
var is_column = [ [ var is_column = [ [
{field : 'WORD',title : '单词',width : 150,align : 'center'}, {field : 'WORD',title : '单词',width : 250,align : 'center'},
//{field : 'LEVEL_NUM',title : '敏感等级',width : 150,align : 'center'}, //{field : 'LEVEL_NUM',title : '敏感等级',width : 150,align : 'center'},
{field : 'STATE_FLAG',title : '数据已失效',width : 80,align : 'center', {field : 'STATE_FLAG',title : '数据已失效',width : 80,align : 'center',
formatter : function(value) { formatter : function(value) {
......
...@@ -19,16 +19,43 @@ ...@@ -19,16 +19,43 @@
<select id="list_classify" parameterType="map" resultType="upperCaseKeyMap"> <select id="list_classify" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[ <![CDATA[
SELECT SELECT
fc.*, fc.*, uu1.USER_NAME AS CREATE_USER_NAME,
uu1.USER_NAME AS CREATE_USER_NAME, uu2.USER_NAME AS UPDATE_USER_NAME,topic.last_topic_id,
uu2.USER_NAME AS UPDATE_USER_NAME IFNULL(topic.last_topic_title,'暂无帖子') AS last_topic_title,
FROM IFNULL(topic.count, '0') AS topic_count,
forum_classify fc IFNULL(now.now_count, '0') AS now_count
FROM
forum_classify fc
LEFT JOIN uicm_user uu1 ON fc.CREATE_ID = uu1.USER_ID LEFT JOIN uicm_user uu1 ON fc.CREATE_ID = uu1.USER_ID
LEFT JOIN uicm_user uu2 ON fc.UPDATE_ID = uu2.USER_ID LEFT JOIN uicm_user uu2 ON fc.UPDATE_ID = uu2.USER_ID
LEFT JOIN (
SELECT ft.*, ft1.uuid AS last_topic_id,ft1.title AS last_topic_title
FROM (
SELECT classify_id,COUNT(*) AS COUNT,MAX(post_time) AS post_time
FROM forum_topic
WHERE DELETE_FLAG = '0'
GROUP BY classify_id
) ft
LEFT JOIN forum_topic ft1 ON ft.classify_id = ft1.classify_id
AND ft.post_time = ft1.post_time
) topic ON topic.classify_id = fc.uuid
LEFT JOIN (
SELECT classify_id,COUNT(*) as now_count
FROM forum_topic
WHERE post_time >= DATE(NOW()) AND post_time < DATE_ADD(DATE(NOW()), INTERVAL 1 DAY) AND delete_flag = '0'
GROUP BY classify_id
) now ON now.classify_id = fc.uuid
]]> ]]>
<include refid="where_classify" /> <include refid="where_classify" />
order by fc.CREATE_TIME order by
<choose>
<when test="orderByClause != null">
${orderByClause}
</when>
<otherwise>
CREATE_TIME ASC
</otherwise>
</choose>
</select> </select>
<select id="list_count_classify" parameterType="map" resultType="int"> <select id="list_count_classify" parameterType="map" resultType="int">
...@@ -100,4 +127,4 @@ ...@@ -100,4 +127,4 @@
#{UUID} #{UUID}
</foreach> </foreach>
</delete> </delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -150,6 +150,10 @@ public class TopicBusinessImpl implements ForumTopicBusiness{ ...@@ -150,6 +150,10 @@ public class TopicBusinessImpl implements ForumTopicBusiness{
// 计算起始记录 // 计算起始记录
int pageStart = (pageNo - 1) * pageSize; int pageStart = (pageNo - 1) * pageSize;
if (query.get("CONTENT") != null && !"".equals(query.get("CONTENT"))) {
query.put("CONTENT_LIKE", "%" + query.get("CONTENT") + "%");
}
List<Map<String, Object>> items = topicDAO.list_topic_reply(new RowBounds(pageStart, pageSize), query); List<Map<String, Object>> items = topicDAO.list_topic_reply(new RowBounds(pageStart, pageSize), query);
int count = topicDAO.list_count_topic_reply(query); int count = topicDAO.list_count_topic_reply(query);
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
<if test="STICK_FLAG != null and STICK_FLAG != ''"> <if test="STICK_FLAG != null and STICK_FLAG != ''">
and ft.STICK_FLAG = #{STICK_FLAG} and ft.STICK_FLAG = #{STICK_FLAG}
</if> </if>
<if test="DELETE_FLAG != null and DELETE_FLAG != ''">
and ft.DELETE_FLAG = #{DELETE_FLAG}
</if>
</trim> </trim>
</where> </where>
</sql> </sql>
...@@ -34,33 +37,54 @@ ...@@ -34,33 +37,54 @@
<if test="REPLY_USER != null and REPLY_USER != ''"> <if test="REPLY_USER != null and REPLY_USER != ''">
and ftr.REPLY_USER = #{REPLY_USER} and ftr.REPLY_USER = #{REPLY_USER}
</if> </if>
<if test="DELETE_FLAG != null and DELETE_FLAG != ''">
and ftr.DELETE_FLAG = #{DELETE_FLAG}
</if>
</trim> </trim>
</where> </where>
</sql> </sql>
<select id="list_topic" parameterType="map" resultType="upperCaseKeyMap"> <select id="list_topic" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[ <![CDATA[
SELECT SELECT
ft.*, fc.classify_name, ft.*, fc.classify_name,post.COUNT,
fc.FILE_NAME, fc.FILE_SAVE_NAME, uu1.USER_NAME AS POST_USER_NAME,uu1.USER_SEX,
fc.FILE_SAVE_PATH, fc.description,
fc.section_manager, fc.delete_flag,
uu1.USER_NAME AS POST_USER_NAME,
uu2.USER_NAME AS CREATE_USER_NAME, uu2.USER_NAME AS CREATE_USER_NAME,
uu3.USER_NAME AS UPDATE_USER_NAME, uu3.USER_NAME AS UPDATE_USER_NAME,
IFNULL(reply.reply_count,0) AS REPLY_COUNT IFNULL(reply.reply_count,0) AS REPLY_COUNT,
IFNULL(reply.reply_time, '暂无回复') AS LAST_REPLY_TIME
FROM FORUM_TOPIC ft FROM FORUM_TOPIC ft
LEFT JOIN forum_classify fc ON ft.classify_id = fc.uuid LEFT JOIN forum_classify fc ON ft.classify_id = fc.uuid
LEFT JOIN uicm_user uu1 ON ft.post_user = uu1.USER_ID LEFT JOIN uicm_user uu1 ON ft.post_user = uu1.USER_ID
LEFT JOIN uicm_user uu2 ON ft.CREATE_ID = uu2.USER_ID LEFT JOIN uicm_user uu2 ON ft.CREATE_ID = uu2.USER_ID
LEFT JOIN uicm_user uu3 ON ft.UPDATE_ID = uu3.USER_ID LEFT JOIN uicm_user uu3 ON ft.UPDATE_ID = uu3.USER_ID
LEFT JOIN ( LEFT JOIN (
SELECT topic_id,COUNT(*) as reply_count SELECT topic_id,COUNT(*) AS reply_count,MAX(reply_time) AS reply_time
FROM forum_topic_reply FROM forum_topic_reply
WHERE DELETE_FLAG = '0'
GROUP BY topic_id GROUP BY topic_id
) reply ON reply.topic_id = ft.uuid ) reply ON reply.topic_id = ft.uuid
LEFT JOIN (
SELECT post_user,COUNT(*) AS COUNT
FROM FORUM_TOPIC
WHERE DELETE_FLAG = '0'
GROUP BY post_user
) post ON post.post_user = ft.post_user
]]> ]]>
<include refid="where_topic" /> <include refid="where_topic" />
ORDER BY ft.stick_flag DESC,ft.post_time DESC order by
<choose>
<when test="orderByClause != null">
${orderByClause}
</when>
<otherwise>
ft.stick_flag DESC,ft.post_time DESC
</otherwise>
</choose>
<if test="HOT_TOPIC_START != null and HOT_TOPIC_END != null">
<![CDATA[
LIMIT ${HOT_TOPIC_START},${HOT_TOPIC_END}
]]>
</if>
</select> </select>
<select id="list_count_topic" parameterType="map" resultType="int"> <select id="list_count_topic" parameterType="map" resultType="int">
...@@ -222,4 +246,4 @@ ...@@ -222,4 +246,4 @@
#{UUID} #{UUID}
</foreach> </foreach>
</delete> </delete>
</mapper> </mapper>
\ No newline at end of file
package com.jw.app.forum.topic.action; package com.jw.app.forum.topic.action;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
...@@ -85,8 +86,14 @@ public class actAction extends BasicAction { ...@@ -85,8 +86,14 @@ public class actAction extends BasicAction {
entity = QueryParamUtil.StringToDate(entity); entity = QueryParamUtil.StringToDate(entity);
// 去除不要更新的字段 // 去除不要更新的字段
entity.remove("OPETYPE"); entity.remove("OPETYPE");
Set<String> titleSet = SensitivewordUtil.getSensitiveWord(entity.get("TITLE").toString(), 2); Set<String> titleSet = new HashSet<String>();
Set<String> contentSet = SensitivewordUtil.getSensitiveWord(entity.get("CONTENT").toString(), 2); Set<String> contentSet = new HashSet<String>();
if(entity.get("TITLE") != null){
titleSet = SensitivewordUtil.getSensitiveWord(entity.get("TITLE").toString(), 2);
}
if(entity.get("CONTENT") != null){
contentSet = SensitivewordUtil.getSensitiveWord(entity.get("CONTENT").toString(), 2);
}
if (titleSet.size() > 0 || contentSet.size() > 0) { if (titleSet.size() > 0 || contentSet.size() > 0) {
Map<String, Object> map = Status.getStatusErrorMessage("存在敏感词,保存失败"); Map<String, Object> map = Status.getStatusErrorMessage("存在敏感词,保存失败");
Map<String, Object> errorInfo = new HashMap<String, Object>(); Map<String, Object> errorInfo = new HashMap<String, Object>();
...@@ -128,7 +135,7 @@ public class actAction extends BasicAction { ...@@ -128,7 +135,7 @@ public class actAction extends BasicAction {
// 操作日志 // 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class); SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteTopic", "" + ListKey, "软删除版块信息", deletekey, "多个流水号", "topic"); sysbusiness.insert_logBusiness("deleteTopic", "" + ListKey, "软删除版块信息", deletekey, "多个流水号", "topic");
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功")); jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
} catch (Exception e) { } catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("软删除失败")); jsonObject.putAll(Status.getStatusErrorMessage("软删除失败"));
e.printStackTrace(); e.printStackTrace();
...@@ -233,7 +240,7 @@ public class actAction extends BasicAction { ...@@ -233,7 +240,7 @@ public class actAction extends BasicAction {
// 操作日志 // 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class); SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteTopicReply", "" + ListKey, "软删除版块信息", deletekey, "多个流水号", "topic"); sysbusiness.insert_logBusiness("deleteTopicReply", "" + ListKey, "软删除版块信息", deletekey, "多个流水号", "topic");
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功")); jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
} catch (Exception e) { } catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("软删除失败")); jsonObject.putAll(Status.getStatusErrorMessage("软删除失败"));
e.printStackTrace(); e.printStackTrace();
......
...@@ -59,10 +59,10 @@ public class dataAction extends BasicAction { ...@@ -59,10 +59,10 @@ public class dataAction extends BasicAction {
*/ */
public String listTopic() throws BusinessException { public String listTopic() throws BusinessException {
ForumTopicBusiness business = BusinessManager.getBusiness(ForumTopicBusiness.class); ForumTopicBusiness business = BusinessManager.getBusiness(ForumTopicBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
try { try {
query = QueryParamUtil.StringToDate(query); query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageRows = business.listTopic(pageNo,pageSize, query); Page<Map<String, Object>> pageRows = business.listTopic(pageNo, pageSize, query);
setPageCount((pageRows.getCount() - 1) / pageSize + 1); setPageCount((pageRows.getCount() - 1) / pageSize + 1);
Map<String, Object> data = new HashMap<String, Object>(); Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateToString(pageRows.getItems())); data.put("rowSet", QueryParamUtil.DateToString(pageRows.getItems()));
...@@ -91,7 +91,7 @@ public class dataAction extends BasicAction { ...@@ -91,7 +91,7 @@ public class dataAction extends BasicAction {
public String listTopicAll() throws BusinessException { public String listTopicAll() throws BusinessException {
ForumTopicBusiness business = BusinessManager.getBusiness(ForumTopicBusiness.class); ForumTopicBusiness business = BusinessManager.getBusiness(ForumTopicBusiness.class);
try { try {
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX); Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
query = QueryParamUtil.StringToDate(query); query = QueryParamUtil.StringToDate(query);
List<Map<String, Object>> listData = business.listTopic(query); List<Map<String, Object>> listData = business.listTopic(query);
int listDataCount = listData.size(); int listDataCount = listData.size();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment