From 980df9f28ab644d20ea73e39665f3d61f00cf94e Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期一, 23 十二月 2024 14:45:05 +0800
Subject: [PATCH] 菜单折叠后图标间距问题
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java | 375 ++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 298 insertions(+), 77 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java
index b8a46a6..dcaa1bb 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsPortalVIServiceImpl.java
@@ -4,14 +4,20 @@
import cn.hutool.core.util.ZipUtil;
import com.vci.bo.ItemSeniorQueryBO;
import com.vci.common.utility.ObjectUtility;
+import com.vci.constant.FrameWorkLangCodeConstant;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.qtm.QTD;
import com.vci.corba.omd.qtm.QTInfo;
import com.vci.corba.portal.PortalService.GetPagePortalVIArrayByPageInfoResult;
import com.vci.corba.portal.data.PortalVI;
import com.vci.dto.*;
-import com.vci.model.*;
+import com.vci.enumpck.UI.ItemTypeEnum;
+import com.vci.model.PRMDO;
+import com.vci.model.PRMItemDO;
import com.vci.pagemodel.*;
+import com.vci.po.PortalVIPO;
+import com.vci.po.QTDPO;
+import com.vci.starter.poi.bo.ReadExcelOption;
import com.vci.starter.poi.bo.WriteExcelData;
import com.vci.starter.poi.bo.WriteExcelOption;
import com.vci.starter.poi.util.ExcelUtil;
@@ -21,9 +27,6 @@
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.util.LocalFileUtil;
import com.vci.starter.web.util.VciBaseUtil;
-import com.vci.starter.word.bo.WordMergeStartTableDataBO;
-import com.vci.starter.word.util.WordUtil;
-import com.vci.web.enumpck.ItemTypeEnum;
import com.vci.web.enumpck.PortalVIType;
import com.vci.web.enumpck.PortalVITypeFlag;
import com.vci.web.service.OsAttributeServiceI;
@@ -40,14 +43,16 @@
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
-import java.io.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
import java.util.*;
-import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
/*
- * 閾炬帴绫诲瀷鏈嶅姟
+ * 琛ㄥ崟/琛ㄦ牸鏈嶅姟
* @author xiej
* @date 2024-08-14
*/
@@ -119,14 +124,14 @@
}
DataGrid<PortalVIVO> dataGrid = new DataGrid<>();
try {
- GetPagePortalVIArrayByPageInfoResult pagePortalVIArrayByPageInfoResult= platformClientUtil.getPortalService().getPagePortalVIArrayByPageInfo(typeName,viName,viType,viTypeFlag,pageIndex,pageSize);
+ GetPagePortalVIArrayByPageInfoResult pagePortalVIArrayByPageInfoResult = platformClientUtil.getPortalService().getPagePortalVIArrayByPageInfo(typeName,viName,viType,viTypeFlag,pageIndex,pageSize);
if(pagePortalVIArrayByPageInfoResult.total>0) {
PortalVI[] portalVIS = pagePortalVIArrayByPageInfoResult.returnValue;
- List<PortalVIVO> portalVIVOS= portalVIDOO2VOS(Arrays.asList(portalVIS));
+ List<PortalVIVO> portalVIVOS = portalVIDOO2VOS(Arrays.asList(portalVIS));
dataGrid.setData(portalVIVOS);
dataGrid.setTotal(pagePortalVIArrayByPageInfoResult.total);
}else{
- dataGrid = new DataGrid<>("娌掓湁鏌ヨ鍒版暟鎹�");
+ dataGrid = new DataGrid<>();
}
} catch (PLException e) {
e.printStackTrace();
@@ -143,7 +148,7 @@
*/
@Override
public BaseResult addSave(PortalVIDTO portalVIDTO) throws VciBaseException {
- return savePortalVIDTO(portalVIDTO,false);
+ return savePortalVIDTO(portalVIDTO,false);
}
/**
@@ -160,9 +165,12 @@
if(PortalVIType.Table.getName()==viType){
lableName=PortalVIType.Table.getLabel();
}
- PortalVIVO portalVIVO=new PortalVIVO();
- PortalVI portalVI= platformClientUtil.getPortalService().getPortalVIById(id);
- portalVIVO=portalVIDOO2VO(portalVI);
+ PortalVIVO portalVIVO = null;
+ PortalVI portalVI = platformClientUtil.getPortalService().getPortalVIById(id);
+ if(portalVI==null||StringUtils.isBlank(portalVI.id)){
+ throw new VciBaseException("鏍规嵁涓婚敭鏈煡璇㈠埌鏁版嵁");
+ }
+ portalVIVO = portalVIDOO2VO(portalVI);
return portalVIVO;
}
@@ -202,7 +210,13 @@
if (formFlag) {
throw new Throwable(viewName + "鏁版嵁宸茬粡琚玌I缁勪欢寮曠敤锛岃閲嶆柊閫夋嫨瑕佸垹闄ょ殑瀵硅薄!");
}
- UITools.getService().deletePortalVIByID(id);
+ PortalVI portalVI = new PortalVI();
+ portalVI.id = portalVIDTO.getId();
+ portalVI.viName = portalVIDTO.getViName();
+ portalVI.viType = portalVIDTO.getViType();
+ portalVI.typeName = portalVIDTO.getTypeName();
+ portalVI.typeFlag = portalVIDTO.getTypeFlag();
+ platformClientUtil.getPortalService().deletePortalVI(portalVI);
}
}catch (Throwable e){
String exceptionMessage = "鍒犻櫎琛ㄥ崟鏃跺嚭鐜伴敊璇紝鍘熷洜锛�" + VciBaseUtil.getExceptionMessage(e);
@@ -215,20 +229,26 @@
@Override
public boolean delete(String ids) throws PLException {
VciBaseUtil.alertNotNull(ids,"涓婚敭");
- List<String> idsList= VciBaseUtil.str2List(ids);
- List<PortalVI> PortalVIList= new ArrayList<>();
- DeletePortalVIDTOList portalVIDTOList=new DeletePortalVIDTOList();
+ List<String> idsList = VciBaseUtil.str2List(ids);
+ List<PortalVIDTO> portalVIDTOList = new ArrayList<>();
+ DeletePortalVIDTOList deletePortalVIDTOList=new DeletePortalVIDTOList();
idsList.stream().forEach(id->{
PortalVI portalVI= null;
try {
portalVI = platformClientUtil.getPortalService().getPortalVIById(id);
- PortalVIList.add(portalVI);
+ PortalVIDTO portalVIDTO = new PortalVIDTO();
+ portalVIDTO.setId(portalVI.id);
+ portalVIDTO.setTypeFlag(portalVI.typeFlag);
+ portalVIDTO.setTypeName(portalVI.typeName);
+ portalVIDTO.setViName(portalVI.viName);
+ portalVIDTO.setViType(portalVI.viType);
+ portalVIDTOList.add(portalVIDTO);
} catch (PLException e) {
e.printStackTrace();
}
});
- portalVIDTOList.setPortalVIDTOList(portalVIO2DTOS(PortalVIList));
- return delete(portalVIDTOList);
+ deletePortalVIDTOList.setPortalVIDTOList(portalVIDTOList);
+ return delete(deletePortalVIDTOList);
}
/**
@@ -239,7 +259,7 @@
*/
@Override
public boolean clone(ClonePortalVIDTOList clonePortalVIDTOList) throws VciBaseException {
- if(clonePortalVIDTOList==null||CollectionUtils.isEmpty(clonePortalVIDTOList.getClonePortalVIDTOList())){
+ if(clonePortalVIDTOList == null || CollectionUtils.isEmpty(clonePortalVIDTOList.getClonePortalVIDTOList())){
throw new VciBaseException("璇烽�夋嫨瑕佸厠闅嗙殑瀵硅薄!");
}
try {
@@ -352,6 +372,21 @@
String prmText=UITools.getPRMText(prmDOO2VIS(portalVIDTO.getPrm(),portalVIDTO.getViType()));
String prmTextFileName= ObjectUtility.getNewObjectID36() + ".txt";
String prmTextFileNameAllName = xfileName + "." + prmTextFileName;
+ if (portalVIDTO.getViType() == PortalVIType.Table.getIntVal()) {//濡傛灉瀵煎叆鐨則able锛屽垯闇�瑕佹牎楠岃〃鏍煎叧鑱旂殑琛ㄥ崟鏄惁瀛樺湪锛屽鏋滀笉瀛樺湪鍒欏湪execl涓槸鍚﹀瓨鍦�
+ PortalVI[] pvs = platformClientUtil.getPortalService().getPortalVIArrayByTypeName(portalVIDTO.getTypeName());
+ PRMDTO prmdto= portalVIDTO.getPrm();
+ List<PRMItemDTO> prmItemDTOS= prmdto.getPrmItemList();
+ if (!CollectionUtils.isEmpty(Arrays.asList(pvs))) {
+ Optional.ofNullable(prmItemDTOS).orElseGet(()->new ArrayList<>()).stream().forEach(prmItemDTO -> {
+ Arrays.stream(pvs).forEach(pv -> {
+ if (prmItemDTO.getItemInObj().equals(pv.typeName + ":" + pv.viName)) {
+ prmItemDTO.setItemInObj(pv.id);
+ }
+ });
+
+ });
+ }
+ }
writeDataToFile(defaultTempFolder,prmTextFileNameAllName,prmText);
rowDataList.add(new WriteExcelData(rowIndex[0], 4,prmTextFileName));//閰嶇疆鏂囨湰
@@ -360,7 +395,7 @@
}
String attributeStr="";
try {
- List<OsAttributeVO> osAttributeVOList=osAttributeService.getOsAttributeVOSByBtName(portalVIDTO.getTypeName(),portalVIDTO.getTypeFlag());
+ List<OsAttributeVO> osAttributeVOList=osAttributeService.getOsAttributeVOSByBtName(portalVIDTO.getTypeName(),portalVIDTO.getTypeFlag(),false);
if(!CollectionUtils.isEmpty(osAttributeVOList)){
List<String> filedList= osAttributeVOList.stream().map(OsAttributeVO::getId).collect(Collectors.toList());
attributeStr=VciBaseUtil.array2String(filedList.toArray(new String[]{}));
@@ -420,6 +455,154 @@
return zip.getAbsoluteFile().getAbsolutePath();
}
+ @Override
+ public BaseResult importData(File file)throws Throwable{
+ if (file == null) {
+ return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"鏃犲鍏ョ殑鏂囦欢"});
+ }
+ try {
+ File unzip = ZipUtil.unzip(file);
+ String filePath=unzip.getAbsolutePath() + File.separator + "export.xls";
+ File btmExcel = new File(filePath);
+ List<PortalVIPO> portalVIPOList=new ArrayList<>();
+ List<QTDPO> QTDPOPOList=new ArrayList<>();
+ try {
+ ReadExcelOption PortalVIPOReadExcelOption=new ReadExcelOption();
+ PortalVIPOReadExcelOption.setSheetName("portalvi");
+ PortalVIPOReadExcelOption.setSheetIndex(0);
+ portalVIPOList = ExcelUtil.readDataObjectFromExcel(btmExcel, PortalVIPO.class,PortalVIPOReadExcelOption);
+ //浠巈xecl鑾峰彇鏌ヨ妯℃澘瀹氫箟.
+ /* ReadExcelOption QTDPOReadExcelOption=new ReadExcelOption();
+ QTDPOReadExcelOption.setSheetName("QTD");
+ QTDPOReadExcelOption.setSheetIndex(1);
+ QTDPOPOList = ExcelUtil.readDataObjectFromExcel(btmExcel, QTDPO.class,QTDPOReadExcelOption);*/
+ }catch (VciBaseException e){
+ throw new Throwable("璇诲彇execl鏁版嵁鍑洪敊锛�"+e.getMessage());
+ }
+ List<PortalVI> portalVIList=new ArrayList<>();
+ if(!CollectionUtils.isEmpty(portalVIPOList)){
+ Map<String,String>formNameMap=new HashMap<>();
+ StringBuffer checkInObj=new StringBuffer();
+ StringBuffer checkPortalVI=new StringBuffer();
+ List<String> sjkExitsList=new ArrayList<>();
+ portalVIPOList.stream().forEach(portalVIPO -> {
+ PortalVI portalVI=new PortalVI();
+ String ploid = ObjectUtility.getNewObjectID36();
+ portalVI.id=ploid;
+ portalVI.viName=portalVIPO.getViName();
+ portalVI.typeName=portalVIPO.getTypeName();
+ portalVI.viType=PortalVIType.getByLabel(portalVIPO.getViTypeText()).getIntVal();
+ portalVI.typeFlag=PortalVITypeFlag.getByLabel(portalVIPO.getTypeFlagText()).getIntVal();
+ String fileName= portalVIPO.getPrmFileName();
+ String prmStr = readLines(filePath+"."+fileName);
+ try {
+ PortalVI[] pvs = platformClientUtil.getPortalService().getPortalVIArrayByTypeName(portalVI.typeName);
+ if (portalVI.viType == PortalVIType.Table.getIntVal()) {//濡傛灉瀵煎叆鐨則able锛屽垯闇�瑕佹牎楠岃〃鏍煎叧鑱旂殑琛ㄥ崟鏄惁瀛樺湪锛屽鏋滀笉瀛樺湪鍒欏湪execl涓槸鍚﹀瓨鍦�
+ formNameMap.put(portalVI.typeName + ":" + portalVI.viName, ploid);
+ PRMDO prmObj = UITools.getPRM(prmStr);
+ List<PRMItemDO> prmItemList = prmObj.getPrmItemList();
+
+ if (!CollectionUtils.isEmpty(prmItemList)) {
+ prmItemList.stream().forEach(prmItemDO -> {
+ if (!CollectionUtils.isEmpty(Arrays.asList(pvs))) {
+ Arrays.stream(pvs).forEach(pv -> {
+ if (prmItemDO.getItemInObj().equals(portalVI.typeName + ":" + pv.viName)) {
+ prmItemDO.setItemInObj(pv.id);
+ }
+ });
+ } else {
+ if (formNameMap.containsKey(prmItemDO.getItemInObj())) {
+ prmItemDO.setItemInObj(formNameMap.get(prmItemDO.getItemInObj()));
+ } else {
+ if (!checkInObj.toString().contains(prmItemDO.getItemInObj())) {
+ String[] split = prmItemDO.getItemInObj().split(":");
+ checkInObj.append(split[1]).append(",");
+ }
+ }
+ }
+
+ });
+ }
+ prmStr = UITools.getPRMText(prmObj);
+ }
+ portalVI.prm = prmStr.trim();
+ //鏍¢獙琛ㄥ崟鏄惁瀛樺湪
+ if (!CollectionUtils.isEmpty(Arrays.asList(pvs))) {
+ Arrays.stream(pvs).forEach(pv -> {
+ if (pv.viName.equals(portalVI.viName)) {
+ checkPortalVI.append(portalVI.viName).append(",");
+ }
+ });
+ }
+ //鏍¢獙灞炴�ф槸鍚︽纭�
+ List<OsAttributeVO> osAttributeVOList = osAttributeService.getOsAttributeVOSByBtName(portalVI.typeName, portalVI.typeFlag,false);
+ if (!CollectionUtils.isEmpty(osAttributeVOList)) {
+ List<String> filedList = osAttributeVOList.stream().map(OsAttributeVO::getId).collect(Collectors.toList());
+ List<String> attributeList = VciBaseUtil.str2List(portalVIPO.getAttributeKey());
+ //鏁版嵁搴撲笉瀛樺湪
+ List<String> sjkExitsLists = Optional.ofNullable(attributeList).orElseGet(() -> new ArrayList<>()).stream().filter(s -> !attributeList.contains(s)).collect(Collectors.toList());
+ sjkExitsList.addAll(sjkExitsLists);
+ }
+ }catch (Throwable e){
+ e.printStackTrace();
+ }
+ portalVIList.add(portalVI);
+ if(StringUtils.isNotBlank(portalVIPO.getQtName())&&StringUtils.isNotBlank(portalVIPO.getQtNameFile())) {
+ QTInfo qt = new QTInfo();
+ String qtText = readLines(filePath + "." + portalVIPO.getQtNameFile());
+ qt.qtText=qtText;
+ qt.qtName = portalVIPO.getQtName();
+ qt.btmName=portalVIPO.getQtName();
+ QTInfo qt2 = null;
+ try {
+ qt2 = platformClientUtil.getQTDService().getQT(qt.qtName);
+ if (qt2 == null) {
+ platformClientUtil.getQTDService().saveQT(qt);
+ }
+ } catch (PLException e) {
+ e.printStackTrace();
+ }
+
+ }
+ });
+ if (checkInObj.length() > 0) {
+ throw new Throwable( checkInObj.toString() + "琛ㄥ崟涓嶅瓨鍦紒");
+ }
+ if (checkPortalVI.length() > 0) {
+ throw new Throwable( checkInObj.toString() + "鍚嶇О宸茬粡瀛樺湪锛�");
+ }
+ if(sjkExitsList.size()>0){
+ throw new Throwable( checkInObj.toString() + "灞炴�у湪绫诲瀷涓笉瀛樺湪锛�");
+ }
+ for (PortalVI pvi : portalVIList) {
+ platformClientUtil.getPortalService().savePortalVI(pvi);
+ }
+ }
+ }catch (Throwable e){
+ // throw new Throwable("瀵煎叆澶辫触锛�"+e.getMessage());
+ return BaseResult.fail("瀵煎叆澶辫触锛�"+e.getMessage());
+ }
+ return BaseResult.success("瀵煎叆鎴愬姛");
+ }
+
+ private String readLines(String filePath){
+ StringBuffer sb=new StringBuffer();
+ FileInputStream prmFile=null;
+ try {
+ prmFile = new FileInputStream(filePath);
+ List<String> prm= IOUtils.readLines(prmFile,"UTF-8");
+ prm.stream().forEach(s -> {
+ sb.append(s);
+ });
+ } catch (IOException e) {
+ IOUtils.closeQuietly(prmFile);
+ e.printStackTrace();
+ }finally {
+ IOUtils.closeQuietly(prmFile);
+ }
+ return sb.toString();
+ }
+
/**
* 鎷疯礉鏁版嵁鍒皐ord妯℃澘涓�
* @param fileName 瑕佸啓鍏ョ殑鏁版嵁
@@ -450,6 +633,7 @@
}
return filePath;
}
+
public List<PortalVIDTO> listByIds(Collection idList){
List<PortalVIDTO> portalVIVOList=new ArrayList<>();
if(CollectionUtils.isEmpty(idList)){
@@ -467,42 +651,42 @@
portalVIVOList= portalVIO2DTOS(portalVIList);
return portalVIVOList;
}
- private BaseResult savePortalVIDTO(PortalVIDTO portalVIDTO,boolean isEdit) {
+ private BaseResult savePortalVIDTO(PortalVIDTO portalVIDTO,boolean isEdit) {
boolean _isBtm=false;
boolean flag = false;
String labelName=PortalVIType.Form.getName();
try {
- VciBaseUtil.alertNotNull(portalVIDTO.getViName(),"鍚嶇О涓嶈兘涓虹┖锛�");
+ VciBaseUtil.alertNotNull(
+ portalVIDTO.getViName(),"鍚嶇О"
+ /*,portalVIDTO.getPrm().getFormQtName(),"缁戝畾琛ㄥ崟"*/);
if(portalVIDTO.getPrm()==null||portalVIDTO.getPrm().getPrmItemList()==null||portalVIDTO.getPrm().getPrmItemList().size()==0){
throw new Throwable(labelName+"锛屾湭璁剧疆");
}
if(PortalVIType.Table.getIntVal()==portalVIDTO.getViType()){//濡傛灉鏄〃鏍肩殑鐨勬牎楠�
labelName=PortalVIType.Table.getName();
- PRMItemDTO prmItemDTO= portalVIDTO.getPrm().getPrmItemList().get(0);
+ PRMItemDTO prmItemDTO = portalVIDTO.getPrm().getPrmItemList().get(0);
//姣忛〉鏄剧ず鏍¢獙
String rtnContent = isCorrectPageNums(prmItemDTO.getItemPageSize());
if (StringUtils.isNotBlank(rtnContent)) {
throw new VciBaseException(rtnContent);
}
- }else{
-
}
labelName= PortalVIType.getByIntVal(portalVIDTO.getViType()).getLabel();
if(!_isBtm){
- PortalVI[] portalVIS= platformClientUtil.getPortalService().getPortalVIArrayByTypeName(portalVIDTO.getTypeName());
+ PortalVI[] portalVIS = platformClientUtil.getPortalService().getPortalVIArrayByTypeName(portalVIDTO.getTypeName());
for (int i = 0; i < portalVIS.length; i++) {
- PortalVI portalVI= portalVIS[i];
- String viName= portalVI.viName;
+ PortalVI portalVI = portalVIS[i];
+ String viName = portalVI.viName;
if(isEdit){//濡傛灉涓轰慨鏀�
try {
- PortalVI oldPortalVI= platformClientUtil.getPortalService().getPortalVIById(portalVIDTO.getId());
- flag=platformClientUtil.getPortalService().judgeUpdateButton(oldPortalVI.typeFlag, oldPortalVI.viName, oldPortalVI.typeName);
+ PortalVI oldPortalVI = platformClientUtil.getPortalService().getPortalVIById(portalVIDTO.getId());
+ flag = platformClientUtil.getPortalService().judgeUpdateButton(oldPortalVI.typeFlag, oldPortalVI.viName, oldPortalVI.typeName);
if (flag && (StringUtils.isNotBlank(portalVIDTO.getViName()))&&(!oldPortalVI.viName.equals(portalVIDTO.getViName()))) {
throw new Throwable("璇�"+labelName+"宸茬粡琚紩鐢紝涓嶈兘淇敼鍚嶇О!");
}
} catch (PLException e) {
- throw new Throwable("鏌ヨ鍘熸湁琛ㄥ崟鍑虹幇寮傚父:"+e.getMessage());
+ throw new Throwable("鏌ヨ鍘熸湁琛ㄥ崟鍑虹幇寮傚父:"+e.getMessage());
}
if (!portalVI.id.equals(portalVIDTO.getId())) {
if (portalVI.viName.equals(portalVIDTO.getViName())) {
@@ -519,7 +703,7 @@
}else{
flag=platformClientUtil.getPortalService().judgeUpdateButton(portalVIDTO.getTypeFlag(), portalVIDTO.getViName(), portalVIDTO.getTypeName());
}
- PortalVI pvi=portalVIDTOO2VI(portalVIDTO);
+ PortalVI pvi = portalVIDTOO2VI(portalVIDTO);
if (!isEdit) {
flag= platformClientUtil.getPortalService().savePortalVI(pvi);
} else {
@@ -538,6 +722,7 @@
}
return BaseResult.success("淇濆瓨"+labelName+"鎴愬姛!");
}
+
@Override
public Map<String, PortalVIVO> selectAllPortalVIMap() throws VciBaseException {
return null;
@@ -589,7 +774,6 @@
return "";
}
-
/**
* 鏋氫妇鐨勬暟鎹璞¤浆鎹负鏄剧ず瀵硅薄
*
@@ -605,6 +789,7 @@
});
return portalVIVOS;
}
+
/**
* 琛ㄥ崟鐨勬暟鎹璞¤浆鎹负鏄剧ず瀵硅薄
* @param portalVIDTOS 琛ㄥ崟鐨勫璞�
@@ -619,6 +804,7 @@
});
return portalVIS;
}
+
/**
* 琛ㄥ崟鐨勬暟鎹璞¤浆鎹负鏄剧ず瀵硅薄
* @param PortalVIS 琛ㄥ崟鐨勫璞�
@@ -626,7 +812,7 @@
*/
@Override
public List<PortalVIDTO> portalVIO2DTOS(Collection<PortalVI> PortalVIS) {
- List<PortalVIDTO>PortalVIDTOS = new ArrayList<>();
+ List<PortalVIDTO> PortalVIDTOS = new ArrayList<>();
Optional.ofNullable(PortalVIS).orElseGet(()->new ArrayList<>()).stream().forEach(PortalVI -> {
PortalVIDTO PPortalVIDTO = portalVIO2DTO(PortalVI);
PortalVIDTOS.add(PPortalVIDTO);
@@ -634,22 +820,20 @@
return PortalVIDTOS;
}
-
-
/**
* 琛ㄥ崟鐨勬暟鎹璞¤浆鎹负鏄剧ず瀵硅薄
* @param portalVIDTO
* @return
*/
@Override
- public PortalVI portalVIDTOO2VI(PortalVIDTO portalVIDTO) {
- PortalVI portalVI=new PortalVI();
- portalVI.id=portalVIDTO.getId();
- portalVI.typeFlag= portalVIDTO.getTypeFlag();
- portalVI.typeName=portalVIDTO.getTypeName();
- portalVI.viName=portalVIDTO.getViName();
- portalVI.viType=portalVIDTO.getViType();
- short viType =portalVIDTO.getViType();
+ public PortalVI portalVIDTOO2VI(PortalVIDTO portalVIDTO) {
+ PortalVI portalVI = new PortalVI();
+ portalVI.id = portalVIDTO.getId();
+ portalVI.typeFlag = portalVIDTO.getTypeFlag();
+ portalVI.typeName = portalVIDTO.getTypeName();
+ portalVI.viName = portalVIDTO.getViName();
+ portalVI.viType = portalVIDTO.getViType();
+ short viType = portalVIDTO.getViType();
PRMDO prmdo = prmDOO2VIS(portalVIDTO.getPrm(),viType);
try {
portalVI.prm=UITools.getPRMText(prmdo);
@@ -658,6 +842,7 @@
}
return portalVI;
}
+
/**
* 琛ㄥ崟鐨勬暟鎹璞¤浆鎹负鏄剧ず瀵硅薄
* @param portalVI
@@ -676,6 +861,7 @@
portalVIDTO.setPrm(prmDOO2DTOS(prmdo,viType));
return portalVIDTO;
}
+
/**
* 琛ㄥ崟鏁版嵁瀵硅薄杞崲
* @param prmdto
@@ -706,7 +892,7 @@
@Override
public PortalVIVO portalVIDOO2VO(PortalVI portalVI) {
- PortalVIVO portalVIVO=new PortalVIVO();
+ PortalVIVO portalVIVO = new PortalVIVO();
portalVIVO.setId(portalVI.id);
portalVIVO.setTypeFlagText(PortalVITypeFlag.getByIntVal(portalVI.typeFlag).getLabel());
portalVIVO.setTypeFlag(portalVI.typeFlag);
@@ -715,7 +901,7 @@
portalVIVO.setViType(portalVI.viType);
portalVIVO.setViTypeText(PortalVIType.getByIntVal(portalVI.viType).getLabel());
- String prm= portalVI.prm;
+ String prm = portalVI.prm;
if(StringUtils.isNotBlank(prm)) {
PRMDO prmdo = UITools.getPRM(prm);
portalVIVO.setPrm(prmDOO2VOS(prmdo, portalVI.viType));
@@ -787,7 +973,7 @@
prmItemDO.setItemHrefConf(prmItemDO.getItemHrefConf());//瓒呴摼鎺ラ厤缃�
prmItemDO.setItemTips(prmItemDTO.getItemTips());
prmItemDO.setItemTrim(prmItemDTO.getItemTrim());
- prmItemDO.setItemDateFormat(prmItemDTO.getItemDateFormat());
+ //prmItemDO.setItemDateFormat(prmItemDTO.getItemDateFormat());
prmItemDO.setItemCtrlDisplyCondition(prmItemDTO.getItemCtrlDisplyCondition());////鎺у埗鏄剧ず鏉′欢
prmItemDO.setItemEditableProgram(prmItemDTO.getItemEditableProgram());
prmItemDO.setItemEditCondition(prmItemDTO.getItemEditCondition());
@@ -818,6 +1004,15 @@
prmItemDO.setItemHttpPathField(prmItemDTO.getItemHttpPathField());
if(viType==PortalVIType.Table.getIntVal()) {//濡傛灉鏄〃鏍�
initTableConfigDTOO2DOData(prmItemDO,prmItemDTO);
+ }else{
+ List<String> itemValueList=new ArrayList<>();
+ List<KeyValue> keyValueList=prmItemDTO.getItemKeyValueList();
+ Optional.ofNullable(keyValueList).orElseGet(()->new ArrayList<>()).stream().forEach(keyValue -> {
+ String value= keyValue.getValue()+"{"+keyValue.getKey()+"}";
+ itemValueList.add(value);
+ });
+ prmItemDO.setItemValueList(itemValueList);
+
}
return prmItemDO;
}
@@ -882,8 +1077,20 @@
prmItemVO.setItemIsHttpSave(prmItemDO.getItemIsHttpSave());
prmItemVO.setItemHttpVolumnPath(prmItemDO.getItemHttpVolumnPath());
prmItemVO.setItemHttpPathField(prmItemDO.getItemHttpPathField());
+
if(viType==PortalVIType.Table.getIntVal()) {//濡傛灉鏄〃鏍�
initTableConfigDOO2VOData(prmItemVO,prmItemDO);
+ }else{
+ List<String> enumList= prmItemDO.getItemValueList();
+ List<KeyValue>itemKeyValueList=new ArrayList<>();
+ Optional.ofNullable(enumList).orElseGet(()->new ArrayList<>()).stream().forEach(enumValue->{
+ List<String> keyValueList= VciBaseUtil.str2List(VciBaseUtil.removeComma(enumValue,"}"),"\\{");
+ KeyValue keyValue=new KeyValue();
+ keyValue.setKey(keyValueList.get(1));
+ keyValue.setValue(keyValueList.get(0));
+ itemKeyValueList.add(keyValue);
+ });
+ prmItemVO.setItemKeyValueList(itemKeyValueList);
}
return prmItemVO;
}
@@ -950,6 +1157,17 @@
prmItemDTO.setItemHttpPathField(prmItemDO.getItemHttpPathField());
if(viType==PortalVIType.Table.getIntVal()) {//濡傛灉鏄〃鏍�
initTableConfigDOO2VOData(prmItemDTO,prmItemDO);
+ }else{
+ List<String> enumList= prmItemDO.getItemValueList();
+ List<KeyValue>itemKeyValueList=new ArrayList<>();
+ Optional.ofNullable(enumList).orElseGet(()->new ArrayList<>()).stream().forEach(enumValue->{
+ List<String> keyValueList= VciBaseUtil.str2List(VciBaseUtil.removeComma(enumValue,"}"),"\\{");
+ KeyValue keyValue=new KeyValue();
+ keyValue.setKey(keyValueList.get(1));
+ keyValue.setValue(keyValueList.get(0));
+ itemKeyValueList.add(keyValue);
+ });
+ prmItemDTO.setItemKeyValueList(itemKeyValueList);
}
return prmItemDTO;
}
@@ -964,10 +1182,12 @@
List<String> allKeyList= getRefFormVIName(prmItemDO.getItemInObj());
List<String> itemOutFieldList =VciBaseUtil.str2List(prmItemDO.getItemOutFields());
List<String> itemKeyFieldList =VciBaseUtil.str2List(prmItemDO.getItemKeyFields());
- List<String> itemSelectoutFieldList= allKeyList.stream().filter(s ->!itemOutFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList());
- prmItemVO.setItemSelectoutFieldList(itemSelectoutFieldList);//寰呴�夋嫨鐨勫睘鎬у瓧娈�
+ List<String> itemSelectOutFieldList= allKeyList.stream()
+ .filter(s -> !itemOutFieldList.contains(s))
+ .collect(Collectors.toList());
+ prmItemVO.setItemSelectOutFieldList(itemSelectOutFieldList);//寰呴�夋嫨鐨勫睘鎬у瓧娈�
prmItemVO.setItemOutFieldList(itemOutFieldList);//闇�瑕佷娇鐢ㄧ殑闆嗗悎
- // List<String> itemSearchFieldList= itemOutFieldList.stream().filter(s ->!CollectionUtils.isEmpty(itemKeyFieldList).stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList());
+ // List<String> itemSearchFieldList= itemOutFieldList.stream().filter(s ->!CollectionUtils.isEmpty(itemKeyFieldList).stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList());
List<String> itemSearchFieldList=new ArrayList<>();
if(!CollectionUtils.isEmpty(itemKeyFieldList)){
itemSearchFieldList= itemOutFieldList.stream().filter(s ->!itemKeyFieldList.contains(s)).collect(Collectors.toList());
@@ -988,8 +1208,8 @@
List<String> allKeyList= getRefFormVIName(prmItemDO.getItemInObj());
List<String> itemOutFieldList =VciBaseUtil.str2List(prmItemDO.getItemOutFields());
List<String> itemKeyFieldList =VciBaseUtil.str2List(prmItemDO.getItemKeyFields());
- List<String> itemSelectoutFieldList= allKeyList.stream().filter(s ->!itemOutFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList());
- prmItemDTO.setItemSelectoutFieldList(itemSelectoutFieldList);//寰呴�夋嫨鐨勫睘鎬у瓧娈�
+ List<String> itemSelectOutFieldList= allKeyList.stream().filter(s ->!itemOutFieldList.stream().map(s1 -> s1).collect(Collectors.toList()).contains(s) ).collect(Collectors.toList());
+ prmItemDTO.setItemSelectoutFieldList(itemSelectOutFieldList);//寰呴�夋嫨鐨勫睘鎬у瓧娈�
prmItemDTO.setItemOutFieldList(itemOutFieldList);//闇�瑕佷娇鐢ㄧ殑闆嗗悎
List<String> itemSearchFieldList=new ArrayList<>();
if(!CollectionUtils.isEmpty(itemKeyFieldList)){
@@ -1005,28 +1225,29 @@
* @param prmItemDO
*/
private void initTableConfigDTOO2DOData(PRMItemDO prmItemDO,PRMItemDTO prmItemDTO){
-
- prmItemDO.setItemOutFields(VciBaseUtil.array2String(prmItemDTO.getItemOutFieldList().toArray(new String[]{})));//闇�瑕佷娇鐢ㄧ殑瀛楁
- prmItemDO.setItemKeyFields(CollectionUtils.isEmpty(prmItemDTO.getItemKeyFieldList())?"":VciBaseUtil.array2String(prmItemDTO.getItemKeyFieldList().toArray(new String[]{})));//闇�瑕佹悳绱㈢殑瀛楁
- List<String> newItemFieldWidthList=prmItemDTO.getItemFieldWidthList().stream().map(KeyValue::getValue).distinct().collect(Collectors.toList());
- prmItemDO.setItemFieldWidth(VciBaseUtil.array2String(newItemFieldWidthList.toArray(new String[]{}),":"));//瀛楁瀹藉害
- List<ItemSeniorQueryBO> itemSeniorQueryBOS= prmItemDTO.getItemSeniorQueryBOS();
- List<String> itemSeniorQueryColsList=new ArrayList<>();
- List<String> itemSeniorQueryColsCountsList=new ArrayList<>();
- List<String> itemQuerySqlList=new ArrayList<>();
- itemSeniorQueryBOS.stream().forEach(itemSeniorQueryBO -> {
- String itemSeniorQueryCols= itemSeniorQueryBO.getItemSeniorQueryCols();
- String itemSeniorQueryColsCounts=itemSeniorQueryBO.getItemSeniorQueryColsCounts();
- String itemQuerySql=itemSeniorQueryBO.getItemQuerySql();
+ prmItemDO.setItemOutFields(VciBaseUtil.array2String(prmItemDTO.getItemOutFieldList().toArray(new String[]{})));
+ //闇�瑕佷娇鐢ㄧ殑瀛楁prmItemDO.setItemKeyFields(CollectionUtils.isEmpty(prmItemDTO.getItemKeyFieldList())?"":VciBaseUtil.array2String(prmItemDTO.getItemKeyFieldList().toArray(new String[]{})));//闇�瑕佹悳绱㈢殑瀛楁
+ // TODO: 2024/12/5 Ludc 杩欏効鍘婚噸鐢ㄧ殑涓嶅锛孠eyValue::getValue鏄瀹藉害鍘婚噸浜�
+ List<String> newItemFieldWidthList = prmItemDTO.getItemFieldWidthList().stream().distinct().map(KeyValue::getValue).collect(Collectors.toList());
+ // TODO: 2024/12/5 Ludc 鍒嗛殧绗﹁鍜屽钩鍙扮粺涓�鐢�,鑰屼笉鏄敤:
+ prmItemDO.setItemFieldWidth(VciBaseUtil.array2String(newItemFieldWidthList.toArray(new String[]{}),","));//瀛楁瀹藉害
+ List<ItemSeniorQueryBO> itemSeniorQueryBOS = prmItemDTO.getItemSeniorQueryBOS();
+ List<String> itemSeniorQueryColsList = new ArrayList<>();
+ List<String> itemSeniorQueryColsCountsList=new ArrayList<>();
+ List<String> itemQuerySqlList = new ArrayList<>();
+ itemSeniorQueryBOS.stream().forEach(itemSeniorQueryBO -> {
+ String itemSeniorQueryCols = itemSeniorQueryBO.getItemSeniorQueryCols();
+ String itemSeniorQueryColsCounts = itemSeniorQueryBO.getItemSeniorQueryColsCounts();
+ String itemQuerySql = itemSeniorQueryBO.getItemQuerySql();
if(StringUtils.isNotBlank(itemSeniorQueryCols)) {
itemSeniorQueryColsList.add(itemSeniorQueryCols);
}
- if(StringUtils.isNotBlank(itemSeniorQueryColsCounts)) {
- itemSeniorQueryColsCountsList.add(itemSeniorQueryColsCounts);
- }
- if(StringUtils.isNotBlank(itemQuerySql)){
- itemQuerySqlList.add(itemQuerySql);
- }
+ if(StringUtils.isNotBlank(itemSeniorQueryColsCounts)) {
+ itemSeniorQueryColsCountsList.add(itemSeniorQueryColsCounts);
+ }
+ if(StringUtils.isNotBlank(itemQuerySql)){
+ itemQuerySqlList.add(itemQuerySql);
+ }
});
prmItemDO.setItemSeniorQueryCols(VciBaseUtil.array2String(itemSeniorQueryColsList.toArray(new String[]{})));
prmItemDO.setItemSeniorQueryColsCounts(VciBaseUtil.array2String(itemSeniorQueryColsCountsList.toArray(new String[]{})));
@@ -1039,8 +1260,8 @@
*/
private List<KeyValue> initItemFieldWidthList(String itemOutFields,String itemFieldWidth){
List<KeyValue> keyValueList=new ArrayList<>();
- List<String>itemOutFieldList= VciBaseUtil.str2List(itemOutFields);
- List<String>itemFieldWidthList= VciBaseUtil.str2List(itemFieldWidth,",");
+ List<String>itemOutFieldList = VciBaseUtil.str2List(itemOutFields);
+ List<String>itemFieldWidthList =VciBaseUtil.str2List(itemFieldWidth,",");
if(itemOutFieldList.size()>0) {
for (int i = 0; i < itemOutFieldList.size(); i++) {
KeyValue keyValue = new KeyValue();
@@ -1088,10 +1309,10 @@
}
return itemSeniorQueryBOList;
}
+
private List<String> getRefFormVIName(String refFormOid){
List<String> keyList=new ArrayList<>();
try {
-
PortalVI refFormVI = UITools.getService().getPortalVIById(refFormOid);
PortalVIVO portalVIVO= portalVIDOO2VO(refFormVI);
if(portalVIVO!=null&&portalVIVO.getPrm().getPrmItemList().size()>0){
--
Gitblit v1.9.3