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
1042d8f0
Commit
1042d8f0
authored
Aug 24, 2018
by
朱天成
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
投票2.0
parent
473407a6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
1376 additions
and
304 deletions
+1376
-304
icon.css
...tent/gaowj/ria/jquery/jquery-easyui-1.4.1/themes/icon.css
+4
-0
endedVoteTab.jsp
WebContent/jwapp/pages/vote/endedVoteTab.jsp
+21
-0
endedVoteTab.js
WebContent/jwapp/pages/vote/js/endedVoteTab.js
+234
-0
ongoingVoteTab.js
WebContent/jwapp/pages/vote/js/ongoingVoteTab.js
+306
-0
voteModule.js
WebContent/jwapp/pages/vote/js/voteModule.js
+16
-5
voteTab.js
WebContent/jwapp/pages/vote/js/voteTab.js
+161
-94
ongoingVoteTab.jsp
WebContent/jwapp/pages/vote/ongoingVoteTab.jsp
+21
-0
userVoteTabDetail.jsp
WebContent/jwapp/pages/vote/userVoteTabDetail.jsp
+45
-0
voteAdvsearch.jsp
WebContent/jwapp/pages/vote/voteAdvsearch.jsp
+0
-41
voteTab.jsp
WebContent/jwapp/pages/vote/voteTab.jsp
+8
-7
voteTabDetail.jsp
WebContent/jwapp/pages/vote/voteTabDetail.jsp
+70
-31
VoteBusiness.java
src_jwapp/com/jw/app/business/VoteBusiness.java
+114
-16
VoteBusinessImpl.java
src_jwapp/com/jw/app/business/vote/VoteBusinessImpl.java
+0
-0
voteDAO.java
src_jwapp/com/jw/app/business/vote/voteDAO.java
+17
-0
voteDAO.xml
src_jwapp/com/jw/app/business/vote/voteDAO.xml
+202
-70
actAction.java
src_jwapp/com/jw/app/vote/action/actAction.java
+59
-15
dataAction.java
src_jwapp/com/jw/app/vote/action/dataAction.java
+83
-21
viewAction.java
src_jwapp/com/jw/app/vote/action/viewAction.java
+15
-4
No files found.
WebContent/gaowj/ria/jquery/jquery-easyui-1.4.1/themes/icon.css
View file @
1042d8f0
...
...
@@ -345,4 +345,7 @@
}
.icon-ext-13_48 {
background:url('
../../../../
images
/
icons
/(
13
,
48
).
png
') no-repeat left center;
}
.icon-ext-07_14 {
background:url('
../../../../
images
/
icons
/(
07
,
14
).
png
'
)
no-repeat
left
center
;
}
\ No newline at end of file
WebContent/jwapp/pages/vote/endedVoteTab.jsp
0 → 100644
View file @
1042d8f0
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="userVoteTab">
<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="voteTab_searchForm" style="float:left">
主题内容: <input class="easyui-textbox" id="FIELD_CONTENT" name="FIELD_CONTENT" style="width:200px"/>
<input type="checkbox" name="FIELD_USERSELF" value="0" onclick="searchRow()" checked />仅显示我参与的
</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>
</div>
<div id="detail" style="overflow:auto;"></div>
<div id="advsearch" 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/vote/js/voteModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/vote/js/endedVoteTab.js" charset="utf-8"></script>
WebContent/jwapp/pages/vote/js/endedVoteTab.js
0 → 100644
View file @
1042d8f0
/**
* 序号:
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:无需更改
**/
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
=
'2'
;
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var
ls_ywlx
=
'YBYW'
;
/****/
/**
* 序号:
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//定义grid列表
var
ls_title
=
"投票管理功能 <font color='#993300'></font>"
;
var
is_column
=
[
[
{
field
:
'CONTENT'
,
title
:
'主题内容'
,
width
:
150
,
align
:
'center'
},
{
field
:
'opt'
,
title
:
'操作'
,
width
:
150
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
var
lookBtn
=
'<a style="cursor:pointer" onclick="javascript:lookfor('
+
index
+
')">查看</a>'
return
'<div class=
\'
optBtns
\'
>'
+
(
lookBtn
)
+
'</div>'
;
}
}
]
];
//列表加载完成回调
function
reportrollback
(){
}
//设置颜色和每行高度
function
rowstyler
(
index
,
row
){
}
//展示列表
queryData
.
FIELD_USERSELF
=
0
;
reportgrid
(
"list"
,
ls_title
,
gaowj
.
WEB_APP_NAME
+
"/voteData_list_ended"
,
queryData
,
is_column
,
60
,
80
);
/****/
/**
* 序号:
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//操用列显示更多(一般情况下无需更改)
function
formatMenu
(
value
,
data
,
index
)
{
var
returnData
=
""
;
return
returnData
+
"<span class=
\"
icon-edit
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
editRow('"
+
index
+
"')
\"
>投票</a>"
;
}
//上浮横向菜单集里的具体菜单项(需更改)
function
getOptionMenu
(
data
,
index
){
}
//返回菜单集的菜单个数(需更改)
function
getOptionMenuCount
(){
}
/**
* 序号:
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function
lookfor
(
index
){
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
is_row
[
0
].
OPETYPE
=
'lookfor'
;
openLookRow
(
"voteView_userVoteTabDetail"
,
is_row
[
0
],
"查看"
,
true
,
0.65
,
0.95
,
0
,
0
);
}
function
openLookRow
(
editUrl
,
is_row
,
is_title
,
is_max
,
is_width
,
is_height
,
is_left
,
is_top
){
$
(
'#detail'
).
dialog
(
{
title
:
is_title
,
iconCls
:
$
.
getJwWindowPic
(),
width
:
ls_width
*
is_width
,
height
:
ls_height
*
is_height
,
closed
:
false
,
cache
:
false
,
maximizable
:
is_max
,
left
:
is_left
,
top
:
is_top
,
href
:
editUrl
,
queryParams
:
get_FIELD
(
is_row
),
modal
:
true
,
buttons
:
[
{
text
:
'关闭'
,
iconCls
:
'icon-back'
,
handler
:
function
()
{
closeBox
(
'detail'
);
}
}
],
onLoad
:
function
editUrlOnload
(){
if
(
is_row
.
OPETYPE
==
'lookfor'
){
lookforUrlOnloadCallback
(
is_row
);
}
else
{
updateUrlOnloadCallback
(
is_row
);
}
}
});
}
//加载投票子页面成功后的回调
function
lookforUrlOnloadCallback
(
is_row
,
index
){
var
listItem
=
voteModule
.
voteDataAction
.
listItem
({
FIELD_MANAGE_ID
:
is_row
.
UUID
}).
listItems
;
var
listUserChecked
=
voteModule
.
voteDataAction
.
listUserChecked
({
FIELD_MANAGE_ID
:
is_row
.
UUID
}).
listusercheckeds
;
for
(
var
i
=
0
;
i
<
listItem
.
length
;
i
++
){
add_vote_item
(
listItem
[
i
].
INDEX_NAME
,
listItem
[
i
].
CONTENT
,
listItem
[
i
].
UUID
);
}
for
(
var
j
=
0
;
j
<
listUserChecked
.
length
;
j
++
){
$
(
"input[name='vote_item_delete']"
).
each
(
function
(
index
)
{
if
(
$
(
"input[name='vote_item_delete']"
).
get
(
index
).
value
==
listUserChecked
[
j
].
ITEM_ID
)
{
$
(
"input[name='vote_item_delete']"
).
get
(
index
).
checked
=
true
;
}
});
}
}
/**
* 功能:刷新
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function
refreshRow
(){
$
(
'#list'
).
datagrid
(
'load'
,{});
$
(
"#voteTab_searchForm"
)[
0
].
reset
();
}
/****/
/**
* 功能:查询
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function
searchRow
(){
var
v_query
=
$
(
"#voteTab_searchForm"
).
getFormVal
();
$
(
'#list'
).
datagrid
(
'load'
,
v_query
);
}
/****/
function
add_vote_item
(
index
,
content
,
uuid
){
if
(
typeof
index
==
'undefined'
){
index
=
''
;
}
if
(
typeof
content
==
'undefined'
){
content
=
''
;
}
if
(
typeof
uuid
==
'undefined'
){
uuid
=
''
;
}
var
vote_item_list
=
$
(
".vote_item_list"
);
var
item
=
$
(
"<div class='vote_item_one' style='overflow: auto;margin-bottom:10px'></div>"
);
vote_item_list
.
append
(
item
);
var
vote_item_checkbox
=
$
(
'<div></div>'
);
vote_item_checkbox
.
addClass
(
'vote_item_checkbox'
);
var
vote_item_info
=
$
(
'<div></div>'
);
vote_item_info
.
addClass
(
'vote_item_info'
);
item
.
append
(
vote_item_checkbox
);
item
.
append
(
vote_item_info
);
vote_item_checkbox
.
append
(
'<input type="checkbox" name="vote_item_delete" value="'
+
uuid
+
'"/>'
);
vote_item_info
.
append
(
index
+
'.'
+
content
);
$
.
parser
.
parse
(
'.vote_item_one'
);
}
WebContent/jwapp/pages/vote/js/ongoingVoteTab.js
0 → 100644
View file @
1042d8f0
/**
* 序号:
* 功能:定义分页(EasyUI)
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:无需更改
**/
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
=
'2'
;
//定义当前模块业务类型(YBYW:一般业务,SPGL:审批业务)
var
ls_ywlx
=
'YBYW'
;
/****/
/**
* 序号:
* 功能:构建主页面列表
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//定义grid列表
var
ls_title
=
"投票管理功能 <font color='#993300'></font>"
;
var
is_column
=
[
[
{
field
:
'CONTENT'
,
title
:
'主题内容'
,
width
:
150
,
align
:
'center'
},
{
field
:
'VOTE_COUNT'
,
title
:
'状态'
,
width
:
150
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
return
value
>
0
?
"已投"
:
"未投"
;
}
},
{
field
:
'opt'
,
title
:
'操作'
,
width
:
150
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
){
var
voteBtn
=
'<a style="cursor:pointer" onclick="javascript:editRow('
+
index
+
')">投票</a>'
var
lookBtn
=
'<a style="cursor:pointer" onclick="javascript:lookfor('
+
index
+
')">查看</a>'
return
'<div class=
\'
optBtns
\'
>'
+
(
row
.
VOTE_COUNT
>
0
?
lookBtn
:
voteBtn
)
+
'</div>'
;
}
}
]
];
//列表加载完成回调
function
reportrollback
(){
}
//设置颜色和每行高度
function
rowstyler
(
index
,
row
){
}
//展示列表
reportgrid
(
"list"
,
ls_title
,
gaowj
.
WEB_APP_NAME
+
"/voteData_list_ongoing"
,
queryData
,
is_column
,
60
,
80
);
/****/
/**
* 序号:
* 功能:设置主页面操作列菜单
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//操用列显示更多(一般情况下无需更改)
function
formatMenu
(
value
,
data
,
index
)
{
var
returnData
=
""
;
return
returnData
+
"<span class=
\"
icon-edit
\"
style=
\"
padding-left:20px;*width:20px;
\"
></span><a href=
\"
javascript:void(0);
\"
onclick=
\"
editRow('"
+
index
+
"')
\"
>投票</a>"
;
}
//上浮横向菜单集里的具体菜单项(需更改)
function
getOptionMenu
(
data
,
index
){
}
//返回菜单集的菜单个数(需更改)
function
getOptionMenuCount
(){
}
/**
* 序号:
* 功能:新增修改弹出
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
//加载投票子页面
function
editRow
(
index
)
{
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
is_row
[
0
].
OPETYPE
=
'update'
;
openEditRow
(
"voteView_userVoteTabDetail"
,
is_row
[
0
],
"投票"
,
true
,
0.65
,
0.95
,
0
,
0
);
}
function
lookfor
(
index
){
$
(
'#list'
).
datagrid
(
'selectRow'
,
index
);
var
is_row
=
$
(
'#list'
).
datagrid
(
'getSelections'
);
$
(
'#list'
).
datagrid
(
'clearSelections'
);
is_row
[
0
].
OPETYPE
=
'lookfor'
;
openLookRow
(
"voteView_userVoteTabDetail"
,
is_row
[
0
],
"查看"
,
true
,
0.65
,
0.95
,
0
,
0
);
}
function
openLookRow
(
editUrl
,
is_row
,
is_title
,
is_max
,
is_width
,
is_height
,
is_left
,
is_top
){
$
(
'#detail'
).
dialog
(
{
title
:
is_title
,
iconCls
:
$
.
getJwWindowPic
(),
width
:
ls_width
*
is_width
,
height
:
ls_height
*
is_height
,
closed
:
false
,
cache
:
false
,
maximizable
:
is_max
,
left
:
is_left
,
top
:
is_top
,
href
:
editUrl
,
queryParams
:
get_FIELD
(
is_row
),
modal
:
true
,
buttons
:
[
{
text
:
'关闭'
,
iconCls
:
'icon-back'
,
handler
:
function
()
{
closeBox
(
'detail'
);
}
}
],
onLoad
:
function
editUrlOnload
(){
if
(
is_row
.
OPETYPE
==
'lookfor'
){
lookforUrlOnloadCallback
(
is_row
);
}
else
{
updateUrlOnloadCallback
(
is_row
);
}
}
});
}
//加载投票子页面成功后的回调
function
lookforUrlOnloadCallback
(
is_row
,
index
){
var
listItem
=
voteModule
.
voteDataAction
.
listItem
({
FIELD_MANAGE_ID
:
is_row
.
UUID
}).
listItems
;
var
listUserChecked
=
voteModule
.
voteDataAction
.
listUserChecked
({
FIELD_MANAGE_ID
:
is_row
.
UUID
}).
listusercheckeds
;
for
(
var
i
=
0
;
i
<
listItem
.
length
;
i
++
){
add_vote_item
(
listItem
[
i
].
INDEX_NAME
,
listItem
[
i
].
CONTENT
,
listItem
[
i
].
UUID
);
}
for
(
var
j
=
0
;
j
<
listUserChecked
.
length
;
j
++
){
$
(
"input[name='vote_item_delete']"
).
each
(
function
(
index
)
{
if
(
$
(
"input[name='vote_item_delete']"
).
get
(
index
).
value
==
listUserChecked
[
j
].
ITEM_ID
)
{
$
(
"input[name='vote_item_delete']"
).
get
(
index
).
checked
=
true
;
}
});
}
}
//加载投票子页面成功后的回调
function
updateUrlOnloadCallback
(
is_row
){
var
listItem
=
voteModule
.
voteDataAction
.
listItem
({
FIELD_MANAGE_ID
:
is_row
.
UUID
}).
listItems
;
for
(
var
i
=
0
;
i
<
listItem
.
length
;
i
++
){
add_vote_item
(
listItem
[
i
].
INDEX_NAME
,
listItem
[
i
].
CONTENT
,
listItem
[
i
].
UUID
);
}
}
//保存
function
updateData
(
is_entity
){
var
uuids
=
''
;
var
i
=
0
;
$
(
".vote_item_list :checkbox:checked"
).
each
(
function
(
index
){
uuids
+=
','
+
$
(
this
).
val
();
i
++
;
});
var
min
=
$
(
"input[name=FIELD_MIN_COUNT]"
).
val
();
var
max
=
$
(
"input[name=FIELD_MAX_COUNT]"
).
val
();
var
flag
=
$
(
"input[name=FIELD_STATUS_FLAG]"
).
val
();
//判断用户选择的选项是否在上下限之间,如果不在,则提示用户,不进行提交操作
if
(
min
==
max
&&
i
!=
min
){
$
.
messager
.
alert
(
"必须选择"
+
max
+
"个选项"
);
return
;
}
else
if
(
i
<
min
||
i
>
max
){
$
.
messager
.
alert
(
"请选择"
+
min
+
"到"
+
max
+
"个选项"
);
return
;
}
if
(
uuids
.
length
>
0
){
uuids
=
uuids
.
substring
(
1
);
}
is_entity
.
FIELD_UUIDS
=
uuids
;
is_entity
.
FIELD_FLAG
=
flag
;
v_result
=
voteModule
.
voteActAction
.
insertUserVote
(
is_entity
);
$
(
'#list'
).
datagrid
(
'reload'
);
return
v_result
;
// }
}
/**
* 功能:刷新
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function
refreshRow
(){
$
(
'#list'
).
datagrid
(
'load'
,{});
$
(
"#voteTab_searchForm"
)[
0
].
reset
();
}
/****/
/**
* 功能:查询
* 参数:
* 说明:
* 作者:朱天成
* 时间:2018-08-07
* 单位:杰夫兄弟智慧科技有限公司
* 备注:需更改
**/
function
searchRow
(){
var
v_query
=
$
(
"#voteTab_searchForm"
).
getFormVal
();
$
(
'#list'
).
datagrid
(
'load'
,
v_query
);
}
/****/
/**
* 查询自己参与
* **/
function
userselfRow
(){
// $("#list").each(function(index) {
// var content=$(this).val();
// if ($(this).VOTE_COUNT >0) {
// $('#list').datagrid('load',content);
// }
// });
// if(row.VOTE_COUNT>0){
//
// }
// $('#list').datagrid('load',v_query);
}
function
add_vote_item
(
index
,
content
,
uuid
){
if
(
typeof
index
==
'undefined'
){
index
=
''
;
}
if
(
typeof
content
==
'undefined'
){
content
=
''
;
}
if
(
typeof
uuid
==
'undefined'
){
uuid
=
''
;
}
var
vote_item_list
=
$
(
".vote_item_list"
);
var
item
=
$
(
"<div class='vote_item_one' style='overflow: auto;margin-bottom:10px'></div>"
);
vote_item_list
.
append
(
item
);
var
vote_item_checkbox
=
$
(
'<div></div>'
);
vote_item_checkbox
.
addClass
(
'vote_item_checkbox'
);
var
vote_item_info
=
$
(
'<div></div>'
);
vote_item_info
.
addClass
(
'vote_item_info'
);
item
.
append
(
vote_item_checkbox
);
item
.
append
(
vote_item_info
);
vote_item_checkbox
.
append
(
'<input type="checkbox" name="vote_item_delete" value="'
+
uuid
+
'"/>'
);
vote_item_info
.
append
(
index
+
'.'
+
content
);
$
.
parser
.
parse
(
'.vote_item_one'
);
}
WebContent/jwapp/pages/vote/js/voteModule.js
View file @
1042d8f0
...
...
@@ -7,18 +7,29 @@ var voteModule = function(format) {
//定义数据交互
voteModule
.
prototype
=
BusinessObject
;
//插入
附件数据
//插入
主题
voteModule
.
prototype
.
insertVote
=
function
(){};
//修改附件数据
//插入用户投票
voteModule
.
prototype
.
insertUserVote
=
function
(){};
//修改主题
voteModule
.
prototype
.
updateVote
=
function
(){};
//删除
附件数据
//删除
主题
voteModule
.
prototype
.
deleteVote
=
function
(){};
//获取主题选项
voteModule
.
prototype
.
listItem
=
function
(){};
//获取用户选项
voteModule
.
prototype
.
listUserChecked
=
function
(){};
//删除主题选项
voteModule
.
prototype
.
deleteItem
=
function
(){};
//提前结束
voteModule
.
prototype
.
endVote
=
function
(){};
//
附件数据
_分页
//
主题
_分页
voteModule
.
prototype
.
list
=
function
(){};
//
附件
所有数据
//
主题
所有数据
voteModule
.
prototype
.
listAll
=
function
(){};
//创建一个数据操作对象,然后再后续使用
voteModule
.
voteActAction
=
new
voteModule
(
"json"
).
delegate
(
"voteAct"
);
//创建一个数据获取对象,然后再后续使用
...
...
WebContent/jwapp/pages/vote/js/voteTab.js
View file @
1042d8f0
This diff is collapsed.
Click to expand it.
WebContent/jwapp/pages/vote/ongoingVoteTab.jsp
0 → 100644
View file @
1042d8f0
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="userVoteTab">
<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="voteTab_searchForm" style="float:left">
主题内容: <input class="easyui-textbox" id="FIELD_CONTENT" name="FIELD_CONTENT" style="width:200px"/>
<input type="checkbox" name="FIELD_USERSELF" value="0" onclick="searchRow()" />仅显示我参与的
</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>
</div>
<div id="detail" style="overflow:auto;"></div>
<div id="advsearch" 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/vote/js/voteModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/vote/js/ongoingVoteTab.js" charset="utf-8"></script>
WebContent/jwapp/pages/vote/userVoteTabDetail.jsp
0 → 100644
View file @
1042d8f0
<%@page contentType="text/html; charset=UTF-8"%>
<style>
.vote_item_list div div{
float:left;
}
.vote_item_content{
margin: 10px 15px;
}
.vote_item_info{
margin-left: 26px;
}
.vote_item_index input{
width:120px;
}
.tableStyle span,.vote_item_content span{
border:none;
}
</style>
<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_STATUS_FLAG" id="STATUS_FLAG" value="${is_row.STATUS_FLAG}" />
<input type="hidden" name="FIELD_MIN_COUNT" id="MIN_COUNT" value="${is_row.MIN_COUNT}" />
<input type="hidden" name="FIELD_MAX_COUNT" id="MAX_COUNT" value="${is_row.MAX_COUNT}" />
<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" readonly="readonly" id="CONTENT" name="FIELD_CONTENT" style="width: 400px" required="true" value="${is_row.CONTENT}" />
</td>
</tr>
</table>
</form>
<form id="voteItemInputForm">
<div class="vote_item_content">
<div style="margin-bottom: 8px;" class="vote_item_item">
<input class="easyui-textbox" readonly="readonly" id="SUB_TITLE" name="FIELD_SUB_TITLE" style="width: 400px;" value="${is_row.SUB_TITLE}" a/>
</div>
<div class="vote_item_list">
</div>
</div>
</form>
\ No newline at end of file
WebContent/jwapp/pages/vote/voteAdvsearch.jsp
deleted
100644 → 0
View file @
473407a6
<%@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="adv_CONTENT" name="FIELD_CONTENT" style="width:365px" />
</td>
</tr>
<tr>
<td style="width: 20%;" class="tableStyleLable">
<span>
投票开始时间从:
</span>
</td>
<td style="width: 80%">
<input class="easyui-datetimebox" id="adv_START_START_TIME" name="FIELD_START_START_TIME"/>
<span>到</span>
<input id="adv_END_START_TIME" name="FIELD_END_START_TIME" type="text" class="easyui-datetimebox">
</td>
</tr>
<tr>
<td style="width: 20%;" class="tableStyleLable">
<span>
投票结束时间从:
</span>
</td>
<td style="width: 80%">
<input class="easyui-datetimebox" id="adv_START_END_TIME" name="FIELD_START_END_TIME"/>
<span>到</span>
<input id="adv_END_END_TIME" name="FIELD_END_END_TIME" type="text" class="easyui-datetimebox">
</td>
</tr>
</table>
</form>
\ No newline at end of file
WebContent/jwapp/pages/vote/voteTab.jsp
View file @
1042d8f0
...
...
@@ -8,18 +8,19 @@
<table id="list" style="width: 100%; height: 100%;"></table>
<div id="tb">
<form id="voteTab_searchForm" style="float:left">
主题名称: <input class="easyui-textbox" id="FIELD_CONTENT" name="FIELD_CONTENT" style="width:200px"/>
主题内容: <input class="easyui-textbox" id="FIELD_CONTENT" name="FIELD_CONTENT" style="width:200px"/>
开始时间: <input class="easyui-datetimebox" id="adv_START_START_TIME" name="FIELD_START_START_TIME" style="width:150px"/>
-<input class="easyui-datetimebox" id="adv_END_START_TIME" name="FIELD_END_START_TIME" style="width:150px"/>
结束时间: <input class="easyui-datetimebox" id="adv_START_END_TIME" name="FIELD_START_END_TIME" style="width:150px"/>
-<input class="easyui-datetimebox" id="adv_END_END_TIME" name="FIELD_END_END_TIME" style="width:150px"/>
</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-ext-advsearch',plain:true" onclick="javascript:advsearchRow()">高级查询</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="javascript:searchRow()">查询</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="javascript:refreshRow()">刷新</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-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-ext-file',plain:true" onclick="javascript:uploadcommonBatchRow()">附件上传</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>
</div>
<div id="detail" style="overflow:auto;"></div>
<div id="advsearch" style="overflow:auto;"></div>
<div id="uploadcommon" 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/vote/js/voteModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/jwapp/pages/vote/js/voteTab.js" charset="utf-8"></script>
WebContent/jwapp/pages/vote/voteTabDetail.jsp
View file @
1042d8f0
<%@page contentType="text/html; charset=UTF-8"%>
<%@page contentType="text/html; charset=UTF-8"%>
<style>
.vote_item_list div div{
float:left;
}
.vote_item_content{
margin: 10px 15px;
}
.vote_item_info{
margin-left: 26px;
}
.vote_item_index input{
width:120px;
}
</style>
<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="CONTENT" name="FIELD_CONTENT" style="width:400px" required=true value="${is_row.CONTENT}"/>
</td>
</tr>
<tr>
<td class="tableStyleLable">
<span>投票开始时间:</span>
</td>
<td>
<input class="easyui-datetimebox" id="START_TIME" name="FIELD_START_TIME" style="width:400px" value="${is_row.START_TIME}"/>
</td>
</tr>
<tr>
<td class="tableStyleLable">
<span>投票结束时间:</span>
</td>
<td>
<input class="easyui-datetimebox" id="END_TIME" name="FIELD_END_TIME" style="width:400px" value="${is_row.END_TIME}"/>
</td>
</tr>
</table>
<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="CONTENT" name="FIELD_CONTENT" style="width: 400px" required="true" value="${is_row.CONTENT}" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>副标题:</span>
</td>
<td style="width: 85%">
<input class="easyui-textbox" id="SUB_TITLE" name="FIELD_SUB_TITLE" style="width: 400px" required="true" value="${is_row.SUB_TITLE}" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>上限值:</span>
</td>
<td style="width: 85%">
<input class="easyui-numberspinner" id="MAX_COUNT" name="FIELD_MAX_COUNT" style="width: 400px" required="true" data-options="min:0" value="${is_row.MAX_COUNT}" />
</td>
</tr>
<tr>
<td style="width: 15%;" class="tableStyleLable">
<span>下限值:</span>
</td>
<td style="width: 85%">
<input class="easyui-numberspinner" id="MIN_COUNT" name="FIELD_MIN_COUNT" style="width: 400px" required="true" data-options="min:0" value="${is_row.MIN_COUNT}" />
</td>
</tr>
<tr>
<td class="tableStyleLable">
<span>投票结束时间:</span>
</td>
<td>
<input id="END_TIME" name="FIELD_END_TIME" style="width: 400px" value="${is_row.END_TIME}" />
</td>
</tr>
</table>
</form>
<form id="voteItemInputForm">
<div class="vote_item_content">
<div style="margin-bottom: 8px;">
<a onclick="add_vote_item()" class="easyui-linkbutton" data-options="iconCls:'icon-add'">添加</a>
<a onclick="delete_vote_item()" class="easyui-linkbutton" data-options="iconCls:'icon-clear'">删除</a>
</div>
<div class="vote_item_list">
</div>
</div>
</form>
\ No newline at end of file
src_jwapp/com/jw/app/business/VoteBusiness.java
View file @
1042d8f0
...
...
@@ -10,48 +10,146 @@ import com.gaowj.business.util.Page;
@Service
public
interface
VoteBusiness
{
/**
* 插入
*
* @param entity
* @throws BusinessException
*/
void
insert_vote
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
/**
* 插入
*
* @param entity
* @throws BusinessException
*/
void
insert_
vote
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
insert_
userVote
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
/**
* 更新
*
* @param entity
* @throws BusinessException
*/
void
update_vote
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
/**
void
update_vote
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
/**
* 删除记录
*
* @param entity
* @throws BusinessException
*/
void
delete_vote
(
List
<
String
>
list
)
throws
BusinessException
;
/**
void
delete_vote
(
List
<
String
>
list
)
throws
BusinessException
;
/**
* 分页获取记录
*
* @param entity
* @throws BusinessException
*/
Page
<
Map
<
String
,
Object
>>
list_vote
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
/**
Page
<
Map
<
String
,
Object
>>
list_vote
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
/**
* 获取所有记录
*
* @param entity
* @throws BusinessException
*/
List
<
Map
<
String
,
Object
>>
list_vote
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
/**
List
<
Map
<
String
,
Object
>>
list_vote
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
/**
* 获取所有记录数
*
* @param entity
* @throws BusinessException
*/
int
listCount_vote
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
listCount_vote
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
}
/**
* 获取选项
*
* @param entity
* @throws BusinessException
*/
List
<
Map
<
String
,
Object
>>
list_item
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
/**
* 删除记录
*
* @param entity
* @throws BusinessException
*/
void
delete_item
(
List
<
String
>
list
)
throws
BusinessException
;
/**
* 提前结束投票
*
* @param entity
* @throws BusinessException
*/
void
update_endvote
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
/**
* 分页获取记录
*
* @param entity
* @throws BusinessException
*/
Page
<
Map
<
String
,
Object
>>
list_ongoing
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
/**
* 获取所有记录
*
* @param entity
* @throws BusinessException
*/
List
<
Map
<
String
,
Object
>>
list_ongoing
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
/**
* 获取所有记录数
*
* @param entity
* @throws BusinessException
*/
int
listCount_ongoing
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
/**
* 分页获取记录
*
* @param entity
* @throws BusinessException
*/
Page
<
Map
<
String
,
Object
>>
list_ended
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
/**
* 获取所有记录
*
* @param entity
* @throws BusinessException
*/
List
<
Map
<
String
,
Object
>>
list_ended
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
/**
* 获取所有记录数
*
* @param entity
* @throws BusinessException
*/
int
listCount_ended
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
/**
* 获取用户选择
*
* @param entity
* @throws BusinessException
*/
List
<
Map
<
String
,
Object
>>
list_userchecked
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
}
src_jwapp/com/jw/app/business/vote/VoteBusinessImpl.java
View file @
1042d8f0
This diff is collapsed.
Click to expand it.
src_jwapp/com/jw/app/business/vote/voteDAO.java
View file @
1042d8f0
...
...
@@ -10,15 +10,32 @@ import com.gaowj.business.exception.BusinessException;
public
interface
voteDAO
{
void
insert_vote
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
insert_item
(
Map
<
String
,
Object
>
itemmap
)
throws
BusinessException
;
void
insert_userVote
(
Map
<
String
,
Object
>
itemmap
)
throws
BusinessException
;
void
update_vote
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_item
(
Map
<
String
,
Object
>
item
)
throws
BusinessException
;
void
delete_vote
(
List
<
String
>
list
)
throws
BusinessException
;
void
delete_vote_item
(
List
<
String
>
list
)
throws
BusinessException
;
void
delete_vote_action
(
List
<
String
>
list
)
throws
BusinessException
;
void
delete_item
(
List
<
String
>
list
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_vote
(
RowBounds
rowbounds
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_vote
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
listCount_vote
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_item
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_userchecked
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
}
src_jwapp/com/jw/app/business/vote/voteDAO.xml
View file @
1042d8f0
<?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.vote.voteDAO"
>
<sql
id=
"WHERE"
>
<where>
<trim
prefixOverrides=
"and"
>
<if
test=
"UUID != null and UUID != ''"
>
and f.UUID = #{UUID}
</if>
<if
test=
"USERSELF == 0"
>
and f.vote_count > 0
</if>
<if
test=
"CONTENT != null and CONTENT != ''"
>
and f.CONTENT like concat('%',#{CONTENT},'%')
</if>
<if
test=
"CREATE_ID != null and CREATE_ID != ''"
>
and f.CREATE_ID like concat('%',#{CREATE_ID},'%')
</if>
<if
test=
"START_TIME != null and START_TIME != ''"
>
and f.CREATE_TIME
>
= #{START_TIME}
</if>
<if
test=
"END_TIME != null and END_TIME != ''"
>
and f.CREATE_TIME
<
= #{END_TIME}
</if>
<if
test=
"UPDATE_ID != null and UPDATE_ID != ''"
>
and f.UPDATE_ID = #{UPDATE_ID}
</if>
<if
test=
"UPDATE_TIME != null and UPDATE_TIME != ''"
>
and f.UPDATE_TIME = #{UPDATE_TIME}
</if>
<if
test=
"START_START_TIME != null and START_START_TIME != ''"
>
and f.START_TIME
>
= #{START_START_TIME}
</if>
<if
test=
"END_START_TIME != null and END_START_TIME != ''"
>
and f.START_TIME
<
= #{END_START_TIME}
</if>
<if
test=
"START_END_TIME != null and START_END_TIME != ''"
>
and f.END_TIME
>
= #{START_END_TIME}
</if>
<if
test=
"END_END_TIME != null and END_END_TIME != ''"
>
and f.END_TIME
<
= #{END_END_TIME}
</if>
</trim>
</where>
</sql>
<insert
id=
"insert_vote"
parameterType=
"map"
>
insert into VOTE_MANAGER(
insert into VOTE_MANAGE(
<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>
<insert
id=
"insert_item"
parameterType=
"map"
>
insert into VOTE_MANAGE_ITEM(
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"itemListKey"
item=
"key"
>
${key},
</foreach>
</trim>
<![CDATA[ ) values( ]]>
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"itemList"
item=
"value"
>
#{value},
</foreach>
</trim>
<![CDATA[ ) ]]>
</insert>
<insert
id=
"insert_userVote"
parameterType=
"map"
>
insert into VOTE_MANAGE_ACTION(
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"infoListKey"
item=
"key"
>
${key},
...
...
@@ -20,7 +93,7 @@
<update
id=
"update_vote"
parameterType=
"map"
>
<![CDATA[
update VOTE_MANAGE
R
set
update VOTE_MANAGE set
]]>
<trim
prefix=
""
suffixOverrides=
","
>
<foreach
collection=
"info"
item=
"info"
>
...
...
@@ -30,87 +103,145 @@
<where>
<if
test=
"UUID != null and UUID != ''"
>
and UUID = #{UUID}
</if>
</if>
</where>
</update>
<update
id=
"update_item"
parameterType=
"map"
>
<![CDATA[
update VOTE_MANAGE_ITEM 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>
<delete
id=
"delete_vote"
parameterType=
"list"
>
<![CDATA[
delete from VOTE_MANAGE
R
where UUID IN
delete from VOTE_MANAGE where UUID IN
]]>
<foreach
collection=
"list"
item=
"UUID"
open=
"("
separator=
","
close=
")"
>
#{UUID}
</foreach>
#{UUID}
</foreach>
</delete>
<delete
id=
"delete_vote_item"
parameterType=
"list"
>
<![CDATA[
delete from VOTE_MANAGE_ITEM where MANAGE_ID IN
]]>
<foreach
collection=
"list"
item=
"UUID"
open=
"("
separator=
","
close=
")"
>
#{UUID}
</foreach>
</delete>
<delete
id=
"delete_vote_action"
parameterType=
"list"
>
<![CDATA[
delete from VOTE_MANAGE_ACTION where MANAGE_ID IN
]]>
<foreach
collection=
"list"
item=
"UUID"
open=
"("
separator=
","
close=
")"
>
#{UUID}
</foreach>
</delete>
<delete
id=
"delete_item"
parameterType=
"list"
>
<![CDATA[
delete from VOTE_MANAGE_ITEM where UUID IN
]]>
<foreach
collection=
"list"
item=
"UUID"
open=
"("
separator=
","
close=
")"
>
#{UUID}
</foreach>
</delete>
<select
id=
"list_vote"
parameterType=
"map"
resultType=
"upperCaseKeyMap"
>
<![CDATA[
select f.*
from VOTE_MANAGER f where 1=1
]]>
<if
test=
"UUID != null and UUID != ''"
>
and f.UUID = #{UUID}
</if>
<if
test=
"CONTENT != null and CONTENT != ''"
>
and f.CONTENT like concat('%',#{CONTENT},'%')
</if>
<if
test=
"START_TIME != null and START_TIME != ''"
>
and f.START_TIME = #{START_TIME}
</if>
<if
test=
"END_TIME != null and END_TIME != ''"
>
and f.END_TIME = #{END_TIME}
</if>
<if
test=
"CREATE_ID != null and CREATE_ID != ''"
>
and f.CREATE_ID like concat('%',#{CREATE_ID},'%')
</if>
<if
test=
"START_TIME != null and START_TIME != ''"
>
and f.CREATE_TIME
>
= #{START_TIME}
</if>
<if
test=
"END_TIME != null and END_TIME != ''"
>
and f.CREATE_TIME
<
= #{END_TIME}
</if>
<if
test=
"UPDATE_ID != null and UPDATE_ID != ''"
>
and f.UPDATE_ID = #{UPDATE_ID}
</if>
<if
test=
"UPDATE_TIME != null and UPDATE_TIME != ''"
>
and f.UPDATE_TIME = #{UPDATE_TIME}
</if>
SELECT * FROM
(
SELECT
manage.*,
SUM( CASE WHEN action.uuid IS NULL THEN 0 ELSE 1 END ) AS vote_count
FROM
( SELECT * FROM `vote_manage`
<where>
<trim
prefixOverrides=
"and"
>
<if
test=
"STATUS_FLAG != null and STATUS_FLAG != ''"
>
and STATUS_FLAG = #{STATUS_FLAG}
</if>
</trim>
</where>
) manage
LEFT JOIN ( SELECT * FROM `vote_manage_action`
<where>
<trim
prefixOverrides=
"and"
>
<if
test=
"USER_ID != null and USER_ID != ''"
>
and USER_ID = #{USER_ID}
</if>
</trim>
</where>
) action ON manage.uuid = action.manage_id
GROUP BY
manage.uuid
) f
<include
refid=
"WHERE"
></include>
order by f.CREATE_TIME DESC
</select>
<select
id=
"listCount_vote"
parameterType=
"map"
resultType=
"int"
>
<![CDATA[
select count(*) c from VOTE_MANAGER f where 1=1
]]>
<if
test=
"UUID != null and UUID != ''"
>
and f.UUID = #{UUID}
</if>
<if
test=
"CONTENT != null and CONTENT != ''"
>
and f.CONTENT like concat('%',#{CONTENT},'%')
</if>
<if
test=
"START_TIME != null and START_TIME != ''"
>
and f.START_TIME = #{START_TIME}
</if>
<if
test=
"END_TIME != null and END_TIME != ''"
>
and f.END_TIME = #{END_TIME}
</if>
<if
test=
"CREATE_ID != null and CREATE_ID != ''"
>
and f.CREATE_ID like concat('%',#{CREATE_ID},'%')
</if>
<if
test=
"START_TIME != null and START_TIME != ''"
>
and f.CREATE_TIME
>
= #{START_TIME}
</if>
<if
test=
"END_TIME != null and END_TIME != ''"
>
and f.CREATE_TIME
<
= #{END_TIME}
</if>
<if
test=
"UPDATE_ID != null and UPDATE_ID != ''"
>
and f.UPDATE_ID = #{UPDATE_ID}
</if>
<if
test=
"UPDATE_TIME != null and UPDATE_TIME != ''"
>
and f.UPDATE_TIME = #{UPDATE_TIME}
</if>
SELECT count(*) FROM
(
SELECT
manage.*,
SUM( CASE WHEN action.uuid IS NULL THEN 0 ELSE 1 END ) AS vote_count
FROM
( SELECT * FROM `vote_manage`
<where>
<trim
prefixOverrides=
"and"
>
<if
test=
"STATUS_FLAG != null and STATUS_FLAG != ''"
>
and STATUS_FLAG = #{STATUS_FLAG}
</if>
</trim>
</where>
) manage
LEFT JOIN ( SELECT * FROM `vote_manage_action`
<where>
<trim
prefixOverrides=
"and"
>
<if
test=
"USER_ID != null and USER_ID != ''"
>
and USER_ID = #{USER_ID}
</if>
</trim>
</where>
) action ON manage.uuid = action.manage_id
GROUP BY
manage.uuid
) f
<include
refid=
"WHERE"
></include>
</select>
<select
id=
"list_item"
parameterType=
"map"
resultType=
"upperCaseKeyMap"
>
select *
from vote_manage_item
where manage_id=#{MANAGE_ID}
order by sort_num ASC
</select>
<select
id=
"list_userchecked"
parameterType=
"map"
resultType=
"upperCaseKeyMap"
>
select *
from VOTE_MANAGE_ACTION
where manage_id=#{MANAGE_ID}
order by CREATE_TIME ASC
</select>
</mapper>
\ No newline at end of file
src_jwapp/com/jw/app/vote/action/actAction.java
View file @
1042d8f0
...
...
@@ -3,6 +3,7 @@ package com.jw.app.vote.action;
import
java.util.List
;
import
java.util.Map
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONObject
;
import
com.jw.app.business.VoteBusiness
;
...
...
@@ -17,11 +18,8 @@ import com.gaowj.standard.utils.CacheKit;
public
class
actAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
2591076090760872233L
;
private
JSONObject
jsonObject
=
new
JSONObject
();
private
JSONObject
jsonObject
=
new
JSONObject
();
public
JSONObject
getJsonObject
()
{
return
jsonObject
;
...
...
@@ -40,6 +38,7 @@ private JSONObject jsonObject = new JSONObject();
VoteBusiness
business
=
BusinessManager
.
getBusiness
(
VoteBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
jsonObject
=
new
JSONObject
();
try
{
entity
=
QueryParamUtil
.
StringToDate
(
entity
);
...
...
@@ -53,11 +52,34 @@ private JSONObject jsonObject = new JSONObject();
//sysbusiness.insert_logBusiness(具体方法,操作内容,操作描述,操作记录ID,操作记录中文描述,分类)
SystemOpeBusiness
sysbusiness
=
BusinessManager
.
getBusiness
(
SystemOpeBusiness
.
class
);
sysbusiness
.
insert_logBusiness
(
"insertVote"
,
""
+
entity
,
"增加学生测试数据"
,
(
String
)
entity
.
get
(
"UUID"
),
(
String
)
entity
.
get
(
"NAME"
),
"votedemo1"
);
//
//更新缓存
CacheKit
.
update
(
"ehcache11"
,
"com_jw_app_vote_dataAction_listAll"
,
business
.
list_vote
(
null
));
//
"增加投票主题"
,
(
String
)
entity
.
get
(
"UUID"
),
(
String
)
entity
.
get
(
"CONTENT"
),
"votedemo1"
);
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"保存成功"
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"保存失败"
));
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 插入用户投票
* @param entity
* @throws BusinessException
*/
public
String
insertUserVote
()
throws
BusinessException
{
VoteBusiness
business
=
BusinessManager
.
getBusiness
(
VoteBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
jsonObject
=
new
JSONObject
();
try
{
entity
=
QueryParamUtil
.
StringToDate
(
entity
);
//去除不要更新的字段
entity
.
remove
(
"OPETYPE"
);
//新增
business
.
insert_userVote
(
entity
);
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"保存成功"
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"保存失败"
));
...
...
@@ -85,8 +107,31 @@ private JSONObject jsonObject = new JSONObject();
// 操作日志
SystemOpeBusiness
sysbusiness
=
BusinessManager
.
getBusiness
(
SystemOpeBusiness
.
class
);
sysbusiness
.
insert_logBusiness
(
"updateVote"
,
""
+
entity
,
"修改测试数据"
,(
String
)
entity
.
get
(
"UUID"
),
(
String
)
entity
.
get
(
"NAME"
),
"votedemo1"
);
//
"修改投票主题"
,(
String
)
entity
.
get
(
"UUID"
),
(
String
)
entity
.
get
(
"CONTENT"
),
"votedemo1"
);
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"修改成功"
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"修改失败"
));
e
.
printStackTrace
();
}
return
"json"
;
}
/**
* 更新
* @param entity
* @throws BusinessException
*/
public
String
endVote
()
throws
BusinessException
{
VoteBusiness
business
=
BusinessManager
.
getBusiness
(
VoteBusiness
.
class
);
Map
<
String
,
Object
>
entity
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
//去除不要更新的字段
entity
.
remove
(
"OPETYPE"
);
//修改
entity
=
QueryParamUtil
.
StringToDate
(
entity
);
business
.
update_endvote
(
entity
);
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"修改成功"
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"修改失败"
));
...
...
@@ -112,9 +157,7 @@ private JSONObject jsonObject = new JSONObject();
// 操作日志
SystemOpeBusiness
sysbusiness
=
BusinessManager
.
getBusiness
(
SystemOpeBusiness
.
class
);
sysbusiness
.
insert_logBusiness
(
"deleteVote"
,
""
+
ListKey
,
"删除测试数据"
,
deletekey
,
"多个流水号"
,
"votedemo1"
);
//
"删除投票主题"
,
deletekey
,
"多个流水号"
,
"votedemo1"
);
jsonObject
.
putAll
(
Status
.
getStatusSuccessMessage
(
"删除成功"
));
}
catch
(
Exception
e
)
{
jsonObject
.
putAll
(
Status
.
getStatusErrorMessage
(
"删除失败"
));
...
...
@@ -122,5 +165,6 @@ private JSONObject jsonObject = new JSONObject();
}
return
"json"
;
}
}
src_jwapp/com/jw/app/vote/action/dataAction.java
View file @
1042d8f0
...
...
@@ -22,11 +22,8 @@ import com.gaowj.business.util.TestMd5;
import
com.gaowj.standard.utils.CacheKit
;
public
class
dataAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1829141492939513911L
;
private
JSONObject
jsonObject
=
new
JSONObject
();
private
JSONObject
jsonObject
=
new
JSONObject
();
private
int
rows
=
20
;
// 每页显示的记录数
private
int
page
=
1
;
// 当前第几页
public
JSONObject
getJsonObject
()
{
...
...
@@ -79,6 +76,58 @@ private JSONObject jsonObject = new JSONObject();
return
"json"
;
}
public
String
list_ongoing
()
throws
BusinessException
{
VoteBusiness
business
=
BusinessManager
.
getBusiness
(
VoteBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
Page
<
Map
<
String
,
Object
>>
pageRows
=
business
.
list_ongoing
(
pageNo
,
pageSize
,
query
);
setPageCount
((
pageRows
.
getCount
()
-
1
)
/
pageSize
+
1
);
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateTimeToString
(
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"
;
}
public
String
list_ended
()
throws
BusinessException
{
VoteBusiness
business
=
BusinessManager
.
getBusiness
(
VoteBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
Page
<
Map
<
String
,
Object
>>
pageRows
=
business
.
list_ended
(
pageNo
,
pageSize
,
query
);
setPageCount
((
pageRows
.
getCount
()
-
1
)
/
pageSize
+
1
);
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateTimeToString
(
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
...
...
@@ -115,25 +164,10 @@ private JSONObject jsonObject = new JSONObject();
String
tt
=
PropUtil
.
getValue
(
"login_main_url"
,
"quartz_service"
,
""
);
//缓存使用
//查看src下ehcache.xml缓存配置文件。(ehcache1-ehcache10表示有10个缓存对象,分别只能缓存1-10分钟,最后有个ehcache11可以持久缓存)
List
<
Map
<
String
,
Object
>>
listData
=
null
;
TestMd5
md5
=
new
TestMd5
();
String
queryMD5
=
""
;
try
{
queryMD5
=
md5
.
MD5
(
query
.
toString
());
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
listData
=
CacheKit
.
get
(
"ehcache11"
,
"com_jw_app_vote_dataAction_listAll_"
+
queryMD5
);
if
(
listData
==
null
){
listData
=
business
.
list_vote
(
query
);
CacheKit
.
put
(
"ehcache11"
,
"com_jw_app_vote_dataAction_listAll_"
+
queryMD5
,
listData
);
}
List
<
Map
<
String
,
Object
>>
listData
=
business
.
list_vote
(
query
);
int
listDataCount
=
listData
.
size
();
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateToString
(
listData
));
data
.
put
(
"rowSet"
,
QueryParamUtil
.
DateT
imeT
oString
(
listData
));
data
.
put
(
"pageNo"
,
1
);
data
.
put
(
"pageSize"
,
listDataCount
);
data
.
put
(
"pageCount"
,
listDataCount
);
...
...
@@ -150,5 +184,33 @@ private JSONObject jsonObject = new JSONObject();
}
return
"json"
;
}
public
String
listItem
()
throws
BusinessException
{
VoteBusiness
business
=
BusinessManager
.
getBusiness
(
VoteBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
List
<
Map
<
String
,
Object
>>
listItems
=
business
.
list_item
(
query
);
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"listItems"
,
listItems
);
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
"json"
;
}
public
String
listUserChecked
()
throws
BusinessException
{
VoteBusiness
business
=
BusinessManager
.
getBusiness
(
VoteBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
List
<
Map
<
String
,
Object
>>
listusercheckeds
=
business
.
list_userchecked
(
query
);
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"listusercheckeds"
,
listusercheckeds
);
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
"json"
;
}
}
src_jwapp/com/jw/app/vote/action/viewAction.java
View file @
1042d8f0
...
...
@@ -8,14 +8,25 @@ import com.gaowj.business.exception.BusinessException;
import
com.gaowj.business.util.RequestUtils
;
public
class
viewAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
6259964352154128000L
;
public
String
voteTab
()
throws
BusinessException
{
public
String
ongoingVoteTab
()
throws
BusinessException
{
return
"ongoingVoteTab"
;
}
public
String
endedVoteTab
()
throws
BusinessException
{
return
"endedVoteTab"
;
}
public
String
voteTab
()
throws
BusinessException
{
return
"voteTab"
;
}
public
String
userVoteTabDetail
()
throws
BusinessException
{
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMapUtf8
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
request
.
setAttribute
(
"is_row"
,
query
);
return
"userVoteTabDetail"
;
}
public
String
voteTabDetail
()
throws
BusinessException
{
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMapUtf8
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
...
...
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