Commit 77e0c173 by 罗绍泽

初步查询到所有的应用信息

parent a394e449
......@@ -7,6 +7,7 @@
<property name="mapperLocations">
<list>
<value>classpath:com/jw/app/business/portlet/PortletDAO.xml</value>
<value>classpath:com/jw/app/business/apps/AppsDAO.xml</value>
</list>
</property>
</bean>
......@@ -17,9 +18,19 @@
<property name="portletDAO" ref="portletDAO"/>
</bean>
<bean id="AppsBusiness"
class="com.jw.app.business.apps.AppsBusinessImpl">
<property name="appsDAO" ref="appsDAO"/>
</bean>
<!-- DAO -->
<bean id="portletDAO" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.jw.app.business.portlet.PortletDAO"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory-apps"/>
</bean>
<bean id="appsDAO" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.jw.app.business.apps.AppsDAO"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory-apps"/>
</bean>
</beans>
......@@ -12,6 +12,9 @@
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/plug/fancyBox/js/jquery.fancybox-media.js?v=1.0.5"></script>
<!-- xcConfirm的js -->
<script src="${pageContext.request.contextPath}/lib/plug/xcConfirm/js/xcConfirm.js"></script>
<!-- 调用api时的js -->
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/common/js/lang_json.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/apps/js/jwAppAppsModule.js" charset="utf-8"></script>
<script type="text/javascript">
var ctx='${pageContext.request.contextPath}';
</script>
......@@ -212,7 +215,7 @@ a{
<div class="index_application_right">
<div class="index_application_show">
<div class="index_application_show_tabs">
<span class="index_application_show_tabs_click">全部应用</span><span>教学类</span><span>管理类</span><span>服务类</span><span>娱乐类</span><span>默认应用</span>
<!-- <span class="index_application_show_tabs_click">全部应用</span><span>教学类</span><span>管理类</span><span>服务类</span><span>娱乐类</span><span>默认应用</span> -->
</div>
<div class="index_application_show_tabs_container">
......@@ -290,7 +293,18 @@ a{
</div>
<script>
//全局变量所有的应用
var list_allApps = jwAppAppsModel.jwAppsAppsDataAction.list_allApps_by_user({FIELD_COLUMN_ID:$('.layout_center_navClick').data('uuid')});
$(function(){
//初始化类别
init_index_categorys();
//初始化apps
//init_index_apps();
//左边导航的切换
$('.index_application_left>div').bind('click',function(){
$('.index_application_left_click').toggleClass('index_application_left_click');
......@@ -327,7 +341,6 @@ $(function(){
$('.index_application_show_tabs>span').bind('click',function(){
$('.index_application_show_tabs_click').toggleClass('index_application_show_tabs_click');
$(this).addClass('index_application_show_tabs_click');
})
})
......@@ -395,4 +408,10 @@ function index_application_isLoad(handler){
function index_application_close(){
console.log('关闭')
}
//初始化类别
function init_index_categorys(){
console.log(list_allApps)
}
</script>
......@@ -64,7 +64,6 @@
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/plug/jquery-easyui-1.5.3/locale/easyui-lang-zh_CN.js"></script>
<!-- 调用api时的js -->
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/common/js/lang_json.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/portlet/js/jwAppPortletModule.js" charset="utf-8"></script>
<script type="text/javascript">
var ctx='${pageContext.request.contextPath}';
......
......@@ -5,6 +5,7 @@
<head>
<title>首页</title>
<jsp:include page="header.jsp"></jsp:include>
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/portlet/js/jwAppPortletModule.js" charset="utf-8"></script>
<script src="${ctx}/jfcas04/js/index.js"></script>
</head>
<body>
......
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:include page="../header.jsp"></jsp:include>
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/portlet/js/jwAppPortletModule.js" charset="utf-8"></script>
<div class="index_container_two_left_echarts_container">
<div><span>各部门每天办件率情况图表.</span><a href="javascript:void(0)">查看更多</a></div>
<div id="index_content_echartsContainer" style="width:100%;height:314px;"></div>
......
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:include page="../header.jsp"></jsp:include>
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/portlet/js/jwAppPortletModule.js" charset="utf-8"></script>
<div class="index_container_three_center_container">
<div>
<span>技术</span>
......
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:include page="../header.jsp"></jsp:include>
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/portlet/js/jwAppPortletModule.js" charset="utf-8"></script>
<div class="index_container_news">
<div>中纪委“大虎”通报缘何出现重大变化</div>
<div>国家移民管理局挂牌仪式举行 郭声琨出席</div>
......
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:include page="../header.jsp"></jsp:include>
<script type="text/javascript" src="${pageContext.request.contextPath}/jwapp/pages/portlet/js/jwAppPortletModule.js" charset="utf-8"></script>
<style>
.sp-preview{
border:none;
......
//此乃本模块与后台交互的方法接口部分
var jwAppAppsModel = function(format) {
this.module = "";
this.action = "";
this.format = format;
};
//定义数据交互
jwAppAppsModel.prototype = BusinessObject;
//获取当前登陆人的所有应用
jwAppAppsModel.prototype.list_allApps_by_user = function(){};
/*//获取所有应用的类别
jwAppAppsModel.prototype.list_allCategory = function(){};*/
//创建一个数据操作对象,然后再后续使用
jwAppAppsModel.jwAppsAppsActAction = new jwAppAppsModel("json").delegate("jwAppsAppstoreAct");
//创建一个数据获取对象,然后再后续使用
jwAppAppsModel.jwAppsAppsDataAction = new jwAppAppsModel("json").delegate("jwAppsAppstoreData");
//说明: 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':'保存失败'}}}]
......@@ -11,8 +11,6 @@ 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;
......@@ -56,114 +54,53 @@ public class dataAction extends BasicAction{
this.page = getPageNo();
}
public String listAppAccount() throws BusinessException{
AppsBusiness business = BusinessManager.getBusiness(AppsBusiness.class);
Map<String,Object> query = RequestUtils.getUpdateFieldMap(request, RequestUtils.UPDATEDATAFIELDPREFIX);
public String list_allApps_by_user() throws BusinessException{
jsonObject=new JSONObject();
//1.根据用户id,获取
/*SELECT * FROM (
SELECT ai_in.* FROM app_install ai_in where ai_in.USERID='6666'
) ai
RIGHT JOIN apps_app apps ON ai.APP_ID=apps.APP_ID*/
/*PortletBusiness business = BusinessManager
.getBusiness(PortletBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,
RequestUtils.UPDATEDATAFIELDPREFIX);*/
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>();
//设置当前登陆人
query.put("USER_ID", SessionUtil.getEmid());
List<Map<String, Object>> listData = business
.list_allApps_by_user(query);
for (Map<String, Object> rm : listData) {
if(rm.get("USERID")!=null){
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("pageSize", listData.size());
data.put("pageCount", listData.size());
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();
data.put("total", listData.size());
jsonObject.put("apps",data);
//查找所有的应用所属的类型
Map<String, Object> queryCategory = RequestUtils.getUpdateFieldMap(request,
RequestUtils.UPDATEDATAFIELDPREFIX);
List<Map<String, Object>> listCategory = business
.list_allCategory(queryCategory);
Map<String, Object> allCategory = new HashMap<String, Object>();
allCategory.put("rowSet", QueryParamUtil.DateToString(listCategory));
allCategory.put("pageNo", 1);
allCategory.put("pageSize", listCategory.size());
allCategory.put("pageCount", listCategory.size());
allCategory.put("rows", allCategory.get("rowSet"));
allCategory.put("total", listCategory.size());
jsonObject.put("types",listCategory);
break;
}
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();
......@@ -171,61 +108,13 @@ public class dataAction extends BasicAction{
// 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);
//2上述结果中的USERID全部为null,表示一个app都没安装
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";
}
//3.验证apps_uninstall有没有数据
//4.如果也没有,表示这个用户是新建用户,需要初始化应用
//5.初始化应用
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";
}
......
......@@ -6,93 +6,23 @@ 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 ;
/**获取该用户的所有应用
*
* @param query
* @return
* @throws BusinessException
*/
List<Map<String,Object>> list_allApps_by_user(Map<String, Object> query) throws BusinessException ;
/**获得所有应用的所属类型
*
* @param query
* @return
*/
List<Map<String, Object>> list_allCategory(Map<String, Object> query) 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 ;
}
......@@ -3,96 +3,13 @@ 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 ;
public interface AppsDAO {
int listCount_userallapp(Map<String, Object> query) throws BusinessException ;
List<Map<String,Object>> list_allApps_by_user(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_allCategory(Map<String,Object> query) throws BusinessException ;
List<Map<String,Object>> list_apps_portal(Map<String,Object> query) throws BusinessException ;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment