| | |
| | | package com.vci.web.service.impl; |
| | | |
| | | import com.sun.jnlp.ApiDialog; |
| | | import com.vci.client.mw.ClientContextVariable; |
| | | import com.vci.common.qt.object.QTConstants; |
| | | import com.vci.common.utility.ObjectUtility; |
| | | import com.vci.corba.common.PLException; |
| | | import com.vci.corba.framework.data.RoleRightInfo; |
| | |
| | | import com.vci.dto.RoleRightDTO; |
| | | import com.vci.dto.UIAuthorDTO; |
| | | import com.vci.frameworkcore.compatibility.SmRoleQueryServiceI; |
| | | import com.vci.pagemodel.OsBtmTypeVO; |
| | | import com.vci.model.PLDefination; |
| | | import com.vci.pagemodel.PLDefinationVO; |
| | | import com.vci.pagemodel.PLUILayoutCloneVO; |
| | |
| | | import com.vci.web.service.UIManagerServiceI; |
| | | import com.vci.web.util.*; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import com.vci.web.util.Func; |
| | | import com.vci.web.util.PlatformClientUtil; |
| | | import com.vci.web.util.UITools; |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.swing.*; |
| | | import javax.swing.text.JTextComponent; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | import java.util.*; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * UI定义服务界面相关接口 |
| | |
| | | */ |
| | | @Resource |
| | | private PlatformClientUtil platformClientUtil; |
| | | |
| | | /** |
| | | * 角色 |
| | | */ |
| | | @Resource |
| | | private SmRoleQueryServiceI smRoleQueryServiceI; |
| | | |
| | | /** |
| | | * 业务类型 |
| | |
| | | @Override |
| | | public int compare(PLUILayout o1, PLUILayout o2) { |
| | | return o1.plCode.compareTo(o2.plCode); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 排序比较器 |
| | | */ |
| | | private Comparator<PLDefinationVO> pageDefinationComparator = new Comparator<PLDefinationVO>() { |
| | | @Override |
| | | public int compare(PLDefinationVO o1, PLDefinationVO o2) { |
| | | return new Integer(o1.getSeq()).compareTo(new Integer(o2.getSeq())); |
| | | } |
| | | }; |
| | | |
| | |
| | | * 根据上下文ID和区域类型,按顺序获取当前区域的tab页 |
| | | */ |
| | | @Override |
| | | public List<PLTabPage> getTabByContextIdAndType(String contextId, int areaType) throws PLException { |
| | | public DataGrid getTabByContextIdAndType(String contextId, int areaType) throws PLException { |
| | | VciBaseUtil.alertNotNull(contextId,"上下文主键",areaType,"区域类型"); |
| | | PLTabPage[] plTabPages = platformClientUtil.getUIService().getTabPagesByContextIdAndType(contextId, (short) areaType); |
| | | return Arrays.asList(plTabPages); |
| | | DataGrid dataGrid = new DataGrid(); |
| | | dataGrid.setTotal(plTabPages.length); |
| | | dataGrid.setData(Arrays.asList(plTabPages)); |
| | | return dataGrid; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 查询页面设计定义 |
| | | * @param plPageContextOId |
| | | * @param pageContextOId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<PLPageDefination> getPLPageDefinations(String plPageContextOId) { |
| | | |
| | | return null; |
| | | public DataGrid getPLPageDefinations(String pageContextOId) throws PLException { |
| | | DataGrid dataGrid = new DataGrid(); |
| | | if(Func.isBlank(pageContextOId)) return dataGrid; |
| | | PLPageDefination[] plPageDefinations = platformClientUtil.getUIService().getPLPageDefinationsByPageContextOId(pageContextOId); |
| | | if(Func.isEmpty(plPageDefinations)){ |
| | | return dataGrid; |
| | | } |
| | | //DO2VO |
| | | List<PLDefinationVO> plDefinationVOS = this.pageDefinations2PLDefinationVO(Arrays.asList(plPageDefinations)); |
| | | dataGrid.setTotal(plDefinationVOS.size()); |
| | | Collections.sort(plDefinationVOS, Comparator.comparing(PLDefinationVO::getSeq)); |
| | | //Arrays.sort(plDefinationVOS, pageDefinationComparator); |
| | | dataGrid.setData(plDefinationVOS); |
| | | return dataGrid; |
| | | } |
| | | |
| | | /** |
| | | * 页面定义的DO2VO对象 |
| | | * @param plPageDefinations |
| | | * @return |
| | | */ |
| | | private List<PLDefinationVO> pageDefinations2PLDefinationVO(List<PLPageDefination> plPageDefinations){ |
| | | List<PLDefinationVO> plDefinationVOList = new ArrayList<>(); |
| | | plPageDefinations.stream().forEach(item->{ |
| | | try { |
| | | PLDefinationVO plDefinationVO = new PLDefinationVO(); |
| | | PLDefination plDefination = UITools.getPLDefination(item.plDefination); |
| | | BeanUtil.copy(plDefination,plDefinationVO); |
| | | plDefinationVOList.add(plDefinationVO); |
| | | } catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | logger.error(e.getMessage()); |
| | | throw new VciBaseException("页面定义DO对象转VO对象时出现错误,原因:"+e.getMessage()); |
| | | } |
| | | }); |
| | | return plDefinationVOList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加页面定义 |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * UI角色对象转换 |
| | | * @param infos |