Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/QTInfoDTO.java
@@ -1,16 +1,12 @@ package com.vci.dto; import com.alibaba.fastjson.annotation.JSONField; import com.vci.common.qt.object.QueryTemplate; import com.vci.model.BaseLinkModel; import com.vci.starter.web.annotation.Column; import lombok.Data; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * æ¥è¯¢æ¨¡æ¿åè¡¨ä¼ è¾å¯¹è±¡ @@ -19,13 +15,24 @@ */ @Data public class QTInfoDTO { public String qtName; public String btmName; public String creator; public long createTime; public String createTimeText; public short levelFlag; public String qtUIText; public String qtText; public QueryTemplate queryTemplate; //æ¥è¯¢æ¨¡æ¿å private String qtName; //ç±»åå private String btmName; //å建人 private String creator; //å建æ¶é´ private long createTime; private String createTimeText; //"0:æ®éæ¥è¯¢æ¨¡æ¿; 1:é«çº§æ¥è¯¢æ¨¡æ¿" private short levelFlag; //æ¥è¯¢æ¨¡æ¿çé¢ï¼è¿æ¯é«çº§æ¥è¯¢ç private String qtUIText; //æ¥è¯¢æ¨¡æ¿å private String qtText; //æ¥è¯¢æ¨¡æ¿ä¿¡æ¯ private QueryTemplate queryTemplate; //æ¥è¯¢æ¡ä»¶ï¼å端è¿è¡ç¸å ³è§£æ private List<HashMap<String,String>> condition; private HashMap<String,Object> tree = new HashMap<>(); } Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/model/IndexObject.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,28 @@ package com.vci.model; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * @author ludc * @date 2024/8/13 13:26 */ @Data @AllArgsConstructor @NoArgsConstructor public class IndexObject { private String oid; private String typeName; private String attrNames; private String description; private String indexName; private String createTime; } Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/OsBtmTypeVO.java
@@ -36,6 +36,11 @@ private String tableName; /** * ç¶ä¸å¡ç±»å */ private String fName; /** * æè¿° */ private String description; @@ -176,10 +181,31 @@ private Date ts; /** * å å«å±æ§åç§° */ private String[] apNameArray; /** * å å«å±æ§ */ private List<OsBtmTypeAttributeVO> attributes; public void setApNameArray(String[] apNameArray) { this.apNameArray = apNameArray; } public String[] getApNameArray() { return apNameArray; } public void setfName(String fName) { this.fName = fName; } public String getfName() { return fName; } public void setDelimiter(String delimiter) { this.delimiter = delimiter; } Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/OsBtmTypePO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,108 @@ package com.vci.po; import com.vci.starter.poi.annotation.ExcelColumn; import com.vci.starter.web.pagemodel.BaseModelVO; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * ä¸å¡ç±»åå¯¼å ¥å¯¹è±¡ * @author yuxc * @date 2024/7/30 16:27 */ @Data @AllArgsConstructor @NoArgsConstructor public class OsBtmTypePO extends BaseModelVO { /** * ç¦æ¢ä¿®æ¹è¿ä¸ªå¼ */ private static final long serialVersionUID = -2239512786206928201L; /** * æå¨æ°æ®è¡ */ @ExcelColumn(rowIndexColumn = true,value = "") private String rowIndex; /** * åç§° */ @ExcelColumn(value="åç§°",nullable = false) private String name; /** * æ ç¾ */ @ExcelColumn(value="æ ç¾") private String lable; /** * æè¿° */ @ExcelColumn(value="æè¿°") private String description; /** * ç»§æ¿èª */ @ExcelColumn(value="ç»§æ¿èª") private String fName; /** * å®ç°ç±» */ @ExcelColumn(value="å®ç°ç±»") private String implClass; /** * çæ¬è§å */ @ExcelColumn(value="çæ¬è§å") private short revLevel; /** * çæ¬å·è§å */ @ExcelColumn(value="çæ¬å·è§å") private String revRuleName; /** * æ¯å¦æå·¥è¾å ¥ */ @ExcelColumn(value="æ¯å¦æå·¥è¾å ¥") private String revInput; /** * åé符 */ @ExcelColumn(value="åé符") private String delimiter; /** * çæ¬¡å·è§å */ @ExcelColumn(value="çæ¬¡å·è§å") private short verRuleName; /** * btmItemsTo */ @ExcelColumn(value="çå½å¨æ") private String lifeCycle; /** * å¤éçå½å¨æå表 */ @ExcelColumn(value="å¤éçå½å¨æå表",nullable = false) private String lifeCycles; /** * 屿§å表 */ @ExcelColumn(value="屿§å表") private String apNameArray; } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java
@@ -214,7 +214,7 @@ try { file.transferTo(new File(excelFileName)); if (file != null) { return attributeService.importAttributes(file1); return attributeService.importAttributes(file1,false); } else { return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"æ å¯¼å ¥çæä»¶"}); } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsQueryTemplateController.java
@@ -3,6 +3,7 @@ import com.vci.corba.common.PLException; import com.vci.corba.omd.ltm.LinkType; import com.vci.corba.omd.qtm.QTD; import com.vci.dto.QTInfoDTO; import com.vci.pagemodel.OsBtmTypeAttributeVO; import com.vci.pagemodel.OsBtmTypeVO; import com.vci.pagemodel.OsLinkTypeAttributeVO; @@ -160,7 +161,11 @@ objectBaseResult.setMsg(Arrays.toString(e.messages)); return objectBaseResult; } catch (DocumentException e) { throw new RuntimeException(e); e.printStackTrace(); BaseResult objectBaseResult = new BaseResult<>(); objectBaseResult.setCode(500); objectBaseResult.setMsg(Arrays.toString(e.getMessage().toCharArray())); return objectBaseResult; } } @@ -180,4 +185,21 @@ return objectBaseResult; } } /** * 龿¥ç±»åæ¥è¯¢æ¨¡æ¿ä¿å * @param qtInfoDTO ä¿åä¼ è¾å¯¹è±¡ * @return ä¿åç»æ */ @PostMapping("/linkSave") public BaseResult linkSave(@RequestBody QTInfoDTO qtInfoDTO){ try { return quereyTemplateServiceI.linkSave(qtInfoDTO); } catch (PLException e) { BaseResult objectBaseResult = new BaseResult<>(); objectBaseResult.setCode(Integer.parseInt(e.code)); objectBaseResult.setMsg(Arrays.toString(e.messages)); return objectBaseResult; } } } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebBtmTypeController.java
@@ -4,6 +4,7 @@ import com.vci.corba.omd.btm.BizType; import com.vci.corba.omd.ltm.LinkType; import com.vci.dto.OsBtmTypeDTO; import com.vci.model.IndexObject; import com.vci.starter.web.annotation.controller.VciUnCheckRight; import com.vci.starter.web.annotation.log.VciBusinessLog; import com.vci.starter.web.enumpck.BooleanEnum; @@ -30,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.FileNotFoundException; @@ -39,6 +41,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import static com.vci.constant.FrameWorkBusLangCodeConstant.DATA_OID_NOT_EXIST; @@ -171,7 +174,7 @@ * btmTypeDTO 龿¥ç±»åçä¿å对象 * @return ä¿åç»æ */ @PostMapping("/addBtmTypes") /*@PostMapping("/addBtmTypes") public BaseResult addBtmTypes(@RequestBody List<BizType> bizTypes){ try { return btmService.addBtmTypes(bizTypes) ? BaseResult.success("ä¸å¡ç±»åæ¹éå建æåï¼"):BaseResult.fail("ä¸å¡ç±»åæ¹éå建失败ï¼"); @@ -181,7 +184,7 @@ logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } } }*/ /** * ä¿®æ¹ä¸å¡ç±»å @@ -318,6 +321,82 @@ } /** * è·åå½åä¸å¡ç±»åä¸çç´¢å¼ * @return * @throws PLException */ @GetMapping("/getIndexByCondition") public BaseResult getIndexByCondition(BaseQueryObject baseQueryObject){ try { return BaseResult.dataList(btmService.getIndexByCondition(baseQueryObject.getConditionMap())); } catch (Exception e) { e.printStackTrace(); String exceptionMessage = "æ¥è¯¢å½åä¸å¡ç±»åä¸çç´¢å¼æ¶æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } } /** * åå»ºç´¢å¼ * @param indexObjectList * @return */ @PostMapping("/addIndex") public BaseResult addIndex(@RequestBody List<IndexObject> indexObjectList){ try { return btmService.addIndex(indexObjectList) ? BaseResult.success("åå»ºç´¢å¼æå!"):BaseResult.fail("å建索å¼å¤±è´¥!"); } catch (Exception e) { e.printStackTrace(); String exceptionMessage = "åå»ºç´¢å¼æ¶æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } } /** * å é¤ç´¢å¼ * @param btmName * @param indexName * @return */ @DeleteMapping("/delIndex") public BaseResult delIndex(String btmName,String indexName){ try { return btmService.delIndex(btmName,indexName) ? BaseResult.success("å é¤ç´¢å¼æå!"):BaseResult.fail("å é¤ç´¢å¼å¤±è´¥!"); } catch (Exception e) { e.printStackTrace(); String exceptionMessage = "å é¤ç´¢å¼æ¶æ¶åºç°é误ï¼åå ï¼" + VciBaseUtil.getExceptionMessage(e); logger.error(exceptionMessage); return BaseResult.fail(exceptionMessage); } } /** * 导åºä¸å¡ç±»å * name 龿¥ç±»ååç§° * @return */ @GetMapping("/expData") public void expData(String name,HttpServletResponse response) throws PLException, IOException { btmService.expData(name, response); } /** * å¯¼å ¥ä¸å¡ç±»å * @param file ä¸ä¼ çæä»¶ * @return */ @PostMapping("/impData") @VciUnCheckRight public BaseResult impData(MultipartFile file){try { return btmService.impData(file); }catch (Throwable e) { throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e); } } /** * è·åä¸å¡ç±»åå å«ç屿§å ¨é¨ä¸ºå°å * @param btmId ä¸å¡ç±»ååç§° * @return 屿§çä¿¡æ¯ Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsAttributeServiceI.java
@@ -166,9 +166,10 @@ /** * å¯¼å ¥å±æ§ * @param file * @param isContinue ç³»ç»ä¸åºç°é夿¯å¦è·³è¿æ¥éç»§ç»æ§è¡ * @return */ BaseResult importAttributes(File file) throws Exception; BaseResult importAttributes(File file,boolean isContinue/*ç³»ç»ä¸åºç°é夿¯å¦è·³è¿æ¥éç»§ç»æ§è¡*/) throws Exception; /** * æ¯å¦é»è®¤ç屿§ Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsBtmServiceI.java
@@ -3,6 +3,7 @@ import com.vci.corba.common.PLException; import com.vci.corba.omd.btm.BizType; import com.vci.dto.OsBtmTypeDTO; import com.vci.model.IndexObject; import com.vci.pagemodel.OsBtmTypeAttributeVO; import com.vci.pagemodel.OsBtmTypeVO; import com.vci.pagemodel.OsERVO; @@ -11,7 +12,9 @@ import com.vci.starter.web.pagemodel.DataGrid; import com.vci.starter.web.pagemodel.PageHelper; import com.vci.starter.web.pagemodel.Tree; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.text.ParseException; import java.util.Collection; @@ -187,7 +190,7 @@ * @param bizTypes * @return */ boolean addBtmTypes(List<BizType> bizTypes); //boolean addBtmTypes(List<BizType> bizTypes); /** * ä¿®æ¹ä¸å¡ç±»å @@ -249,26 +252,39 @@ BaseResult deleteAllType() throws PLException; /** * æ ¹æ®ä¸å¡ç±»ååç§°åå ¶ä¸ç屿§åç§°è·å乿çç´¢å¼ * @param btmName * @param attrName * æ ¹æ®ä¸å¡ç±»ååç§°åç´¢å¼åç§°æ¥è¯¢è·åå·²æçç´¢å¼ * @param conditionMap æ ¹æ®æ¥è¯¢æ¡ä»¶ä¼ å: typename:ä¸å¡ç±»åå;indexname:ç´¢å¼å * @return */ List<String> getIndexByBtmAndAttrName(String btmName,String attrName); List<IndexObject> getIndexByCondition(Map<String,String> conditionMap) throws PLException; /** * æ ¹æ®ä¸å¡ç±»ååç§°åå ¶ä¸ç屿§åç§°å é¤ç´¢å¼ * @param btmName * @param attrName * @param indexName * @return */ boolean delIndexByBtmAndAttrName(String btmName,String attrName); boolean delIndex(String btmName,String indexName) throws PLException; /** * ç»ä¸å¡ç±»åä¸çæå®å±æ§æ°å¢ç´¢å¼ * @param addMap å¦ï¼(btmName:part attrName:name indexName: PARTNAMEINDEX) * @param indexObjectList * @return */ boolean addIndex(Map<String,String> addMap); boolean addIndex(List<IndexObject> indexObjectList) throws PLException; /** * 导åºä¸å¡ç±»å * name ä¸å¡ç±»ååç§° * @return åå»ºç»æ */ void expData(String oid, HttpServletResponse response) throws PLException, IOException; /** * å¯¼å ¥ä¸å¡ç±»å * @param file ä¸ä¼ çæä»¶ * @return */ BaseResult impData(MultipartFile file) throws Exception; } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsQuereyTemplateServiceI.java
@@ -3,6 +3,7 @@ import com.vci.corba.common.PLException; import com.vci.corba.omd.ltm.LinkType; import com.vci.corba.omd.qtm.QTD; import com.vci.dto.QTInfoDTO; import com.vci.pagemodel.OsBtmTypeAttributeVO; import com.vci.pagemodel.OsLinkTypeAttributeVO; import com.vci.pagemodel.OsLinkTypeVO; @@ -75,4 +76,11 @@ * @return æ¥è¯¢ç»æ */ BaseResult isExistsQT(String name) throws PLException; /** * 龿¥ç±»åæ¥è¯¢æ¨¡æ¿ä¿å * @param qtInfoDTO ä¿åä¼ è¾å¯¹è±¡ * @return ä¿åç»æ */ BaseResult linkSave(QTInfoDTO qtInfoDTO) throws PLException; } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java
@@ -479,6 +479,10 @@ ); //屿§è±æåç§°æ ¡éªï¼å¤ç©ºãç³»ç»ä¸å¤éãæ¯å¦å ³é®åãæ¯å¦åè§çï¼ checkName(osAttributeDTO.getId()); //æ£æ¥å±æ§åæ¯å¦å·²åå¨ä¸ç³»ç»ä¸ if(platformClientUtil.getAttributeService().checkRowIsExists(osAttributeDTO.getId())){ throw new PLException("500",new String[]{"屿§åç§°ã" + osAttributeDTO.getId() + "ãå¨ç³»ç»ä¸å·²åå¨!"}); } //æ£æ¥é»è®¤å¼ä¸å±æ§ç±»åæ¯å¦å¹é checkDefValue(osAttributeDTO); //osAttributeDTO.setOid(VciBaseUtil.getPk().toUpperCase(Locale.ROOT)); @@ -693,9 +697,9 @@ throw new PLException("500",new String[]{"屿§åæ æ,åå ï¼å±æ§åæ¯æ°æ®åºå ³é®å!"}); } //æ£æ¥å±æ§åæ¯å¦å·²åå¨ä¸ç³»ç»ä¸ if(platformClientUtil.getAttributeService().checkRowIsExists(abName)){ /*if(platformClientUtil.getAttributeService().checkRowIsExists(abName)){ throw new PLException("500",new String[]{"屿§åç§°ã" + abName + "ãå¨ç³»ç»ä¸å·²åå¨!"}); } }*/ } /** @@ -997,10 +1001,12 @@ /** * å¯¼å ¥å±æ§ * @param file * @param isContinue ç³»ç»ä¸åºç°é夿¯å¦è·³è¿æ¥éç»§ç»æ§è¡ * @return * @throws Exception */ @Override public BaseResult importAttributes(File file) throws Exception{ public BaseResult importAttributes(File file, boolean isContinue) throws Exception{ VciBaseUtil.alertNotNull(file,"excelæä»¶"); if(!file.exists()){ throw new VciBaseException("å¯¼å ¥çexcelæä»¶ä¸åå¨,{0}",new String[]{file.getPath()}); @@ -1017,13 +1023,29 @@ List<OsAttributeDTO> dtoList = new ArrayList<>(); //å½åexcel䏿¯å¦éå¤ç¨çå¤éMap:ï¼keyï¼å¤é屿§ï¼valueï¼è¡å·ï¼ Map<String, String> excelReapeat = new HashMap<>(); poList.stream().forEach(osAttributePO -> { for (int i = 0; i < poList.size(); i++) { OsAttributePO osAttributePO = poList.get(i); if(Func.isBlank(osAttributePO.getId())){//屿§åå¤ç©º throw new VciBaseException("第ã"+osAttributePO.getRowIndex()+"ãè¡ï¼attrnameerror"); }else if(Func.isBlank(osAttributePO.getAttributeDataType())){ throw new VciBaseException("第ã"+osAttributePO.getRowIndex()+"ãè¡ï¼typeerror"); }else if(excelReapeat.containsKey(osAttributePO.getId())){//屿§åè¡¨æ ¼ä¸å¤é throw new VciBaseException("第ã"+excelReapeat.get(osAttributePO.getId())+"ãè¡å第ã"+osAttributePO.getRowIndex()+"ãè¡æ°æ®ï¼å±æ§åéå¤"); }else { try { if(platformClientUtil.getAttributeService().checkRowIsExists(osAttributePO.getId())){ throw new PLException("500",new String[]{"屿§åç§°ã" + osAttributePO.getId() + "ãå¨ç³»ç»ä¸å·²åå¨!"}); } } catch (PLException e) { e.printStackTrace(); String errorMsg = "ä¸ç³»ç»ä¸å±æ§åæ¥éæ¶åºç°é误,åå ï¼" + VciBaseUtil.getExceptionMessage(e); logger.error(errorMsg); //æ¯å¦è·³è¿å½æé夿°æ® if(isContinue){ continue; } throw new VciBaseException(errorMsg); } } //屿§åæ ¡éª try { @@ -1076,7 +1098,7 @@ throw new VciBaseException(VciBaseUtil.getExceptionMessage(e)); } dtoList.add(osAttributeDTO); }); } //æ§è¡ä¿åæä½ dtoList.stream().forEach(dto->{ try { Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
@@ -1,12 +1,21 @@ package com.vci.web.service.impl; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.ZipUtil; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.vci.client.common.oq.OQTool; import com.vci.client.common.providers.ClientServiceProvider; import com.vci.client.mw.ClientSessionUtility; import com.vci.common.qt.object.Condition; import com.vci.common.qt.object.QueryTemplate; import com.vci.common.utility.ObjectUtility; import com.vci.constant.FrameWorkLangCodeConstant; import com.vci.corba.common.PLException; import com.vci.corba.omd.atm.AttributeDef; import com.vci.corba.omd.btm.BizType; import com.vci.corba.omd.data.AttributeValue; import com.vci.corba.omd.data.BusinessObject; import com.vci.corba.omd.etm.EnumType; import com.vci.corba.omd.lcm.Bound; import com.vci.corba.omd.lcm.LifeCycle; @@ -15,10 +24,19 @@ import com.vci.corba.omd.vrm.VersionRule; import com.vci.dto.OsBtmTypeDTO; import com.vci.dto.OsBtmTypeLinkAttributesDTO; import com.vci.model.IndexObject; import com.vci.omd.constants.AttributeConstants; import com.vci.omd.constants.FileObjectType; import com.vci.omd.objects.OtherInfo; import com.vci.omd.utils.ObjectTool; import com.vci.pagemodel.*; import com.vci.po.OsBtmTypePO; import com.vci.po.OsLinkTypePO; 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.constant.ExcelLangCodeConstant; import com.vci.starter.poi.util.ExcelUtil; import com.vci.starter.web.annotation.log.VciUnLog; import com.vci.starter.web.enumpck.BooleanEnum; import com.vci.starter.web.exception.VciBaseException; @@ -26,15 +44,10 @@ import com.vci.starter.web.pagemodel.DataGrid; import com.vci.starter.web.pagemodel.PageHelper; import com.vci.starter.web.pagemodel.Tree; import com.vci.starter.web.util.*; import com.vci.starter.web.util.BeanUtil; import com.vci.starter.web.util.VciBaseUtil; import com.vci.starter.web.util.VciDateUtil; import com.vci.starter.web.util.WebThreadLocalUtil; import com.vci.web.service.*; import com.vci.web.util.ConcurrentDateFormat; import com.vci.web.util.Func; import com.vci.web.util.PlatformClientUtil; import com.vci.web.util.WebUtil; import com.vci.web.util.*; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -42,8 +55,11 @@ import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import javax.swing.*; import java.io.File; import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -202,11 +218,13 @@ vo.setTableName(VciBaseUtil.getTableName(vo.getId())); vo.setInputRevisionFlag(btmItem.revInput); vo.setDelimiter(btmItem.delimiter); vo.setfName(btmItem.fName); if(StringUtils.isNotBlank(vo.getRevisionRuleId()) || vo.isInputRevisionFlag()){ vo.setRevisionFlag(true); } vo.setVersionRule(String.valueOf(btmItem.verRuleName)); vo.setSubLifeCycleId(Arrays.stream(btmItem.lifeCycles).collect(Collectors.joining(","))); vo.setApNameArray(btmItem.apNameArray); List<OsAttributeVO> attributeVOS = attributeService.listAttrByIds(Arrays.stream(btmItem.apNameArray).collect(Collectors.toList())); List<OsBtmTypeAttributeVO> btmTypeAttributeVOS = new ArrayList<>(); Optional.ofNullable(attributeVOS).orElseGet(()->new ArrayList<>()).stream().forEach(attributeVO->{ @@ -580,18 +598,20 @@ public List<Tree> getTreeBizTypes() throws PLException { List<Tree> rootTreeList = new ArrayList<>(); BizType[] bizTypes = getBizTypes(""); BizType btItem = null; for(int i = 0; i < bizTypes.length; i++){ btItem = bizTypes[i]; if(btItem.fName.equals("")){ OsBtmTypeVO osBtmTypeVO = null; List<OsBtmTypeVO> osBtmTypeVOS = btmDO2VOs(Arrays.asList(bizTypes)); for(int i = 0; i < osBtmTypeVOS.size(); i++){ osBtmTypeVO = osBtmTypeVOS.get(i); if(osBtmTypeVO.getfName().equals("")){ Tree tree = new Tree(); tree.setOid(btItem.oid); tree.setOid(osBtmTypeVO.getOid()); tree.setParentName(null); tree.setParentId(null); tree.setLeaf(true); tree.setText(btItem.description); tree.setAttributes(WebUtil.objectToMapString(btItem)); tree.setChildren(getChildren(bizTypes,btItem)); tree.setText(osBtmTypeVO.getDescription()); tree.setAttributes(WebUtil.objectToMapString(osBtmTypeVO)); tree.setChildren(getChildren(osBtmTypeVOS,osBtmTypeVO)); rootTreeList.add(tree); } } @@ -734,7 +754,7 @@ * @param bizTypes * @return */ @Override /* @Override public boolean addBtmTypes(List<BizType> bizTypes) { VciBaseUtil.alertNotNull(bizTypes,"å建çä¸å¡ç±»å对象å表"); bizTypes.stream().forEach(bizType->{ @@ -747,9 +767,8 @@ throw new VciBaseException(exceptionMessage); } }); return true; } }*/ /** * æ£æ¥ä¸å¡ç±»ååç§°æ¯å¦åè§ @@ -809,7 +828,6 @@ if (dbBizType.revLevel == 1 && dto.getRevLevel()==0) { throw new PLException("500",new String[]{"çæ¬åæ´é误ï¼ä¸è½ä»ä¸çº§å为ä¸å¯ä¿®è®¢"}); } if (dbBizType.revLevel == 2 && (dto.getRevLevel() == 1 || dto.getRevLevel() == 0)) { throw new PLException("500",new String[]{"çæ¬åæ´é误ï¼ä¸è½ä»äºçº§å为ä¸çº§æä¸å¯ä¿®è®¢"}); } @@ -1119,35 +1137,304 @@ } /** * æ ¹æ®ä¸å¡ç±»ååç§°åå ¶ä¸ç屿§åç§°è·å乿çç´¢å¼ * @param btmName * @param attrName * æ ¹æ®ä¸å¡ç±»ååç§°åå ¶ä¸ç屿§åç§°è·åå·²æçç´¢å¼ * @param conditionMap æ ¹æ®æ¥è¯¢æ¡ä»¶ä¼ å: typename:ä¸å¡ç±»åå; * @return */ @Override public List<String> getIndexByBtmAndAttrName(String btmName, String attrName) { return null; public List<IndexObject> getIndexByCondition(Map<String,String> conditionMap) throws PLException { if(Func.isEmpty(conditionMap)){ return new ArrayList<>(); } List<String> indexNameList = new ArrayList<String>(); QueryTemplate qtl = new QueryTemplate(); List<String> list = new ArrayList<String>(); list.add("*"); qtl.setBtmType("indexobject"); qtl.setClauseList(list); qtl.setId("p"); qtl.setType("btm"); qtl.setRightFlag(false); Condition condition = OQTool.getCondition(conditionMap); qtl.setCondition(condition); //HashMap<String, String> indexmap = new HashMap<String, String>(); BusinessObject findBTMObjects[] = platformClientUtil.getQueryService().findBTMObjects(qtl.getId(), OQTool.qtTOXMl(qtl).asXML()); List<IndexObject> indexObjects = new ArrayList<>(); for(int i = 0; i < findBTMObjects.length; i++) { BusinessObject findBTMObject = findBTMObjects[i]; IndexObject indexObject = new IndexObject(); indexObject.setOid(findBTMObject.oid); indexObject.setDescription(findBTMObject.description); indexObject.setCreateTime(Func.format(new Date(findBTMObject.createTime),DateUtil.PATTERN_DATE)); indexObject.setIndexName(ObjectTool.getBOAttributeValue(findBTMObject,"indexname")); indexObject.setTypeName(ObjectTool.getBOAttributeValue(findBTMObject,"typename")); indexObject.setAttrNames(ObjectTool.getBOAttributeValue(findBTMObject,"attrname")); indexObjects.add(indexObject); } return indexObjects; } /** * æ ¹æ®ä¸å¡ç±»ååç§°åå ¶ä¸ç屿§åç§°å é¤ç´¢å¼ * @param btmName * @param attrName * @param indexName * @return */ @Override public boolean delIndexByBtmAndAttrName(String btmName, String attrName) { public boolean delIndex(String btmName, String indexName) throws PLException { VciBaseUtil.alertNotNull(btmName,"ä¸å¡ç±»åå",indexName,"ç´¢å¼å"); Map<String, String> conditionMap = new HashMap<>(); conditionMap.put("typename",btmName); conditionMap.put("indexname",indexName); List<IndexObject> bo2 = getIndexByCondition(conditionMap); if(bo2!=null && bo2.size()>0) { String[] indexAttr = {indexName}; boolean alterFlag = platformClientUtil.getBtmService().dropIndex(btmName, indexAttr); if (!alterFlag) { return false; } for (int i = 0; i < bo2.size(); i++) { String oid = bo2.get(i).getOid(); BusinessObject bo = platformClientUtil.getBOFactoryService().readBusinessObject(oid, "indexobject"); platformClientUtil.getBOFactoryService().deleteBusinessObject(bo,1); } } return true; } /** * ç»ä¸å¡ç±»åä¸çæå®å±æ§æ°å¢ç´¢å¼ * @param addMap å¦ï¼(btmName:part attrName:name indexName: PARTNAMEINDEX) * @param indexObjectList * @return */ @Override public boolean addIndex(Map<String, String> addMap) { public boolean addIndex(List<IndexObject> indexObjectList) throws PLException { VciBaseUtil.alertNotNull(indexObjectList,"æ°å¢çç´¢å¼ä¿¡æ¯"); String btmName = indexObjectList.get(0).getTypeName(); String indexNames = indexObjectList.stream().map(IndexObject::getIndexName).collect(Collectors.joining()); String[] oldindexAttr = {indexNames}; BusinessObject bo; List<BusinessObject> boList = new ArrayList<>(); //å æ¥è¯¢å½åæ·»å ç´¢å¼æ¯å¦å·²ç»åå¨ï¼å¦æåå¨å°±å å é¤åæ°å¢å®ç°æ¿æ¢æä½ Map<String, String> conditionMap = new HashMap<>(); conditionMap.put("typename",btmName); List<IndexObject> indexObjects = getIndexByCondition(conditionMap); if(indexObjects!=null && indexObjects.size()>0){ //ç´¢å¼ä¸å卿¶å é¤å°±ä¼æ¥éç´¢å¼ä¸åå¨ï¼æä»¥è¿éæç´¢å¼æå»å é¤ boolean b = platformClientUtil.getBtmService().dropIndex(btmName, oldindexAttr); if(b){ for(int i = 0; i < indexObjects.size(); i ++){ String oid = (String) indexObjects.get(i).getOid(); bo = platformClientUtil.getBOFactoryService().readBusinessObject(oid,"indexobject"); platformClientUtil.getBOFactoryService().deleteBusinessObject(bo,1); } } } for(int i = 0; i < indexObjectList.size(); i ++){ IndexObject indexObject = indexObjectList.get(i); //bo = platformClientUtil.getBOFService().initBusinessObject("indexobject"); bo = boService.createCBOByBtmName("indexobject"); List<AttributeValue> attributeValues = new ArrayList<>(); attributeValues.add(new AttributeValue("typename", btmName)); attributeValues.add(new AttributeValue("indexname", indexObject.getIndexName())); attributeValues.add(new AttributeValue("attrname", indexObject.getAttrNames())); bo.newAttrValList = attributeValues.toArray(new AttributeValue[attributeValues.size()]); bo.description = indexObject.getDescription(); String[] indexAttr = {indexObject.getIndexName(),indexObject.getAttrNames()}; //ç»æå®ä¸å¡ç±»åçæå®å±æ§åå»ºç´¢å¼ boolean alterFlag = platformClientUtil.getBtmService().addIndex(btmName, indexAttr); //ç´¢å¼å建æåä¹åï¼éè¦å卿åç´¢å¼å°ç´¢å¼è¡¨ä¸ if(!alterFlag){ return false; } boList.add(bo); //æ·»å ç´¢å¼ä¿¡æ¯å°ç´¢å¼çä¸å¡è¡¨ä¸ //platformClientUtil.getBOFactoryService().createBusinessObject(bo,false,false); } //æ·»å ç´¢å¼ä¿¡æ¯å°ç´¢å¼çä¸å¡è¡¨ä¸ platformClientUtil.getBOFactoryService().batchCreateBusinessObject(boList.toArray(new BusinessObject[boList.size()]),false,false); return true; } /** * 导åºä¸å¡ç±»å * name ä¸å¡ç±»ååç§° * @return åå»ºç»æ */ @Override public void expData(String names, HttpServletResponse response) throws PLException, IOException { String defaultTempFolder = LocalFileUtil.getDefaultTempFolder(); //åexcel String excelPath = defaultTempFolder + File.separator + "btm.xls"; //设置åå List<String> columns = new ArrayList<>( Arrays.asList("ç±»ååç§°", "æ ç¾", "ç»§æ¿èª", "å®ç°ç±»", "æè¿°", "çæ¬è§å", "çæ¬å·è§å", "æ¯å¦æå·¥è¾å ¥","åé符", "çæ¬¡å·è§å","çå½å¨æ", "å¤éçå½å¨æå表","屿§å表") ); try { new File(excelPath).createNewFile(); //设置å List<WriteExcelData> excelDataList = new ArrayList<>(); //设置å头 for (int index = 0; index < columns.size(); index++) { excelDataList.add(new WriteExcelData(0,index, columns.get(index))); } HashSet<String> attributes = new HashSet<>(); int i = 0; for (String name : names.split(",")) { BizType bizType = platformClientUtil.getBtmService().getBizTypeByName(name); excelDataList.add(new WriteExcelData(i+1,0, bizType.name)); excelDataList.add(new WriteExcelData(i+1,1, bizType.label)); excelDataList.add(new WriteExcelData(i+1,2, bizType.fName)); excelDataList.add(new WriteExcelData(i+1,3, bizType.implClass)); excelDataList.add(new WriteExcelData(i+1,4, bizType.description)); excelDataList.add(new WriteExcelData(i+1,5, bizType.revLevel)); excelDataList.add(new WriteExcelData(i+1,6, bizType.revRuleName)); excelDataList.add(new WriteExcelData(i+1,7, bizType.revInput)); excelDataList.add(new WriteExcelData(i+1,8, bizType.delimiter)); excelDataList.add(new WriteExcelData(i+1,9, bizType.verRuleName)); excelDataList.add(new WriteExcelData(i+1,10, bizType.lifeCycle)); excelDataList.add(new WriteExcelData(i+1,11, String.join(",",bizType.lifeCycles))); excelDataList.add(new WriteExcelData(i+1,12, String.join(",",bizType.apNameArray))); attributes.addAll(Arrays.asList(bizType.apNameArray)); i++; } WriteExcelOption excelOption = new WriteExcelOption(excelDataList); ExcelUtil.writeDataToFile(excelPath, excelOption); //导åºå±æ§ String attrPath = attributeService.exportAttributes("btmattr", attributes.stream().collect(Collectors.joining(",")),true); //ç§»å¨å±æ§å°é¾æ¥ç±»åæä»¶å¤¹éé¢å» cn.hutool.core.io.FileUtil.move(new File(attrPath), new File(defaultTempFolder),true); cn.hutool.core.io.FileUtil.del(attrPath.substring(0,attrPath.lastIndexOf("\\"))); }catch (IOException e) { throw new RuntimeException(e); } File zip = ZipUtil.zip(defaultTempFolder); FileUtil.del(defaultTempFolder + File.separator); ControllerUtil.writeFileToResponse(response,zip.getAbsoluteFile()); } /** * å¯¼å ¥ä¸å¡ç±»å * @param file ä¸ä¼ çæä»¶ * @return */ @Override public BaseResult impData(MultipartFile file) throws Exception { String defaultTempFolder = LocalFileUtil.getDefaultTempFolder(); String fileName = defaultTempFolder + File.separator + LocalFileUtil.getFileNameForIE(file.getOriginalFilename()); file.transferTo(new File(fileName)); if (file == null) { return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"æ å¯¼å ¥çæä»¶"}); } if (!fileName.endsWith(".zip") || !fileName.endsWith(".rar")) { throw new VciBaseException("ä» è½ä¸ä¼ zipå缩æä»¶ï¼è¯·éæ°ä¸ä¼ ï¼"); } File unzip = ZipUtil.unzip(fileName); File btmExcel = new File(unzip.getAbsolutePath() + File.separator + "btm.xls"); File attrExcel = new File(unzip.getAbsolutePath() + File.separator + "btmattr.xls"); if (!attrExcel.exists()) { //å¢å è§£åçè·¯å¾ï¼çæä»¶è¿å¨æ²¡æ attrExcel = new File(unzip.getAbsolutePath() + File.separator + unzip.getName() + File.separator + "btmattr.xls"); if (!attrExcel.exists()) { return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"没æå¯¼å ¥ç屿§æä»¶ãå¯¼å ¥ç»æ¢ï¼"}); } } //TODOï¼å¯¼å ¥å±æ§ï¼ä½æ¯è¿ä¸ªé»è¾å®é ä¸åå¨ä¸äºé®é¢ï¼å¯¼å ¥ç屿§åªæ¯ä¸å¡ç±»åç屿§ä¸åºè¯¥å»ç»å±æ§æ± å¯¼å ¥ï¼å¯è½æ¯æ³ç屿§ä¸åå¨çå°±æ°å¢ä¸æ¬¡ BaseResult baseResult = attributeService.importAttributes(attrExcel,true); if(!baseResult.isSuccess()){ //å é¤ä¸ä¼ çæä»¶å¤¹ FileUtil.del(defaultTempFolder + File.separator); return baseResult; } //å ¥ä¸å¡ç±»å if (!btmExcel.exists()) { //å¢å è§£åçè·¯å¾ï¼çæä»¶è¿å¨æ²¡æ btmExcel = new File(unzip.getAbsolutePath() + File.separator + unzip.getName() + File.separator + "btm.xls"); if (!btmExcel.exists()) { //å é¤ä¸ä¼ çæä»¶å¤¹ FileUtil.del(defaultTempFolder + File.separator); return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"没æå¯¼å ¥ç龿¥æä»¶ãå¯¼å ¥ç»æ¢ï¼"}); } } try{ //1ã读åexcelä¸çæ°æ®ï¼ç»æå¯¹è±¡ ReadExcelOption excelOption = new ReadExcelOption(); List<OsBtmTypePO> poList = ExcelUtil.readDataObjectFromExcel(btmExcel, OsBtmTypePO.class,excelOption,(value, po, fieldName)->{}); //å»é¤é½æ¯ç©ºçæ åµ if(CollectionUtils.isEmpty(poList)){ return BaseResult.fail(ExcelLangCodeConstant.IMPORT_CONTENT_NULL,new String[]{}); } //å½åexcel䏿¯å¦éå¤ç¨çå¤éMap:ï¼keyï¼å¤é屿§ï¼valueï¼è¡å·ï¼ Map<String, String> excelReapeat = new HashMap<>(); int maxLength = platformClientUtil.getLinkTypeService().getLTNameMaxLength(); //å¤æå¿ å¡«å±æ§æ¯å¦ä¸ºç©ºï¼ç¨æ·æ¯å¦å·²åå¨ï¼ä»¥åé¨é¨æ¯å¦å¡«éçæ ¡éªé»è¾ poList.stream().forEach(osBtmTypePO -> { if(Func.isBlank(osBtmTypePO.getName())){//屿§åå¤ç©º throw new VciBaseException("第ã"+osBtmTypePO.getRowIndex()+"ãè¡ï¼name"); }else if(osBtmTypePO.getName().length() > maxLength){ throw new VciBaseException("第ã"+osBtmTypePO.getRowIndex()+"ãè¡ï¼ä¸å¡ç±»ååé¿åº¦ä¸è½è¶ è¿" + maxLength); }else if(!osBtmTypePO.getName().matches("^[A-Za-z]+$")){ throw new VciBaseException("第ã"+osBtmTypePO.getRowIndex()+"ãè¡ï¼ä¸å¡ç±»ååç§°åªè½ä¸ºè±æåæ¯"); }else if (osBtmTypePO.getName().length() > maxLength) { throw new VciBaseException("第ã"+osBtmTypePO.getRowIndex()+"ãè¡ï¼ä¸å¡ç±»ååé¿åº¦ä¸è½è¶ è¿" + maxLength); }else if(excelReapeat.containsKey(osBtmTypePO.getName())){//ä¸å¡ç±»ååå¨è¡¨æ ¼ä¸å¤é throw new VciBaseException("第ã"+excelReapeat.get(osBtmTypePO.getName())+"ãè¡å第ã"+osBtmTypePO.getRowIndex()+"ãè¡æ°æ®ï¼ä¸å¡ç±»ååéå¤"); }else if (Func.isBlank(osBtmTypePO.getLifeCycle())) { throw new VciBaseException("第ã"+osBtmTypePO.getRowIndex()+"ãè¡ï¼çå½å¨æä¸è½ä¸ºç©º"); }else if ("true".equalsIgnoreCase(osBtmTypePO.getRevInput()) && Func.isBlank(osBtmTypePO.getRevRuleName())) { throw new VciBaseException("第ã"+osBtmTypePO.getRowIndex()+"ãè¡ï¼çæ¬å·è§åä¸è½ä¸ºç©º"); } try { BizType historyBtm = platformClientUtil.getBtmService().getBizTypeByName(osBtmTypePO.getName()); //å·²ææ¤æ°æ®è¿è¡å é¤è¦ç if(historyBtm != null && !historyBtm.name.equals("")){ platformClientUtil.getBtmService().deleteBizType(historyBtm); } } catch (PLException e) { throw new RuntimeException(e); } //屿§åexcelä¸å¤éå¤ç excelReapeat.put(osBtmTypePO.getName(),osBtmTypePO.getRowIndex()); BizType bizType = new BizType(); bizType.name = osBtmTypePO.getName(); bizType.label = osBtmTypePO.getLable(); bizType.description = osBtmTypePO.getDescription(); bizType.fName = osBtmTypePO.getFName(); bizType.implClass = osBtmTypePO.getImplClass(); bizType.revLevel = osBtmTypePO.getRevLevel(); bizType.revRuleName = osBtmTypePO.getRevRuleName(); bizType.revInput = Boolean.parseBoolean(osBtmTypePO.getRevInput().toLowerCase(Locale.ROOT)); bizType.delimiter = osBtmTypePO.getDelimiter(); bizType.verRuleName = osBtmTypePO.getVerRuleName(); bizType.lifeCycle = osBtmTypePO.getLifeCycle(); bizType.lifeCycles = osBtmTypePO.getLifeCycles().split(","); bizType.apNameArray = osBtmTypePO.getApNameArray().split(","); String userId = WebUtil.getCurrentUserId(); bizType.modifier = userId; bizType.creator = userId; try { platformClientUtil.getBtmService().addBizType(bizType); } catch (PLException e) { throw new RuntimeException(e); } }); }catch (Exception e){ if(logger.isErrorEnabled()){ logger.error("读åexcelå å®¹æ¶æä¿åä¸å¡ç±»åä¿¡æ¯æ¶åºç°äºé误ï¼å ·ä½åå ï¼",VciBaseUtil.getExceptionMessage(e)); } e.printStackTrace(); return BaseResult.fail(VciBaseUtil.getExceptionMessage(e),new String[]{},e); } //å é¤ä¸ä¼ çæä»¶å¤¹ FileUtil.del(defaultTempFolder + File.separator); return BaseResult.success("ä¸å¡ç±»åå¯¼å ¥æåï¼"); } /** @@ -1186,21 +1473,21 @@ return flag; } private List<Tree> getChildren(BizType[] bizTypes,BizType parentBIzType){ private List<Tree> getChildren(List<OsBtmTypeVO> osBtmTypeVOS,OsBtmTypeVO parentBIzType){ List<Tree> trees= new ArrayList<>(); for (BizType bizType : bizTypes) { if(StringUtils.isBlank(bizType.fName)){ for (OsBtmTypeVO bizType : osBtmTypeVOS) { if(StringUtils.isBlank(bizType.getfName())){ continue; } if(bizType.fName.equals(parentBIzType.name)){ if(bizType.getfName().equals(parentBIzType.getName())){ Tree tree = new Tree(); tree.setOid(bizType.oid); tree.setParentName(parentBIzType.fName); tree.setParentId(parentBIzType.oid); tree.setOid(bizType.getOid()); tree.setParentName(parentBIzType.getfName()); tree.setParentId(parentBIzType.getOid()); tree.setLeaf(true); tree.setText(bizType.description); tree.setText(bizType.getDescription()); tree.setAttributes(WebUtil.objectToMapString(bizType)); tree.setChildren(getChildren(bizTypes,bizType)); tree.setChildren(getChildren(osBtmTypeVOS,bizType)); trees.add(tree); } } Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLifeCycleServiceImpl.java
@@ -713,7 +713,7 @@ throw new PLException("500",new String[]{"请å¾éè¦å¯¼åºççå½å¨ææ¨¡æ¿!"}); } //ç颿²¡ä¼ åç§°ï¼ä½¿ç¨é»è®¤å¯¼åºåç§° exportFileName = Func.isBlank(exportFileName) ? "çæ¬è§å导åº_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName; exportFileName = Func.isBlank(exportFileName) ? "çå½å¨æå¯¼åº_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName; //设置åå List<String> columns = this.getCloumns(flag); Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java
@@ -611,7 +611,7 @@ return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"没æå¯¼å ¥ç屿§æä»¶ãå¯¼å ¥ç»æ¢ï¼"}); } } BaseResult baseResult = attributeService.importAttributes(attrExcel); BaseResult baseResult = attributeService.importAttributes(attrExcel,true); if(!baseResult.isSuccess()){ //å é¤ä¸ä¼ çæä»¶å¤¹ FileUtil.del(defaultTempFolder + File.separator); @@ -648,7 +648,7 @@ }else if(!osLinkTypePO.getName().matches("^[A-Za-z]+$")){ throw new VciBaseException("第ã"+osLinkTypePO.getRowIndex()+"ãè¡ï¼é¾æ¥ç±»ååç§°åªè½ä¸ºè±æåæ¯"); }else if(excelReapeat.containsKey(osLinkTypePO.getName())){//屿§åè¡¨æ ¼ä¸å¤é throw new VciBaseException("第ã"+excelReapeat.get(osLinkTypePO.getName())+"ãè¡å第ã"+osLinkTypePO.getRowIndex()+"ãè¡æ°æ®ï¼å±æ§åéå¤"); throw new VciBaseException("第ã"+excelReapeat.get(osLinkTypePO.getName())+"ãè¡å第ã"+osLinkTypePO.getRowIndex()+"ãè¡æ°æ®ï¼é¾æ¥ç±»ååéå¤"); } try { LinkType historyLink = platformClientUtil.getLinkTypeService().getLinkType(osLinkTypePO.getName()); @@ -687,7 +687,7 @@ }); }catch (Exception e){ if(logger.isErrorEnabled()){ logger.error("读åexcelå å®¹æ¶æä¿åç¨æ·ä¿¡æ¯æ¶åºç°äºé误ï¼å ·ä½åå ï¼",VciBaseUtil.getExceptionMessage(e)); logger.error("读åexcelå å®¹æ¶æä¿å龿¥ç±»åä¿¡æ¯æ¶åºç°äºé误ï¼å ·ä½åå ï¼",VciBaseUtil.getExceptionMessage(e)); } e.printStackTrace(); return BaseResult.fail(VciBaseUtil.getExceptionMessage(e),new String[]{},e); Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsQueryTemplateImpl.java
@@ -1,13 +1,15 @@ package com.vci.web.service.impl; import com.alibaba.fastjson.JSONObject; import com.vci.client.common.oq.OQTool; import com.vci.common.qt.object.QTConstants; import com.vci.common.qt.object.QueryTemplate; import com.vci.common.qt.object.*; import com.vci.corba.common.PLException; import com.vci.corba.omd.atm.AttributeDef; import com.vci.corba.omd.data.LinkObject; import com.vci.corba.omd.qtm.QTD; import com.vci.corba.omd.qtm.QTInfo; import com.vci.dto.QTInfoDTO; import com.vci.omd.objects.OtherInfo; import com.vci.starter.web.pagemodel.BaseResult; import com.vci.starter.web.util.*; import com.vci.web.service.*; @@ -18,6 +20,7 @@ import org.apache.commons.lang3.time.DateFormatUtils; import org.dom4j.DocumentException; import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.*; @@ -36,6 +39,18 @@ */ @Autowired private PlatformClientUtil platformClientUtil; private final String EQUAL = "="; private final String UNEQUAL = "!="; private final String CONTAINS = "å å«"; private final String IN = "in"; private final String NOTIN = "not in"; private final String GT = ">"; private final String GTE = ">="; private final String LT = "<"; private final String LTE = "<="; private final String AND = "å¹¶ä¸"; private final String OR = "æè "; /** * æ¥è¯¢æ¨¡æ¿çå表 @@ -156,12 +171,68 @@ qtInfoDTO.setLevelFlag(obj.levelFlag); // qtInfoDTO.setQtText(obj.qtText); qtInfoDTO.setQtUIText(obj.qtUIText); if(StringUtils.isNotBlank(obj.qtUIText)){ //å°ç»å®çStringææ¬è§£æä¸ºXMLææ¡£å¹¶è¿åæ°å建çdocument qtInfoDTO.setTree(analysisXml(obj)); } qtInfoDTO.setQueryTemplate(OQTool.getQTByDoc(DocumentHelper.parseText(obj.qtText), obj.qtName)); qtInfoDTO.setCreateTimeText(DateFormatUtils.format(new Date(obj.createTime), DateUtil.PATTERN_DATETIME)); dtos.add(qtInfoDTO); } return BaseResult.dataList(dtos); } /** * å°å®¢æç«¯ç颿¾ç¤ºçxml转为hashMap * @param obj çé¢å¯¹è±¡ * @return * @throws DocumentException */ private HashMap<String,Object> analysisXml(QTInfo obj) throws DocumentException { org.dom4j.Document document = DocumentHelper.parseText(obj.qtUIText); if(document == null){ return null; } //è·åæ ¹èç¹,å¨ä¾åä¸å°±æ¯responsedataèç¹ Element root = document.getRootElement(); List<HashMap<String,Object>> treeList = new ArrayList<>(); HashMap<String,Object> treeMap = new HashMap<>(); treeMap.put("connector",root.getText()); List<Element> children = root.elements(); List<Object> childList = new ArrayList<>(); for(Iterator<Element> i = children.iterator(); i.hasNext();){ Element child = i.next(); if(AND.equals(child.getText()) || OR.equals(child.getText())){ childList.add(addDefaultMutableTree(child)); }else { childList.add(child.getText().trim()); } } treeMap.put("child",childList); return treeMap; } /** * å°åèç¹è½¬ä¸ºmapç»æ * @param element */ public Map<String, Object> addDefaultMutableTree(Element element){ List<Object> childList = new ArrayList<>(); List<Element> children = element.elements(); HashMap<String,Object> treeMap = new HashMap<>(); treeMap.put("connector",element.getText()); for(Iterator<Element> i = children.iterator(); i.hasNext();){ Element child = i.next(); if(AND.equals(child.getText()) || OR.equals(child.getText())){ childList.add(addDefaultMutableTree(child)); }else { childList.add(child.getText().trim()); } } treeMap.put("child",childList); return treeMap; } /** * æ£æ¥æ¥è¯¢æ¨¡æ¿å忝å¦åå¨ * @param name æ¥è¯¢æ¨¡æ¿åå @@ -174,6 +245,559 @@ } /** * 龿¥ç±»åæ¥è¯¢æ¨¡æ¿ä¿å * @param qtInfoDTO ä¿åä¼ è¾å¯¹è±¡ * @return ä¿åç»æ */ @Override public BaseResult linkSave(QTInfoDTO qtInfoDTO) throws PLException { QueryTemplate qt = getQT(qtInfoDTO); String checkInfo = OQTool.checkQT(qt); if(!checkInfo.equals("OK")){ throw new PLException("500", new String[]{checkInfo}); } boolean saveFlag ; qt.setId(qtInfoDTO.getQtName()); qt.setOrderInfoList(qtInfoDTO.getQueryTemplate().getOrderInfoList()); QTInfo qtWrapper = new QTInfo(); qtWrapper.qtName = qt.getId(); qtWrapper.btmName = qt.getLinkType(); qtWrapper.creator = WebUtil.getCurrentUserId(); qtWrapper.createTime = System.currentTimeMillis(); if(qtInfoDTO.getTree() == null){ qtWrapper.qtUIText = ""; }else{ qtWrapper.qtUIText = getSeniorXML(qtInfoDTO); } qtWrapper.levelFlag = qtInfoDTO.getLevelFlag(); qtWrapper.qtText = OQTool.qtTOXMl(qt).asXML(); saveFlag = platformClientUtil.getQTDService().saveQT(qtWrapper); if(saveFlag){ return BaseResult.success(); }else{ return BaseResult.fail("ä¿åæ¥è¯¢æ¨¡æ¿å¤±è´¥"); } } private String getSeniorXML(QTInfoDTO qtInfoDTO){ HashMap<String, Object> tree = qtInfoDTO.getTree(); if(tree.isEmpty()){ return ""; } StringBuilder xmlStr = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?><root>"); xmlStr.append(tree.get("connector")); List<Object> childrens = (List<Object>) tree.get("child"); Iterator<Object> children = childrens.iterator(); while (children.hasNext()) { Object obj = children.next(); if(obj instanceof JSONObject && (((JSONObject) obj).get("connector").equals(AND) || ((JSONObject) obj).get("connector").equals(OR))){ xmlStr.append(getSeniorChildXML((JSONObject) obj)); }else{ xmlStr.append("<child>").append(obj).append("</child>"); } } return xmlStr.append("</root>").toString(); } private String getSeniorChildXML(JSONObject childs){ StringBuilder xmlStr = new StringBuilder("<child>" + childs.get("connector")); List<Object> childrens = (List<Object>) childs.get("child"); if(childrens == null){ return ""; } Iterator<Object> child = childrens.iterator(); while (child.hasNext()) { Object obj = child.next(); if(obj instanceof JSONObject && (((JSONObject) obj).get("connector").equals(AND) || ((JSONObject) obj).get("connector").equals(OR))){ xmlStr.append(getSeniorChildXML((JSONObject) obj)); }else{ xmlStr.append("<child>").append(obj).append("</child>"); } } return xmlStr.append("</child>").toString(); } /** * ç»è£ æ¥è¯¢æ¨¡æ¿ * @return */ public QueryTemplate getQT(QTInfoDTO qtInfoDTO) throws PLException { QueryTemplate qt = new QueryTemplate(); qt.setType(QTConstants.TYPE_LINK); //TODO String qtId = qt.setLinkType(qtInfoDTO.getBtmName()); qt.setDirection(qtInfoDTO.getQueryTemplate().getDirection()); qt.setBtmType(qtInfoDTO.getQueryTemplate().getBtmType()); qt.setVersion(qtInfoDTO.getQueryTemplate().getVersion()); qt.setQueryISLeaf(qtInfoDTO.getQueryTemplate().isQueryISLeaf()); qt.setLevel(qtInfoDTO.getQueryTemplate().getLevel()); List<String> clauseList = new ArrayList<String>(); //TODO æ¥è¯¢å æ¾ç¤ºå clauseList.add("*"); qt.setClauseList(clauseList); Condition con = new Condition(); qt.setCondition(con); HashMap<String, ConditionItem> ciMap = getCIMap(qtInfoDTO); con.setCIMap(ciMap); con.setRootCIName(con.getRootCINameByCIMap(ciMap)); return qt; } /** * è·åæ¥è¯¢æ¡ä»¶ * @return */ private HashMap<String, ConditionItem> getCIMap(QTInfoDTO qtInfoDTO) throws PLException { HashMap<String, ConditionItem> ciMap = new HashMap<>(); //æ®éæ¥è¯¢æ¡ä»¶ if(qtInfoDTO.getLevelFlag() == 0){ /** * å å ¥å¶åèç¹ */ for(int i = 0; i < qtInfoDTO.getCondition().size(); i++){ ConditionItem ci = new ConditionItem(); String id = "ci" + (i + 1); ci.setId(id); ci.setLeafFlag(true); HashMap<String, String> condition = qtInfoDTO.getCondition().get(i); String clause = condition.get("clause"); String operator = condition.get("operator"); String ordinaryValue = condition.get("ordinaryValue"); //add by zhangweiwei 2014/12/09 end å å¢å éæ©æ¥è¯¢æ¨¡æ¿æé®å°æ¯è¡ç»ä»¶æ°ç±4æ¹æ5 LeafInfo leafInfo = new LeafInfo(); if(clause.contains("T_OID.") || clause.contains("F_OID.")){ //廿T_OID.æè F_OID. String clause_ = clause.substring(6); //屿§ä¸ºåç §å±æ§ if(clause_.contains(".")){ int fpIndex = clause_.indexOf("."); String refAbName = clause.substring(0, fpIndex + 6); clause = clause.substring(fpIndex + 6 + 1); leafInfo.setClause(refAbName); //廿T_OID.æè F_OID. refAbName = refAbName.substring(6); leafInfo.setOperator(Operator.IN); QueryTemplate qt = getRefQT(refAbName, clause, operator, ordinaryValue); LeafValue lValue = new LeafValue(); lValue.setQueryTemplate(qt); leafInfo.setValue(lValue); //屿§ä¸ºéåç §å±æ§ }else{ leafInfo.setClause(clause); leafInfo.setOperator(operator); LeafValue lValue = new LeafValue(); leafInfo.setValue(lValue); //add by zhangweiwei 2014/12/09 start //妿åµå¥Link if(ordinaryValue.contains(";")){ leafInfo.setOperator(Operator.IN); String[] values = ordinaryValue.split(";"); String QTname = values[0]; String attr = values[1].substring(0, values[1].length()); try { QTInfo qt = platformClientUtil.getQTDService().getQT(QTname); String qtText = qt.qtText; QueryTemplate qt_ = OQTool.getQTByQTText(qt.qtName, qtText); List<String> clauseList = new ArrayList<String>(); clauseList.add(attr); qt_.setClauseList(clauseList); lValue.setQueryTemplate(qt_); //lValue.setAttr(attr); } catch (PLException e) { e.printStackTrace(); } catch (DocumentException e1) { e1.printStackTrace(); } }else{ lValue.setOrdinaryValue(ordinaryValue); } //add by zhangweiwei 2014/12/09 end } }else{ //屿§ä¸ºåç §å±æ§ if(clause.contains(".")){ int fpIndex = clause.indexOf("."); String refAbName = clause.substring(0, fpIndex); clause = clause.substring(fpIndex + 1); leafInfo.setClause(refAbName); leafInfo.setOperator(Operator.IN); QueryTemplate qt = getRefQT(refAbName, clause, operator, ordinaryValue); LeafValue lValue = new LeafValue(); lValue.setQueryTemplate(qt); leafInfo.setValue(lValue); //屿§ä¸ºéåç §å±æ§ }else{ leafInfo.setClause(clause); leafInfo.setOperator(operator); LeafValue lValue = new LeafValue(); leafInfo.setValue(lValue); //add by zhangweiwei 2014/12/09 start //妿åµå¥Link if(ordinaryValue.contains(";")){ leafInfo.setOperator(Operator.IN); String[] values = ordinaryValue.split(";"); String QTname = values[0]; String attr = values[1].substring(0, values[1].length()); try { QTInfo qt = platformClientUtil.getQTDService().getQT(QTname); String qtText = qt.qtText; QueryTemplate qt_ = OQTool.getQTByQTText(qt.qtName, qtText); List<String> clauseList = new ArrayList<String>(); clauseList.add(attr); qt_.setClauseList(clauseList); lValue.setQueryTemplate(qt_); //lValue.setAttr(attr); } catch (PLException e) { e.printStackTrace(); } catch (DocumentException e1) { e1.printStackTrace(); } }else{ lValue.setOrdinaryValue(ordinaryValue); } //add by zhangweiwei 2014/12/09 end } } ci.setLeafInfo(leafInfo); ciMap.put(ci.getId(), ci); } Iterator<String> iterator = ciMap.keySet().iterator(); ArrayList<ConditionItem> ciList = new ArrayList<ConditionItem>(); String lCIId = null; while(iterator.hasNext()){ lCIId = iterator.next(); break; } int count = ciMap.size(); while(iterator.hasNext()){ String rCIId = iterator.next(); ConditionItem pCI = new ConditionItem(); String pId = "ci" + ++count; pCI.setId(pId); pCI.setLeafFlag(false); ChildrenInfo pChildrenInfo = new ChildrenInfo(); pChildrenInfo.setLeftCIName(lCIId); pChildrenInfo.setConnector(Connector.AND); pChildrenInfo.setRightCIName(rCIId); pCI.setChildrenInfo(pChildrenInfo); ciList.add(pCI); lCIId = pId; } for(Iterator<ConditionItem> i = ciList.iterator(); i.hasNext();){ ConditionItem ci = i.next(); ciMap.put(ci.getId(), ci); } //é«çº§æ¥è¯¢æ¡ä»¶ }else if(qtInfoDTO.getLevelFlag() == 1){ ciMap = getCIMapForSeniorTree(qtInfoDTO); // OQTool.parseTreeToDoc(seniorTree); } return ciMap; } /** * è·åé«çº§æ¥è¯¢çæ¥è¯¢æ¡ä»¶éå * @return */ private HashMap<String, ConditionItem> getCIMapForSeniorTree(QTInfoDTO qtInfoDTO) throws PLException { HashMap<String, ConditionItem> ciMap = new HashMap<>(); HashMap<String, Object> tree = qtInfoDTO.getTree(); if (tree.isEmpty()) { // æ æ¥è¯¢æ¡ä»¶çæ¥è¯¢ return null; } ArrayList<ConditionItem> ciList = new ArrayList<ConditionItem>(); String connector = String.valueOf(tree.get("connector")); List<Object> childrens = (List<Object>) tree.get("child"); Iterator<Object> children = childrens.iterator(); while (children.hasNext()) { Object obj = children.next(); if(obj instanceof JSONObject && (((JSONObject) obj).get("connector").equals(AND) || ((JSONObject) obj).get("connector").equals(OR))){ List<ConditionItem> subCIList = getCIList((JSONObject) obj, ciList.size() + 1); if(subCIList == null){ continue; } if(ciList.size() > 0){ ConditionItem leftCI = ciList.get(ciList.size() - 1); ConditionItem rightCI = subCIList.get(subCIList.size() - 1); ciList.addAll(subCIList); ConditionItem pCI = new ConditionItem(); pCI.setId("ci" + (ciList.size() + 1)); ciList.add(pCI); pCI.setLeafFlag(false); ChildrenInfo cInfo = new ChildrenInfo(); pCI.setChildrenInfo(cInfo); cInfo.setLeftCIName(leftCI.getId()); cInfo.setConnector(connector); cInfo.setRightCIName(rightCI.getId()); }else{ ciList.addAll(subCIList); } }else{ String text = String.valueOf(obj); if(text == null || text.equals("")){ continue; } if(!text.contains(Operator.EQUAL) && !text.contains(Operator.UNEQUAL) && !text.contains(Operator.CONTAINS) && !text.contains(Operator.IN) && !text.contains(Operator.NOTIN) &&!text.contains(Operator.GTE) && !text.contains(Operator.GT) && !text.contains(Operator.LTE) && !text.contains(Operator.LT)){ continue; } if(ciList.size() > 0){ ConditionItem leftCI = ciList.get(ciList.size() - 1); ConditionItem rightCI = getCIByNode(text, ciList.size() + 1); ciList.add(rightCI); ConditionItem pCI = new ConditionItem(); pCI.setId("ci" + (ciList.size() + 1)); ciList.add(pCI); pCI.setLeafFlag(false); ChildrenInfo cInfo = new ChildrenInfo(); pCI.setChildrenInfo(cInfo); cInfo.setLeftCIName(leftCI.getId()); cInfo.setConnector(connector); cInfo.setRightCIName(rightCI.getId()); }else{ ConditionItem ci = getCIByNode(text, ciList.size() + 1); ciList.add(ci); } } } for(int i = 0; i < ciList.size(); i++){ ConditionItem ci = ciList.get(i); ciMap.put(ci.getId(), ci); } return ciMap; } /** * æ åä¸ä¸ªæ¥è¯¢æ¡ä»¶ç»èç¹ * @param children * @param beginId * @return */ private List<ConditionItem> getCIList(JSONObject children, int beginId) throws PLException { List<ConditionItem> ciList = new ArrayList<>(); String connector = String.valueOf(children.get("connector")); List<Object> childrens = (List<Object>) children.get("child"); if(childrens == null){ return null; } Iterator<Object> child = childrens.iterator(); while (child.hasNext()) { Object obj = child.next(); if(obj instanceof JSONObject && (((JSONObject) obj).get("connector").equals(AND) || ((JSONObject) obj).get("connector").equals(OR))){ List<ConditionItem> subCIList = getCIList((JSONObject) obj, beginId); if(ciList.size() > 0){ ConditionItem leftCI = ciList.get(ciList.size() - 1); ConditionItem rightCI = subCIList.get(subCIList.size() - 1); ciList.addAll(subCIList); beginId = beginId + subCIList.size(); ConditionItem pCI = new ConditionItem(); pCI.setId("ci" + beginId); ciList.add(pCI); beginId = beginId + 1; pCI.setLeafFlag(false); ChildrenInfo cInfo = new ChildrenInfo(); pCI.setChildrenInfo(cInfo); cInfo.setLeftCIName(leftCI.getId()); cInfo.setConnector(connector); cInfo.setRightCIName(rightCI.getId()); }else{ ciList.addAll(subCIList); beginId = beginId + subCIList.size(); } }else{ String text = String.valueOf(obj); if(text == null || text.equals("")){ continue; } if(!text.contains(Operator.EQUAL) && !text.contains(Operator.UNEQUAL) && !text.contains(Operator.CONTAINS) && !text.contains(Operator.IN) && !text.contains(Operator.NOTIN) &&!text.contains(Operator.GTE) && !text.contains(Operator.GT) && !text.contains(Operator.LTE) && !text.contains(Operator.LT)){ continue; } if(ciList.size() > 0){ ConditionItem leftCI = ciList.get(ciList.size() - 1); ConditionItem rightCI = getCIByNode(text, beginId); ciList.add(rightCI); beginId = beginId + 1; ConditionItem pCI = new ConditionItem(); pCI.setId("ci" + beginId); ciList.add(pCI); beginId = beginId + 1; pCI.setLeafFlag(false); ChildrenInfo cInfo = new ChildrenInfo(); pCI.setChildrenInfo(cInfo); cInfo.setLeftCIName(leftCI.getId()); cInfo.setConnector(connector); cInfo.setRightCIName(rightCI.getId()); }else{ ConditionItem ci = getCIByNode(text, beginId); ciList.add(ci); beginId = beginId + 1; } } } return ciList; } /** * é«çº§æ¥è¯¢ * æNodeå 容解ææConditionItem * @param text * @param id * @return */ private ConditionItem getCIByNode(String text, int id) throws PLException { ConditionItem ci = new ConditionItem(); ci.setId("ci" + id); ci.setLeafFlag(true); LeafInfo leafInfo = new LeafInfo(); ci.setLeafInfo(leafInfo); String operator = null; if(text.contains(Operator.EQUAL)){ operator = Operator.EQUAL; }else if(text.contains(Operator.CONTAINS)){ operator = Operator.CONTAINS; }else if(text.contains(Operator.UNEQUAL)){ operator = Operator.UNEQUAL; }else if(text.contains(Operator.IN)){ operator = Operator.IN; }else if(text.contains(Operator.NOTIN)){ operator = Operator.NOTIN; }else if(text.contains(Operator.GTE)){ operator = Operator.GTE; }else if(text.contains(Operator.GT)){ operator = Operator.GT; }else if(text.contains(Operator.LTE)){ operator = Operator.LTE; }else if(text.contains(Operator.LT)){ operator = Operator.LT; } int operatorIndex = text.indexOf(operator); String clause = text.substring(0, operatorIndex).trim(); String ordinaryValue = text.substring(operatorIndex + 2).trim(); if(clause.contains("T_OID.") || clause.contains("F_OID.")){ //廿T_OID.æè F_OID. String clause_ = clause.substring(6); //屿§ä¸ºåç §å±æ§ if(clause_.contains(".")){ int fpIndex = clause_.indexOf("."); String refAbName = clause.substring(0, fpIndex + 6); clause = clause.substring(fpIndex + 6 + 1); leafInfo.setClause(refAbName); //廿T_OID.æè F_OID. refAbName = refAbName.substring(6); leafInfo.setOperator(Operator.IN); QueryTemplate qt = getRefQT(refAbName, clause, operator, ordinaryValue); LeafValue lValue = new LeafValue(); lValue.setQueryTemplate(qt); leafInfo.setValue(lValue); //屿§ä¸ºéåç §å±æ§ }else{ leafInfo.setClause(clause); leafInfo.setOperator(operator); LeafValue lValue = new LeafValue(); leafInfo.setValue(lValue); lValue.setOrdinaryValue(ordinaryValue); } }else{ //屿§ä¸ºåç §å±æ§ if(clause.contains(".")){ int fpIndex = clause.indexOf("."); String refAbName = clause.substring(0, fpIndex); clause = clause.substring(fpIndex + 1); leafInfo.setClause(refAbName); leafInfo.setOperator(Operator.IN); QueryTemplate qt = getRefQT(refAbName, clause, operator, ordinaryValue); LeafValue lValue = new LeafValue(); lValue.setQueryTemplate(qt); leafInfo.setValue(lValue); //屿§ä¸ºéåç §å±æ§ }else{ leafInfo.setClause(clause); leafInfo.setOperator(operator); LeafValue lValue = new LeafValue(); leafInfo.setValue(lValue); lValue.setOrdinaryValue(ordinaryValue); } } return ci; } /** * è·ååç §çæ¥è¯¢æ¨¡æ¿ * @param refAbName: åç §å±æ§å * @param clause: 屿§åç §çä¸å¡ç±»åä¸ç屿§ * @param operator * @param ordinaryValue * @return */ private QueryTemplate getRefQT(String refAbName, String clause, String operator, String ordinaryValue) throws PLException { QueryTemplate qt = new QueryTemplate(); List<String> clauseList = new ArrayList<String>(); clauseList.add("OID"); qt.setClauseList(clauseList); AttributeDef refAb = platformClientUtil.getAttributeService().getAttributeDefByName(refAbName); OtherInfo otherInfo = OtherInfo.getOtherInfoByText(refAb.other); int refFlag = otherInfo.getRefFlag(); String type = otherInfo.getRefTypeName(); if(refFlag == 0){ qt.setType(QTConstants.TYPE_BTM); qt.setBtmType(type); }else if(refFlag == 1){ qt.setType(QTConstants.TYPE_LINK); qt.setLinkType(type); } Condition condition = new Condition(); qt.setCondition(condition); condition.setRootCIName("ci1"); HashMap<String, ConditionItem> ciMap = new HashMap<String, ConditionItem>(); condition.setCIMap(ciMap); ConditionItem ci = new ConditionItem(); ci.setId("ci1"); ciMap.put(ci.getId(), ci); ci.setLeafFlag(true); LeafInfo leafInfo = new LeafInfo(); if(clause.contains(".")){ int fpIndex = clause.indexOf("."); String refAbName_ = clause.substring(0, fpIndex); clause = clause.substring(fpIndex + 1); leafInfo.setClause(refAbName_); leafInfo.setOperator(Operator.IN); QueryTemplate qt_ = getRefQT(refAbName_, clause, operator, ordinaryValue); LeafValue lValue = new LeafValue(); lValue.setQueryTemplate(qt_); leafInfo.setValue(lValue); qt.setId("qt_" + refAbName + "_" + refAbName_); }else{ leafInfo.setClause(clause); leafInfo.setOperator(operator); LeafValue lValue = new LeafValue(); lValue.setOrdinaryValue(ordinaryValue); leafInfo.setValue(lValue); qt.setId("qt_" + refAbName + "_" + clause); } ci.setLeafInfo(leafInfo); condition.setCIMap(ciMap); return qt; } /** * ç»è£ æ¥è¯¢æ¨¡æ¿ * @return */