From 085df90e488067783759dcd63cdb5fb43a51ff1f Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期四, 26 九月 2024 12:44:04 +0800
Subject: [PATCH] 添加记录当前在线用户人数查询接口

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java |  217 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 216 insertions(+), 1 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
index 5da58ec..40346aa 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java
@@ -5,6 +5,7 @@
 import com.vci.corba.common.data.UserEntityInfo;
 import com.vci.corba.framework.data.RoleRightInfo;
 import com.vci.corba.omd.btm.BizType;
+import com.vci.corba.omd.qtm.QTInfo;
 import com.vci.corba.portal.PortalService;
 import com.vci.corba.portal.data.*;
 import com.vci.dto.RoleRightDTO;
@@ -2266,7 +2267,7 @@
      * @param obj
      * @throws PLException
      */
-    public void checkCodeName(PLUILayout obj) throws PLException {
+    private void checkCodeName(PLUILayout obj) throws PLException {
         PLUILayout[] plUILayouts = platformClientUtil.getUIService().getPLUILayoutsByRelatedType(obj.plRelatedType);
         int length = plUILayouts.length;
         String code = obj.plCode;
@@ -2332,6 +2333,220 @@
         return res;
     }
 
+    /**
+     * 涓氬姟绫诲瀷銆佹簮瀵硅薄绫诲瀷銆侀《灞傝妭鐐规樉绀虹被鍨嬬瓑閮借皟鐢ㄨ繖涓帴鍙f煡璇�
+     * @param baseQueryObject
+     * @return
+     * @throws PLException
+     */
+    public DataGrid<BizType> getBtmDatasByPage(BaseQueryObject baseQueryObject) throws PLException{
+        BizType[] btmNames = null;
+        int start = baseQueryObject.getPage() <= 1 ? 1 : (baseQueryObject.getPage() - 1) * baseQueryObject.getLimit() + 1;
+        int end = baseQueryObject.getPage() <= 1 ? baseQueryObject.getLimit() : (baseQueryObject.getPage() * baseQueryObject.getLimit());
+
+
+        String where = " 1=1 ";
+        String text = "";
+        Map<String, String> conditionMap = baseQueryObject.getConditionMap();
+        if(Func.isNotEmpty(conditionMap)){
+            //杩囨护鏉′欢
+            String filterInputValue = conditionMap.get("filterInputValue");
+            if(Func.isNotBlank(filterInputValue)){
+                where += String.format(" and (bt.name like '%%%s%%' or bt.label like '%%%s%%')", text, text);
+            }
+        }
+
+        String fromWhere = String.format(" from plbtmtype bt where %s ", where);
+        String fromWhereOrderBy = String.format(" %s order by bt.name", fromWhere);
+        String sql = String.format("select * from(" +
+                "  select row_.*,rownum rownum_ from( " +
+                "         select bt.name, bt.label %s" +
+                "  ) row_ " +
+                ") where rownum_ >= %d and rownum_ <= %d ", fromWhereOrderBy, start, end);
+        List<BizType> list = new LinkedList<BizType>();
+        String[][] kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
+        for(String[] kvs : kvss){
+            BizType bi = new BizType();
+            bi.name = kvs[0];
+            bi.label = kvs[1];
+            list.add(bi);
+        }
+        btmNames = list.toArray(new BizType[]{});
+
+        sql = String.format("select count(1) count_ %s", fromWhere);
+        kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
+        int total = Integer.valueOf(kvss[0][0]);
+
+        DataGrid<BizType> res = new DataGrid<>();
+        res.setData(Arrays.asList(btmNames));
+        res.setTotal(total);
+        return res;
+    }
+
+    /**
+     * UI瀹氫箟涓嬫媺鏌ヨ锛坱emplateType涓篣I瀹氫箟鏃剁殑UI瀹氫箟涓嬫媺鏌ヨ锛�
+     * @param baseQueryObject selectBtmType 閫夋嫨鐨勬簮瀵硅薄,甯﹀垎椤典俊鎭�
+     * @return
+     * @throws PLException
+     */
+    public DataGrid<PLUILayout> getUILayoutDatasByPage(BaseQueryObject baseQueryObject) throws PLException{
+        PLUILayout[] datas = null;
+        int start = baseQueryObject.getPage() <= 1 ? 1 : (baseQueryObject.getPage() - 1) * baseQueryObject.getLimit() + 1;
+        int end = baseQueryObject.getPage() <= 1 ? baseQueryObject.getLimit() : (baseQueryObject.getPage() * baseQueryObject.getLimit());
+
+        String where = " 1=1 ";
+
+        Map<String, String> conditionMap = baseQueryObject.getConditionMap();
+        if(Func.isNotEmpty(conditionMap)){
+            //閫夋嫨鐨勫璞$被鍨�
+            String selectBtmType = conditionMap.get("selectBtmType");
+            if(selectBtmType != null){
+                where += String.format(" and ui.PLRELATEDTYPE = '%s' ", selectBtmType);
+            }
+            //杩囨护鏉′欢
+            String filterInputValue = conditionMap.get("filterInputValue");
+            if(Func.isNotBlank(filterInputValue)){
+                where += String.format(" and (ui.plname like '%%%s%%') ", filterInputValue, filterInputValue);
+            }
+        }
+        String fromWhere = String.format(" from PLUILAYOUT ui where %s ", where);
+        String fromWhereOrderBy = String.format(" %s order by ui.plname", fromWhere);
+        String sql = String.format("select * from(" +
+                "  select row_.*,rownum rownum_ from( " +
+                "         select ui.plname, ui.plcode %s" +
+                "  ) row_ " +
+                ") where rownum_ >= %d and rownum_ <= %d ", fromWhereOrderBy, start, end);
+        List<PLUILayout> list = new LinkedList<PLUILayout>();
+        String[][] kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
+        for(String[] kvs : kvss){
+            PLUILayout bi = new PLUILayout();
+            bi.plName = kvs[0];
+            bi.plCode = kvs[1];
+            list.add(bi);
+        }
+        datas = list.toArray(new PLUILayout[0]);
+
+        sql = String.format("select count(1) count_ %s", fromWhere);
+        kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
+        int total = Integer.valueOf(kvss[0][0]);
+
+        DataGrid<PLUILayout> res = new DataGrid<PLUILayout>();
+        res.setData(Arrays.asList(datas));
+        res.setTotal(total);
+        return res;
+    }
+
+    /**
+     * 閫夋嫨妯℃澘涓嬫媺鏌ヨ锛坱emplateType涓鸿〃鏍笺�佽〃鍗曘�佹爲琛ㄦ椂鐨勯�夋嫨瀵硅薄涓嬫媺鏌ヨ锛�
+     * @param baseQueryObject
+     * @return
+     * @throws PLException
+     */
+    public DataGrid<PortalVI> getPortalVIDatasByPage(BaseQueryObject baseQueryObject) throws PLException{
+        PortalVI[] datas = null;
+        int start = baseQueryObject.getPage() <= 1 ? 1 : (baseQueryObject.getPage() - 1) * baseQueryObject.getLimit() + 1;
+        int end = baseQueryObject.getPage() <= 1 ? baseQueryObject.getLimit() : (baseQueryObject.getPage() * baseQueryObject.getLimit());
+
+        String where = " 1=1 ";
+
+        Map<String, String> conditionMap = baseQueryObject.getConditionMap();
+        if(Func.isNotEmpty(conditionMap)){
+            //閫夋嫨鐨勬簮瀵硅薄鎴栬�呮槸閫夋嫨鐨勭埗鑺傜偣鏄剧ず绫诲瀷
+            String selectBtmType = conditionMap.get("selectBtmType");
+            if(selectBtmType != null){
+                where += String.format(" and vi.typename = '%s' ", selectBtmType);
+            }
+            /*if(getPopupDialog().getPortalVIType() != null){
+                where += String.format(" and vi.vitype = %d ", getPopupDialog().getPortalVIType().getIntVal());
+            }*/
+            //杩囨护鏉′欢
+            String filterInputValue = conditionMap.get("filterInputValue");
+            if(Func.isNotBlank(filterInputValue)){
+                where += String.format(" and (vi.viname like '%%%s%%') ", filterInputValue, filterInputValue);
+            }
+        }
+
+        String fromWhere = String.format(" from plportalvi vi where %s ", where);
+        String fromWhereOrderBy = String.format(" %s order by vi.viname", fromWhere);
+        String sql = String.format("select * from(" +
+                "  select row_.*,rownum rownum_ from( " +
+                "         select vi.viname,vi.vitype  %s" +
+                "  ) row_ " +
+                ") where rownum_ >= %d and rownum_ <= %d ", fromWhereOrderBy, start, end);
+        List<PortalVI> list = new LinkedList<>();
+        String[][] kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
+        for(String[] kvs : kvss){
+            PortalVI bi = new PortalVI();
+            bi.viName = kvs[0];
+            bi.viType = Short.valueOf(kvs[1]);
+            list.add(bi);
+        }
+        datas = list.toArray(new PortalVI[]{});
+
+        sql = String.format("select count(1) count_ %s", fromWhere);
+        kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
+        int total = Integer.valueOf(kvss[0][0]);
+
+        DataGrid<PortalVI> res = new DataGrid<>();
+        res.setData(Arrays.asList(datas));
+        res.setTotal(total);
+        return res;
+    }
+
+    /**
+     * 鏌ヨ妯℃澘涓嬫媺鏌ヨ
+     * @param baseQueryObject
+     * @return
+     * @throws PLException
+     */
+    public DataGrid<QTInfo> getQTInfoDatasByPage(BaseQueryObject baseQueryObject) throws PLException{
+        QTInfo[] datas = null;
+        int start = baseQueryObject.getPage() <= 1 ? 1 : (baseQueryObject.getPage() - 1) * baseQueryObject.getLimit() + 1;
+        int end = baseQueryObject.getPage() <= 1 ? baseQueryObject.getLimit() : (baseQueryObject.getPage() * baseQueryObject.getLimit());
+
+        String where = " 1=1 ";
+
+        Map<String, String> conditionMap = baseQueryObject.getConditionMap();
+        if(Func.isNotEmpty(conditionMap)){
+            //閫夋嫨鐨勬簮瀵硅薄鎴栬�呮槸閫夋嫨鐨勭埗鑺傜偣鏄剧ず绫诲瀷
+            String selectBtmType = conditionMap.get("selectBtmType");
+            if(selectBtmType != null){
+                where += String.format(" and qt.btmname = '%s' ", selectBtmType);
+            }
+            //杩囨护鏉′欢
+            String filterInputValue = conditionMap.get("filterInputValue");
+            if(Func.isNotBlank(filterInputValue)){
+                where += String.format(" and (qt.qtname like '%%%s%%') ", filterInputValue, filterInputValue);
+            }
+        }
+
+        String fromWhere = String.format(" from PL_QTEMPLATE qt where %s ", where);
+        String fromWhereOrderBy = String.format(" %s order by qt.qtname ", fromWhere);
+        String sql = String.format("select * from(" +
+                "  select row_.*,rownum rownum_ from( " +
+                "         select qt.qtname,qt.btmname  %s" +
+                "  ) row_ " +
+                ") where rownum_ >= %d and rownum_ <= %d ", fromWhereOrderBy, start, end);
+        List<QTInfo> list = new LinkedList<QTInfo>();
+        String[][] kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
+        for(String[] kvs : kvss){
+            QTInfo bi = new QTInfo();
+            bi.qtName = kvs[0];
+            bi.btmName = kvs[1];
+            list.add(bi);
+        }
+        datas = list.toArray(new QTInfo[]{});
+
+        sql = String.format("select count(1) count_ %s", fromWhere);
+        kvss = platformClientUtil.getQueryService().queryBySqlWithoutKey(sql);
+        int total = Integer.valueOf(kvss[0][0]);
+
+        DataGrid<QTInfo> res = new DataGrid<QTInfo>();
+        res.setData(Arrays.asList(datas));
+        res.setTotal(total);
+        return res;
+    }
+
     //鍩虹鍏叡妫�鏌ユ帴鍙�
     private abstract class BaseComptInter {
 

--
Gitblit v1.9.3