dangsn
2024-06-14 82ff3244651e8a470237b9667583ad942f3a973e
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIEngineServiceImpl.java
@@ -4,7 +4,6 @@
import com.thoughtworks.xstream.XStream;
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.PLException;
import com.vci.corba.portal.data.*;
import com.vci.starter.web.annotation.log.VciUnLog;
@@ -131,8 +130,7 @@
   public void checkInvalidXmlVI() {
      PortalVI[] portalVIS = null;
      try {
         portalVIS = ServiceProvider.getUIService().getAllPortalVI();
         // portalVIS = platformClientUtil.getPortalService().getAllPortalVI();
         portalVIS = platformClientUtil.getUIService().getAllPortalVI();
      } catch (PLException vciError) {
         throw WebUtil.getVciBaseException(vciError);
      }
@@ -156,7 +154,7 @@
   public List<UIFormDefineVO> selectAllForm() {
      PortalVI[] portalVIS = null;
      try {
         portalVIS = ServiceProvider.getUIService().getAllPortalVI();
         portalVIS = platformClientUtil.getUIService().getAllPortalVI();
      } catch (PLException vciError) {
         throw WebUtil.getVciBaseException(vciError);
      }
@@ -405,7 +403,7 @@
      if(!QUERY_BY_CACHE){
         PortalVI portalVI = null;
         try {
            portalVI = ServiceProvider.getUIService().getPortalVIByTypeNameAndVIName(btmId, id);
            portalVI = platformClientUtil.getUIService().getPortalVIByTypeNameAndVIName(btmId, id);
         } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
         }
@@ -447,7 +445,7 @@
   public List<UITableDefineVO> selectAllTable() {
      PortalVI[] portalVIS = null;
      try {
         portalVIS = ServiceProvider.getUIService().getAllPortalVI();
         portalVIS = platformClientUtil.getUIService().getAllPortalVI();
      } catch (PLException vciError) {
         throw WebUtil.getVciBaseException(vciError);
      }
@@ -523,7 +521,7 @@
         self.selectAllForm().stream().filter(s -> formOid.equalsIgnoreCase(s.getOid())).findAny().orElseGet(() -> null);
      }else{
         try {
            formDefineVO = formDO2VO(ServiceProvider.getUIService().getPortalVIById(formOid));
            formDefineVO = formDO2VO(platformClientUtil.getUIService().getPortalVIById(formOid));
         } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
         }
@@ -723,7 +721,7 @@
      if(!QUERY_BY_CACHE){
         PortalVI portalVI = null;
         try {
            portalVI = ServiceProvider.getUIService().getPortalVIByTypeNameAndVIName(btmId, id);
            portalVI = platformClientUtil.getUIService().getPortalVIByTypeNameAndVIName(btmId, id);
         } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
         }
@@ -764,8 +762,7 @@
   @VciUnLog
   public List<UIActionVO> selectAllAction() {
      try {
//         return actionDO2VOs(Arrays.stream(platformClientUtil.getPortalService().getAllPLAction()).collect(Collectors.toList()));
         return actionDO2VOs(Arrays.stream(ServiceProvider.getUIService().getAllPLAction()).collect(Collectors.toList()));
         return actionDO2VOs(Arrays.stream(platformClientUtil.getUIService().getAllPLAction()).collect(Collectors.toList()));
      } catch (PLException vciError) {
         throw WebUtil.getVciBaseException(vciError);
      }
@@ -1006,7 +1003,7 @@
    */
   private List<UILayoutVO> listLayoutByContent(String pkContent){
      try {
         return UILayoutDO2VOs(Arrays.stream(ServiceProvider.getUIService().getPLTabPagesByPageDefinationOId(pkContent)).collect(Collectors.toList()),true);
         return UILayoutDO2VOs(Arrays.stream(platformClientUtil.getUIService().getPLTabPagesByPageDefinationOId(pkContent)).collect(Collectors.toList()),true);
      } catch (PLException vciError) {
         throw WebUtil.getVciBaseException(vciError);
      }
@@ -1129,8 +1126,7 @@
         if(queryDetail){
            //单个的,直接获取
            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));
               layoutVO.setComponentVOs(uiComponentDO2VOs(Arrays.stream(platformClientUtil.getUIService().getPLPageDefinationsByPageContextOId(layoutVO.getOid())).collect(Collectors.toList()),true));
            } catch (PLException vciError) {
               throw WebUtil.getVciBaseException(vciError);
            }
@@ -1176,7 +1172,7 @@
      }
      if(!QUERY_BY_CACHE){
         try {
            return uiComponentDO2VO(ServiceProvider.getUIService().getPLPageDefinationById(componentOid),true);
            return uiComponentDO2VO(platformClientUtil.getUIService().getPLPageDefinationById(componentOid),true);
         } catch (PLException vciError) {
            throw WebUtil.getVciBaseException(vciError);
         }
@@ -1248,8 +1244,7 @@
               componentVO.setTableDefineVO(tableDefineVOMap.get(key));
            }else{
               try {
                  componentVO.setTableDefineVO(tableDO2VO(ServiceProvider.getUIService().getPortalVIByTypeNameAndVIName(btmType,componentDefineXO.getTemplateId()),true));
                  //componentVO.setTableDefineVO(tableDO2VO(platformClientUtil.getPortalService().getPortalVIByTypeNameAndVIName(btmType,componentDefineXO.getTemplateId()),true));
                  componentVO.setTableDefineVO(tableDO2VO(platformClientUtil.getUIService().getPortalVIByTypeNameAndVIName(btmType,componentDefineXO.getTemplateId()),true));
               } catch (PLException vciError) {
                  throw WebUtil.getVciBaseException(vciError);
               }
@@ -1285,7 +1280,7 @@
               tableDefineVO= tableDefineVOMap.get(key);
            }else{
               try {
                  tableDefineVO = tableDO2VO(ServiceProvider.getUIService().getPortalVIByTypeNameAndVIName(btmType,componentDefineXO.getTemplateId()),true);
                  tableDefineVO = tableDO2VO(platformClientUtil.getUIService().getPortalVIByTypeNameAndVIName(btmType,componentDefineXO.getTemplateId()),true);
               } catch (PLException vciError) {
                  throw WebUtil.getVciBaseException(vciError);
               }
@@ -1336,7 +1331,7 @@
               componentVO.setFormDefineVO(formDefineVOMap.get(key));
            }else{
               try {
                  componentVO.setFormDefineVO(formDO2VO(ServiceProvider.getUIService().getPortalVIByTypeNameAndVIName(btmType,componentDefineXO.getTemplateId())));
                  componentVO.setFormDefineVO(formDO2VO(platformClientUtil.getUIService().getPortalVIByTypeNameAndVIName(btmType,componentDefineXO.getTemplateId())));
               } catch (PLException vciError) {
                  throw WebUtil.getVciBaseException(vciError);
               }
@@ -1386,7 +1381,7 @@
   @Override
   public List<UIButtonDefineVO> listButtonByComponent(String pkComponent){
      try {
         List<UIButtonDefineVO> buttonDefineVOS = buttonDO2VOs(Arrays.stream(ServiceProvider.getUIService().getPLTabButtonsByTableOId(pkComponent)).collect(Collectors.toSet())).stream().sorted(((o1, o2) -> o1.getOrderNum().compareTo(o2.getOrderNum()))).collect(Collectors.toList());
         List<UIButtonDefineVO> buttonDefineVOS = buttonDO2VOs(Arrays.stream(platformClientUtil.getUIService().getPLTabButtonsByTableOId(pkComponent)).collect(Collectors.toSet())).stream().sorted(((o1, o2) -> o1.getOrderNum().compareTo(o2.getOrderNum()))).collect(Collectors.toList());
         if(CollectionUtils.isEmpty(buttonDefineVOS)){
            return buttonDefineVOS;
         }
@@ -1460,8 +1455,7 @@
            //查找参数
            Map<String,String> params = new HashMap<>();
            try {
               //PLCommandParameter[] parameters = platformClientUtil.getPortalService().getPLCommandParametersByCommandOId(buttonVO.getOid());
               PLCommandParameter[] parameters = ServiceProvider.getUIService().getPLCommandParametersByCommandOId(buttonVO.getOid());
               PLCommandParameter[] parameters = platformClientUtil.getUIService().getPLCommandParametersByCommandOId(buttonVO.getOid());
               if(parameters!=null && parameters.length > 0){
                  for(PLCommandParameter parameter: parameters){
                     params.put(parameter.plKey,parameter.plValue);
@@ -1526,10 +1520,7 @@
      WebUtil.alertNotNull(btmType,"业务类型或者链接类型",id,"UI上下文的编号");
      PLUILayout[] obj = null;
      try {
         obj = ServiceProvider.getUIService().getPLUILayoutsByRelatedType(btmType);
//         obj = platformClientUtil.getPortalService().getPLPageLayoutDefinationsByRelatedType(btmType);
//         obj = ServiceProvider.geT(btmType);
         obj = platformClientUtil.getUIService().getPLUILayoutsByRelatedType(btmType);
      } catch (PLException vciError) {
         throw WebUtil.getVciBaseException(vciError);
      }
@@ -1541,7 +1532,6 @@
         }
      }
      return UIContentDO2VO(context,true);
//      return UIContentDO2VO(null,true);
   }
}