Commit 8114d792 by 罗绍泽

论坛更新

parent 55fc0dab
......@@ -30,18 +30,18 @@
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>版块描述:</span>
<span>版块排序:</span>
</td>
<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>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>版块排序:</span>
<span>版块描述:</span>
</td>
<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>
</tr>
</table>
......
......@@ -229,7 +229,7 @@ function deleteBatchRow(){
**/
function refreshRow(){
$('#list').datagrid('load',{});
$("#topicDetail_searchForm")[0].reset();
$("#replyDetail_searchForm")[0].reset();
}
/****/
......@@ -244,9 +244,9 @@ function refreshRow(){
* 备注:需更改
**/
function searchRow(){
var v_query = $("#topicDetail_searchForm").getFormVal();
var v_query = $("#replyDetail_searchForm").getFormVal();
$('#list').datagrid('load',v_query);
renderDATAFORM(v_query,$("#topicDetail_searchForm"));
renderDATAFORM(v_query,$("#replyDetail_searchForm"));
}
/****/
......
......@@ -27,7 +27,7 @@
<td style="width: 85%">${is_row.POST_TIME}</td>
</tr>
</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_table.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 @@
</div>
</form>
<div id="tb">
<form id="topicDetail_searchForm" style="float:left">
内容: <input id="FIELD_CONTENT" name="FIELD_TITLE" type="text" style="width: 200px" class="tableInput-easyui">
<form id="replyDetail_searchForm" style="float:left">
<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>
<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>
......
......@@ -9,7 +9,7 @@
<span>标题:</span>
</td>
<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>
</tr>
<tr>
......
......@@ -60,7 +60,7 @@ var v_yesnoquery_data = standardModel.dataAction.listAllCache(v_yesnoquery);
//定义grid列表
var ls_title="敏感词管理";
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 : 'STATE_FLAG',title : '数据已失效',width : 80,align : 'center',
formatter : function(value) {
......
......@@ -19,16 +19,43 @@
<select id="list_classify" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[
SELECT
fc.*,
uu1.USER_NAME AS CREATE_USER_NAME,
uu2.USER_NAME AS UPDATE_USER_NAME
fc.*, uu1.USER_NAME AS CREATE_USER_NAME,
uu2.USER_NAME AS UPDATE_USER_NAME,topic.last_topic_id,
IFNULL(topic.last_topic_title,'暂无帖子') AS last_topic_title,
IFNULL(topic.count, '0') AS topic_count,
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 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" />
order by fc.CREATE_TIME
order by
<choose>
<when test="orderByClause != null">
${orderByClause}
</when>
<otherwise>
CREATE_TIME ASC
</otherwise>
</choose>
</select>
<select id="list_count_classify" parameterType="map" resultType="int">
......
......@@ -150,6 +150,10 @@ public class TopicBusinessImpl implements ForumTopicBusiness{
// 计算起始记录
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);
int count = topicDAO.list_count_topic_reply(query);
......
......@@ -16,6 +16,9 @@
<if test="STICK_FLAG != null and STICK_FLAG != ''">
and ft.STICK_FLAG = #{STICK_FLAG}
</if>
<if test="DELETE_FLAG != null and DELETE_FLAG != ''">
and ft.DELETE_FLAG = #{DELETE_FLAG}
</if>
</trim>
</where>
</sql>
......@@ -34,33 +37,54 @@
<if test="REPLY_USER != null and REPLY_USER != ''">
and ftr.REPLY_USER = #{REPLY_USER}
</if>
<if test="DELETE_FLAG != null and DELETE_FLAG != ''">
and ftr.DELETE_FLAG = #{DELETE_FLAG}
</if>
</trim>
</where>
</sql>
<select id="list_topic" parameterType="map" resultType="upperCaseKeyMap">
<![CDATA[
SELECT
ft.*, fc.classify_name,
fc.FILE_NAME, fc.FILE_SAVE_NAME,
fc.FILE_SAVE_PATH, fc.description,
fc.section_manager, fc.delete_flag,
uu1.USER_NAME AS POST_USER_NAME,
ft.*, fc.classify_name,post.COUNT,
uu1.USER_NAME AS POST_USER_NAME,uu1.USER_SEX,
uu2.USER_NAME AS CREATE_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
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 uu2 ON ft.CREATE_ID = uu2.USER_ID
LEFT JOIN uicm_user uu3 ON ft.UPDATE_ID = uu3.USER_ID
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
WHERE DELETE_FLAG = '0'
GROUP BY topic_id
) 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" />
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 id="list_count_topic" parameterType="map" resultType="int">
......
package com.jw.app.forum.topic.action;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -85,8 +86,14 @@ public class actAction extends BasicAction {
entity = QueryParamUtil.StringToDate(entity);
// 去除不要更新的字段
entity.remove("OPETYPE");
Set<String> titleSet = SensitivewordUtil.getSensitiveWord(entity.get("TITLE").toString(), 2);
Set<String> contentSet = SensitivewordUtil.getSensitiveWord(entity.get("CONTENT").toString(), 2);
Set<String> titleSet = new HashSet<String>();
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) {
Map<String, Object> map = Status.getStatusErrorMessage("存在敏感词,保存失败");
Map<String, Object> errorInfo = new HashMap<String, Object>();
......@@ -128,7 +135,7 @@ public class actAction extends BasicAction {
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteTopic", "" + ListKey, "软删除版块信息", deletekey, "多个流水号", "topic");
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("软删除失败"));
e.printStackTrace();
......@@ -233,7 +240,7 @@ public class actAction extends BasicAction {
// 操作日志
SystemOpeBusiness sysbusiness = BusinessManager.getBusiness(SystemOpeBusiness.class);
sysbusiness.insert_logBusiness("deleteTopicReply", "" + ListKey, "软删除版块信息", deletekey, "多个流水号", "topic");
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
jsonObject.putAll(Status.getStatusSuccessMessage("删除成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("软删除失败"));
e.printStackTrace();
......
......@@ -59,10 +59,10 @@ public class dataAction extends BasicAction {
*/
public String listTopic() throws BusinessException {
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 {
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);
Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateToString(pageRows.getItems()));
......@@ -91,7 +91,7 @@ public class dataAction extends BasicAction {
public String listTopicAll() throws BusinessException {
ForumTopicBusiness business = BusinessManager.getBusiness(ForumTopicBusiness.class);
try {
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
query = QueryParamUtil.StringToDate(query);
List<Map<String, Object>> listData = business.listTopic(query);
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