From f29ad099c6dc5c55d6cb94fb190d06743777ec6d Mon Sep 17 00:00:00 2001 From: dangsn <dangsn@chicecm.com> Date: 星期三, 05 六月 2024 10:56:48 +0800 Subject: [PATCH] 项目引用调整 --- Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/UIEngineServiceImpl.java | 132 +++++++++++++++++++++----------------------- 1 files changed, 63 insertions(+), 69 deletions(-) diff --git a/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/UIEngineServiceImpl.java b/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/UIEngineServiceImpl.java index 47b838d..056e30d 100644 --- a/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/UIEngineServiceImpl.java +++ b/Source/platformProject/vci-platform-web/src/main/java/com/vci/web/service/impl/UIEngineServiceImpl.java @@ -5,9 +5,8 @@ import com.thoughtworks.xstream.io.xml.XmlFriendlyNameCoder; import com.thoughtworks.xstream.io.xml.XppDriver; import com.vci.client.common.providers.ServiceProvider; -import com.vci.corba.common.VCIError; -import com.vci.corba.portal.data.PLPageDefination; -import com.vci.corba.portal.data.PLUILayout; +import com.vci.corba.common.PLException; +import com.vci.corba.portal.data.*; import com.vci.starter.web.annotation.log.VciUnLog; import com.vci.starter.web.exception.VciBaseException; import com.vci.starter.web.util.BeanUtil; @@ -40,10 +39,6 @@ import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import com.vci.corba.portal.data.PortalVI; -import com.vci.corba.portal.data.PLAction; -import com.vci.corba.portal.data.PLTabPage; -import com.vci.corba.portal.data.PLTabButton; import plm.corba.portal.*; import java.util.*; @@ -58,7 +53,7 @@ * */ @Service -public class UIEngineServiceImpl implements UIEngineServiceI { +public class UIEngineServiceImpl implements UIEngineServiceI { /** * 鏄惁浠庣紦瀛樹腑鏌ヨ @@ -144,7 +139,7 @@ try { portalVIS = ServiceProvider.getUIService().getAllPortalVI(); // portalVIS = platformClientUtil.getPortalService().getAllPortalVI(); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } for(int i = 0 ; i < portalVIS.length ; i++){ @@ -165,13 +160,13 @@ @Override @VciUnLog public List<UIFormDefineVO> selectAllForm() { - com.vci.corba.portal.data.PortalVI[] portalVIS = null; + PortalVI[] portalVIS = null; try { portalVIS = ServiceProvider.getUIService().getAllPortalVI(); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } - List<com.vci.corba.portal.data.PortalVI> portalVIList = Arrays.stream(portalVIS).filter(portal -> 1 == portal.viType).collect(Collectors.toList()); + List<PortalVI> portalVIList = Arrays.stream(portalVIS).filter(portal -> 1 == portal.viType).collect(Collectors.toList()); return formDO2VOs(portalVIList); } @@ -193,9 +188,9 @@ * @return 鏄剧ず瀵硅薄 */ @Override - public List<UIFormDefineVO> formDO2VOs(Collection<com.vci.corba.portal.data.PortalVI> portalVIS) { + public List<UIFormDefineVO> formDO2VOs(Collection<PortalVI> portalVIS) { List<UIFormDefineVO> formDefineVOList = new ArrayList<>(); - Optional.ofNullable(portalVIS).orElseGet(()->new ArrayList<com.vci.corba.portal.data.PortalVI>()).stream().forEach(portal->{ + Optional.ofNullable(portalVIS).orElseGet(()->new ArrayList<PortalVI>()).stream().forEach(portal->{ try { UIFormDefineVO defineVO = formDO2VO(portal); formDefineVOList.add(defineVO); @@ -216,7 +211,7 @@ */ @Override @VciUnLog - public UIFormDefineVO formDO2VO(com.vci.corba.portal.data.PortalVI portal) { + public UIFormDefineVO formDO2VO(PortalVI portal) { if(portal == null ||StringUtils.isBlank(portal.prm)){ throw new VciBaseException("琛ㄥ崟鍙兘涓嶅瓨鍦紝鍥犱负鏈兘鑾峰彇鍒板畠鐨勪俊鎭�"); } @@ -370,18 +365,18 @@ if("radio".equalsIgnoreCase(itemVO.getType()) || "checkbox".equalsIgnoreCase(itemVO.getType()) || "combox".equalsIgnoreCase(itemVO.getType())){ //鐪嬬湅鏈夋病鏈夊崟鐙缃� - if(StringUtils.isNotBlank(itemXO.getComboxKey())){ - itemVO.setComboxKey(itemXO.getComboxKey()); - if(StringUtils.isNotBlank(itemXO.getComboxItems())){ - List<KeyValue> keyValues = new ArrayList<>(); - VciBaseUtil.str2List(itemXO.getComboxItems()).stream().forEach(temmpKeyValue->{ - KeyValue kv = new KeyValue(); - kv.setKey(temmpKeyValue.split("=")[0]); - kv.setValue(temmpKeyValue.split("=")[1]); - keyValues.add(kv); - }); - itemVO.setData(keyValues); +// if(StringUtils.isNotBlank(itemXO.getComboxKey())){ +// itemVO.setComboxKey(itemXO.getComboxKey()); + if(StringUtils.isNotBlank(itemXO.getComboxItems())){ + List<KeyValue> keyValues = new ArrayList<>(); + for (String keyValue : itemXO.getComboxItems().split(";")) { + KeyValue kv = new KeyValue(); + String[] split = keyValue.split("\\{"); + kv.setKey(split[0]); + kv.setValue(split[1].substring(0,split[1].length()-1)); + keyValues.add(kv); } + itemVO.setData(keyValues); }else{ String attr = itemVO.getField(); if(itemVO.getField().toLowerCase().startsWith("t_oid.") @@ -416,10 +411,10 @@ return null; } if(!QUERY_BY_CACHE){ - com.vci.corba.portal.data.PortalVI portalVI = null; + PortalVI portalVI = null; try { portalVI = ServiceProvider.getUIService().getPortalVIByTypeNameAndVIName(btmId, id); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } return formDO2VO(portalVI); @@ -459,13 +454,13 @@ @Cacheable(value = VCI_OBJECT_SERVICE,key = CacheKeyConstant.ALL_TABLE,unless = "#result == null") @VciUnLog public List<UITableDefineVO> selectAllTable() { - com.vci.corba.portal.data.PortalVI[] portalVIS = null; + PortalVI[] portalVIS = null; try { portalVIS = ServiceProvider.getUIService().getAllPortalVI(); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } - List<com.vci.corba.portal.data.PortalVI> portalVIList = Arrays.stream(portalVIS).filter(portal -> 0 == portal.viType).collect(Collectors.toList()); + List<PortalVI> portalVIList = Arrays.stream(portalVIS).filter(portal -> 0 == portal.viType).collect(Collectors.toList()); return tableDO2VOs(portalVIList,false); } @@ -490,7 +485,7 @@ @VciUnLog public List<UITableDefineVO> tableDO2VOs(Collection<PortalVI> prms, boolean queryDetail) { List<UITableDefineVO> tableDefineVOList = new ArrayList<>(); - Optional.ofNullable(prms).orElseGet(()->new ArrayList<com.vci.corba.portal.data.PortalVI>()).stream().forEach(portal->{ + Optional.ofNullable(prms).orElseGet(()->new ArrayList<PortalVI>()).stream().forEach(portal->{ UITableDefineVO defineVO = tableDO2VO(portal,queryDetail); tableDefineVOList.add(defineVO); }); @@ -507,7 +502,6 @@ @Override @VciUnLog public UITableDefineVO tableDO2VO(PortalVI portal, boolean queryDetail) { - UITableDefineVO tableDefineVO = new UITableDefineVO(); tableDefineVO.setOid(portal.id); tableDefineVO.setId(portal.viName); @@ -539,7 +533,7 @@ }else{ try { formDefineVO = formDO2VO(ServiceProvider.getUIService().getPortalVIById(formOid)); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } } @@ -737,10 +731,10 @@ return null; } if(!QUERY_BY_CACHE){ - com.vci.corba.portal.data.PortalVI portalVI = null; + PortalVI portalVI = null; try { portalVI = ServiceProvider.getUIService().getPortalVIByTypeNameAndVIName(btmId, id); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } return tableDO2VO(portalVI,true); @@ -782,7 +776,7 @@ try { // return actionDO2VOs(Arrays.stream(platformClientUtil.getPortalService().getAllPLAction()).collect(Collectors.toList())); return actionDO2VOs(Arrays.stream(ServiceProvider.getUIService().getAllPLAction()).collect(Collectors.toList())); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } } @@ -836,8 +830,8 @@ actionVO.setCreator(action.plCreateUser); actionVO.setLastModifier(action.plModifyUser); try { - actionVO.setCreateTime(VciDateUtil.str2Date(String.valueOf(action.plCreateTime), VciDateUtil.DateTimeFormat)); - actionVO.setLastModifyTime(VciDateUtil.str2Date(String.valueOf(action.plCreateTime), VciDateUtil.DateTimeFormat)); + actionVO.setCreateTime(new Date(action.plCreateTime)); + actionVO.setLastModifyTime(new Date(action.plCreateTime)); }catch (Throwable e){ logger.error("杞崲鏃堕棿",e); } @@ -872,7 +866,7 @@ public List<UIContentVO> selectAllUIContent() { try { return UIContentDO2VOs(Arrays.stream(platformClientUtil.getPortalService().getAllPLPageLayoutDefinations()).collect(Collectors.toList())); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } } @@ -921,8 +915,8 @@ contentVO.setDescription(pageLayoutDefination.plDesc); contentVO.setCreator(pageLayoutDefination.plCreateUser); try { - contentVO.setCreateTime(VciDateUtil.str2Date(String.valueOf(pageLayoutDefination.plCreateTime),VciDateUtil.DateTimeFormat)); - contentVO.setLastModifyTime(VciDateUtil.str2Date(String.valueOf(pageLayoutDefination.plModifyTime),VciDateUtil.DateTimeFormat)); + contentVO.setCreateTime(new Date(pageLayoutDefination.plCreateTime)); + contentVO.setLastModifyTime(new Date(pageLayoutDefination.plModifyTime)); } catch (Exception e) { e.printStackTrace(); } @@ -1032,7 +1026,7 @@ private List<UILayoutVO> listLayoutByContent(String pkContent){ try { return UILayoutDO2VOs(Arrays.stream(ServiceProvider.getUIService().getPLTabPagesByPageDefinationOId(pkContent)).collect(Collectors.toList()),true); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } } @@ -1078,7 +1072,7 @@ public List<UILayoutVO> selectAllUILayout() { // try { // return UILayoutDO2VOs(Arrays.stream(platformClientUtil.getPortalService().getAllPLTabPages()).collect(Collectors.toList()),true); -// } catch (VCIError vciError) { +// } catch (PLException vciError) { // throw WebUtil.getVciBaseException(vciError); // } return null; @@ -1143,8 +1137,8 @@ } layoutVO.setCreator(page.plCreateUser); try { - layoutVO.setCreateTime(VciDateUtil.str2Date(String.valueOf(page.plCreateTime),VciDateUtil.DateTimeFormat)); - layoutVO.setLastModifyTime(VciDateUtil.str2Date(String.valueOf(page.plModifyTime),VciDateUtil.DateTimeFormat)); + layoutVO.setCreateTime(new Date(page.plCreateTime)); + layoutVO.setLastModifyTime(new Date(page.plModifyTime)); } catch (Exception e) { e.printStackTrace(); } @@ -1157,7 +1151,7 @@ try { layoutVO.setComponentVOs(uiComponentDO2VOs(Arrays.stream(ServiceProvider.getUIService().getPLPageDefinationsByPageContextOId(layoutVO.getOid())).collect(Collectors.toList()),true)); // layoutVO.setComponentVOs(uiComponentDO2VOs(Arrays.stream(platformClientUtil.getPortalService().getPLPageDefinationsByPageContextOId(layoutVO.getOid())).collect(Collectors.toList()),true)); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } } @@ -1184,7 +1178,7 @@ public List<UIComponentVO> selectAllUIComponent() { // try { // return uiComponentDO2VOs(Arrays.stream(platformClientUtil.getPortalService().getAllPLPageDefinations()).collect(Collectors.toList()),false); -// } catch (VCIError vciError) { +// } catch (PLException vciError) { // throw WebUtil.getVciBaseException(vciError); // } return null; @@ -1203,10 +1197,8 @@ } if(!QUERY_BY_CACHE){ try { - PLPageDefination plPageDefination = ServiceProvider.getUIService().getPLPageDefinationById(componentOid); - // PLPageDefination plPageDefination = platformClientUtil.getPortalService().getPLPageDefinationById(componentOid); - return uiComponentDO2VO(plPageDefination,true); - } catch (VCIError vciError) { + return uiComponentDO2VO(ServiceProvider.getUIService().getPLPageDefinationById(componentOid),true); + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } }else{ @@ -1224,7 +1216,7 @@ * @param pages 鏁版嵁瀵硅薄 * @return 鏄剧ず瀵硅薄 */ - private List<UIComponentVO> uiComponentDO2VOs(Collection<PLPageDefination> pages, boolean queryDetail){ + private List<UIComponentVO> uiComponentDO2VOs(Collection<com.vci.corba.portal.data.PLPageDefination> pages, boolean queryDetail){ List<UIComponentVO> componentVOS = new ArrayList<>(); pages.stream().forEach(page->{ componentVOS.add(uiComponentDO2VO(page,queryDetail)); @@ -1279,7 +1271,7 @@ try { componentVO.setTableDefineVO(tableDO2VO(ServiceProvider.getUIService().getPortalVIByTypeNameAndVIName(btmType,componentDefineXO.getTemplateId()),true)); //componentVO.setTableDefineVO(tableDO2VO(platformClientUtil.getPortalService().getPortalVIByTypeNameAndVIName(btmType,componentDefineXO.getTemplateId()),true)); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } } @@ -1315,7 +1307,7 @@ }else{ try { tableDefineVO = tableDO2VO(ServiceProvider.getUIService().getPortalVIByTypeNameAndVIName(btmType,componentDefineXO.getTemplateId()),true); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } } @@ -1366,7 +1358,7 @@ }else{ try { componentVO.setFormDefineVO(formDO2VO(ServiceProvider.getUIService().getPortalVIByTypeNameAndVIName(btmType,componentDefineXO.getTemplateId()))); - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } } @@ -1430,7 +1422,7 @@ }else{ return buttonDefineVOS; } - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } } @@ -1441,7 +1433,7 @@ * @return 鏄剧ず瀵硅薄 */ @Override - public List<UIButtonDefineVO> buttonDO2VOs(Collection<PLTabButton> buttons){ + public List<UIButtonDefineVO> buttonDO2VOs(Collection<com.vci.corba.portal.data.PLTabButton> buttons){ List<UIButtonDefineVO> buttonDefineVOS = new ArrayList<>(); Optional.ofNullable(buttons).orElseGet(()->new ArrayList<>()).stream().forEach(button->{ buttonDefineVOS.add(buttonDO2VO(button)); @@ -1489,14 +1481,14 @@ //鏌ユ壘鍙傛暟 Map<String,String> params = new HashMap<>(); try { -// PLCommandParameter[] parameters = platformClientUtil.getPortalService().getPLCommandParametersByCommandOId(buttonVO.getOid()); - com.vci.corba.portal.data.PLCommandParameter[] parameters = ServiceProvider.getUIService().getPLCommandParametersByCommandOId(buttonVO.getOid()); + //PLCommandParameter[] parameters = platformClientUtil.getPortalService().getPLCommandParametersByCommandOId(buttonVO.getOid()); + PLCommandParameter[] parameters = ServiceProvider.getUIService().getPLCommandParametersByCommandOId(buttonVO.getOid()); if(parameters!=null && parameters.length > 0){ - for(com.vci.corba.portal.data.PLCommandParameter parameter: parameters){ + for(PLCommandParameter parameter: parameters){ params.put(parameter.plKey,parameter.plValue); } } - } catch (VCIError vciError) { + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } buttonVO.setParamVOS(params); @@ -1554,22 +1546,24 @@ @Cacheable(value = VCI_OBJECT_SERVICE,key = "#p0.concat('${uicache}').concat(#p1)",unless = "#result == null || #p0 == null || #p1 ==null") public UIContentVO getUIContentByBtmTypeAndId(String btmType, String id) { WebUtil.alertNotNull(btmType,"涓氬姟绫诲瀷鎴栬�呴摼鎺ョ被鍨�",id,"UI涓婁笅鏂囩殑缂栧彿"); - PLPageLayoutDefination[] obj = null; + PLUILayout[] obj = null; try { - obj = platformClientUtil.getPortalService().getPLPageLayoutDefinationsByRelatedType(btmType); - } catch (VCIError vciError) { + obj = ServiceProvider.getUIService().getPLUILayoutsByRelatedType(btmType); +// obj = platformClientUtil.getPortalService().getPLPageLayoutDefinationsByRelatedType(btmType); +// obj = ServiceProvider.geT(btmType); + + } catch (PLException vciError) { throw WebUtil.getVciBaseException(vciError); } - PLPageLayoutDefination context = null; + PLUILayout context = null; for (int i = 0; i < obj.length; i++) { if (obj[i].plCode.equals(id)) { context = obj[i]; break; } } -// return UIContentDO2VO(context,true); - return UIContentDO2VO(null,true); + return UIContentDO2VO(context,true); +// return UIContentDO2VO(null,true); } - } -- Gitblit v1.9.3