| | |
| | | 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.PLTabButton; |
| | | import com.vci.corba.portal.data.PLUILayout; |
| | | import com.vci.starter.web.annotation.log.VciUnLog; |
| | | import com.vci.starter.web.exception.VciBaseException; |
| | |
| | | import com.vci.web.service.OsBtmServiceI; |
| | | import com.vci.web.service.UIEngineServiceI; |
| | | import com.vci.web.service.WebBoServiceI; |
| | | import com.vci.web.util.Func; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.WebUtil; |
| | | import com.vci.web.xmlmodel.UIComponentDefineXO; |
| | |
| | | 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 com.vci.corba.portal.data.PLAction; |
| | | import com.vci.corba.portal.data.PLPageDefination; |
| | | import com.vci.corba.portal.data.PLCommandParameter; |
| | | import plm.corba.portal.*; |
| | | |
| | | import java.util.*; |
| | |
| | | * |
| | | */ |
| | | @Service |
| | | public class UIEngineServiceImpl implements UIEngineServiceI { |
| | | public class UIEngineServiceImpl implements UIEngineServiceI { |
| | | |
| | | /** |
| | | * 是否从缓存中查询 |
| | |
| | | @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) { |
| | | 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); |
| | | } |
| | | |
| | |
| | | * @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); |
| | |
| | | */ |
| | | @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("表单可能不存在,因为未能获取到它的信息"); |
| | | } |
| | |
| | | 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) { |
| | |
| | | @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) { |
| | | 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); |
| | | } |
| | | |
| | |
| | | @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); |
| | | }); |
| | |
| | | @Override |
| | | @VciUnLog |
| | | public UITableDefineVO tableDO2VO(PortalVI portal, boolean queryDetail) { |
| | | |
| | | UITableDefineVO tableDefineVO = new UITableDefineVO(); |
| | | tableDefineVO.setOid(portal.id); |
| | | tableDefineVO.setId(portal.viName); |
| | |
| | | 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) { |
| | |
| | | } |
| | | if(!QUERY_BY_CACHE){ |
| | | try { |
| | | PLPageDefination plPageDefination = ServiceProvider.getUIService().getPLPageDefinationById(componentOid); |
| | | // PLPageDefination plPageDefination = platformClientUtil.getPortalService().getPLPageDefinationById(componentOid); |
| | | return uiComponentDO2VO(plPageDefination,true); |
| | | return uiComponentDO2VO(ServiceProvider.getUIService().getPLPageDefinationById(componentOid),true); |
| | | } catch (VCIError vciError) { |
| | | throw WebUtil.getVciBaseException(vciError); |
| | | } |
| | |
| | | * @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)); |
| | |
| | | * @return 显示对象 |
| | | */ |
| | | @Override |
| | | public UIButtonDefineVO buttonDO2VO(com.vci.corba.portal.data.PLTabButton button) { |
| | | public UIButtonDefineVO buttonDO2VO(PLTabButton button) { |
| | | UIButtonDefineVO buttonVO = new UIButtonDefineVO(); |
| | | Map<String, UIActionVO> actionVOMap = self.selectAllActionMap(); |
| | | // Map<String, UIActionVO> actionVOMap = ServiceProvider.getUIService().getAllPLAction(); |
| | | //Map<String, UIActionVO> actionVOMap = ServiceProvider.getUIService().getAllPLAction(); |
| | | if(button !=null){ |
| | | buttonVO.setOid(button.plOId); |
| | | buttonVO.setPkComponent(button.plTableOId); |
| | |
| | | //查找参数 |
| | | 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); |
| | | } |
| | | } |
| | |
| | | break; |
| | | } |
| | | } |
| | | // return UIContentDO2VO(context,true); |
| | | //return UIContentDO2VO(context,true); |
| | | return UIContentDO2VO(null,true); |
| | | } |
| | | |