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
bca92c3a
Commit
bca92c3a
authored
Apr 28, 2018
by
罗绍泽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
应用接口初始化
parent
84e9a1d3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
519 additions
and
60 deletions
+519
-60
portletApi.jsp
WebContent/jwapp/pages/portlet/portletApi.jsp
+1
-1
struts-ext.xml
src/struts-ext.xml
+14
-0
actAction.java
src_jwapp/com/jw/app/apps/action/actAction.java
+0
-0
dataAction.java
src_jwapp/com/jw/app/apps/action/dataAction.java
+232
-0
AppsBusiness.java
src_jwapp/com/jw/app/business/AppsBusiness.java
+98
-0
AppsBusinessImpl.java
src_jwapp/com/jw/app/business/apps/AppsBusinessImpl.java
+0
-0
AppsDAO.java
src_jwapp/com/jw/app/business/apps/AppsDAO.java
+98
-0
AppsDAO.xml
src_jwapp/com/jw/app/business/apps/AppsDAO.xml
+0
-0
PortletBusinessImpl.java
...wapp/com/jw/app/business/portlet/PortletBusinessImpl.java
+63
-55
PortletDAO.xml
src_jwapp/com/jw/app/business/portlet/PortletDAO.xml
+13
-4
No files found.
WebContent/jwapp/pages/portlet/portletApi.jsp
View file @
bca92c3a
...
@@ -154,7 +154,7 @@ var result = jwAppPortletModel.jwAppsPortletActAction.saveLayout({
...
@@ -154,7 +154,7 @@ var result = jwAppPortletModel.jwAppsPortletActAction.saveLayout({
</tr>
</tr>
<tr>
<tr>
<td>
参数备注
</td>
<td>
参数备注
</td>
<td>
FIELD_COLUMN_ID:栏目id
</td>
<td>
1.columnsId:栏目id;2.portlets:portlets的id数组
</td>
</tr>
</tr>
<tr>
<tr>
<td><span
class=
"look"
>
结果查看
</span></td>
<td><span
class=
"look"
>
结果查看
</span></td>
...
...
src/struts-ext.xml
View file @
bca92c3a
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
<struts>
<struts>
<package
name=
"src_jwapp"
extends=
"gaowj"
>
<package
name=
"src_jwapp"
extends=
"gaowj"
>
<!-- Portlet相关 -->
<action
name=
"jwAppsPortletAct_*"
class=
"com.jw.app.portlet.action.actAction"
<action
name=
"jwAppsPortletAct_*"
class=
"com.jw.app.portlet.action.actAction"
method=
"{1}"
>
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<result
name=
"json"
type=
"json"
>
...
@@ -21,5 +22,18 @@
...
@@ -21,5 +22,18 @@
method=
"{1}"
>
method=
"{1}"
>
<result
name=
"{1}"
>
/jwapp/pages/portlet/{1}.jsp
</result>
<result
name=
"{1}"
>
/jwapp/pages/portlet/{1}.jsp
</result>
</action>
</action>
<!-- 集成应用相关 -->
<action
name=
"jwAppsAppstoreAct_*"
class=
"com.jw.app.apps.action.actAction"
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<param
name=
"root"
>
jsonObject
</param>
</result>
</action>
<action
name=
"jwAppsAppstoreData_*"
class=
"com.jw.app.apps.action.dataAction"
method=
"{1}"
>
<result
name=
"json"
type=
"json"
>
<param
name=
"root"
>
jsonObject
</param>
</result>
</action>
</package>
</package>
</struts>
</struts>
src_jwapp/com/jw/app/apps/action/actAction.java
0 → 100644
View file @
bca92c3a
This diff is collapsed.
Click to expand it.
src_jwapp/com/jw/app/apps/action/dataAction.java
0 → 100644
View file @
bca92c3a
package
com
.
jw
.
app
.
apps
.
action
;
import
java.sql.SQLException
;
import
java.text.ParseException
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
net.sf.json.JSONObject
;
import
com.gaowj.business.action.BasicAction
;
import
com.gaowj.business.comp.BusinessManager
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.Encipher
;
import
com.gaowj.business.util.Page
;
import
com.gaowj.business.util.RequestUtils
;
import
com.gaowj.business.util.SessionUtil
;
import
com.jw.app.business.AppsBusiness
;
import
com.jw.app.business.utils.QueryParamUtil
;
public
class
dataAction
extends
BasicAction
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
4630126275397330597L
;
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
();
}
public
String
listAppAccount
()
throws
BusinessException
{
AppsBusiness
business
=
BusinessManager
.
getBusiness
(
AppsBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
Page
<
Map
<
String
,
Object
>>
pageRows
=
business
.
list_app_account
(
pageNo
,
pageSize
,
query
);
for
(
Map
<
String
,
Object
>
m
:
pageRows
.
getItems
()){
if
(
m
.
get
(
"PWD"
)!=
null
){
m
.
put
(
"PWD"
,
Encipher
.
DecodePasswd
((
String
)
m
.
get
(
"PWD"
)));
}
}
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"
;
}
public
String
listAllAppAccount
()
throws
BusinessException
{
AppsBusiness
business
=
BusinessManager
.
getBusiness
(
AppsBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
List
<
Map
<
String
,
Object
>>
listData
=
business
.
list_app_account
(
query
);
for
(
Map
<
String
,
Object
>
m
:
listData
){
if
(
m
.
get
(
"PWD"
)!=
null
){
m
.
put
(
"PWD"
,
Encipher
.
DecodePasswd
((
String
)
m
.
get
(
"PWD"
)));
}
}
int
listDataCount
=
business
.
listCount_app_account
(
query
);
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"
;
}
public
String
listApp
()
throws
BusinessException
{
AppsBusiness
business
=
BusinessManager
.
getBusiness
(
AppsBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
Page
<
Map
<
String
,
Object
>>
pageRows
=
business
.
list_app
(
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"
;
}
public
String
listAllApp
()
throws
BusinessException
{
AppsBusiness
business
=
BusinessManager
.
getBusiness
(
AppsBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
List
<
Map
<
String
,
Object
>>
listData
=
business
.
list_apps_portal
(
query
);
int
listDataCount
=
business
.
listCount_app
(
query
);
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"
;
}
public
String
listAllCategory
()
throws
BusinessException
{
AppsBusiness
business
=
BusinessManager
.
getBusiness
(
AppsBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
List
<
Map
<
String
,
Object
>>
listData
=
business
.
list_category
(
query
);
int
listDataCount
=
business
.
listCount_category
(
query
);
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"
;
}
public
String
listUserAllApp
()
throws
BusinessException
{
AppsBusiness
business
=
BusinessManager
.
getBusiness
(
AppsBusiness
.
class
);
Map
<
String
,
Object
>
query
=
RequestUtils
.
getUpdateFieldMap
(
request
,
RequestUtils
.
UPDATEDATAFIELDPREFIX
);
try
{
query
=
QueryParamUtil
.
StringToDate
(
query
);
query
.
put
(
"USERID"
,
SessionUtil
.
getCode
());
Page
<
Map
<
String
,
Object
>>
pageRows
=
business
.
list_userallapp
(
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"
;
}
}
src_jwapp/com/jw/app/business/AppsBusiness.java
0 → 100644
View file @
bca92c3a
package
com
.
jw
.
app
.
business
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.stereotype.Service
;
import
com.gaowj.business.exception.BusinessException
;
import
com.gaowj.business.util.Page
;
@Service
public
interface
AppsBusiness
{
//APP_ACCOUNT 模拟登陆帐号密码管理
String
insert_app_account
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_app_account
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
delete_app_account
(
List
<
String
>
list
)
throws
BusinessException
;
Page
<
Map
<
String
,
Object
>>
list_app_account
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_app_account
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
listCount_app_account
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
//APPS_APP app详细信息
String
insert_app
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_app
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
delete_app
(
List
<
String
>
list
)
throws
BusinessException
;
Page
<
Map
<
String
,
Object
>>
list_app
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_app
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_apps_portal
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
listCount_app
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
//APPS_CATEGORY app分类信息
void
insert_category
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_category
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
delete_category
(
List
<
String
>
list
)
throws
BusinessException
;
Page
<
Map
<
String
,
Object
>>
list_category
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_category
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
listCount_category
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
//APP_INSTALL app用户安装信息
void
insert_install
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_install
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
delete_install
(
List
<
String
>
list
)
throws
BusinessException
;
void
delete_install_app_id
(
List
<
String
>
list
)
throws
BusinessException
;
void
delete_install_app_user
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
Page
<
Map
<
String
,
Object
>>
list_install
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_install
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
listCount_install
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
//APPS_UNINSTALL app用户卸载信息
void
insert_uninstall
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_uninstall
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
void
delete_uninstall
(
List
<
String
>
list
)
throws
BusinessException
;
void
delete_uninstall_app_id
(
List
<
String
>
list
)
throws
BusinessException
;
void
delete_uninstall_app_user
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
Page
<
Map
<
String
,
Object
>>
list_uninstall
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_uninstall
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
listCount_uninstall
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
//APPS_USERALLAPP用户所有已安装和未安装app信息
Page
<
Map
<
String
,
Object
>>
list_userallapp
(
int
pageNo
,
int
pageSize
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_userallapp
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
listCount_userallapp
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
//APPS_USERALLAPP_NEWUSER找出所有未安装app的信息
List
<
Map
<
String
,
Object
>>
list_userallapp_newuser
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
}
src_jwapp/com/jw/app/business/apps/AppsBusinessImpl.java
0 → 100644
View file @
bca92c3a
This diff is collapsed.
Click to expand it.
src_jwapp/com/jw/app/business/apps/AppsDAO.java
0 → 100644
View file @
bca92c3a
package
com
.
jw
.
app
.
business
.
apps
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.session.RowBounds
;
import
com.gaowj.business.exception.BusinessException
;
public
interface
AppsDAO
{
//APP_ACCOUNT 模拟登陆帐号密码管理
void
insert_app_account
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_app_account
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
delete_app_account
(
List
<
String
>
list
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_app_account
(
RowBounds
rowbounds
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_app_account
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
listCount_app_account
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
//APPS_APP app详细信息
void
insert_app
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_app
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
delete_app
(
List
<
String
>
list
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_app
(
RowBounds
rowbounds
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_app
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
listCount_app
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_delete_app
(
List
<
String
>
list
)
throws
BusinessException
;
//APPS_CATEGORY app分类信息
void
insert_category
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_category
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
delete_category
(
List
<
String
>
list
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_category
(
RowBounds
rowbounds
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_category
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
listCount_category
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
//APP_INSTALL app用户安装信息
void
insert_install
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_install
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
delete_install
(
List
<
String
>
list
)
throws
BusinessException
;
void
delete_install_app_id
(
List
<
String
>
list
)
throws
BusinessException
;
void
delete_install_app_user
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_install
(
RowBounds
rowbounds
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_install
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
listCount_install
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
//APPS_UNINSTALL app用户卸载信息
void
insert_uninstall
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
update_uninstall
(
Map
<
String
,
Object
>
entity
)
throws
BusinessException
;
void
delete_uninstall
(
List
<
String
>
list
)
throws
BusinessException
;
void
delete_uninstall_app_id
(
List
<
String
>
list
)
throws
BusinessException
;
void
delete_uninstall_app_user
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_uninstall
(
RowBounds
rowbounds
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_uninstall
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
listCount_uninstall
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
//APPS_USERALLAPP用户所有已安装和未安装app信息
List
<
Map
<
String
,
Object
>>
list_userallapp
(
RowBounds
rowbounds
,
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_userallapp
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
int
listCount_userallapp
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
//APPS_USERALLAPP_NEWUSER找出所有未安装app的信息
List
<
Map
<
String
,
Object
>>
list_userallapp_newuser
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
List
<
Map
<
String
,
Object
>>
list_apps_portal
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
;
}
src_jwapp/com/jw/app/business/apps/AppsDAO.xml
0 → 100644
View file @
bca92c3a
This diff is collapsed.
Click to expand it.
src_jwapp/com/jw/app/business/portlet/PortletBusinessImpl.java
View file @
bca92c3a
...
@@ -20,7 +20,7 @@ public class PortletBusinessImpl implements PortletBusiness {
...
@@ -20,7 +20,7 @@ public class PortletBusinessImpl implements PortletBusiness {
/**
/**
* 默认模板的标识符
* 默认模板的标识符
*/
*/
private
static
final
String
DEFAULT
=
"default"
;
private
static
final
String
DEFAULT
=
"default"
;
private
PortletDAO
portletDAO
;
private
PortletDAO
portletDAO
;
...
@@ -32,38 +32,18 @@ public class PortletBusinessImpl implements PortletBusiness {
...
@@ -32,38 +32,18 @@ public class PortletBusinessImpl implements PortletBusiness {
this
.
portletDAO
=
portletDAO
;
this
.
portletDAO
=
portletDAO
;
}
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
list_portlet_template_by_user
(
Map
<
String
,
Object
>
query
)
public
List
<
Map
<
String
,
Object
>>
list_portlet_template_by_user
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
{
throws
BusinessException
{
List
<
Map
<
String
,
Object
>>
listData
=
null
;
List
<
Map
<
String
,
Object
>>
listData
=
null
;
try
{
try
{
query
.
put
(
"USER_ID"
,
SessionUtil
.
getEmid
());
query
.
put
(
"USER_ID"
,
SessionUtil
.
getEmid
());
listData
=
QueryParamUtil
.
ClobToString
(
portletDAO
.
list_portlet_template_user
(
query
));
listData
=
QueryParamUtil
.
ClobToString
(
portletDAO
.
list_portlet_template_user
(
query
));
if
(
listData
.
size
()==
0
)
{
if
(
listData
.
size
()
==
0
)
{
//如果当前登陆人还没有设置自定义的资源,则显示默认的资源
//
如果当前登陆人还没有设置自定义的资源,则显示默认的资源
query
.
put
(
"USER_ID"
,
DEFAULT
);
query
.
put
(
"USER_ID"
,
DEFAULT
);
listData
=
QueryParamUtil
.
ClobToString
(
portletDAO
.
list_portlet_template_user
(
query
));
listData
=
QueryParamUtil
.
ClobToString
(
portletDAO
.
list_portlet_template_user
(
query
));
}
}
for
(
Map
<
String
,
Object
>
map:
listData
){
manageMap
(
listData
);
if
(
"5"
.
equals
(
map
.
get
(
"P_TYPE"
))){
//如果是内容发布,则将内容发布的信息传回去
Map
<
String
,
Object
>
contentQuery
=
new
HashMap
<
String
,
Object
>();
contentQuery
.
put
(
"PORTAL_ID"
,
map
.
get
(
"PORTLET_ID"
));
List
<
Map
<
String
,
Object
>>
listInfo
=
portletDAO
.
list_portlet_content
(
contentQuery
);
map
.
put
(
"INFOS"
,
listInfo
);
}
else
if
(
"4"
.
equals
(
map
.
get
(
"P_TYPE"
))){
//如果是模拟登陆,则把登录的url和用户密码传回去
Map
<
String
,
Object
>
appQuery
=
new
HashMap
<
String
,
Object
>();
//当前登陆人,当前需要模拟登录的APP_ID
appQuery
.
put
(
"APP_ID"
,
map
.
get
(
"APP_ID"
));
appQuery
.
put
(
"USER_ID"
,
SessionUtil
.
getEmid
());
List
<
Map
<
String
,
Object
>>
listWebInfo
=
portletDAO
.
list_app_acount
(
appQuery
);
if
(
listWebInfo
.
size
()>
0
){
map
.
put
(
"WEB_INFO"
,
listWebInfo
.
get
(
0
));
}
}
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
// TODO Auto-generated catch block
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -74,9 +54,36 @@ public class PortletBusinessImpl implements PortletBusiness {
...
@@ -74,9 +54,36 @@ public class PortletBusinessImpl implements PortletBusiness {
return
listData
;
return
listData
;
}
}
/**
* 处理特殊信息
*
* @param listData
*/
private
void
manageMap
(
List
<
Map
<
String
,
Object
>>
listData
)
{
for
(
Map
<
String
,
Object
>
map
:
listData
)
{
if
(
"5"
.
equals
(
map
.
get
(
"P_TYPE"
)))
{
// 如果是内容发布,则将内容发布的信息传回去
Map
<
String
,
Object
>
contentQuery
=
new
HashMap
<
String
,
Object
>();
contentQuery
.
put
(
"PORTAL_ID"
,
map
.
get
(
"PORTLET_ID"
));
List
<
Map
<
String
,
Object
>>
listInfo
=
portletDAO
.
list_portlet_content
(
contentQuery
);
map
.
put
(
"INFOS"
,
listInfo
);
}
else
if
(
"4"
.
equals
(
map
.
get
(
"P_TYPE"
)))
{
// 如果是模拟登陆,则把登录的url和用户密码传回去
Map
<
String
,
Object
>
appQuery
=
new
HashMap
<
String
,
Object
>();
// 当前登陆人,当前需要模拟登录的APP_ID
appQuery
.
put
(
"APP_ID"
,
map
.
get
(
"APP_ID"
));
appQuery
.
put
(
"USER_ID"
,
SessionUtil
.
getEmid
());
List
<
Map
<
String
,
Object
>>
listWebInfo
=
portletDAO
.
list_app_acount
(
appQuery
);
if
(
listWebInfo
.
size
()
>
0
)
{
map
.
put
(
"WEB_INFO"
,
listWebInfo
.
get
(
0
));
}
}
}
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
list_portlet_columns
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
{
public
List
<
Map
<
String
,
Object
>>
list_portlet_columns
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
{
List
<
Map
<
String
,
Object
>>
listData
=
null
;
List
<
Map
<
String
,
Object
>>
listData
=
null
;
try
{
try
{
listData
=
QueryParamUtil
.
ClobToString
(
portletDAO
.
list_portlet_columns
(
query
));
listData
=
QueryParamUtil
.
ClobToString
(
portletDAO
.
list_portlet_columns
(
query
));
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
@@ -91,9 +98,10 @@ public class PortletBusinessImpl implements PortletBusiness {
...
@@ -91,9 +98,10 @@ public class PortletBusinessImpl implements PortletBusiness {
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
list_portlet_template
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
{
public
List
<
Map
<
String
,
Object
>>
list_portlet_template
(
Map
<
String
,
Object
>
query
)
throws
BusinessException
{
List
<
Map
<
String
,
Object
>>
listData
=
null
;
List
<
Map
<
String
,
Object
>>
listData
=
null
;
try
{
try
{
listData
=
QueryParamUtil
.
ClobToString
(
portletDAO
.
list_portlet_template
(
query
));
listData
=
QueryParamUtil
.
ClobToString
(
portletDAO
.
list_portlet_template
(
query
));
manageMap
(
listData
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
// TODO Auto-generated catch block
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -105,44 +113,44 @@ public class PortletBusinessImpl implements PortletBusiness {
...
@@ -105,44 +113,44 @@ public class PortletBusinessImpl implements PortletBusiness {
}
}
@Override
@Override
public
void
saveLayout
(
String
columnsId
,
List
<
Map
<
String
,
Object
>>
list
)
throws
BusinessException
{
public
void
saveLayout
(
String
columnsId
,
List
<
Map
<
String
,
Object
>>
list
)
throws
BusinessException
{
String
userId
=
SessionUtil
.
getEmid
();
String
userId
=
SessionUtil
.
getEmid
();
List
<
Map
<
String
,
Object
>>
listData
=
null
;
List
<
Map
<
String
,
Object
>>
listData
=
null
;
try
{
try
{
Map
<
String
,
Object
>
query
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
query
=
new
HashMap
<
String
,
Object
>();
query
.
put
(
"USER_ID"
,
userId
);
query
.
put
(
"USER_ID"
,
userId
);
query
.
put
(
"COLUMN_ID"
,
columnsId
);
query
.
put
(
"COLUMN_ID"
,
columnsId
);
listData
=
QueryParamUtil
.
ClobToString
(
portletDAO
.
list_portlet_template_user
(
query
));
listData
=
QueryParamUtil
.
ClobToString
(
portletDAO
.
list_portlet_template_user
(
query
));
if
(
listData
.
size
()==
0
)
{
if
(
listData
.
size
()
==
0
)
{
//如果当前登陆人没有设置自己的模板布局,则查询默认的布局
//
如果当前登陆人没有设置自己的模板布局,则查询默认的布局
query
.
put
(
"USER_ID"
,
DEFAULT
);
query
.
put
(
"USER_ID"
,
DEFAULT
);
listData
=
QueryParamUtil
.
ClobToString
(
portletDAO
.
list_portlet_template_user
(
query
));
listData
=
QueryParamUtil
.
ClobToString
(
portletDAO
.
list_portlet_template_user
(
query
));
}
}
//验证用户传过来的布局和数据库中的布局是否一致,默认为一致
//
验证用户传过来的布局和数据库中的布局是否一致,默认为一致
boolean
same
=
true
;
boolean
same
=
true
;
if
(
listData
.
size
()!=
list
.
size
())
{
if
(
listData
.
size
()
!=
list
.
size
())
{
same
=
false
;
same
=
false
;
}
else
{
}
else
{
//长度一致的情况下,判断每一个索引所在位置的portletId是否一致
//
长度一致的情况下,判断每一个索引所在位置的portletId是否一致
for
(
int
i
=
0
;
i
<
listData
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
listData
.
size
();
i
++)
{
//只要有一个不满足,则设置same为false
//
只要有一个不满足,则设置same为false
if
(!
listData
.
get
(
i
).
get
(
"PORTLET_ID"
).
equals
(
list
.
get
(
i
).
get
(
"PORTLET_ID"
)))
{
if
(!
listData
.
get
(
i
).
get
(
"PORTLET_ID"
).
equals
(
list
.
get
(
i
).
get
(
"PORTLET_ID"
)))
{
same
=
false
;
same
=
false
;
break
;
break
;
}
}
}
}
}
}
if
(!
same
)
{
if
(!
same
)
{
//如果不一致,则将用户的自定义模板布局删除,重新添加新布局进行保存
//
如果不一致,则将用户的自定义模板布局删除,重新添加新布局进行保存
Map
<
String
,
Object
>
deleteQuery
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
deleteQuery
=
new
HashMap
<
String
,
Object
>();
deleteQuery
.
put
(
"USER_ID"
,
userId
);
deleteQuery
.
put
(
"USER_ID"
,
userId
);
portletDAO
.
delete_portlet_template_user
(
deleteQuery
);
portletDAO
.
delete_portlet_template_user
(
deleteQuery
);
//重新添加
//
重新添加
int
index
=
0
;
int
index
=
0
;
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
now
=
formatter
.
format
(
new
Date
());
String
now
=
formatter
.
format
(
new
Date
());
for
(
Map
<
String
,
Object
>
map:
list
)
{
for
(
Map
<
String
,
Object
>
map
:
list
)
{
map
.
put
(
"ID"
,
UUID
.
randomUUID
().
toString
());
map
.
put
(
"ID"
,
UUID
.
randomUUID
().
toString
());
map
.
put
(
"USER_ID"
,
userId
);
map
.
put
(
"USER_ID"
,
userId
);
map
.
put
(
"ORDER_NUM"
,
index
++);
map
.
put
(
"ORDER_NUM"
,
index
++);
...
@@ -161,10 +169,10 @@ public class PortletBusinessImpl implements PortletBusiness {
...
@@ -161,10 +169,10 @@ public class PortletBusinessImpl implements PortletBusiness {
}
}
}
}
private
List
<
Map
<
String
,
Object
>>
mapToList
(
Map
<
String
,
Object
>
map
)
{
private
List
<
Map
<
String
,
Object
>>
mapToList
(
Map
<
String
,
Object
>
map
)
{
List
<
Map
<
String
,
Object
>>
entity
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
entity
=
new
ArrayList
<
Map
<
String
,
Object
>>();
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
map
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
map
.
entrySet
())
{
Map
<
String
,
Object
>
field
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
field
=
new
HashMap
<
String
,
Object
>();
field
.
put
(
"key"
,
entry
.
getKey
());
field
.
put
(
"key"
,
entry
.
getKey
());
field
.
put
(
"value"
,
entry
.
getValue
());
field
.
put
(
"value"
,
entry
.
getValue
());
entity
.
add
(
field
);
entity
.
add
(
field
);
...
...
src_jwapp/com/jw/app/business/portlet/PortletDAO.xml
View file @
bca92c3a
...
@@ -115,10 +115,19 @@
...
@@ -115,10 +115,19 @@
<select
id=
"list_app_acount"
parameterType=
"map"
<select
id=
"list_app_acount"
parameterType=
"map"
resultType=
"upperCaseKeyMap"
>
resultType=
"upperCaseKeyMap"
>
select btua.*,btumu.USER_NAME,btumu.USER_PWD,btumu.USER_ID from b_t_ufp_apps btua
SELECT
left join b_t_ufp_mapper_user btumu
btua.*, btumu.USER_NAME,
on btua.APP_ID=btumu.APP_ID
btumu.USER_PWD,
WHERE btumu.USER_ID=#{USER_ID} AND btua.APP_ID=#{APP_ID}
btumu.USER_ID,
ctso.USER_ID AS SSO_USER_ID
FROM
b_t_ufp_apps btua
LEFT JOIN b_t_ufp_mapper_user btumu ON btua.APP_ID = btumu.APP_ID
LEFT JOIN c_t_sys_otherlogin ctso ON btumu.USER_ID = ctso.USER_SYS_NAME
AND btumu.APP_ID = ctso.YIYONG_ID
WHERE
ctso.USER_ID = #{USER_ID}
AND ctso.YIYONG_ID = #{APP_ID}
</select>
</select>
<delete
id=
"delete_portlet_template_user"
parameterType=
"map"
>
<delete
id=
"delete_portlet_template_user"
parameterType=
"map"
>
...
...
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