From 8bb85606a294d2c6d2d4840d42a62744d7ef909b Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期五, 27 九月 2024 09:51:54 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIManagerServiceImpl.java | 220 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 217 insertions(+), 3 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 3ef9a19..da050fc 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; @@ -20,7 +21,7 @@ import com.vci.starter.web.pagemodel.DataGrid; import com.vci.starter.web.pagemodel.SessionInfo; import com.vci.starter.web.util.*; -import com.vci.web.redis.RedisService; +import com.vci.starter.web.redis.RedisService; import com.vci.web.service.OsBtmServiceI; import com.vci.web.service.UIManagerServiceI; import com.vci.web.util.*; @@ -2118,7 +2119,6 @@ return roleRightVOS; } - /** * UI瑙掕壊瀵硅薄杞崲 * @param infos @@ -2267,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; @@ -2333,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