Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jfV5portal
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
管理员
jfV5portal
Commits
07d9f753
Commit
07d9f753
authored
Sep 07, 2018
by
罗绍泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
论坛功能添加
parent
f12b65a4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
3387 additions
and
0 deletions
+3387
-0
business-apps.xml
WebContent/WEB-INF/conf/gaowj/bl/business-apps.xml
+27
-0
web.xml
WebContent/WEB-INF/web.xml
+6
-0
icon.css
...tent/gaowj/ria/jquery/jquery-easyui-1.4.1/themes/icon.css
+13
-0
classifyTab.jsp
WebContent/jwapp/pages/forum/classify/classifyTab.jsp
+27
-0
classifyTabDetail.jsp
WebContent/jwapp/pages/forum/classify/classifyTabDetail.jsp
+49
-0
classifyModule.js
WebContent/jwapp/pages/forum/classify/js/classifyModule.js
+36
-0
classifyTab.js
WebContent/jwapp/pages/forum/classify/js/classifyTab.js
+0
-0
topicDetail.js
WebContent/jwapp/pages/forum/topic/js/topicDetail.js
+388
-0
topicModule.js
WebContent/jwapp/pages/forum/topic/js/topicModule.js
+48
-0
topicTab.js
WebContent/jwapp/pages/forum/topic/js/topicTab.js
+0
-0
topicDetail.jsp
WebContent/jwapp/pages/forum/topic/topicDetail.jsp
+60
-0
topicTab.jsp
WebContent/jwapp/pages/forum/topic/topicTab.jsp
+29
-0
topicTabDetail.jsp
WebContent/jwapp/pages/forum/topic/topicTabDetail.jsp
+33
-0
wordModule.js
WebContent/jwapp/pages/forum/word/js/wordModule.js
+32
-0
wordTab.js
WebContent/jwapp/pages/forum/word/js/wordTab.js
+329
-0
wordTab.jsp
WebContent/jwapp/pages/forum/word/wordTab.jsp
+22
-0
wordTabDetail.jsp
WebContent/jwapp/pages/forum/word/wordTabDetail.jsp
+25
-0
InitSensitiveServlet.java
src/com/gaowj/business/util/InitSensitiveServlet.java
+25
-0
SensitivewordUtil.java
src/com/gaowj/business/util/SensitivewordUtil.java
+160
-0
SensitiveWordInit.java
src/com/gaowj/business/util/model/SensitiveWordInit.java
+88
-0
struts-ext.xml
src/struts-ext.xml
+42
-0
ForumClassifyBusiness.java
src_jwapp/com/jw/app/business/ForumClassifyBusiness.java
+26
-0
ForumTopicBusiness.java
src_jwapp/com/jw/app/business/ForumTopicBusiness.java
+37
-0
ForumWordBusiness.java
src_jwapp/com/jw/app/business/ForumWordBusiness.java
+24
-0
ClassifyBusinessImpl.java
.../jw/app/business/forum/classify/ClassifyBusinessImpl.java
+142
-0
classifyDAO.java
...jwapp/com/jw/app/business/forum/classify/classifyDAO.java
+27
-0
classifyDAO.xml
src_jwapp/com/jw/app/business/forum/classify/classifyDAO.xml
+104
-0
TopicBusinessImpl.java
...pp/com/jw/app/business/forum/topic/TopicBusinessImpl.java
+233
-0
topicDAO.java
src_jwapp/com/jw/app/business/forum/topic/topicDAO.java
+44
-0
topicDAO.xml
src_jwapp/com/jw/app/business/forum/topic/topicDAO.xml
+215
-0
WordBusinessImpl.java
...wapp/com/jw/app/business/forum/word/WordBusinessImpl.java
+147
-0
wordDAO.java
src_jwapp/com/jw/app/business/forum/word/wordDAO.java
+22
-0
wordDAO.xml
src_jwapp/com/jw/app/business/forum/word/wordDAO.xml
+86
-0
actAction.java
src_jwapp/com/jw/app/forum/classify/action/actAction.java
+213
-0
dataAction.java
src_jwapp/com/jw/app/forum/classify/action/dataAction.java
+116
-0
viewAction.java
src_jwapp/com/jw/app/forum/classify/action/viewAction.java
+26
-0
actAction.java
src_jwapp/com/jw/app/forum/topic/action/actAction.java
+0
-0
dataAction.java
src_jwapp/com/jw/app/forum/topic/action/dataAction.java
+178
-0
viewAction.java
src_jwapp/com/jw/app/forum/topic/action/viewAction.java
+38
-0
actAction.java
src_jwapp/com/jw/app/forum/word/action/actAction.java
+130
-0
dataAction.java
src_jwapp/com/jw/app/forum/word/action/dataAction.java
+116
-0
viewAction.java
src_jwapp/com/jw/app/forum/word/action/viewAction.java
+24
-0
No files found.
WebContent/WEB-INF/conf/gaowj/bl/business-apps.xml
View file @
07d9f753
...
...
@@ -30,6 +30,9 @@
<value>
classpath:com/gaowj/business/base/impl/BaseDAO.xml
</value>
<value>
classpath:com/jw/app/business/meeting/meetingDAO.xml
</value>
<value>
classpath:com/jw/app/business/log/logDAO.xml
</value>
<value>
classpath:com/jw/app/business/forum/classify/classifyDAO.xml
</value>
<value>
classpath:com/jw/app/business/forum/topic/topicDAO.xml
</value>
<value>
classpath:com/jw/app/business/forum/word/wordDAO.xml
</value>
</list>
</property>
</bean>
...
...
@@ -120,6 +123,18 @@
<property
name=
"mapperInterface"
value=
"com.jw.app.business.log.logDAO"
/>
<property
name=
"sqlSessionFactory"
ref=
"sqlSessionFactory-apps"
/>
</bean>
<bean
id=
"classifyDAO"
class=
"org.mybatis.spring.mapper.MapperFactoryBean"
>
<property
name=
"mapperInterface"
value=
"com.jw.app.business.forum.classify.classifyDAO"
/>
<property
name=
"sqlSessionFactory"
ref=
"sqlSessionFactory-apps"
/>
</bean>
<bean
id=
"topicDAO"
class=
"org.mybatis.spring.mapper.MapperFactoryBean"
>
<property
name=
"mapperInterface"
value=
"com.jw.app.business.forum.topic.topicDAO"
/>
<property
name=
"sqlSessionFactory"
ref=
"sqlSessionFactory-apps"
/>
</bean>
<bean
id=
"wordDAO"
class=
"org.mybatis.spring.mapper.MapperFactoryBean"
>
<property
name=
"mapperInterface"
value=
"com.jw.app.business.forum.word.wordDAO"
/>
<property
name=
"sqlSessionFactory"
ref=
"sqlSessionFactory-apps"
/>
</bean>
<!-- BusinessInterFace -->
<bean
id=
"PortletBusiness"
class=
"com.jw.app.business.portlet.PortletBusinessImpl"
>
...
...
@@ -205,6 +220,18 @@
<property
name=
"logDAO"
ref=
"logDAO"
/>
</bean>
<bean
id=
"ClassifyBusiness"
class=
"com.jw.app.business.forum.classify.ClassifyBusinessImpl"
>
<property
name=
"classifyDAO"
ref=
"classifyDAO"
/>
</bean>
<bean
id=
"TopicBusiness"
class=
"com.jw.app.business.forum.topic.TopicBusinessImpl"
>
<property
name=
"topicDAO"
ref=
"topicDAO"
/>
</bean>
<bean
id=
"WordBusiness"
class=
"com.jw.app.business.forum.word.WordBusinessImpl"
>
<property
name=
"wordDAO"
ref=
"wordDAO"
/>
</bean>
<!-- DAO -->
<bean
id=
"portletDAO"
class=
"org.mybatis.spring.mapper.MapperFactoryBean"
>
<property
name=
"mapperInterface"
value=
"com.jw.app.business.portlet.PortletDAO"
/>
...
...
WebContent/WEB-INF/web.xml
View file @
07d9f753
...
...
@@ -147,6 +147,12 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j
<load-on-startup>
2
</load-on-startup>
</servlet>
<servlet>
<servlet-name>
initSensitiveWordServlet
</servlet-name>
<servlet-class>
com.gaowj.business.util.InitSensitiveServlet
</servlet-class>
<load-on-startup>
3
</load-on-startup>
</servlet>
<!-- 是否允许同一帐号多地登陆,为1则允许,为0则不允许-->
<context-param>
<param-name>
MultiUserLogin
</param-name>
...
...
WebContent/gaowj/ria/jquery/jquery-easyui-1.4.1/themes/icon.css
View file @
07d9f753
...
...
@@ -361,3 +361,15 @@
.icon-ext-01_08 {
background:url('
../../../../
images
/
icons
/(
01
,
08
).
png
') no-repeat left center;
}
.icon-ext-00_44 {
background:url('
../../../../
images
/
icons
/(
00
,
44
).
png
') no-repeat left center;
}
.icon-ext-49_47 {
background:url('
../../../../
images
/
icons
/(
49
,
47
).
png
') no-repeat left center;
}
.icon-ext-09_00 {
background:url('
../../../../
images
/
icons
/(
09
,
00
).
png
') no-repeat left center;
}
.icon-ext-49_33 {
background:url('
../../../../
images
/
icons
/(
49
,
33
).
png
'
)
no-repeat
left
center
;
}
\ No newline at end of file
WebContent/jwapp/pages/forum/classify/classifyTab.jsp
0 → 100644
View file @
07d9f753
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="classifyTab">
<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>
</div>
<table id="list" style="width: 100%; height: 100%;"></table>
<div id="tb">
<form id="classifyTab_searchForm" style="float:left">
名称: <input id="FIELD_CLASSIFY_NAME" name="FIELD_CLASSIFY_NAME" 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>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addRow()">新增</a>
<a href="#" id="mb1" class="easyui-menubutton" data-options="menu:'#mm1',iconCls:'icon-ext-29_22'">更多</a>
<div id="mm1" style="width:30px;">
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteBatchRow()">删除记录</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-undo',plain:true" onclick="javascript:resumeBatchRow()">恢复记录</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="javascript:removeBatchRow()">清除记录</a>
</div>
</div>
<div id="detail" style="overflow:auto;"></div>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/forum/classify/js/classifyModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/forum/classify/js/classifyTab.js" charset="utf-8"></script>
WebContent/jwapp/pages/forum/classify/classifyTabDetail.jsp
0 → 100644
View file @
07d9f753
<%@page contentType="text/html; charset=UTF-8"%>
<form id="inputForm" method="post" style="width: 100%;">
<input type="hidden" name="FIELD_OPETYPE" id="OPETYPE" value="${is_row.OPETYPE}" />
<input type="hidden" name="FIELD_UUID" id="UUID" value="${is_row.UUID}"/>
<input type="hidden" name="FIELD_FILE_NAME" id="FILE_NAME" value="${is_row.FILE_NAME}"/>
<input type="hidden" name="FIELD_FILE_SAVE_NAME" id="FILE_SAVE_NAME" value="${is_row.FILE_SAVE_NAME}"/>
<input type="hidden" name="FIELD_FILE_SAVE_PATH" id="FILE_SAVE_PATH" value="${is_row.FILE_SAVE_PATH}"/>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>版块名称:</span>
</td>
<td style="width: 85%">
<input class="easyui-textbox" id="CLASSIFY_NAME" name="FIELD_CLASSIFY_NAME" style="width:500px" value="${is_row.CLASSIFY_NAME}"/>
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>版块图片:</span>
</td>
<td style="width: 85%">
<input type="button" id="CLASSIFY_BG" value="上传">
<input type="button" id="CLASSIFY_BG_BTN" value="上传按钮" style='display:none'>
<span>${is_row.FILE_NAME}</span>
<!-- <input type="file" name="userFile" id="userFile" />
<div class="tableStyleLable" id="notice"></div> -->
</td>
<tr>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>版块描述:</span>
</td>
<td style="width: 85%">
<input class="easyui-textbox" id="DESCRIPTION" name="FIELD_DESCRIPTION" style="width:500px" value="${is_row.DESCRIPTION}"/>
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>版块排序:</span>
</td>
<td style="width: 85%">
<input class="easyui-textbox" id="SORT" name="FIELD_SORT" style="width:500px" value="${is_row.SORT}"/>
</td>
</tr>
</table>
</form>
\ No newline at end of file
WebContent/jwapp/pages/forum/classify/js/classifyModule.js
0 → 100644
View file @
07d9f753
//此乃本模块与后台交互的方法接口部分
var
classifyModule
=
function
(
format
)
{
this
.
module
=
""
;
this
.
action
=
""
;
this
.
format
=
format
;
};
//定义数据交互
classifyModule
.
prototype
=
BusinessObject
;
//上传图片
classifyModule
.
prototype
.
upload
=
function
(){};
//插入数据
classifyModule
.
prototype
.
insertClassify
=
function
(){};
//更新
classifyModule
.
prototype
.
updateClassify
=
function
(){};
//伪删除数据
classifyModule
.
prototype
.
deleteClassify
=
function
(){};
//恢复数据
classifyModule
.
prototype
.
resumeClassify
=
function
(){};
//清除数据
classifyModule
.
prototype
.
deleteTrueClassify
=
function
(){};
//附件数据_分页
classifyModule
.
prototype
.
list
=
function
(){};
//附件所有数据
classifyModule
.
prototype
.
listAll
=
function
(){};
//创建一个数据操作对象,然后再后续使用
classifyModule
.
classifyActAction
=
new
classifyModule
(
"json"
).
delegate
(
"forumClassifyAct"
);
//创建一个数据获取对象,然后再后续使用
classifyModule
.
classifyDataAction
=
new
classifyModule
(
"json"
).
delegate
(
"forumClassifyData"
);
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
// 3、前后台增删改的返回状态 如:json[{'0':{'rowSet':{'NAME':'-1','VALUE':'保存失败'}}}]
WebContent/jwapp/pages/forum/classify/js/classifyTab.js
0 → 100644
View file @
07d9f753
This diff is collapsed.
Click to expand it.
WebContent/jwapp/pages/forum/topic/js/topicDetail.js
0 → 100644
View file @
07d9f753
/**
* 序号:1
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:无需更改
**/
var
ls_width
=
$
(
window
).
width
();
var
ls_height
=
$
(
window
).
height
();
var
local_page
=
1
;
var
rows
=
20
;
var
listPageSize
=
[
10
,
20
,
50
,
100
,
500
,
1000
];
var
queryData
=
eval
(
"({'page':'"
+
local_page
+
"','rows':'"
+
rows
+
"'})"
);
var
tab_n
=
0
;
//重置分页参数
function
resetQueryData
(){
queryData
=
""
;
queryData
=
eval
(
"({'page':'"
+
local_page
+
"','rows':'"
+
rows
+
"'})"
);
}
//定义附件关联模块ID(1:一般业务,2:测试信息,3:审批业务,999:其它数据 )
var
ls_module_id
=
'3'
;
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var
ls_ywlx
=
'YBYW'
;
//定义当前文件树节点
var
ls_node
=
null
;
/****/
/**
* 序号:2
* 功能:构建下拉框内容
* 参数:
* 说明:方便新增、修改页面里的下拉选项加载数据
* 作者:高伟杰
* 时间:2018-07-11
* 单位:宁波金网
* 备注:需更改
**/
//加载是否数据
var
v_yesnoquery
=
{};
v_yesnoquery
.
FIELD_tableName
=
"DM_ST_YES_NO"
;
var
v_yesnoquery_data
=
standardModel
.
dataAction
.
listAllCache
(
v_yesnoquery
);
/****/
/**
* 序号:3
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
var
ls_title
=
"回复管理"
;
var
is_column
=
[
[
{
field
:
'CONTENT'
,
title
:
'内容'
,
width
:
250
,
align
:
'center'
},
{
field
:
'REPLY_USER_NAME'
,
title
:
'回帖人'
,
width
:
100
,
align
:
'center'
},
{
field
:
'REPLY_TIME'
,
title
:
'回帖时间'
,
width
:
150
,
align
:
'center'
},
{
field
:
'DELETE_FLAG'
,
title
:
'数据已删除'
,
width
:
80
,
align
:
'center'
,
formatter
:
function
(
value
)
{
return
getCodeName
(
v_yesnoquery_data
.
rowSet
,
value
);
}
}
]
];
//列表加载完成回调
function
dataOnLoadSuccess
(){
}
//设置颜色和每行高度
function
rowstyler
(
index
,
row
)
{
if
(
row
.
DELETE_FLAG
!=
'1'
)
{
if
(
row
.
STICK_FLAG
==
'1'
)
{
return
'color:blue;height:30px;'
;
}
else
{
return
'height:30px;'
;
}
}
else
{
return
'color:#c0c0c0;height:30px;'
;
}
}
//展示列表
queryData
.
FIELD_TOPIC_ID
=
$
(
"#TOPIC_ID"
).
val
();
datagrid
(
"list"
,
''
,
gaowj
.
WEB_APP_NAME
+
"/forumTopicData_listReply"
,
queryData
,
is_column
,
60
,
80
);
/****/
/**
* 序号:4
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//操用列显示更多(一般情况下无需更改)
function
formatMenu
(
value
,
data
,
index
)
{
var
returnData
=
""
;
return
returnData
+
"<span class=
\"
icon-ext-moremenu
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span>"
+
"<span data-p1="
+
index
+
" class=
\"
easyui-tooltip
\"
style=
\"
color:blue;cursor:pointer;
\"
>更多</span>"
;
}
//上浮横向菜单集里的具体菜单项(需更改)
var
is_tc
=
0
;
function
getOptionMenu
(
data
,
index
){
var
returnData
=
""
;
is_tc
=
3
;
returnData
=
"<span class=
\"
icon-clear
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
deleteRow('"
+
index
+
"')
\"
>删除</a> | <span class=
\"
icon-undo
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
resumeRow('"
+
index
+
"')
\"
>恢复</a> | <span class=
\"
icon-remove
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
removeRow('"
+
index
+
"')
\"
>清除</a>"
;
return
returnData
;
}
//返回菜单集的菜单个数(需更改)
function
getOptionMenuCount
(){
var
is_menu_count
=
is_tc
;
return
is_menu_count
;
}
/****/
/**
* 序号:5
* 功能:新增
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//保存
function
addRow
(){
var
is_entity
=
$
(
"#inputForm"
).
getFormVal
();
//处理相关
var
v_result
=
topicModule
.
topicActAction
.
insertTopicReply
(
is_entity
);
$
(
'#list'
).
datagrid
(
'reload'
);
$
(
'#CONTENT'
).
val
(
''
);
if
(
v_result
!=
null
&&
v_result
!=
undefined
)
{
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
}
//return v_result;
}
/****/
/**
* 序号:6
* 功能:单个删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
deleteRow
(
index
){
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
var
code
=
is_row
[
0
].
UUID
;
$
.
messager
.
confirm
(
'提示'
,
'确定删除?'
,
function
(
r
)
{
if
(
r
)
{
var
v_query
=
{};
v_query
.
FIELD_CODE
=
code
;
var
v_result
=
topicModule
.
topicActAction
.
deleteTopicReply
(
v_query
);
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
$
(
'#list'
).
datagrid
(
'reload'
);
}
});
}
/****/
/**
* 序号:7
* 功能:批量删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
deleteBatchRow
(){
var
code
=
""
;
var
rows
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
for
(
var
i
=
0
;
i
<
rows
.
length
;
i
++
){
code
=
code
+
rows
[
i
].
UUID
+
","
;
}
if
(
rows
==
null
||
rows
==
""
){
$
.
messager
.
alert
(
'提示'
,
"请选择需删除的记录!"
,
'info'
);
return
;
}
if
(
code
.
length
>
0
){
code
=
code
.
substring
(
0
,
code
.
length
-
1
);
}
$
.
messager
.
confirm
(
'提示'
,
'确定删除?'
,
function
(
r
)
{
if
(
r
)
{
var
v_query
=
{};
v_query
.
FIELD_CODE
=
code
;
var
v_result
=
topicModule
.
topicActAction
.
deleteTopicReply
(
v_query
);
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
$
(
'#list'
).
datagrid
(
'reload'
);
}
});
}
/****/
/**
* 序号:8
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
refreshRow
(){
$
(
'#list'
).
datagrid
(
'load'
,{});
$
(
"#topicDetail_searchForm"
)[
0
].
reset
();
}
/****/
/**
* 序号:9
* 功能:查询
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
searchRow
(){
var
v_query
=
$
(
"#topicDetail_searchForm"
).
getFormVal
();
$
(
'#list'
).
datagrid
(
'load'
,
v_query
);
renderDATAFORM
(
v_query
,
$
(
"#topicDetail_searchForm"
));
}
/****/
/**
* 序号:10
* 功能:单个恢复
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
resumeRow
(
index
){
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
var
code
=
is_row
[
0
].
UUID
;
$
.
messager
.
confirm
(
'提示'
,
'确定恢复?'
,
function
(
r
)
{
if
(
r
)
{
var
v_query
=
{};
v_query
.
FIELD_CODE
=
code
;
var
v_result
=
topicModule
.
topicActAction
.
resumeTopicReply
(
v_query
);
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
$
(
'#list'
).
datagrid
(
'reload'
);
}
});
}
/****/
/**
* 序号:11
* 功能:批量恢复
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
resumeBatchRow
(){
var
code
=
""
;
var
rows
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
for
(
var
i
=
0
;
i
<
rows
.
length
;
i
++
){
code
=
code
+
rows
[
i
].
UUID
+
","
;
}
if
(
rows
==
null
||
rows
==
""
){
$
.
messager
.
alert
(
'提示'
,
"请选择需恢复的记录!"
,
'info'
);
return
;
}
if
(
code
.
length
>
0
){
code
=
code
.
substring
(
0
,
code
.
length
-
1
);
}
$
.
messager
.
confirm
(
'提示'
,
'确定恢复删除的记录?'
,
function
(
r
)
{
if
(
r
)
{
var
v_query
=
{};
v_query
.
FIELD_CODE
=
code
;
var
v_result
=
topicModule
.
topicActAction
.
resumeTopicReply
(
v_query
);
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
$
(
'#list'
).
datagrid
(
'reload'
);
}
});
}
/****/
/**
* 序号:12
* 功能:单个清除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
removeRow
(
index
){
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
if
(
is_row
[
0
].
DELETE_FLAG
!=
null
&&
is_row
[
0
].
DELETE_FLAG
==
'0'
){
$
.
messager
.
alert
(
'提示'
,
"存在没有删除标记的记录,无法清除!"
,
'info'
);
return
;
}
var
code
=
is_row
[
0
].
UUID
;
$
.
messager
.
confirm
(
'提示'
,
'确定清除记录?'
,
function
(
r
)
{
if
(
r
)
{
var
v_query
=
{};
v_query
.
FIELD_CODE
=
code
;
var
v_result
=
topicModule
.
topicActAction
.
deleteTrueTopicReply
(
v_query
);
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
$
(
'#list'
).
datagrid
(
'reload'
);
}
});
}
/****/
/**
* 序号:13
* 功能:批量清除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
removeBatchRow
(){
var
code
=
""
;
var
rows
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
for
(
var
i
=
0
;
i
<
rows
.
length
;
i
++
){
code
=
code
+
rows
[
i
].
UUID
+
","
;
if
(
rows
[
i
].
DELETE_FLAG
!=
null
&&
rows
[
i
].
DELETE_FLAG
==
'0'
){
$
.
messager
.
alert
(
'提示'
,
"存在没有删除标记的记录,无法清除!"
,
'info'
);
return
;
}
}
if
(
rows
==
null
||
rows
==
""
){
$
.
messager
.
alert
(
'提示'
,
"请选择需清除的记录!"
,
'info'
);
return
;
}
if
(
code
.
length
>
0
){
code
=
code
.
substring
(
0
,
code
.
length
-
1
);
}
$
.
messager
.
confirm
(
'提示'
,
'确定清除记录?'
,
function
(
r
)
{
if
(
r
)
{
var
v_query
=
{};
v_query
.
FIELD_CODE
=
code
;
var
v_result
=
topicModule
.
topicActAction
.
deleteTrueTopicReply
(
v_query
);
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
$
(
'#list'
).
datagrid
(
'reload'
);
}
});
}
/****/
WebContent/jwapp/pages/forum/topic/js/topicModule.js
0 → 100644
View file @
07d9f753
//此乃本模块与后台交互的方法接口部分
var
topicModule
=
function
(
format
)
{
this
.
module
=
""
;
this
.
action
=
""
;
this
.
format
=
format
;
};
//定义数据交互
topicModule
.
prototype
=
BusinessObject
;
//插入数据
topicModule
.
prototype
.
insertTopic
=
function
(){};
//更新
topicModule
.
prototype
.
updateTopic
=
function
(){};
//伪删除数据
topicModule
.
prototype
.
deleteTopic
=
function
(){};
//恢复数据
topicModule
.
prototype
.
resumeTopic
=
function
(){};
//清除数据
topicModule
.
prototype
.
deleteTrueTopic
=
function
(){};
//插入主题回复
topicModule
.
prototype
.
insertTopicReply
=
function
(){};
//更新主题回复
topicModule
.
prototype
.
updateTopicReply
=
function
(){};
//删除主题回复数据
topicModule
.
prototype
.
deleteTopicReply
=
function
(){};
//恢复数据
topicModule
.
prototype
.
resumeTopicReply
=
function
(){};
//清除数据
topicModule
.
prototype
.
deleteTrueTopicReply
=
function
(){};
//附件数据_分页
topicModule
.
prototype
.
listTopic
=
function
(){};
//附件所有数据
topicModule
.
prototype
.
listTopicAll
=
function
(){};
//附件数据_分页
topicModule
.
prototype
.
listReply
=
function
(){};
//附件所有数据
topicModule
.
prototype
.
listReplyAll
=
function
(){};
//创建一个数据操作对象,然后再后续使用
topicModule
.
topicActAction
=
new
topicModule
(
"json"
).
delegate
(
"forumTopicAct"
);
//创建一个数据获取对象,然后再后续使用
topicModule
.
topicDataAction
=
new
topicModule
(
"json"
).
delegate
(
"forumTopicData"
);
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
// 3、前后台增删改的返回状态 如:json[{'0':{'rowSet':{'NAME':'-1','VALUE':'保存失败'}}}]
WebContent/jwapp/pages/forum/topic/js/topicTab.js
0 → 100644
View file @
07d9f753
This diff is collapsed.
Click to expand it.
WebContent/jwapp/pages/forum/topic/topicDetail.jsp
0 → 100644
View file @
07d9f753
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div style="overflow:auto;height:100%;">
<%-- <table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>标题:</span>
</td>
<td style="width: 85%"><span>[${is_row.CLASSIFY_NAME }]</span>${is_row.TITLE}</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>内容:</span>
</td>
<td style="width: 85%">${is_row.CONTENT}</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>发帖人:</span>
</td>
<td style="width: 85%">${is_row.POST_USER_NAME }</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>发帖时间:</span>
</td>
<td style="width: 85%">${is_row.POST_TIME}</td>
</tr>
</table> --%>
<div id="topicDetailTab">
<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>
</div>
<table id="list" style="width: 100%;height:75%;"></table>
<form id="inputForm" style="clear:both;">
<div>
<input type="hidden" id="TOPIC_ID" name="FIELD_TOPIC_ID" value="${is_row.UUID}">
<!-- <script id="CONTENT" type="text/plain" style="width:100%;height:150px;float:left;"></script> -->
<textarea name="FIELD_CONTENT" id="CONTENT" style="width:100%;height:100px;"></textarea>
<input type="button" value="回复" onclick="javascript:addRow()">
</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>
<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="#" id="mb1" class="easyui-menubutton" data-options="menu:'#mm1',iconCls:'icon-ext-29_22'">更多</a>
<div id="mm1" style="width:30px;">
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteBatchRow()">删除记录</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-undo',plain:true" onclick="javascript:resumeBatchRow()">恢复记录</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="javascript:removeBatchRow()">清除记录</a>
</div>
</div>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/forum/topic/js/topicModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/forum/topic/js/topicDetail.js" charset="utf-8"></script>
\ No newline at end of file
WebContent/jwapp/pages/forum/topic/topicTab.jsp
0 → 100644
View file @
07d9f753
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="topicTab">
<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>
</div>
<table id="list" style="width: 100%; height: 100%;"></table>
<div id="tb">
<form id="topicTab_searchForm" style="float:left">
名称: <input id="FIELD_TITLE" name="FIELD_TITLE" 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>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addRow()">新增</a>
<a href="#" id="mb1" class="easyui-menubutton" data-options="menu:'#mm1',iconCls:'icon-ext-29_22'">更多</a>
<div id="mm1" style="width:30px;">
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteBatchRow()">删除记录</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-undo',plain:true" onclick="javascript:resumeBatchRow()">恢复记录</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="javascript:removeBatchRow()">清除记录</a>
</div>
</div>
<div id="detail" style="overflow:auto;"></div>
<div id="replyDetail" style="overflow:auto;"></div>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/forum/classify/js/classifyModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/forum/topic/js/topicModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/forum/topic/js/topicTab.js" charset="utf-8"></script>
WebContent/jwapp/pages/forum/topic/topicTabDetail.jsp
0 → 100644
View file @
07d9f753
<%@page contentType="text/html; charset=UTF-8"%>
<form id="inputForm" method="post" style="width: 100%;">
<input type="hidden" name="FIELD_OPETYPE" id="OPETYPE" value="${is_row.OPETYPE}" />
<input type="hidden" name="FIELD_UUID" id="UUID" value="${is_row.UUID}"/>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>标题:</span>
</td>
<td style="width: 85%">
<input class="easyui-textbox" id="TITLE" name="FIELD_TITLE" style="width:500px" value="${is_row.TITLE}"/>
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>分类:</span>
</td>
<td style="width: 85%">
<input class="easyui-combobox" id="CLASSIFY_ID" name="FIELD_CLASSIFY_ID" data-options="required:true" style="width:200px" value="${is_row.CLASSIFY_ID}"/>
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>内容:</span>
</td>
<td style="width: 85%">
<script id="CONTENT" type="text/plain" style="width:625px;height:300px;float:left;"></script>
</td>
</tr>
</table>
</form>
\ No newline at end of file
WebContent/jwapp/pages/forum/word/js/wordModule.js
0 → 100644
View file @
07d9f753
//此乃本模块与后台交互的方法接口部分
var
wordModule
=
function
(
format
)
{
this
.
module
=
""
;
this
.
action
=
""
;
this
.
format
=
format
;
};
//定义数据交互
wordModule
.
prototype
=
BusinessObject
;
//插入数据
wordModule
.
prototype
.
insertWord
=
function
(){};
//更新
wordModule
.
prototype
.
updateWord
=
function
(){};
//删除数据
wordModule
.
prototype
.
deleteWord
=
function
(){};
//刷新敏感词缓存
wordModule
.
prototype
.
insertSensitiveWordCache
=
function
(){};
//附件数据_分页
wordModule
.
prototype
.
list
=
function
(){};
//附件所有数据
wordModule
.
prototype
.
listAll
=
function
(){};
//创建一个数据操作对象,然后再后续使用
wordModule
.
wordActAction
=
new
wordModule
(
"json"
).
delegate
(
"forumWordAct"
);
//创建一个数据获取对象,然后再后续使用
wordModule
.
wordDataAction
=
new
wordModule
(
"json"
).
delegate
(
"forumWordData"
);
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
// 3、前后台增删改的返回状态 如:json[{'0':{'rowSet':{'NAME':'-1','VALUE':'保存失败'}}}]
WebContent/jwapp/pages/forum/word/js/wordTab.js
0 → 100644
View file @
07d9f753
/**
* 序号:1
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:无需更改
**/
var
ls_width
=
$
(
window
).
width
();
var
ls_height
=
$
(
window
).
height
();
var
local_page
=
1
;
var
rows
=
20
;
var
listPageSize
=
[
10
,
20
,
50
,
100
,
500
,
1000
];
var
queryData
=
eval
(
"({'page':'"
+
local_page
+
"','rows':'"
+
rows
+
"'})"
);
var
tab_n
=
0
;
//重置分页参数
function
resetQueryData
(){
queryData
=
""
;
queryData
=
eval
(
"({'page':'"
+
local_page
+
"','rows':'"
+
rows
+
"'})"
);
}
//定义附件关联模块ID(1:一般业务,2:测试信息,3:审批业务,999:其它数据 )
var
ls_module_id
=
'3'
;
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var
ls_ywlx
=
'YBYW'
;
//定义当前文件树节点
var
ls_node
=
null
;
/****/
/**
* 序号:2
* 功能:构建下拉框内容
* 参数:
* 说明:方便新增、修改页面里的下拉选项加载数据
* 作者:高伟杰
* 时间:2018-07-11
* 单位:宁波金网
* 备注:需更改
**/
//加载是否数据
var
v_yesnoquery
=
{};
v_yesnoquery
.
FIELD_tableName
=
"DM_ST_YES_NO"
;
var
v_yesnoquery_data
=
standardModel
.
dataAction
.
listAllCache
(
v_yesnoquery
);
/****/
/**
* 序号:3
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//定义grid列表
var
ls_title
=
"敏感词管理"
;
var
is_column
=
[
[
{
field
:
'WORD'
,
title
:
'单词'
,
width
:
150
,
align
:
'center'
},
//{field : 'LEVEL_NUM',title : '敏感等级',width : 150,align : 'center'},
{
field
:
'STATE_FLAG'
,
title
:
'数据已失效'
,
width
:
80
,
align
:
'center'
,
formatter
:
function
(
value
)
{
return
getCodeName
(
v_yesnoquery_data
.
rowSet
,
value
);
}
},
{
field
:
'CREATE_USER_NAME'
,
title
:
'创建人员'
,
width
:
100
,
align
:
'center'
},
{
field
:
'CREATE_TIME'
,
title
:
'创建时间'
,
width
:
150
,
align
:
'center'
},
{
field
:
'UPDATE_USER_NAME'
,
title
:
'修改人员'
,
width
:
100
,
align
:
'center'
},
{
field
:
'UPDATE_TIME'
,
title
:
'修改时间'
,
width
:
150
,
align
:
'center'
}
]
];
//列表加载完成回调
function
dataOnLoadSuccess
(){
}
//设置颜色和每行高度
function
rowstyler
(
index
,
row
){
if
(
row
.
STATE_FLAG
!=
'1'
){
return
'height:30px;'
;
}
else
{
return
'color:#c0c0c0;height:30px;'
;
}
}
//展示列表
datagrid
(
"list"
,
ls_title
,
gaowj
.
WEB_APP_NAME
+
"/forumWordData_list"
,
queryData
,
is_column
,
60
,
80
);
/****/
/**
* 序号:4
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//操用列显示更多(一般情况下无需更改)
function
formatMenu
(
value
,
data
,
index
)
{
var
returnData
=
""
;
return
returnData
+
"<span class=
\"
icon-ext-moremenu
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span>"
+
"<span data-p1="
+
index
+
" class=
\"
easyui-tooltip
\"
style=
\"
color:blue;cursor:pointer;
\"
>更多</span>"
;
}
//上浮横向菜单集里的具体菜单项(需更改)
var
is_tc
=
0
;
function
getOptionMenu
(
data
,
index
)
{
var
returnData
=
""
;
is_tc
=
3
;
if
(
data
.
STATE_FLAG
==
'1'
)
{
returnData
=
"<span class=
\"
icon-edit
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
editRow('"
+
index
+
"')
\"
>编辑</a> | <span class=
\"
icon-clear
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
deleteRow('"
+
index
+
"')
\"
>删除</a> | <span class=
\"
icon-redo
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
stateRow('"
+
index
+
"',0)
\"
>生效</a>"
;
}
else
if
(
data
.
STATE_FLAG
==
'0'
)
{
returnData
=
"<span class=
\"
icon-edit
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
editRow('"
+
index
+
"')
\"
>编辑</a> | <span class=
\"
icon-clear
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
deleteRow('"
+
index
+
"')
\"
>删除</a> | <span class=
\"
icon-undo
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
stateRow('"
+
index
+
"',1)
\"
>失效</a>"
;
}
return
returnData
;
}
//返回菜单集的菜单个数(需更改)
function
getOptionMenuCount
(){
var
is_menu_count
=
is_tc
;
return
is_menu_count
;
}
/****/
/**
* 序号:5
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
//加载增加子页面
function
addRow
(){
var
is_row
=
{
OPETYPE
:
'insert'
};
openEditRow
(
"forumWordView_wordTabDetail"
,
is_row
,
"新增"
,
true
,
0.65
,
0.95
,
160
,
0
);
}
//加载增加子页面成功后的回调
function
addUrlOnloadCallback
(
is_row
)
{
$
(
'#STATE_FLAG'
).
combobox
({
data
:
v_yesnoquery_data
.
rowSet
,
valueField
:
'CODE_ID'
,
textField
:
'CODE_NAME'
,
editable
:
false
,
panelHeight
:
'auto'
});
}
//保存
function
insertData
(
is_entity
)
{
//处理相关
var
v_result
=
wordModule
.
wordActAction
.
insertWord
(
is_entity
);
$
(
'#list'
).
datagrid
(
'reload'
);
return
v_result
;
}
//加载修改子页面
function
editRow
(
index
)
{
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
is_row
[
0
].
OPETYPE
=
'update'
;
openEditRow
(
"forumWordView_wordTabDetail"
,
is_row
[
0
],
"编辑"
,
true
,
0.65
,
0.95
,
160
,
0
);
}
//加载修改子页面成功后的回调
function
updateUrlOnloadCallback
(
is_row
){
$
(
'#STATE_FLAG'
).
combobox
({
data
:
v_yesnoquery_data
.
rowSet
,
valueField
:
'CODE_ID'
,
textField
:
'CODE_NAME'
,
editable
:
false
,
panelHeight
:
'auto'
});
}
//保存
function
updateData
(
is_entity
)
{
v_result
=
wordModule
.
wordActAction
.
updateWord
(
is_entity
);
$
(
'#list'
).
datagrid
(
'reload'
);
return
v_result
;
}
/****/
/**
* 序号:6
* 功能:单个删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
deleteRow
(
index
){
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
var
code
=
is_row
[
0
].
UUID
;
$
.
messager
.
confirm
(
'提示'
,
'确定删除?'
,
function
(
r
)
{
if
(
r
)
{
var
v_query
=
{};
v_query
.
FIELD_CODE
=
code
;
var
v_result
=
wordModule
.
wordActAction
.
deleteWord
(
v_query
);
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
$
(
'#list'
).
datagrid
(
'reload'
);
}
});
}
/****/
/**
* 序号:7
* 功能:批量删除
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
deleteBatchRow
(){
var
code
=
""
;
var
rows
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
for
(
var
i
=
0
;
i
<
rows
.
length
;
i
++
){
code
=
code
+
rows
[
i
].
UUID
+
","
;
}
if
(
rows
==
null
||
rows
==
""
){
$
.
messager
.
alert
(
'提示'
,
"请选择需删除的记录!"
,
'info'
);
return
;
}
if
(
code
.
length
>
0
){
code
=
code
.
substring
(
0
,
code
.
length
-
1
);
}
$
.
messager
.
confirm
(
'提示'
,
'确定删除?'
,
function
(
r
)
{
if
(
r
)
{
var
v_query
=
{};
v_query
.
FIELD_CODE
=
code
;
var
v_result
=
wordModule
.
wordActAction
.
deleteWord
(
v_query
);
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
$
(
'#list'
).
datagrid
(
'reload'
);
}
});
}
/****/
/**
* 序号:8
* 功能:刷新
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
refreshRow
(){
$
(
'#list'
).
datagrid
(
'load'
,{});
$
(
"#wordTab_searchForm"
)[
0
].
reset
();
}
/****/
/**
* 序号:9
* 功能:查询
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
searchRow
(){
var
v_query
=
$
(
"#wordTab_searchForm"
).
getFormVal
();
$
(
'#list'
).
datagrid
(
'load'
,
v_query
);
renderDATAFORM
(
v_query
,
$
(
"#wordTab_searchForm"
));
}
/****/
/**
* 序号:10
* 功能:更新状态
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function
stateRow
(
index
,
flag
)
{
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
//更新置顶状态
var
v_wordupdate
=
{};
v_wordupdate
.
FIELD_UUID
=
is_row
[
0
].
UUID
;
v_wordupdate
.
FIELD_STATE_FLAG
=
flag
;
var
v_result
=
wordModule
.
wordActAction
.
updateWord
(
v_wordupdate
);
//处理相关
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
$
(
'#list'
).
datagrid
(
'reload'
);
}
//刷新缓存
function
refreshCache
(){
var
v_result
=
wordModule
.
wordActAction
.
insertSensitiveWordCache
();
if
(
v_result
!=
null
&&
v_result
!=
undefined
)
{
$
.
messager
.
alert
(
'提示'
,
v_result
.
VALUE
);
}
}
/****/
WebContent/jwapp/pages/forum/word/wordTab.jsp
0 → 100644
View file @
07d9f753
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="wordTab">
<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>
</div>
<table id="list" style="width: 100%; height: 100%;"></table>
<div id="tb">
<form id="wordTab_searchForm" style="float:left">
名称: <input id="FIELD_WORD" name="FIELD_WORD" 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>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addRow()">新增</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteBatchRow()">删除</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="javascript:refreshCache()">刷新缓存</a>
</div>
<div id="detail" style="overflow:auto;"></div>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/forum/word/js/wordModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/forum/word/js/wordTab.js" charset="utf-8"></script>
WebContent/jwapp/pages/forum/word/wordTabDetail.jsp
0 → 100644
View file @
07d9f753
<%@page contentType="text/html; charset=UTF-8"%>
<form id="inputForm" method="post" style="width: 100%;">
<input type="hidden" name="FIELD_OPETYPE" id="OPETYPE" value="${is_row.OPETYPE}" />
<input type="hidden" name="FIELD_UUID" id="UUID" value="${is_row.UUID}"/>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableStyle" style="margin: 10px 15px; width: 95%; line-height: 30px;">
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>单词:</span>
</td>
<td style="width: 85%">
<input class="easyui-textbox" id="WORD" name="FIELD_WORD" style="width:500px" value="${is_row.WORD}"/>
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>是否失效:</span>
</td>
<td style="width: 85%">
<input class="easyui-combobox" style="width:130px;" id="STATE_FLAG" name="FIELD_STATE_FLAG" value="${is_row.STATE_FLAG}" />
</td>
</tr>
</table>
</form>
\ No newline at end of file
src/com/gaowj/business/util/InitSensitiveServlet.java
0 → 100644
View file @
07d9f753
package
com
.
gaowj
.
business
.
util
;
import
java.io.Serializable
;
import
javax.servlet.http.HttpServlet
;
import
com.gaowj.business.comp.BusinessManager
;
import
com.gaowj.business.comp.DefaultBusinessHandler
;
import
com.jw.app.business.ForumWordBusiness
;
public
class
InitSensitiveServlet
extends
HttpServlet
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
5990830868434698892L
;
public
void
init
()
{
new
DefaultBusinessHandler
();
ForumWordBusiness
st
=
(
ForumWordBusiness
)
BusinessManager
.
getBusiness
(
ForumWordBusiness
.
class
);
st
.
insert_sensitive_word_cache
();
}
}
src/com/gaowj/business/util/SensitivewordUtil.java
0 → 100644
View file @
07d9f753
package
com
.
gaowj
.
business
.
util
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.Map
;
import
java.util.Set
;
/**
* 敏感词过滤工具类
*
* @author AlanLee
*
*/
public
class
SensitivewordUtil
{
/**
* 敏感词库
*/
public
static
Map
sensitiveWordMap
=
null
;
/**
* 只过滤最小敏感词
*/
public
static
int
minMatchTYpe
=
1
;
/**
* 过滤所有敏感词
*/
public
static
int
maxMatchType
=
2
;
/**
* 敏感词库敏感词数量
*
* @return
*/
public
static
int
getWordSize
()
{
if
(
SensitivewordUtil
.
sensitiveWordMap
==
null
)
{
return
0
;
}
return
SensitivewordUtil
.
sensitiveWordMap
.
size
();
}
/**
* 是否包含敏感词
*
* @param txt
* @param matchType
* @return
*/
public
static
boolean
isContaintSensitiveWord
(
String
txt
,
int
matchType
)
{
boolean
flag
=
false
;
for
(
int
i
=
0
;
i
<
txt
.
length
();
i
++)
{
int
matchFlag
=
checkSensitiveWord
(
txt
,
i
,
matchType
);
if
(
matchFlag
>
0
)
{
flag
=
true
;
}
}
return
flag
;
}
/**
* 获取敏感词内容
*
* @param txt
* @param matchType
* @return 敏感词内容
*/
public
static
Set
<
String
>
getSensitiveWord
(
String
txt
,
int
matchType
)
{
Set
<
String
>
sensitiveWordList
=
new
HashSet
<
String
>();
for
(
int
i
=
0
;
i
<
txt
.
length
();
i
++)
{
int
length
=
checkSensitiveWord
(
txt
,
i
,
matchType
);
if
(
length
>
0
)
{
// 将检测出的敏感词保存到集合中
sensitiveWordList
.
add
(
txt
.
substring
(
i
,
i
+
length
));
i
=
i
+
length
-
1
;
}
}
return
sensitiveWordList
;
}
/**
* 替换敏感词
*
* @param txt
* @param matchType
* @param replaceChar
* @return
*/
public
static
String
replaceSensitiveWord
(
String
txt
,
int
matchType
,
String
replaceChar
)
{
String
resultTxt
=
txt
;
Set
<
String
>
set
=
getSensitiveWord
(
txt
,
matchType
);
Iterator
<
String
>
iterator
=
set
.
iterator
();
String
word
=
null
;
String
replaceString
=
null
;
while
(
iterator
.
hasNext
())
{
word
=
iterator
.
next
();
replaceString
=
getReplaceChars
(
replaceChar
,
word
.
length
());
resultTxt
=
resultTxt
.
replaceAll
(
word
,
replaceString
);
}
return
resultTxt
;
}
/**
* 替换敏感词内容
*
* @param replaceChar
* @param length
* @return
*/
private
static
String
getReplaceChars
(
String
replaceChar
,
int
length
)
{
String
resultReplace
=
replaceChar
;
for
(
int
i
=
1
;
i
<
length
;
i
++)
{
resultReplace
+=
replaceChar
;
}
return
resultReplace
;
}
/**
* 检查敏感词数量
*
* @param txt
* @param beginIndex
* @param matchType
* @return
*/
public
static
int
checkSensitiveWord
(
String
txt
,
int
beginIndex
,
int
matchType
)
{
boolean
flag
=
false
;
// 记录敏感词数量
int
matchFlag
=
0
;
char
word
=
0
;
Map
nowMap
=
SensitivewordUtil
.
sensitiveWordMap
;
for
(
int
i
=
beginIndex
;
i
<
txt
.
length
();
i
++)
{
word
=
txt
.
charAt
(
i
);
// 判断该字是否存在于敏感词库中
nowMap
=
(
Map
)
nowMap
.
get
(
word
);
if
(
nowMap
!=
null
)
{
matchFlag
++;
// 判断是否是敏感词的结尾字,如果是结尾字则判断是否继续检测
if
(
"1"
.
equals
(
nowMap
.
get
(
"isEnd"
)))
{
flag
=
true
;
// 判断过滤类型,如果是小过滤则跳出循环,否则继续循环
if
(
SensitivewordUtil
.
minMatchTYpe
==
matchType
)
{
break
;
}
}
}
else
{
break
;
}
}
if
(!
flag
)
{
matchFlag
=
0
;
}
return
matchFlag
;
}
}
\ No newline at end of file
src/com/gaowj/business/util/model/SensitiveWordInit.java
0 → 100644
View file @
07d9f753
package
com
.
gaowj
.
business
.
util
.
model
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* 敏感词库初始化
*
* @author AlanLee
*
*/
public
class
SensitiveWordInit
{
/**
* 敏感词库
*/
public
HashMap
sensitiveWordMap
;
/**
* 初始化敏感词
*
* @return
*/
public
Map
initKeyWord
(
List
<
Map
<
String
,
Object
>>
sensitiveWords
)
{
try
{
// 从敏感词集合对象中取出敏感词并封装到Set集合中
Set
<
String
>
keyWordSet
=
new
HashSet
<
String
>();
for
(
Map
<
String
,
Object
>
s
:
sensitiveWords
)
{
keyWordSet
.
add
(
s
.
get
(
"WORD"
).
toString
().
trim
());
}
// 将敏感词库加入到HashMap中
addSensitiveWordToHashMap
(
keyWordSet
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
sensitiveWordMap
;
}
/**
* 封装敏感词库
*
* @param keyWordSet
*/
@SuppressWarnings
(
"rawtypes"
)
private
void
addSensitiveWordToHashMap
(
Set
<
String
>
keyWordSet
)
{
// 初始化HashMap对象并控制容器的大小
sensitiveWordMap
=
new
HashMap
(
keyWordSet
.
size
());
// 敏感词
String
key
=
null
;
// 用来按照相应的格式保存敏感词库数据
Map
nowMap
=
null
;
// 用来辅助构建敏感词库
Map
<
String
,
String
>
newWorMap
=
null
;
// 使用一个迭代器来循环敏感词集合
Iterator
<
String
>
iterator
=
keyWordSet
.
iterator
();
System
.
out
.
println
(
"封装敏感词库开始"
);
while
(
iterator
.
hasNext
())
{
key
=
iterator
.
next
();
// 等于敏感词库,HashMap对象在内存中占用的是同一个地址,所以此nowMap对象的变化,sensitiveWordMap对象也会跟着改变
nowMap
=
sensitiveWordMap
;
for
(
int
i
=
0
;
i
<
key
.
length
();
i
++)
{
// 截取敏感词当中的字,在敏感词库中字为HashMap对象的Key键值
char
keyChar
=
key
.
charAt
(
i
);
// 判断这个字是否存在于敏感词库中
Object
wordMap
=
nowMap
.
get
(
keyChar
);
if
(
wordMap
!=
null
)
{
nowMap
=
(
Map
)
wordMap
;
}
else
{
newWorMap
=
new
HashMap
<
String
,
String
>();
newWorMap
.
put
(
"isEnd"
,
"0"
);
nowMap
.
put
(
keyChar
,
newWorMap
);
nowMap
=
newWorMap
;
}
// 如果该字是当前敏感词的最后一个字,则标识为结尾字
if
(
i
==
key
.
length
()
-
1
)
{
nowMap
.
put
(
"isEnd"
,
"1"
);
}
//System.out.println("封装敏感词库过程:" + sensitiveWordMap);
}
}
System
.
out
.
println
(
"封装敏感词库結束"
);
}
}
src/struts-ext.xml
View file @
07d9f753
...
...
@@ -369,7 +369,49 @@
</result>
</action>
</package>
<package
name=
"src_jwapp_forum"
extends=
"gaowj"
>
<action
name=
"forumClassifyAct_*"
class=
"com.jw.app.forum.classify.action.actAction"
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<param
name=
"root"
>
jsonObject
</param>
</result>
</action>
<action
name=
"forumClassifyData_*"
class=
"com.jw.app.forum.classify.action.dataAction"
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<param
name=
"root"
>
jsonObject
</param>
</result>
</action>
<action
name=
"forumClassifyView_*"
class=
"com.jw.app.forum.classify.action.viewAction"
method=
"{1}"
>
<result
name=
"{1}"
>
/jwapp/pages/forum/classify/{1}.jsp
</result>
</action>
<action
name=
"forumTopicAct_*"
class=
"com.jw.app.forum.topic.action.actAction"
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<param
name=
"root"
>
jsonObject
</param>
</result>
</action>
<action
name=
"forumTopicData_*"
class=
"com.jw.app.forum.topic.action.dataAction"
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<param
name=
"root"
>
jsonObject
</param>
</result>
</action>
<action
name=
"forumTopicView_*"
class=
"com.jw.app.forum.topic.action.viewAction"
method=
"{1}"
>
<result
name=
"{1}"
>
/jwapp/pages/forum/topic/{1}.jsp
</result>
</action>
<action
name=
"forumWordAct_*"
class=
"com.jw.app.forum.word.action.actAction"
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<param
name=
"root"
>
jsonObject
</param>
</result>
</action>
<action
name=
"forumWordData_*"
class=
"com.jw.app.forum.word.action.dataAction"
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<param
name=
"root"
>
jsonObject
</param>
</result>
</action>
<action
name=
"forumWordView_*"
class=
"com.jw.app.forum.word.action.viewAction"
method=
"{1}"
>
<result
name=
"{1}"
>
/jwapp/pages/forum/word/{1}.jsp
</result>
</action>
</package>
<package
name=
"caslogin"
extends=
"struts-default,json-default"
>
<action
name=
"jfcas"
class=
"com.gaowj.system.login.CasAction"
>
...
...
src_jwapp/com/jw/app/business/ForumClassifyBusiness.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
business
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.stereotype.Service
;
import
com.gaowj.business.util.Page
;
@Service
public
interface
ForumClassifyBusiness
{
Page
<
Map
<
String
,
Object
>>
list
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
);
List
<
Map
<
String
,
Object
>>
list
(
Map
<
String
,
Object
>
query
);
void
insert_classify
(
Map
<
String
,
Object
>
entity
);
void
update_classify
(
Map
<
String
,
Object
>
entity
);
void
delete_classify
(
List
<
String
>
listKey
);
void
resume_classify
(
List
<
String
>
listKey
);
void
delete_true_classify
(
List
<
String
>
listKey
);
}
src_jwapp/com/jw/app/business/ForumTopicBusiness.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
business
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.stereotype.Service
;
import
com.gaowj.business.util.Page
;
@Service
public
interface
ForumTopicBusiness
{
Page
<
Map
<
String
,
Object
>>
listTopic
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
);
List
<
Map
<
String
,
Object
>>
listTopic
(
Map
<
String
,
Object
>
query
);
void
insert_topic
(
Map
<
String
,
Object
>
entity
);
void
update_topic
(
Map
<
String
,
Object
>
entity
);
void
delete_topic
(
List
<
String
>
listKey
);
void
resume_topic
(
List
<
String
>
listKey
);
void
delete_true_topic
(
List
<
String
>
listKey
);
Page
<
Map
<
String
,
Object
>>
listTopicReply
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
);
List
<
Map
<
String
,
Object
>>
listTopicReply
(
Map
<
String
,
Object
>
query
);
void
insert_topic_reply
(
Map
<
String
,
Object
>
entity
);
void
delete_topic_reply
(
List
<
String
>
listKey
);
void
resume_topic_reply
(
List
<
String
>
listKey
);
void
delete_true_topic_reply
(
List
<
String
>
listKey
);
}
src_jwapp/com/jw/app/business/ForumWordBusiness.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
business
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.stereotype.Service
;
import
com.gaowj.business.util.Page
;
@Service
public
interface
ForumWordBusiness
{
Page
<
Map
<
String
,
Object
>>
listWord
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
);
List
<
Map
<
String
,
Object
>>
listWord
(
Map
<
String
,
Object
>
query
);
void
insert_word
(
Map
<
String
,
Object
>
entity
);
void
update_word
(
Map
<
String
,
Object
>
entity
);
void
delete_word
(
List
<
String
>
listKey
);
void
insert_sensitive_word_cache
();
}
src_jwapp/com/jw/app/business/forum/classify/ClassifyBusinessImpl.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
business
.
forum
.
classify
;
import
java.io.IOException
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.session.RowBounds
;
import
com.gaowj.business.util.Page
;
import
com.gaowj.business.util.SessionUtil
;
import
com.jw.app.business.ForumClassifyBusiness
;
import
com.jw.app.business.utils.QueryParamUtil
;
public
class
ClassifyBusinessImpl
implements
ForumClassifyBusiness
{
private
classifyDAO
classifyDAO
;
public
classifyDAO
getClassifyDAO
()
{
return
classifyDAO
;
}
public
void
setClassifyDAO
(
classifyDAO
classifyDAO
)
{
this
.
classifyDAO
=
classifyDAO
;
}
@Override
public
Page
<
Map
<
String
,
Object
>>
list
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
{
// 计算起始记录
int
pageStart
=
(
pageNo
-
1
)
*
pageSize
;
if
(
query
.
get
(
"CLASSIFY_NAME"
)
!=
null
&&
!
""
.
equals
(
query
.
get
(
"CLASSIFY_NAME"
)))
{
query
.
put
(
"CLASSIFY_NAME_LIKE"
,
"%"
+
query
.
get
(
"CLASSIFY_NAME"
)
+
"%"
);
}
List
<
Map
<
String
,
Object
>>
items
=
classifyDAO
.
list_classify
(
new
RowBounds
(
pageStart
,
pageSize
),
query
);
int
count
=
classifyDAO
.
list_count_classify
(
query
);
// 创建分页对象
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<
Map
<
String
,
Object
>>();
page
.
setStart
(
pageStart
);
page
.
setLimit
(
pageSize
);
page
.
setCount
(
count
);
page
.
setItems
(
items
);
return
page
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
list
(
Map
<
String
,
Object
>
query
)
{
List
<
Map
<
String
,
Object
>>
listData
=
null
;
try
{
listData
=
QueryParamUtil
.
ClobToString
(
classifyDAO
.
list_classify
(
query
));
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
listData
;
}
@Override
public
void
insert_classify
(
Map
<
String
,
Object
>
entity
)
{
if
(
entity
.
get
(
"UUID"
)
==
null
)
{
entity
.
put
(
"UUID"
,
java
.
util
.
UUID
.
randomUUID
().
toString
());
}
if
(
entity
.
get
(
"CREATE_ID"
)
==
null
)
{
entity
.
put
(
"CREATE_ID"
,
SessionUtil
.
getCode
());
}
if
(
entity
.
get
(
"CREATE_TIME"
)
==
null
)
{
entity
.
put
(
"CREATE_TIME"
,
new
Date
());
}
if
(
entity
.
get
(
"UPDATE_ID"
)
==
null
)
{
entity
.
put
(
"UPDATE_ID"
,
SessionUtil
.
getCode
());
}
if
(
entity
.
get
(
"UPDATE_TIME"
)
==
null
)
{
entity
.
put
(
"UPDATE_TIME"
,
new
Date
());
}
List
<
String
>
infoListKey
=
new
ArrayList
<
String
>();
List
<
Object
>
infoList
=
new
ArrayList
<
Object
>();
if
(
entity
.
keySet
()
!=
null
)
{
Set
<
String
>
key
=
entity
.
keySet
();
// 将map集合中的key和value 取出来分别放到list集合里
for
(
String
str
:
key
)
{
infoList
.
add
(
entity
.
get
(
str
));
infoListKey
.
add
(
str
);
}
entity
.
put
(
"infoListKey"
,
infoListKey
);
entity
.
put
(
"infoList"
,
infoList
);
// 插入分类信息
classifyDAO
.
insert_classify
(
entity
);
}
}
@Override
public
void
update_classify
(
Map
<
String
,
Object
>
entity
)
{
if
(
entity
.
get
(
"UPDATE_TIME"
)
==
null
)
{
entity
.
put
(
"UPDATE_TIME"
,
new
Date
());
}
if
(
entity
.
get
(
"UPDATE_ID"
)
==
null
)
{
entity
.
put
(
"UPDATE_ID"
,
SessionUtil
.
getCode
());
}
// 动态传值修改
List
<
Map
<
String
,
Object
>>
updateList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
if
(
entity
.
keySet
()
!=
null
)
{
Set
<
String
>
key
=
entity
.
keySet
();
// 将map集合中的key和value 取出来分别放到list集合里
for
(
String
str
:
key
)
{
Map
<
String
,
Object
>
updateMap
=
new
HashMap
<
String
,
Object
>();
if
(
StringUtils
.
equalsIgnoreCase
(
"UUID"
,
str
))
continue
;
updateMap
.
put
(
"key"
,
str
);
updateMap
.
put
(
"value"
,
entity
.
get
(
str
));
updateList
.
add
(
updateMap
);
}
entity
.
put
(
"info"
,
updateList
);
//
classifyDAO
.
update_classify
(
entity
);
}
}
@Override
public
void
delete_classify
(
List
<
String
>
listKey
)
{
classifyDAO
.
delete_classify
(
listKey
);
}
@Override
public
void
resume_classify
(
List
<
String
>
listKey
)
{
classifyDAO
.
resume_classify
(
listKey
);
}
@Override
public
void
delete_true_classify
(
List
<
String
>
listKey
)
{
classifyDAO
.
delete_true_classify
(
listKey
);
}
}
src_jwapp/com/jw/app/business/forum/classify/classifyDAO.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
business
.
forum
.
classify
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.session.RowBounds
;
import
com.gaowj.business.exception.BusinessException
;
public
interface
classifyDAO
{
void
insert_classify
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_classify
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
delete_classify
(
List
<
String
>
list
)
throws
BusinessException
;
void
resume_classify
(
List
<
String
>
list
)
throws
BusinessException
;
void
delete_true_classify
(
List
<
String
>
list
)
throws
BusinessException
;
int
list_count_classify
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_classify
(
RowBounds
rowBounds
,
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_classify
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
}
src_jwapp/com/jw/app/business/forum/classify/classifyDAO.xml
0 → 100644
View file @
07d9f753
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jw.app.business.forum.classify.classifyDAO"
>
<sql
id=
"where_classify"
>
<where>
<trim
prefixOverrides=
"AND |OR"
>
<if
test=
"CLASSIFY_NAME_LIKE != null and CLASSIFY_NAME_LIKE != ''"
>
and fc.CLASSIFY_NAME LIKE #{CLASSIFY_NAME_LIKE}
</if>
<if
test=
"UUID != null and UUID != ''"
>
and fc.UUID = #{UUID}
</if>
<if
test=
"DELETE_FLAG != null and DELETE_FLAG != ''"
>
and fc.DELETE_FLAG = #{DELETE_FLAG}
</if>
</trim>
</where>
</sql>
<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
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
]]>
<include
refid=
"where_classify"
/>
order by fc.CREATE_TIME
</select>
<select
id=
"list_count_classify"
parameterType=
"map"
resultType=
"int"
>
<![CDATA[
SELECT 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
]]>
<include
refid=
"where_classify"
/>
</select>
<insert
id=
"insert_classify"
parameterType=
"map"
>
insert into forum_classify(
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"infoListKey"
item=
"key"
>
${key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"infoList"
item=
"value"
>
#{value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<update
id=
"update_classify"
parameterType=
"map"
>
<![CDATA[
update forum_classify set
]]>
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"info"
item=
"info"
>
${info.key} = #{info.value} ,
</foreach>
</trim>
<where>
<if
test=
"UUID != null and UUID != ''"
>
and UUID = #{UUID}
</if>
</where>
</update>
<update
id=
"delete_classify"
parameterType=
"java.util.List"
>
<![CDATA[
update forum_classify set DELETE_FLAG = '1' where UUID IN
]]>
<foreach
collection=
"list"
item=
"UUID"
open=
"("
separator=
","
close=
")"
>
#{UUID}
</foreach>
</update>
<delete
id=
"resume_classify"
parameterType=
"list"
>
<![CDATA[
update forum_classify set DELETE_FLAG = '0' where UUID IN
]]>
<foreach
collection=
"list"
item=
"UUID"
open=
"("
separator=
","
close=
")"
>
#{UUID}
</foreach>
</delete>
<delete
id=
"delete_true_classify"
parameterType=
"list"
>
<![CDATA[
delete from forum_classify where DELETE_FLAG = '1' and UUID IN
]]>
<foreach
collection=
"list"
item=
"UUID"
open=
"("
separator=
","
close=
")"
>
#{UUID}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src_jwapp/com/jw/app/business/forum/topic/TopicBusinessImpl.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
business
.
forum
.
topic
;
import
java.io.IOException
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.session.RowBounds
;
import
com.gaowj.business.util.Page
;
import
com.gaowj.business.util.SessionUtil
;
import
com.jw.app.business.ForumTopicBusiness
;
import
com.jw.app.business.utils.QueryParamUtil
;
public
class
TopicBusinessImpl
implements
ForumTopicBusiness
{
private
topicDAO
topicDAO
;
public
topicDAO
getTopicDAO
()
{
return
topicDAO
;
}
public
void
setTopicDAO
(
topicDAO
topicDAO
)
{
this
.
topicDAO
=
topicDAO
;
}
@Override
public
Page
<
Map
<
String
,
Object
>>
listTopic
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
{
// 计算起始记录
int
pageStart
=
(
pageNo
-
1
)
*
pageSize
;
if
(
query
.
get
(
"TITLE"
)
!=
null
&&
!
""
.
equals
(
query
.
get
(
"TITLE"
)))
{
query
.
put
(
"TITLE_LIKE"
,
"%"
+
query
.
get
(
"TITLE"
)
+
"%"
);
}
List
<
Map
<
String
,
Object
>>
items
=
topicDAO
.
list_topic
(
new
RowBounds
(
pageStart
,
pageSize
),
query
);
int
count
=
topicDAO
.
list_count_topic
(
query
);
// 创建分页对象
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<
Map
<
String
,
Object
>>();
page
.
setStart
(
pageStart
);
page
.
setLimit
(
pageSize
);
page
.
setCount
(
count
);
page
.
setItems
(
items
);
return
page
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
listTopic
(
Map
<
String
,
Object
>
query
)
{
List
<
Map
<
String
,
Object
>>
listData
=
null
;
try
{
listData
=
QueryParamUtil
.
ClobToString
(
topicDAO
.
list_topic
(
query
));
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
listData
;
}
@Override
public
void
insert_topic
(
Map
<
String
,
Object
>
entity
)
{
if
(
entity
.
get
(
"UUID"
)
==
null
)
{
entity
.
put
(
"UUID"
,
java
.
util
.
UUID
.
randomUUID
().
toString
());
}
if
(
entity
.
get
(
"CREATE_ID"
)
==
null
)
{
entity
.
put
(
"CREATE_ID"
,
SessionUtil
.
getCode
());
}
if
(
entity
.
get
(
"CREATE_TIME"
)
==
null
)
{
entity
.
put
(
"CREATE_TIME"
,
new
Date
());
}
if
(
entity
.
get
(
"UPDATE_ID"
)
==
null
)
{
entity
.
put
(
"UPDATE_ID"
,
SessionUtil
.
getCode
());
}
if
(
entity
.
get
(
"UPDATE_TIME"
)
==
null
)
{
entity
.
put
(
"UPDATE_TIME"
,
new
Date
());
}
if
(
entity
.
get
(
"POST_USER"
)
==
null
){
entity
.
put
(
"POST_USER"
,
SessionUtil
.
getCode
());
}
if
(
entity
.
get
(
"POST_TIME"
)
==
null
)
{
entity
.
put
(
"POST_TIME"
,
new
Date
());
}
List
<
String
>
infoListKey
=
new
ArrayList
<
String
>();
List
<
Object
>
infoList
=
new
ArrayList
<
Object
>();
if
(
entity
.
keySet
()
!=
null
)
{
Set
<
String
>
key
=
entity
.
keySet
();
// 将map集合中的key和value 取出来分别放到list集合里
for
(
String
str
:
key
)
{
infoList
.
add
(
entity
.
get
(
str
));
infoListKey
.
add
(
str
);
}
entity
.
put
(
"infoListKey"
,
infoListKey
);
entity
.
put
(
"infoList"
,
infoList
);
// 插入收件信息
topicDAO
.
insert_topic
(
entity
);
}
}
@Override
public
void
update_topic
(
Map
<
String
,
Object
>
entity
)
{
if
(
entity
.
get
(
"UPDATE_TIME"
)
==
null
)
{
entity
.
put
(
"UPDATE_TIME"
,
new
Date
());
}
if
(
entity
.
get
(
"UPDATE_ID"
)
==
null
)
{
entity
.
put
(
"UPDATE_ID"
,
SessionUtil
.
getCode
());
}
// 动态传值修改
List
<
Map
<
String
,
Object
>>
updateList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
if
(
entity
.
keySet
()
!=
null
)
{
Set
<
String
>
key
=
entity
.
keySet
();
// 将map集合中的key和value 取出来分别放到list集合里
for
(
String
str
:
key
)
{
Map
<
String
,
Object
>
updateMap
=
new
HashMap
<
String
,
Object
>();
if
(
StringUtils
.
equalsIgnoreCase
(
"UUID"
,
str
))
continue
;
updateMap
.
put
(
"key"
,
str
);
updateMap
.
put
(
"value"
,
entity
.
get
(
str
));
updateList
.
add
(
updateMap
);
}
entity
.
put
(
"info"
,
updateList
);
//
topicDAO
.
update_topic
(
entity
);
}
}
@Override
public
void
delete_topic
(
List
<
String
>
listKey
)
{
topicDAO
.
delete_topic
(
listKey
);
}
@Override
public
void
resume_topic
(
List
<
String
>
listKey
)
{
topicDAO
.
resume_topic
(
listKey
);
}
@Override
public
void
delete_true_topic
(
List
<
String
>
listKey
)
{
topicDAO
.
delete_true_topic
(
listKey
);
}
@Override
public
Page
<
Map
<
String
,
Object
>>
listTopicReply
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
{
// 计算起始记录
int
pageStart
=
(
pageNo
-
1
)
*
pageSize
;
List
<
Map
<
String
,
Object
>>
items
=
topicDAO
.
list_topic_reply
(
new
RowBounds
(
pageStart
,
pageSize
),
query
);
int
count
=
topicDAO
.
list_count_topic_reply
(
query
);
// 创建分页对象
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<
Map
<
String
,
Object
>>();
page
.
setStart
(
pageStart
);
page
.
setLimit
(
pageSize
);
page
.
setCount
(
count
);
page
.
setItems
(
items
);
return
page
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
listTopicReply
(
Map
<
String
,
Object
>
query
)
{
List
<
Map
<
String
,
Object
>>
listData
=
null
;
try
{
listData
=
QueryParamUtil
.
ClobToString
(
topicDAO
.
list_topic_reply
(
query
));
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
listData
;
}
@Override
public
void
insert_topic_reply
(
Map
<
String
,
Object
>
entity
)
{
if
(
entity
.
get
(
"UUID"
)
==
null
)
{
entity
.
put
(
"UUID"
,
java
.
util
.
UUID
.
randomUUID
().
toString
());
}
if
(
entity
.
get
(
"CREATE_ID"
)
==
null
)
{
entity
.
put
(
"CREATE_ID"
,
SessionUtil
.
getCode
());
}
if
(
entity
.
get
(
"CREATE_TIME"
)
==
null
)
{
entity
.
put
(
"CREATE_TIME"
,
new
Date
());
}
if
(
entity
.
get
(
"UPDATE_ID"
)
==
null
)
{
entity
.
put
(
"UPDATE_ID"
,
SessionUtil
.
getCode
());
}
if
(
entity
.
get
(
"UPDATE_TIME"
)
==
null
)
{
entity
.
put
(
"UPDATE_TIME"
,
new
Date
());
}
if
(
entity
.
get
(
"REPLY_USER"
)
==
null
){
entity
.
put
(
"REPLY_USER"
,
SessionUtil
.
getCode
());
}
if
(
entity
.
get
(
"REPLY_TIME"
)
==
null
)
{
entity
.
put
(
"REPLY_TIME"
,
new
Date
());
}
List
<
String
>
infoListKey
=
new
ArrayList
<
String
>();
List
<
Object
>
infoList
=
new
ArrayList
<
Object
>();
if
(
entity
.
keySet
()
!=
null
)
{
Set
<
String
>
key
=
entity
.
keySet
();
// 将map集合中的key和value 取出来分别放到list集合里
for
(
String
str
:
key
)
{
infoList
.
add
(
entity
.
get
(
str
));
infoListKey
.
add
(
str
);
}
entity
.
put
(
"infoListKey"
,
infoListKey
);
entity
.
put
(
"infoList"
,
infoList
);
// 插入收件信息
topicDAO
.
insert_topic_reply
(
entity
);
}
}
@Override
public
void
delete_topic_reply
(
List
<
String
>
listKey
)
{
topicDAO
.
delete_topic_reply
(
listKey
);
}
@Override
public
void
resume_topic_reply
(
List
<
String
>
listKey
)
{
topicDAO
.
resume_topic_reply
(
listKey
);
}
@Override
public
void
delete_true_topic_reply
(
List
<
String
>
listKey
)
{
topicDAO
.
delete_true_topic_reply
(
listKey
);
}
}
src_jwapp/com/jw/app/business/forum/topic/topicDAO.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
business
.
forum
.
topic
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.session.RowBounds
;
import
com.gaowj.business.exception.BusinessException
;
public
interface
topicDAO
{
void
insert_topic
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_topic
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
delete_topic
(
List
<
String
>
list
)
throws
BusinessException
;
void
resume_topic
(
List
<
String
>
list
)
throws
BusinessException
;
void
delete_true_topic
(
List
<
String
>
list
)
throws
BusinessException
;
int
list_count_topic
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_topic
(
RowBounds
rowBounds
,
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_topic
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
insert_topic_reply
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_topic_reply
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
delete_topic_reply
(
List
<
String
>
list
)
throws
BusinessException
;
void
resume_topic_reply
(
List
<
String
>
list
)
throws
BusinessException
;
void
delete_true_topic_reply
(
List
<
String
>
list
)
throws
BusinessException
;
int
list_count_topic_reply
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_topic_reply
(
RowBounds
rowBounds
,
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_topic_reply
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
delete_reply_by_topic_id
(
List
<
String
>
list
)
throws
BusinessException
;
}
src_jwapp/com/jw/app/business/forum/topic/topicDAO.xml
0 → 100644
View file @
07d9f753
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jw.app.business.forum.topic.topicDAO"
>
<sql
id=
"where_topic"
>
<where>
<trim
prefixOverrides=
"AND |OR"
>
<if
test=
"UUID != null and UUID != ''"
>
and ft.UUID = #{UUID}
</if>
<if
test=
"TITLE_LIKE != null and TITLE_LIKE != ''"
>
and ft.TITLE LIKE #{TITLE_LIKE}
</if>
<if
test=
"CLASSIFY_ID != null and CLASSIFY_ID != ''"
>
and ft.CLASSIFY_ID = #{CLASSIFY_ID}
</if>
<if
test=
"STICK_FLAG != null and STICK_FLAG != ''"
>
and ft.STICK_FLAG = #{STICK_FLAG}
</if>
</trim>
</where>
</sql>
<sql
id=
"where_topic_reply"
>
<where>
<trim
prefixOverrides=
"AND |OR"
>
<if
test=
"UUID != null and UUID != ''"
>
and ftr.UUID = #{UUID}
</if>
<if
test=
"TOPIC_ID != null and TOPIC_ID != ''"
>
and ftr.TOPIC_ID = #{TOPIC_ID}
</if>
<if
test=
"REPLY_USER != null and REPLY_USER != ''"
>
and ftr.REPLY_USER = #{REPLY_USER}
</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,
uu2.USER_NAME AS CREATE_USER_NAME,
uu3.USER_NAME AS UPDATE_USER_NAME,
IFNULL(vtr.reply_count,0) AS REPLY_COUNT
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 view_forum_topic_reply vtr ON vtr.topic_id = ft.uuid
]]>
<include
refid=
"where_topic"
/>
ORDER BY ft.stick_flag DESC,ft.post_time DESC
</select>
<select
id=
"list_count_topic"
parameterType=
"map"
resultType=
"int"
>
<![CDATA[
SELECT COUNT(*)
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 view_forum_topic_reply vtr ON vtr.topic_id = ft.uuid
]]>
<include
refid=
"where_topic"
/>
</select>
<insert
id=
"insert_topic"
parameterType=
"map"
>
insert into forum_topic(
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"infoListKey"
item=
"key"
>
${key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"infoList"
item=
"value"
>
#{value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<update
id=
"update_topic"
parameterType=
"map"
>
<![CDATA[
update forum_topic set
]]>
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"info"
item=
"info"
>
${info.key} = #{info.value} ,
</foreach>
</trim>
<where>
<if
test=
"UUID != null and UUID != ''"
>
and UUID = #{UUID}
</if>
</where>
</update>
<update
id=
"delete_topic"
parameterType=
"java.util.List"
>
<![CDATA[
update forum_topic set DELETE_FLAG = '1' where UUID IN
]]>
<foreach
collection=
"list"
item=
"UUID"
open=
"("
separator=
","
close=
")"
>
#{UUID}
</foreach>
</update>
<delete
id=
"resume_topic"
parameterType=
"list"
>
<![CDATA[
update forum_topic set DELETE_FLAG = '0' where UUID IN
]]>
<foreach
collection=
"list"
item=
"UUID"
open=
"("
separator=
","
close=
")"
>
#{UUID}
</foreach>
</delete>
<delete
id=
"delete_true_topic"
parameterType=
"list"
>
<![CDATA[
delete from forum_topic where DELETE_FLAG = '1' and UUID IN
]]>
<foreach
collection=
"list"
item=
"UUID"
open=
"("
separator=
","
close=
")"
>
#{UUID}
</foreach>
</delete>
<select
id=
"list_topic_reply"
parameterType=
"map"
resultType=
"upperCaseKeyMap"
>
<![CDATA[
SELECT
ftr.*, ft.classify_id, ft.title,
ft.content AS TOPIC_CONTENT,
ft.post_time, ft.post_user,
uu1.USER_NAME AS REPLY_USER_NAME
FROM forum_topic_reply ftr
LEFT JOIN forum_topic ft ON ftr.topic_id = ft.uuid
LEFT JOIN uicm_user uu1 ON ftr.reply_user = uu1.USER_ID
]]>
<include
refid=
"where_topic_reply"
/>
order by ftr.REPLY_TIME ASC
</select>
<select
id=
"list_count_topic_reply"
parameterType=
"map"
resultType=
"int"
>
<![CDATA[
SELECT COUNT(*)
FROM forum_topic_reply ftr
LEFT JOIN forum_topic ft ON ftr.topic_id = ft.uuid
LEFT JOIN uicm_user uu1 ON ftr.reply_user = uu1.USER_ID
]]>
<include
refid=
"where_topic_reply"
/>
</select>
<insert
id=
"insert_topic_reply"
parameterType=
"map"
>
insert into forum_topic_reply(
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"infoListKey"
item=
"key"
>
${key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"infoList"
item=
"value"
>
#{value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<update
id=
"update_topic_reply"
parameterType=
"map"
>
<![CDATA[
update forum_topic_reply set
]]>
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"info"
item=
"info"
>
${info.key} = #{info.value} ,
</foreach>
</trim>
<where>
<if
test=
"UUID != null and UUID != ''"
>
and UUID = #{UUID}
</if>
</where>
</update>
<update
id=
"delete_topic_reply"
parameterType=
"java.util.List"
>
<![CDATA[
update forum_topic_reply set DELETE_FLAG = '1' where UUID IN
]]>
<foreach
collection=
"list"
item=
"UUID"
open=
"("
separator=
","
close=
")"
>
#{UUID}
</foreach>
</update>
<delete
id=
"resume_topic_reply"
parameterType=
"list"
>
<![CDATA[
update forum_topic_reply set DELETE_FLAG = '0' where UUID IN
]]>
<foreach
collection=
"list"
item=
"UUID"
open=
"("
separator=
","
close=
")"
>
#{UUID}
</foreach>
</delete>
<delete
id=
"delete_true_topic_reply"
parameterType=
"list"
>
<![CDATA[
delete from forum_topic_reply where DELETE_FLAG = '1' and UUID IN
]]>
<foreach
collection=
"list"
item=
"UUID"
open=
"("
separator=
","
close=
")"
>
#{UUID}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src_jwapp/com/jw/app/business/forum/word/WordBusinessImpl.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
business
.
forum
.
word
;
import
java.io.IOException
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.ibatis.session.RowBounds
;
import
com.gaowj.business.util.Page
;
import
com.gaowj.business.util.SensitivewordUtil
;
import
com.gaowj.business.util.SessionUtil
;
import
com.gaowj.business.util.model.SensitiveWordInit
;
import
com.jw.app.business.ForumWordBusiness
;
import
com.jw.app.business.utils.QueryParamUtil
;
public
class
WordBusinessImpl
implements
ForumWordBusiness
{
private
wordDAO
wordDAO
;
public
wordDAO
getWordDAO
()
{
return
wordDAO
;
}
public
void
setWordDAO
(
wordDAO
wordDAO
)
{
this
.
wordDAO
=
wordDAO
;
}
@Override
public
Page
<
Map
<
String
,
Object
>>
listWord
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
{
// 计算起始记录
int
pageStart
=
(
pageNo
-
1
)
*
pageSize
;
if
(
query
.
get
(
"WORD"
)
!=
null
&&
!
""
.
equals
(
query
.
get
(
"WORD"
)))
{
query
.
put
(
"WORD_LIKE"
,
"%"
+
query
.
get
(
"WORD"
)
+
"%"
);
}
List
<
Map
<
String
,
Object
>>
items
=
wordDAO
.
list_word
(
new
RowBounds
(
pageStart
,
pageSize
),
query
);
int
count
=
wordDAO
.
list_count_word
(
query
);
// 创建分页对象
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<
Map
<
String
,
Object
>>();
page
.
setStart
(
pageStart
);
page
.
setLimit
(
pageSize
);
page
.
setCount
(
count
);
page
.
setItems
(
items
);
return
page
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
listWord
(
Map
<
String
,
Object
>
query
)
{
List
<
Map
<
String
,
Object
>>
listData
=
null
;
try
{
listData
=
QueryParamUtil
.
ClobToString
(
wordDAO
.
list_word
(
query
));
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
listData
;
}
@Override
public
void
insert_word
(
Map
<
String
,
Object
>
entity
)
{
if
(
entity
.
get
(
"UUID"
)
==
null
)
{
entity
.
put
(
"UUID"
,
java
.
util
.
UUID
.
randomUUID
().
toString
());
}
if
(
entity
.
get
(
"CREATE_ID"
)
==
null
)
{
entity
.
put
(
"CREATE_ID"
,
SessionUtil
.
getCode
());
}
if
(
entity
.
get
(
"CREATE_TIME"
)
==
null
)
{
entity
.
put
(
"CREATE_TIME"
,
new
Date
());
}
if
(
entity
.
get
(
"UPDATE_ID"
)
==
null
)
{
entity
.
put
(
"UPDATE_ID"
,
SessionUtil
.
getCode
());
}
if
(
entity
.
get
(
"UPDATE_TIME"
)
==
null
)
{
entity
.
put
(
"UPDATE_TIME"
,
new
Date
());
}
List
<
String
>
infoListKey
=
new
ArrayList
<
String
>();
List
<
Object
>
infoList
=
new
ArrayList
<
Object
>();
if
(
entity
.
keySet
()
!=
null
)
{
Set
<
String
>
key
=
entity
.
keySet
();
// 将map集合中的key和value 取出来分别放到list集合里
for
(
String
str
:
key
)
{
infoList
.
add
(
entity
.
get
(
str
));
infoListKey
.
add
(
str
);
}
entity
.
put
(
"infoListKey"
,
infoListKey
);
entity
.
put
(
"infoList"
,
infoList
);
// 插入分类信息
wordDAO
.
insert_word
(
entity
);
}
}
@Override
public
void
update_word
(
Map
<
String
,
Object
>
entity
)
{
if
(
entity
.
get
(
"UPDATE_TIME"
)
==
null
)
{
entity
.
put
(
"UPDATE_TIME"
,
new
Date
());
}
if
(
entity
.
get
(
"UPDATE_ID"
)
==
null
)
{
entity
.
put
(
"UPDATE_ID"
,
SessionUtil
.
getCode
());
}
// 动态传值修改
List
<
Map
<
String
,
Object
>>
updateList
=
new
ArrayList
<
Map
<
String
,
Object
>>();
if
(
entity
.
keySet
()
!=
null
)
{
Set
<
String
>
key
=
entity
.
keySet
();
// 将map集合中的key和value 取出来分别放到list集合里
for
(
String
str
:
key
)
{
Map
<
String
,
Object
>
updateMap
=
new
HashMap
<
String
,
Object
>();
if
(
StringUtils
.
equalsIgnoreCase
(
"UUID"
,
str
))
continue
;
updateMap
.
put
(
"key"
,
str
);
updateMap
.
put
(
"value"
,
entity
.
get
(
str
));
updateList
.
add
(
updateMap
);
}
entity
.
put
(
"info"
,
updateList
);
//
wordDAO
.
update_word
(
entity
);
}
}
@Override
public
void
delete_word
(
List
<
String
>
listKey
)
{
wordDAO
.
delete_word
(
listKey
);
}
@Override
public
void
insert_sensitive_word_cache
()
{
// 初始化敏感词库对象
SensitiveWordInit
sensitiveWordInit
=
new
SensitiveWordInit
();
// 从数据库中获取敏感词对象集合
Map
<
String
,
Object
>
entity
=
new
HashMap
<
String
,
Object
>();
entity
.
put
(
"STATE_FLAG"
,
0
);
List
<
Map
<
String
,
Object
>>
sensitiveWords
=
wordDAO
.
list_word
(
entity
);
// 构建敏感词库
Map
sensitiveWordMap
=
sensitiveWordInit
.
initKeyWord
(
sensitiveWords
);
// 传入SensitivewordUtil类中的敏感词库
SensitivewordUtil
.
sensitiveWordMap
=
sensitiveWordMap
;
}
}
src_jwapp/com/jw/app/business/forum/word/wordDAO.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
business
.
forum
.
word
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.session.RowBounds
;
import
com.gaowj.business.exception.BusinessException
;
public
interface
wordDAO
{
void
insert_word
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_word
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
delete_word
(
List
<
String
>
list
)
throws
BusinessException
;
int
list_count_word
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_word
(
RowBounds
rowBounds
,
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_word
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
}
src_jwapp/com/jw/app/business/forum/word/wordDAO.xml
0 → 100644
View file @
07d9f753
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jw.app.business.forum.word.wordDAO"
>
<sql
id=
"where_word"
>
<where>
<trim
prefixOverrides=
"AND |OR"
>
<if
test=
"WORD_LIKE != null and WORD_LIKE != ''"
>
and fsw.WORD LIKE #{WORD_LIKE}
</if>
<if
test=
"UUID != null and UUID != ''"
>
and fsw.UUID = #{UUID}
</if>
<if
test=
"LEVEL_NUM != null and LEVEL_NUM != ''"
>
and fsw.LEVEL_NUM = #{LEVEL_NUM}
</if>
</trim>
</where>
</sql>
<select
id=
"list_word"
parameterType=
"map"
resultType=
"upperCaseKeyMap"
>
<![CDATA[
SELECT
fsw.*,
uu1.USER_NAME AS CREATE_USER_NAME,
uu2.USER_NAME AS UPDATE_USER_NAME
FROM
forum_sensitive_word fsw
LEFT JOIN uicm_user uu1 ON fsw.CREATE_ID = uu1.USER_ID
LEFT JOIN uicm_user uu2 ON fsw.UPDATE_ID = uu2.USER_ID
]]>
<include
refid=
"where_word"
/>
order by fsw.CREATE_TIME
</select>
<select
id=
"list_count_word"
parameterType=
"map"
resultType=
"int"
>
<![CDATA[
SELECT COUNT(*)
FROM
forum_sensitive_word fsw
LEFT JOIN uicm_user uu1 ON fsw.CREATE_ID = uu1.USER_ID
LEFT JOIN uicm_user uu2 ON fsw.UPDATE_ID = uu2.USER_ID
]]>
<include
refid=
"where_word"
/>
</select>
<insert
id=
"insert_word"
parameterType=
"map"
>
insert into forum_sensitive_word(
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"infoListKey"
item=
"key"
>
${key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"infoList"
item=
"value"
>
#{value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<update
id=
"update_word"
parameterType=
"map"
>
<![CDATA[
update forum_sensitive_word set
]]>
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"info"
item=
"info"
>
${info.key} = #{info.value} ,
</foreach>
</trim>
<where>
<if
test=
"UUID != null and UUID != ''"
>
and UUID = #{UUID}
</if>
</where>
</update>
<update
id=
"delete_word"
parameterType=
"java.util.List"
>
<![CDATA[
delete from forum_sensitive_word where UUID IN
]]>
<foreach
collection=
"list"
item=
"UUID"
open=
"("
separator=
","
close=
")"
>
#{UUID}
</foreach>
</update>
</mapper>
\ No newline at end of file
src_jwapp/com/jw/app/forum/classify/action/actAction.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
forum
.
classify
.
action
;
import
java.io.File
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.lang.StringUtils
;
import
com.gaowj.business.SystemOpeBusiness
;
import
com.gaowj.business.action.BasicAction
;
import
com.gaowj.business.comp.BusinessManager
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.PropUtil
;
import
com.gaowj.business.util.QueryParamUtil
;
import
com.gaowj.business.util.RequestUtils
;
import
com.gaowj.business.util.SessionUtil
;
import
com.gaowj.business.util.Status
;
import
com.gaowj.util.AuthenticateUtil
;
import
com.jw.app.business.ForumClassifyBusiness
;
import
net.sf.json.JSONObject
;
public
class
actAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
4288710492337967286L
;
private
JSONObject
jsonObject
=
new
JSONObject
();
public
JSONObject
getJsonObject
()
{
return
jsonObject
;
}
public
void
setJsonObject
(
JSONObject
jsonObject
)
{
this
.
jsonObject
=
jsonObject
;
}
/**
* 插入
* @param entity
* @throws BusinessException
*/
public
String
insertClassify
()
throws
BusinessException
{
ForumClassifyBusiness
business
=
BusinessManager
.
getBusiness
(
ForumClassifyBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
entity
=
QueryParamUtil
.
StringToDate
(
entity
);
// 去除不要更新的字段
entity
.
remove
(
"OPETYPE"
);
// 新增
business
.
insert_classify
(
entity
);
// 操作日志
SystemOpeBusiness
sysbusiness
=
BusinessManager
.
getBusiness
(
SystemOpeBusiness
.
class
);
sysbusiness
.
insert_logBusiness
(
"insertClassify"
,
""
+
entity
,
"添加版块"
,
(
String
)
entity
.
get
(
"UUID"
),
(
String
)
entity
.
get
(
"CLASSIFY_NAME"
),
"classify"
);
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"保存成功"
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"保存失败"
));
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 更新分类
* @param entity
* @throws BusinessException
*/
public
String
updateClassify
()
throws
BusinessException
{
ForumClassifyBusiness
business
=
BusinessManager
.
getBusiness
(
ForumClassifyBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
//修改
entity
=
QueryParamUtil
.
StringToDate
(
entity
);
// 去除不要更新的字段
entity
.
remove
(
"OPETYPE"
);
business
.
update_classify
(
entity
);
// 操作日志
SystemOpeBusiness
sysbusiness
=
BusinessManager
.
getBusiness
(
SystemOpeBusiness
.
class
);
sysbusiness
.
insert_logBusiness
(
"updateClassify"
,
""
+
entity
,
"更新版块信息"
,(
String
)
entity
.
get
(
"UUID"
),
(
String
)
entity
.
get
(
"CLASSIFY_NAME"
),
"classify"
);
//
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"修改成功"
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"修改失败"
));
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 软删除
* @param entity
* @throws BusinessException
*/
public
String
deleteClassify
()
throws
BusinessException
{
ForumClassifyBusiness
business
=
BusinessManager
.
getBusiness
(
ForumClassifyBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
String
deletekey
=
(
String
)
entity
.
get
(
"CODE"
);
List
<
String
>
ListKey
=
QueryParamUtil
.
StringToList
(
deletekey
);
try
{
business
.
delete_classify
(
ListKey
);
// 操作日志
SystemOpeBusiness
sysbusiness
=
BusinessManager
.
getBusiness
(
SystemOpeBusiness
.
class
);
sysbusiness
.
insert_logBusiness
(
"deleteClassify"
,
""
+
ListKey
,
"软删除版块信息"
,
deletekey
,
"多个流水号"
,
"classify"
);
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"软删除成功"
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"软删除失败"
));
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 恢复删除的分类
* @param entity
* @throws BusinessException
*/
public
String
resumeClassify
()
throws
BusinessException
{
ForumClassifyBusiness
business
=
BusinessManager
.
getBusiness
(
ForumClassifyBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
String
deletekey
=
(
String
)
entity
.
get
(
"CODE"
);
List
<
String
>
ListKey
=
QueryParamUtil
.
StringToList
(
deletekey
);
try
{
business
.
resume_classify
(
ListKey
);
// 操作日志
SystemOpeBusiness
sysbusiness
=
BusinessManager
.
getBusiness
(
SystemOpeBusiness
.
class
);
sysbusiness
.
insert_logBusiness
(
"resumeClassify"
,
""
+
ListKey
,
"恢复版块信息"
,
deletekey
,
"多个流水号"
,
"classify"
);
//
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"恢复成功"
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"恢复失败"
));
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 在软删除基础上删除记录
* @param entity
* @throws BusinessException
*/
public
String
deleteTrueClassify
()
throws
BusinessException
{
ForumClassifyBusiness
business
=
BusinessManager
.
getBusiness
(
ForumClassifyBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
String
deletekey
=
(
String
)
entity
.
get
(
"CODE"
);
List
<
String
>
ListKey
=
QueryParamUtil
.
StringToList
(
deletekey
);
try
{
business
.
delete_true_classify
(
ListKey
);
// 操作日志
SystemOpeBusiness
sysbusiness
=
BusinessManager
.
getBusiness
(
SystemOpeBusiness
.
class
);
sysbusiness
.
insert_logBusiness
(
"deleteTrueClassify"
,
""
+
ListKey
,
"删除"
,
deletekey
,
"多个流水号"
,
"classify"
);
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"删除成功"
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"删除失败"
));
e
.
printStackTrace
();
}
return
"json"
;
}
public
String
upload
()
throws
BusinessException
{
String
savePath
=
""
;
if
(
StringUtils
.
isEmpty
(
savePath
))
savePath
=
AuthenticateUtil
.
getEndpoint
(
"uploadPath"
);
if
(
StringUtils
.
isEmpty
(
savePath
))
savePath
=
request
.
getSession
().
getServletContext
().
getRealPath
(
"/uploadFile/file/"
);
try
{
savePath
=
setFilepath
(
savePath
,
true
);
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
super
.
setUserUploadFilePath
(
savePath
);
super
.
upload
();
String
ret
=
super
.
getUserUploadFileResult
();
// 操作日志
SystemOpeBusiness
sysbusiness
=
BusinessManager
.
getBusiness
(
SystemOpeBusiness
.
class
);
sysbusiness
.
insert_logBusiness
(
"upload"
,
"用户["
+
SessionUtil
.
getEmname
()+
"]上传论坛分类图片:"
+
ret
,
"上传文件"
,
ret
,
"上传文件:"
+
super
.
getUserFileFileName
(),
"forumClassify"
);
//
return
null
;
}
private
String
setFilepath
(
String
sourcepath
,
boolean
tf
)
throws
Exception
{
String
destpath
=
""
;
if
(
StringUtils
.
isEmpty
(
sourcepath
)
||
StringUtils
.
equalsIgnoreCase
(
sourcepath
,
"UUID"
))
sourcepath
=
PropUtil
.
getValue
(
"uploadPath"
,
"quartz_service"
,
""
);
Calendar
date
=
Calendar
.
getInstance
();
SimpleDateFormat
format1
=
new
SimpleDateFormat
(
"yyyy"
);
SimpleDateFormat
format2
=
new
SimpleDateFormat
(
"MM"
);
SimpleDateFormat
format3
=
new
SimpleDateFormat
(
"dd"
);
String
name1
=
format1
.
format
(
date
.
getTime
());
String
name2
=
format2
.
format
(
date
.
getTime
());
String
name3
=
format3
.
format
(
date
.
getTime
());
destpath
=
sourcepath
+
"classify"
+
File
.
separator
+
name1
+
File
.
separator
+
name2
+
File
.
separator
+
name3
;
if
(
tf
)
{
File
fileDir
=
new
File
(
destpath
);
if
(!
fileDir
.
exists
())
{
fileDir
.
mkdirs
();
}
}
return
destpath
;
}
}
src_jwapp/com/jw/app/forum/classify/action/dataAction.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
forum
.
classify
.
action
;
import
java.sql.SQLException
;
import
java.text.ParseException
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.gaowj.business.action.BasicAction
;
import
com.gaowj.business.comp.BusinessManager
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.Page
;
import
com.gaowj.business.util.QueryParamUtil
;
import
com.gaowj.business.util.RequestUtils
;
import
com.jw.app.business.ForumClassifyBusiness
;
import
net.sf.json.JSONObject
;
public
class
dataAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
4453526240239394214L
;
private
JSONObject
jsonObject
=
new
JSONObject
();
private
int
rows
=
20
;
// 每页显示的记录数
private
int
page
=
1
;
// 当前第几页
public
JSONObject
getJsonObject
()
{
return
jsonObject
;
}
public
void
setJsonObject
(
JSONObject
jsonObject
)
{
this
.
jsonObject
=
jsonObject
;
}
public
int
getRows
()
{
rows
=
getPageSize
();
return
rows
;
}
public
void
setRows
(
int
rows
)
{
setPageSize
(
rows
);
this
.
rows
=
getPageSize
();
}
public
int
getPage
()
{
page
=
getPageNo
();
return
page
;
}
public
void
setPage
(
int
page
)
{
setPageNo
(
page
);
this
.
page
=
getPageNo
();
}
/**
* 分页获取记录
* @param entity
* @throws BusinessException
*/
public
String
list
()
throws
BusinessException
{
ForumClassifyBusiness
business
=
BusinessManager
.
getBusiness
(
ForumClassifyBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
Page
<
Map
<
String
,
Object
>>
pageRows
=
business
.
list
(
pageNo
,
pageSize
,
query
);
setPageCount
((
pageRows
.
getCount
()
-
1
)
/
pageSize
+
1
);
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateToString
(
pageRows
.
getItems
()));
data
.
put
(
"pageNo"
,
pageNo
);
data
.
put
(
"pageSize"
,
pageSize
);
data
.
put
(
"pageCount"
,
pageCount
);
data
.
put
(
"rows"
,
data
.
get
(
"rowSet"
));
data
.
put
(
"total"
,
pageRows
.
getCount
());
jsonObject
=
new
JSONObject
();
jsonObject
.
putAll
(
data
);
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 获取所有发件记录
* @param entity
* @throws BusinessException
*/
public
String
listAll
()
throws
BusinessException
{
ForumClassifyBusiness
business
=
BusinessManager
.
getBusiness
(
ForumClassifyBusiness
.
class
);
try
{
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
query
=
QueryParamUtil
.
StringToDate
(
query
);
List
<
Map
<
String
,
Object
>>
listData
=
business
.
list
(
query
);
int
listDataCount
=
listData
.
size
();
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateToString
(
listData
));
data
.
put
(
"pageNo"
,
1
);
data
.
put
(
"pageSize"
,
listDataCount
);
data
.
put
(
"pageCount"
,
listDataCount
);
data
.
put
(
"rows"
,
data
.
get
(
"rowSet"
));
data
.
put
(
"total"
,
listDataCount
);
jsonObject
=
new
JSONObject
();
jsonObject
.
putAll
(
data
);
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
"json"
;
}
}
src_jwapp/com/jw/app/forum/classify/action/viewAction.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
forum
.
classify
.
action
;
import
java.util.Map
;
import
com.gaowj.business.action.BasicAction
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.RequestUtils
;
public
class
viewAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
3722089470057317919L
;
public
String
classifyTab
()
throws
BusinessException
{
return
"classifyTab"
;
}
public
String
classifyTabDetail
()
throws
BusinessException
{
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMapUtf8
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
request
.
setAttribute
(
"is_row"
,
query
);
return
"classifyTabDetail"
;
}
}
src_jwapp/com/jw/app/forum/topic/action/actAction.java
0 → 100644
View file @
07d9f753
This diff is collapsed.
Click to expand it.
src_jwapp/com/jw/app/forum/topic/action/dataAction.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
forum
.
topic
.
action
;
import
java.sql.SQLException
;
import
java.text.ParseException
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.gaowj.business.action.BasicAction
;
import
com.gaowj.business.comp.BusinessManager
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.Page
;
import
com.gaowj.business.util.QueryParamUtil
;
import
com.gaowj.business.util.RequestUtils
;
import
com.jw.app.business.ForumTopicBusiness
;
import
net.sf.json.JSONObject
;
public
class
dataAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
6047561835854708253L
;
private
JSONObject
jsonObject
=
new
JSONObject
();
private
int
rows
=
20
;
// 每页显示的记录数
private
int
page
=
1
;
// 当前第几页
public
JSONObject
getJsonObject
()
{
return
jsonObject
;
}
public
void
setJsonObject
(
JSONObject
jsonObject
)
{
this
.
jsonObject
=
jsonObject
;
}
public
int
getRows
()
{
rows
=
getPageSize
();
return
rows
;
}
public
void
setRows
(
int
rows
)
{
setPageSize
(
rows
);
this
.
rows
=
getPageSize
();
}
public
int
getPage
()
{
page
=
getPageNo
();
return
page
;
}
public
void
setPage
(
int
page
)
{
setPageNo
(
page
);
this
.
page
=
getPageNo
();
}
/**
* 分页获取记录
* @param entity
* @throws BusinessException
*/
public
String
listTopic
()
throws
BusinessException
{
ForumTopicBusiness
business
=
BusinessManager
.
getBusiness
(
ForumTopicBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
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
()));
data
.
put
(
"pageNo"
,
pageNo
);
data
.
put
(
"pageSize"
,
pageSize
);
data
.
put
(
"pageCount"
,
pageCount
);
data
.
put
(
"rows"
,
data
.
get
(
"rowSet"
));
data
.
put
(
"total"
,
pageRows
.
getCount
());
jsonObject
=
new
JSONObject
();
jsonObject
.
putAll
(
data
);
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 获取所有发件记录
* @param entity
* @throws BusinessException
*/
public
String
listTopicAll
()
throws
BusinessException
{
ForumTopicBusiness
business
=
BusinessManager
.
getBusiness
(
ForumTopicBusiness
.
class
);
try
{
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
();
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateToString
(
listData
));
data
.
put
(
"pageNo"
,
1
);
data
.
put
(
"pageSize"
,
listDataCount
);
data
.
put
(
"pageCount"
,
listDataCount
);
data
.
put
(
"rows"
,
data
.
get
(
"rowSet"
));
data
.
put
(
"total"
,
listDataCount
);
jsonObject
=
new
JSONObject
();
jsonObject
.
putAll
(
data
);
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 分页获取记录
* @param entity
* @throws BusinessException
*/
public
String
listReply
()
throws
BusinessException
{
ForumTopicBusiness
business
=
BusinessManager
.
getBusiness
(
ForumTopicBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
Page
<
Map
<
String
,
Object
>>
pageRows
=
business
.
listTopicReply
(
pageNo
,
pageSize
,
query
);
setPageCount
((
pageRows
.
getCount
()
-
1
)
/
pageSize
+
1
);
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateToString
(
pageRows
.
getItems
()));
data
.
put
(
"pageNo"
,
pageNo
);
data
.
put
(
"pageSize"
,
pageSize
);
data
.
put
(
"pageCount"
,
pageCount
);
data
.
put
(
"rows"
,
data
.
get
(
"rowSet"
));
data
.
put
(
"total"
,
pageRows
.
getCount
());
jsonObject
=
new
JSONObject
();
jsonObject
.
putAll
(
data
);
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 获取所有发件记录
* @param entity
* @throws BusinessException
*/
public
String
listReplyAll
()
throws
BusinessException
{
ForumTopicBusiness
business
=
BusinessManager
.
getBusiness
(
ForumTopicBusiness
.
class
);
try
{
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
query
=
QueryParamUtil
.
StringToDate
(
query
);
List
<
Map
<
String
,
Object
>>
listData
=
business
.
listTopicReply
(
query
);
int
listDataCount
=
listData
.
size
();
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateToString
(
listData
));
data
.
put
(
"pageNo"
,
1
);
data
.
put
(
"pageSize"
,
listDataCount
);
data
.
put
(
"pageCount"
,
listDataCount
);
data
.
put
(
"rows"
,
data
.
get
(
"rowSet"
));
data
.
put
(
"total"
,
listDataCount
);
jsonObject
=
new
JSONObject
();
jsonObject
.
putAll
(
data
);
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
"json"
;
}
}
src_jwapp/com/jw/app/forum/topic/action/viewAction.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
forum
.
topic
.
action
;
import
java.util.List
;
import
java.util.Map
;
import
com.gaowj.business.action.BasicAction
;
import
com.gaowj.business.comp.BusinessManager
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.RequestUtils
;
import
com.jw.app.business.ForumTopicBusiness
;
public
class
viewAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1964078783297617064L
;
public
String
topicTab
()
throws
BusinessException
{
return
"topicTab"
;
}
public
String
topicTabDetail
()
throws
BusinessException
{
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMapUtf8
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
request
.
setAttribute
(
"is_row"
,
query
);
return
"topicTabDetail"
;
}
public
String
topicDetail
()
throws
BusinessException
{
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMapUtf8
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
ForumTopicBusiness
business
=
BusinessManager
.
getBusiness
(
ForumTopicBusiness
.
class
);
List
<
Map
<
String
,
Object
>>
listData
=
business
.
listTopic
(
query
);
if
(
listData
.
size
()
>
0
){
request
.
setAttribute
(
"is_row"
,
listData
.
get
(
0
));
}
return
"topicDetail"
;
}
}
src_jwapp/com/jw/app/forum/word/action/actAction.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
forum
.
word
.
action
;
import
java.util.List
;
import
java.util.Map
;
import
com.gaowj.business.SystemOpeBusiness
;
import
com.gaowj.business.action.BasicAction
;
import
com.gaowj.business.comp.BusinessManager
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.QueryParamUtil
;
import
com.gaowj.business.util.RequestUtils
;
import
com.gaowj.business.util.Status
;
import
com.jw.app.business.ForumWordBusiness
;
import
net.sf.json.JSONObject
;
public
class
actAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
3820556865628078876L
;
private
JSONObject
jsonObject
=
new
JSONObject
();
public
JSONObject
getJsonObject
()
{
return
jsonObject
;
}
public
void
setJsonObject
(
JSONObject
jsonObject
)
{
this
.
jsonObject
=
jsonObject
;
}
/**
* 插入
* @param entity
* @throws BusinessException
*/
public
String
insertWord
()
throws
BusinessException
{
ForumWordBusiness
business
=
BusinessManager
.
getBusiness
(
ForumWordBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
entity
=
QueryParamUtil
.
StringToDate
(
entity
);
// 去除不要更新的字段
entity
.
remove
(
"OPETYPE"
);
// 新增
business
.
insert_word
(
entity
);
// 操作日志
SystemOpeBusiness
sysbusiness
=
BusinessManager
.
getBusiness
(
SystemOpeBusiness
.
class
);
sysbusiness
.
insert_logBusiness
(
"insertWord"
,
""
+
entity
,
"添加敏感词"
,
(
String
)
entity
.
get
(
"UUID"
),
(
String
)
entity
.
get
(
"WORD"
),
"word"
);
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"保存成功"
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"保存失败"
));
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 更新
* @param entity
* @throws BusinessException
*/
public
String
updateWord
()
throws
BusinessException
{
ForumWordBusiness
business
=
BusinessManager
.
getBusiness
(
ForumWordBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
// 修改
entity
=
QueryParamUtil
.
StringToDate
(
entity
);
// 去除不要更新的字段
entity
.
remove
(
"OPETYPE"
);
business
.
update_word
(
entity
);
// 操作日志
SystemOpeBusiness
sysbusiness
=
BusinessManager
.
getBusiness
(
SystemOpeBusiness
.
class
);
sysbusiness
.
insert_logBusiness
(
"updateWord"
,
""
+
entity
,
"更新敏感词"
,
(
String
)
entity
.
get
(
"UUID"
),
(
String
)
entity
.
get
(
"WORD"
),
"word"
);
//
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"修改成功"
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"修改失败"
));
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 删除
* @param entity
* @throws BusinessException
*/
public
String
deleteWord
()
throws
BusinessException
{
ForumWordBusiness
business
=
BusinessManager
.
getBusiness
(
ForumWordBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
String
deletekey
=
(
String
)
entity
.
get
(
"CODE"
);
List
<
String
>
ListKey
=
QueryParamUtil
.
StringToList
(
deletekey
);
try
{
business
.
delete_word
(
ListKey
);
// 操作日志
SystemOpeBusiness
sysbusiness
=
BusinessManager
.
getBusiness
(
SystemOpeBusiness
.
class
);
sysbusiness
.
insert_logBusiness
(
"deleteWord"
,
""
+
ListKey
,
"删除敏感词信息"
,
deletekey
,
"多个流水号"
,
"word"
);
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"删除成功"
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"删除失败"
));
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 刷新敏感词缓存
* @return
* @throws BusinessException
*/
public
String
insertSensitiveWordCache
()
throws
BusinessException
{
ForumWordBusiness
business
=
BusinessManager
.
getBusiness
(
ForumWordBusiness
.
class
);
try
{
business
.
insert_sensitive_word_cache
();
// 操作日志
SystemOpeBusiness
sysbusiness
=
BusinessManager
.
getBusiness
(
SystemOpeBusiness
.
class
);
sysbusiness
.
insert_logBusiness
(
"insertSensitiveWordCache"
,
""
,
""
,
"刷新敏感词缓存"
,
""
,
"word"
);
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"刷新成功"
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"刷新失败"
));
e
.
printStackTrace
();
}
return
"json"
;
}
}
src_jwapp/com/jw/app/forum/word/action/dataAction.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
forum
.
word
.
action
;
import
java.sql.SQLException
;
import
java.text.ParseException
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.gaowj.business.action.BasicAction
;
import
com.gaowj.business.comp.BusinessManager
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.Page
;
import
com.gaowj.business.util.QueryParamUtil
;
import
com.gaowj.business.util.RequestUtils
;
import
com.jw.app.business.ForumWordBusiness
;
import
net.sf.json.JSONObject
;
public
class
dataAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
3364257265580987520L
;
private
JSONObject
jsonObject
=
new
JSONObject
();
private
int
rows
=
20
;
// 每页显示的记录数
private
int
page
=
1
;
// 当前第几页
public
JSONObject
getJsonObject
()
{
return
jsonObject
;
}
public
void
setJsonObject
(
JSONObject
jsonObject
)
{
this
.
jsonObject
=
jsonObject
;
}
public
int
getRows
()
{
rows
=
getPageSize
();
return
rows
;
}
public
void
setRows
(
int
rows
)
{
setPageSize
(
rows
);
this
.
rows
=
getPageSize
();
}
public
int
getPage
()
{
page
=
getPageNo
();
return
page
;
}
public
void
setPage
(
int
page
)
{
setPageNo
(
page
);
this
.
page
=
getPageNo
();
}
/**
* 分页获取记录
* @param entity
* @throws BusinessException
*/
public
String
list
()
throws
BusinessException
{
ForumWordBusiness
business
=
BusinessManager
.
getBusiness
(
ForumWordBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
Page
<
Map
<
String
,
Object
>>
pageRows
=
business
.
listWord
(
pageNo
,
pageSize
,
query
);
setPageCount
((
pageRows
.
getCount
()
-
1
)
/
pageSize
+
1
);
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateToString
(
pageRows
.
getItems
()));
data
.
put
(
"pageNo"
,
pageNo
);
data
.
put
(
"pageSize"
,
pageSize
);
data
.
put
(
"pageCount"
,
pageCount
);
data
.
put
(
"rows"
,
data
.
get
(
"rowSet"
));
data
.
put
(
"total"
,
pageRows
.
getCount
());
jsonObject
=
new
JSONObject
();
jsonObject
.
putAll
(
data
);
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 获取所有发件记录
* @param entity
* @throws BusinessException
*/
public
String
listAll
()
throws
BusinessException
{
ForumWordBusiness
business
=
BusinessManager
.
getBusiness
(
ForumWordBusiness
.
class
);
try
{
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
query
=
QueryParamUtil
.
StringToDate
(
query
);
List
<
Map
<
String
,
Object
>>
listData
=
business
.
listWord
(
query
);
int
listDataCount
=
listData
.
size
();
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateToString
(
listData
));
data
.
put
(
"pageNo"
,
1
);
data
.
put
(
"pageSize"
,
listDataCount
);
data
.
put
(
"pageCount"
,
listDataCount
);
data
.
put
(
"rows"
,
data
.
get
(
"rowSet"
));
data
.
put
(
"total"
,
listDataCount
);
jsonObject
=
new
JSONObject
();
jsonObject
.
putAll
(
data
);
}
catch
(
SQLException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
"json"
;
}
}
src_jwapp/com/jw/app/forum/word/action/viewAction.java
0 → 100644
View file @
07d9f753
package
com
.
jw
.
app
.
forum
.
word
.
action
;
import
java.util.Map
;
import
com.gaowj.business.action.BasicAction
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.RequestUtils
;
public
class
viewAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
734005515827805804L
;
public
String
wordTab
()
throws
BusinessException
{
return
"wordTab"
;
}
public
String
wordTabDetail
()
throws
BusinessException
{
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMapUtf8
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
request
.
setAttribute
(
"is_row"
,
query
);
return
"wordTabDetail"
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment