Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/bo/TreeWrapperOptions.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,122 @@ package com.vci.ubcs.code.bo; import com.vci.ubcs.code.vo.pagemodel.TreeQueryObject; import java.io.Serializable; public class TreeWrapperOptions implements Serializable { private static final long serialVersionUID = 3183500138266494574L; private String textFieldName = "name"; private String textValueSep = " "; private String parentFieldName; private String oidFieldName = "oid"; private String oidValueSep = ","; private boolean allAttributes = true; private String parentOid; private boolean multipleSelect = false; private boolean showCheckBox = false; public TreeWrapperOptions() { } public TreeWrapperOptions(String parentFieldName) { this.parentFieldName = parentFieldName; } public TreeWrapperOptions(String textFieldName, String parentFieldName) { this.textFieldName = textFieldName; this.parentFieldName = parentFieldName; } public TreeWrapperOptions(String textFieldName, String parentFieldName, String parentOid) { this.textFieldName = textFieldName; this.parentFieldName = parentFieldName; this.parentOid = parentOid; } public void copyFromTreeQuery(TreeQueryObject treeQueryObject) { if (treeQueryObject != null) { this.parentOid = treeQueryObject.getParentOid(); this.multipleSelect = treeQueryObject.isMultipleSelect(); this.showCheckBox = treeQueryObject.isShowCheckBox(); } } public String getTextFieldName() { return this.textFieldName; } public void setTextFieldName(String textFieldName) { this.textFieldName = textFieldName; } public String getParentFieldName() { return this.parentFieldName; } public void setParentFieldName(String parentFieldName) { this.parentFieldName = parentFieldName; } public String getOidFieldName() { return this.oidFieldName; } public void setOidFieldName(String oidFieldName) { this.oidFieldName = oidFieldName; } public boolean isAllAttributes() { return this.allAttributes; } public void setAllAttributes(boolean allAttributes) { this.allAttributes = allAttributes; } public String getParentOid() { return this.parentOid; } public void setParentOid(String parentOid) { this.parentOid = parentOid; } public boolean isMultipleSelect() { return this.multipleSelect; } public void setMultipleSelect(boolean multipleSelect) { this.multipleSelect = multipleSelect; } public boolean isShowCheckBox() { return this.showCheckBox; } public void setShowCheckBox(boolean showCheckBox) { this.showCheckBox = showCheckBox; } public String getTextValueSep() { return this.textValueSep; } public void setTextValueSep(String textValueSep) { this.textValueSep = textValueSep; } public String getOidValueSep() { return this.oidValueSep; } public void setOidValueSep(String oidValueSep) { this.oidValueSep = oidValueSep; } public String toString() { return "TreeWrapperOptions{textFieldName='" + this.textFieldName + '\'' + ", textValueSep='" + this.textValueSep + '\'' + ", parentFieldName='" + this.parentFieldName + '\'' + ", oidFieldName='" + this.oidFieldName + '\'' + ", oidValueSep='" + this.oidValueSep + '\'' + ", allAttributes=" + this.allAttributes + ", parentOid='" + this.parentOid + '\'' + ", multipleSelect=" + this.multipleSelect + ", showCheckBox=" + this.showCheckBox + '}'; } } Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeClstemplateDTO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,34 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill åºéª (smallchill@163.com) */ package com.vci.ubcs.code.dto; import com.vci.ubcs.code.entity.CodeClstemplateEntity; import lombok.Data; import lombok.EqualsAndHashCode; /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç æ°æ®ä¼ è¾å¯¹è±¡å®ä½ç±» * * @author yuxc * @since 2023-04-10 */ @Data @EqualsAndHashCode(callSuper = true) public class CodeClstemplateDTO extends CodeClstemplateEntity { private static final long serialVersionUID = 1L; } Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeClstemplateEntity.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,70 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill åºéª (smallchill@163.com) */ package com.vci.ubcs.code.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.vci.ubcs.com.vci.starter.annotation.Transient; import lombok.Data; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.EqualsAndHashCode; /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç å®ä½ç±» * * @author yuxc * @since 2023-04-10 */ @Data @TableName("PL_CODE_CLSTEMPLATE") @ApiModel(value = "PlCodeClstemplate对象", description = "ç¼ç åºå®ä¹-模æ¿ç®¡ç") @EqualsAndHashCode(callSuper = true) public class CodeClstemplateEntity extends BaseModel { /** * 主é¢åºåç±»ä¸»é® */ @ApiModelProperty(value = "主é¢åºå类主é®") private String codeClassifyOid; /** * ä¸å¡ç±»åçç¼å· */ @ApiModelProperty(value = "ä¸å¡ç±»åçç¼å·") private String btmTypeId; /** * ä¸å¡ç±»åçåç§° */ @ApiModelProperty(value = "ä¸å¡ç±»åçåç§°") private String btmTypeName; /** * 主é¢åºåç±»ä¸»é®æ¾ç¤ºææ¬ */ @Transient(referColumn = "codeClassifyOid.name") private String codeClassifyOidName; @Override public String toString() { return "CodeClassifyTemplateDO{" + "codeClassifyOid='" + codeClassifyOid + '\'' + ", codeClassifyOidName='" + codeClassifyOidName + '\'' + ", btmTypeId='" + btmTypeId + '\'' + ", btmTypeName='" + btmTypeName + '\'' + "} " + super.toString(); } } Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/CodeClstemplateVO.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,34 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill åºéª (smallchill@163.com) */ package com.vci.ubcs.code.vo; import com.vci.ubcs.code.entity.CodeClstemplateEntity; import lombok.Data; import lombok.EqualsAndHashCode; /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç è§å¾å®ä½ç±» * * @author yuxc * @since 2023-04-10 */ @Data @EqualsAndHashCode(callSuper = true) public class CodeClstemplateVO extends CodeClstemplateEntity { private static final long serialVersionUID = 1L; } Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/TreeQueryObject.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,137 @@ package com.vci.ubcs.code.vo.pagemodel; // // Source code recreated from a .class file by IntelliJ IDEA // (powered by FernFlower decompiler) // import java.io.Serializable; import java.util.Map; public class TreeQueryObject implements Serializable { private static final long serialVersionUID = -7570704940199743059L; private Map<String, String> conditionMap; private boolean multipleSelect; private boolean showCheckBox; private boolean queryAllLevel; private String parentOid; private String parentBtmName; private String valueField = "oid"; private String textField = "name"; private String parentFieldName; private Map<String, String> extandParamsMap; private boolean queryAllRev; private String sort; private String order; public TreeQueryObject() { } public String getValueField() { return this.valueField; } public void setValueField(String valueField) { this.valueField = valueField; } public String getTextField() { return this.textField; } public void setTextField(String textField) { this.textField = textField; } public String getParentFieldName() { return this.parentFieldName; } public void setParentFieldName(String parentFieldName) { this.parentFieldName = parentFieldName; } public Map<String, String> getConditionMap() { return this.conditionMap; } public void setConditionMap(Map<String, String> conditionMap) { this.conditionMap = conditionMap; } public boolean isMultipleSelect() { return this.multipleSelect; } public void setMultipleSelect(boolean multipleSelect) { this.multipleSelect = multipleSelect; } public boolean isShowCheckBox() { return this.showCheckBox; } public void setShowCheckBox(boolean showCheckBox) { this.showCheckBox = showCheckBox; } public String getParentOid() { return this.parentOid; } public void setParentOid(String parentOid) { this.parentOid = parentOid; } public String getParentBtmName() { return this.parentBtmName; } public void setParentBtmName(String parentBtmName) { this.parentBtmName = parentBtmName; } public Map<String, String> getExtandParamsMap() { return this.extandParamsMap; } public void setExtandParamsMap(Map<String, String> extandParamsMap) { this.extandParamsMap = extandParamsMap; } public boolean isQueryAllLevel() { return this.queryAllLevel; } public void setQueryAllLevel(boolean queryAllLevel) { this.queryAllLevel = queryAllLevel; } public boolean isQueryAllRev() { return this.queryAllRev; } public void setQueryAllRev(boolean queryAllRev) { this.queryAllRev = queryAllRev; } public String getSort() { return this.sort; } public void setSort(String sort) { this.sort = sort; } public String getOrder() { return this.order; } public void setOrder(String order) { this.order = order; } public String toString() { return "TreeQueryObject{conditionMap=" + this.conditionMap + ", multipleSelect=" + this.multipleSelect + ", showCheckBox=" + this.showCheckBox + ", queryAllLevel=" + this.queryAllLevel + ", parentOid='" + this.parentOid + '\'' + ", parentBtmName='" + this.parentBtmName + '\'' + ", valueField='" + this.valueField + '\'' + ", textField='" + this.textField + '\'' + ", parentFieldName='" + this.parentFieldName + '\'' + ", extandParamsMap=" + this.extandParamsMap + ", queryAllRev=" + this.queryAllRev + ", sort='" + this.sort + '\'' + ", order='" + this.order + '\'' + '}'; } } Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/com/vci/starter/revision/service/RevisionModelUtil.java
@@ -7,15 +7,28 @@ //package com.vci.starter.revision.service; import com.vci.ubcs.code.bo.TreeWrapperOptions; import com.vci.ubcs.code.entity.BaseModel; import com.vci.ubcs.com.vci.starter.util.VciBaseUtil; import com.vci.ubcs.com.vci.starter.web.pagemodel.Tree; import com.vci.ubcs.com.vci.starter.web.service.VciSecretServiceI; import com.vci.ubcs.com.vci.starter.web.util.BeanUtilForVCI; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springblade.core.tool.utils.StringUtil; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.function.Function; import java.util.stream.Collectors; @Component public class RevisionModelUtil implements VciSecretServiceI { private Logger logger = LoggerFactory.getLogger(this.getClass()); public void copyFromDTOIgnore(Object dto, BaseModel baseModel) { VciBaseUtil.alertNotNull(new Object[]{dto, "æ°æ®ä¼ è¾å¯¹è±¡", baseModel, "æ°æ®åºä¸çæ°æ®å¯¹è±¡"}); BaseModel tempModel = new BaseModel(); @@ -27,5 +40,72 @@ baseModel.setDescription(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getValueFromField("description", dto))); tempModel = null; } public <T, R> List<Tree> doList2Trees(List<T> doList, TreeWrapperOptions wrapperOptions, Function<T, R> f) { if (CollectionUtils.isEmpty(doList)) { return new ArrayList(); } else { List<Tree> allTree = new ArrayList(); List<Tree> children = new ArrayList(); Iterator var6 = doList.iterator(); while(true) { while(var6.hasNext()) { T doObject = (T) var6.next(); Tree tree = new Tree(); List<String> oidFieldNames = VciBaseUtil.str2List(wrapperOptions.getOidFieldName()); List<String> oidValues = new LinkedList(); oidFieldNames.stream().forEach((s) -> { oidValues.add(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getValueFromField(s, doObject))); }); tree.setOid((String)oidValues.stream().collect(Collectors.joining(wrapperOptions.getOidValueSep()))); if (f != null) { tree.setText((String)f.apply(doObject)); } else { List<String> textFieldNames = VciBaseUtil.str2List(wrapperOptions.getTextFieldName()); List<String> textValues = new LinkedList(); textFieldNames.stream().forEach((s) -> { textValues.add(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getValueFromField(s, doObject))); }); tree.setText((String)textValues.stream().collect(Collectors.joining(wrapperOptions.getTextValueSep()))); } if (StringUtil.isNotBlank(wrapperOptions.getParentFieldName())) { tree.setParentId(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getValueFromField(wrapperOptions.getParentFieldName(), doObject))); } if (wrapperOptions.isAllAttributes()) { try { tree.setAttributes(VciBaseUtil.objectToMapString(doObject)); } catch (Exception var13) { if (this.logger.isErrorEnabled()) { this.logger.error("æå¯¹è±¡è½¬æ¢ä¸ºmapæ¶åºç°äºé误ï¼ä½æ¯ä¸å½±åæ çå±ç¤ºï¼å¯¹ä¸å¡å¯è½æå½±å"); } } } if (wrapperOptions.isMultipleSelect() || wrapperOptions.isShowCheckBox()) { tree.setShowCheckbox(true); } if (wrapperOptions.getParentOid() == null) { wrapperOptions.setParentOid(""); } if (!StringUtil.isBlank(tree.getParentId()) && (!StringUtil.isNotBlank(wrapperOptions.getParentOid()) || !wrapperOptions.getParentOid().equalsIgnoreCase(tree.getParentId()))) { children.add(tree); } else { allTree.add(tree); } } (new Tree()).findChild(allTree, children); if (allTree.size() <= 0) { allTree.addAll(children); } return allTree; } } } } Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/com/vci/starter/web/pagemodel/Tree.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,205 @@ package com.vci.ubcs.com.vci.starter.web.pagemodel; import org.springblade.core.tool.utils.StringUtil; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; public class Tree implements Serializable { private static final long serialVersionUID = 6886695271635257882L; private String oid; private String text; private boolean leaf = false; private boolean showCheckbox = false; private boolean checked = false; private List<Tree> children = new ArrayList(); private String icon; private String iconCls; private String parentId; private String parentName; private String parentBtmName; private boolean expanded = false; private String href; private String index; private Map<String, String> attributes = new HashMap(); public Tree() { } public Tree(String oid, String text) { this.setOid(oid); this.setText(text); } public String getOid() { return this.oid; } public void setOid(String oid) { this.oid = oid; } public String getText() { return this.text; } public void setText(String text) { this.text = text; } public boolean isLeaf() { return this.leaf; } public void setLeaf(boolean leaf) { this.leaf = leaf; } public boolean isShowCheckbox() { return this.showCheckbox; } public void setShowCheckbox(boolean showCheckbox) { this.showCheckbox = showCheckbox; } public boolean isChecked() { return this.checked; } public void setChecked(boolean checked) { this.checked = checked; } public List<Tree> getChildren() { return this.children; } public void setChildren(List<Tree> children) { this.children = children; } public String getIcon() { return this.icon; } public void setIcon(String icon) { this.icon = icon; } public String getIconCls() { return this.iconCls; } public void setIconCls(String iconCls) { this.iconCls = iconCls; } public String getParentId() { return this.parentId; } public void setParentId(String parentId) { this.parentId = parentId; } public boolean isExpanded() { return this.expanded; } public void setExpanded(boolean expanded) { this.expanded = expanded; } public String getHref() { return this.href; } public void setHref(String href) { this.href = href; } public String getIndex() { return this.index; } public void setIndex(String index) { this.index = index; } public Map<String, String> getAttributes() { return this.attributes; } public void setAttributes(Map<String, String> attributes) { this.attributes = attributes; } public String getParentName() { return this.parentName; } public void setParentName(String parentName) { this.parentName = parentName; } public String getParentBtmName() { return this.parentBtmName; } public void setParentBtmName(String parentBtmName) { this.parentBtmName = parentBtmName; } public static List<Tree> getChildList(List<Tree> rootTree, List<Tree> children) { if (rootTree == null || rootTree.size() == 0) { if (children == null || children.size() <= 0) { return null; } rootTree = children.subList(0, children.size()); } Tree bt = new Tree(); bt.findChild(rootTree, children); return rootTree; } public void findChild(List<Tree> treenode, List<Tree> children) { Tree node; for(Iterator var3 = treenode.iterator(); var3.hasNext(); this.getChildren().add(node)) { node = (Tree)var3.next(); Iterator var5 = children.iterator(); while(var5.hasNext()) { Tree childnode = (Tree)var5.next(); if (node.getOid().equalsIgnoreCase(childnode.getParentId())) { childnode.setParentName(node.getText()); if (StringUtil.isBlank(childnode.getParentBtmName())) { childnode.setParentBtmName((String)node.getAttributes().getOrDefault("btmname", "")); } node.getChildren().add(childnode); } } if (node.getChildren().size() > 0) { this.findChild(node.getChildren(), children); node.setLeaf(false); } else { node.setLeaf(true); } } } public String toString() { return "Tree{oid='" + this.oid + '\'' + ", text='" + this.text + '\'' + ", leaf=" + this.leaf + ", showCheckbox=" + this.showCheckbox + ", checked=" + this.checked + ", children=" + this.children + ", icon='" + this.icon + '\'' + ", iconCls='" + this.iconCls + '\'' + ", parentId='" + this.parentId + '\'' + ", parentName='" + this.parentName + '\'' + ", parentBtmName='" + this.parentBtmName + '\'' + ", expanded=" + this.expanded + ", href='" + this.href + '\'' + ", index='" + this.index + '\'' + ", attributes=" + this.attributes + '}'; } } Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/com/vci/starter/web/util/VciBaseUtil.java
@@ -1094,5 +1094,43 @@ } } public static <T> Collection<Collection<T>> switchCollectionForOracleIn(Collection<T> list) { return switchCollectionForOracleIn(list, 500); } public static <T> Collection<Collection<T>> switchCollectionForOracleIn(Collection<T> collection, int preSize) { Collection<Collection<T>> listHasList = new ArrayList(); if (collection == null) { return listHasList; } else { List<T> newList = new ArrayList(); Iterator var4 = collection.iterator(); while(var4.hasNext()) { Object obj = var4.next(); newList.add((T) obj); } int muti = 1; int i; if (newList.size() > preSize) { i = newList.size() % preSize; muti = (newList.size() - i) / preSize + (i == 0 ? 0 : 1); } for(i = 0; i < muti; ++i) { int start = i * preSize; int end = start + preSize; if (i == muti - 1 || end > newList.size()) { end = newList.size(); } List subList = newList.subList(start, end); listHasList.add(subList); } return listHasList; } } } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeClassifyController.java
@@ -21,16 +21,22 @@ import com.vci.ubcs.code.entity.CodeClassify; import com.vci.ubcs.code.mapper.CodeClassifyMapper; import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; import com.vci.ubcs.code.vo.pagemodel.TreeQueryObject; import com.vci.ubcs.com.vci.starter.web.pagemodel.Tree; import com.vci.ubcs.com.vci.starter.web.util.VciBaseUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import lombok.AllArgsConstructor; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.IResultCode; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; @@ -38,7 +44,14 @@ import com.vci.ubcs.code.service.ICodeClassifyService; import org.springblade.core.boot.ctrl.BladeController; import java.io.File; import java.io.IOException; import java.util.Collection; import java.util.Date; import java.util.List; import static com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant.FRAMEWORK_DATA_DISABLED; import static com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant.FRAMEWORK_DATA_ENABLED; /** * 主é¢åºå®ä¹è¡¨ æ§å¶å¨ @@ -155,4 +168,63 @@ public R delCodeClassify(CodeClassify codeClassify) { return codeClassifyService.deleteCodeClassify(codeClassify); } /** * å¯ç¨ * @param codeClassify * @return */ @PostMapping( "/enableData") public R enable(CodeClassify codeClassify) { return codeClassifyService.updateLcStatus(codeClassify.getOid(),FRAMEWORK_DATA_ENABLED); } /** * åç¨ * @param codeClassify * @return */ @PostMapping( "/disableData") public R disable(CodeClassify codeClassify) { return codeClassifyService.updateLcStatus(codeClassify.getOid(),FRAMEWORK_DATA_DISABLED); } /** * 䏻鮿¹éè·å主é¢åºåç±» * @param oids 主é®ï¼å¤ä¸ªä»¥éå·åéï¼ä½æ¯åæ§è½å½±åï¼å»ºè®®ä¸æ¬¡æ¥è¯¢ä¸è¶ è¿10000个 * @return 主é¢åºåç±»æ¾ç¤ºå¯¹è±¡ */ @GetMapping("/listDataByOids") public R listCodeClassifyByOids(String oids){ Collection<CodeClassifyVO> voCollection = codeClassifyService.listCodeClassifyByOids(VciBaseUtil.str2List(oids)); return R.data(voCollection); } /** * åç §æ 主é¢åºåç±» * @param treeQueryObject æ å½¢æ¥è¯¢å¯¹è±¡ * @return 主é¢åºåç±»æ¾ç¤ºæ */ @GetMapping("/referTree") public List<Tree> referTree(TreeQueryObject treeQueryObject) { return codeClassifyService.referTree(treeQueryObject); } /** * 导åºåç±» * @param oid åç±»ä¸»é® */ @GetMapping("/exportClassify") public void exportClassify(String oid, HttpServletResponse response) throws IOException { String excelName = codeClassifyService.exportClassify(oid); // try { // ControllerUtil.writeFileToResponse(response,excelName); // } catch (Throwable e) { // //妿åºé,æé误信æ¯åå°text // String msg = LangBaseUtil.getErrorMsg(e); // String errorFile = LocalFileUtil.getDefaultTempFolder() + File.separator + "é误.txt"; // LocalFileUtil.writeContentToFile(msg,errorFile); // ControllerUtil.writeFileToResponse(response,errorFile); // } } } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/CodeClstemplateController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,130 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill åºéª (smallchill@163.com) */ package com.vci.ubcs.code.controller; import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; import com.vci.ubcs.code.mapper.CodeButtonMapper; import com.vci.ubcs.code.mapper.CodeClstemplateMapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import lombok.AllArgsConstructor; import javax.validation.Valid; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; import com.baomidou.mybatisplus.core.metadata.IPage; import com.vci.ubcs.code.entity.CodeClstemplateEntity; import com.vci.ubcs.code.vo.CodeClstemplateVO; import com.vci.ubcs.code.wrapper.PlCodeClstemplateWrapper; import com.vci.ubcs.code.service.ICodeClstemplateService; import org.springblade.core.boot.ctrl.BladeController; /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç æ§å¶å¨ * * @author yuxc * @since 2023-04-10 */ @RestController @AllArgsConstructor @RequestMapping("/plCodeClstemplate") @Api(value = "ç¼ç åºå®ä¹-模æ¿ç®¡ç", tags = "ç¼ç åºå®ä¹-模æ¿ç®¡çæ¥å£") public class CodeClstemplateController extends BladeController { private final ICodeClstemplateService plCodeClstemplateService; CodeClstemplateMapper codeClstemplateMapper; /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç 详æ */ @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详æ ", notes = "ä¼ å ¥plCodeClstemplate") public R<CodeClstemplateVO> detail(CodeClstemplateEntity plCodeClstemplate) { CodeClstemplateEntity detail = plCodeClstemplateService.getOne(Condition.getQueryWrapper(plCodeClstemplate)); return R.data(PlCodeClstemplateWrapper.build().entityVO(detail)); } /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç å页 */ @GetMapping("/list") @ApiOperationSupport(order = 2) @ApiOperation(value = "å页", notes = "ä¼ å ¥plCodeClstemplate") public R<IPage<CodeClstemplateVO>> list(CodeClstemplateEntity plCodeClstemplate, Query query) { IPage<CodeClstemplateEntity> pages = plCodeClstemplateService.page(Condition.getPage(query), Condition.getQueryWrapper(plCodeClstemplate)); return R.data(PlCodeClstemplateWrapper.build().pageVO(pages)); } /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç èªå®ä¹å页 */ @GetMapping("/page") @ApiOperationSupport(order = 3) @ApiOperation(value = "å页", notes = "ä¼ å ¥plCodeClstemplate") public R<IPage<CodeClstemplateVO>> page(CodeClstemplateVO plCodeClstemplate, Query query) { IPage<CodeClstemplateVO> pages = plCodeClstemplateService.selectPlCodeClstemplatePage(Condition.getPage(query), plCodeClstemplate); return R.data(pages); } /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç æ°å¢ */ @PostMapping("/save") @ApiOperationSupport(order = 4) @ApiOperation(value = "æ°å¢", notes = "ä¼ å ¥plCodeClstemplate") public R save(@Valid @RequestBody CodeClstemplateEntity plCodeClstemplate) { return R.status(plCodeClstemplateService.save(plCodeClstemplate)); } /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç ä¿®æ¹ */ @PostMapping("/update") @ApiOperationSupport(order = 5) @ApiOperation(value = "ä¿®æ¹", notes = "ä¼ å ¥plCodeClstemplate") public R update(@Valid @RequestBody CodeClstemplateEntity plCodeClstemplate) { return R.status(plCodeClstemplateService.updateById(plCodeClstemplate)); } /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç æ°å¢æä¿®æ¹ */ @PostMapping("/submit") @ApiOperationSupport(order = 6) @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å ¥plCodeClstemplate") public R submit(@Valid @RequestBody CodeClstemplateEntity plCodeClstemplate) { return R.status(plCodeClstemplateService.saveOrUpdate(plCodeClstemplate)); } /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç å é¤ */ @PostMapping("/remove") @ApiOperationSupport(order = 7) @ApiOperation(value = "é»è¾å é¤", notes = "ä¼ å ¥ids") public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { return R.status(SqlHelper.retBool(codeClstemplateMapper.deleteBatchIds(Func.toLongList(ids)))); } } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/feign/IPlCodeClstemplateClient.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,49 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill åºéª (smallchill@163.com) */ package com.vci.ubcs.code.feign; import org.springblade.core.mp.support.BladePage; import com.vci.ubcs.code.entity.CodeClstemplateEntity; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç Feignæ¥å£ç±» * * @author yuxc * @since 2023-04-10 */ @FeignClient( value = "blade-plCodeClstemplate" ) public interface IPlCodeClstemplateClient { String API_PREFIX = "/client"; String TOP = API_PREFIX + "/top"; /** * è·åç¼ç åºå®ä¹-模æ¿ç®¡çå表 * * @param current é¡µå· * @param size é¡µæ° * @return BladePage */ @GetMapping(TOP) BladePage<CodeClstemplateEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/feign/PlCodeClstemplateClient.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,54 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill åºéª (smallchill@163.com) */ package com.vci.ubcs.code.feign; import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import com.vci.ubcs.code.entity.CodeClstemplateEntity; import com.vci.ubcs.code.service.ICodeClstemplateService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç Feignå®ç°ç±» * * @author yuxc * @since 2023-04-10 */ @ApiIgnore() @RestController @AllArgsConstructor public class PlCodeClstemplateClient implements IPlCodeClstemplateClient { private final ICodeClstemplateService plCodeClstemplateService; @Override @GetMapping(TOP) public BladePage<CodeClstemplateEntity> top(Integer current, Integer size) { Query query = new Query(); query.setCurrent(current); query.setSize(size); // IPage<CodeClstemplateEntity> page = service.page(Condition.getPage(query)); // return BladePage.of(page); return null; } } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/mapper/CodeClassifyMapper.java
@@ -60,5 +60,20 @@ // @MapKey("oid") Boolean checkHasChild(String oid); /** * æ¥æ¾æ å½¢ç»æ * * @param oid åç±»çä¸»é® * @return æ°æ®éå */ List<CodeClassify> selectCodeClassifyVOByTree(String oid); /** * æ¥æ¾æ å½¢ç»æ * * @param oid åç±»çä¸»é® * @return æ°æ®éå */ List<CodeClassify> selectAllLevelChildHasPath(String oid); } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/mapper/CodeClstemplateMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,43 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill åºéª (smallchill@163.com) */ package com.vci.ubcs.code.mapper; import com.vci.ubcs.code.entity.CodeClstemplateEntity; import com.vci.ubcs.code.vo.CodeClstemplateVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import java.util.List; /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç Mapper æ¥å£ * * @author yuxc * @since 2023-04-10 */ public interface CodeClstemplateMapper extends BaseMapper<CodeClstemplateEntity> { /** * èªå®ä¹å页 * * @param page * @param plCodeClstemplate * @return */ List<CodeClstemplateVO> selectPlCodeClstemplatePage(IPage page, CodeClstemplateVO plCodeClstemplate); } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/ICodeClassifyService.java
@@ -5,8 +5,11 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.vci.ubcs.code.entity.CodeClassify; import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; import com.vci.ubcs.code.vo.pagemodel.TreeQueryObject; import com.vci.ubcs.com.vci.starter.web.pagemodel.Tree; import org.springblade.core.tool.api.R; import java.util.Collection; import java.util.List; /** @@ -76,4 +79,70 @@ */ R deleteCodeClassify(CodeClassify codeClassify) ; /** * å¯ç¨ãåç¨ * @param oid ä¸»é® * @param lcStatus ç¶æ * @return æ§è¡ç»æ */ R updateLcStatus(String oid, String lcStatus); /** * æ ¹æ®ä¸»é®æ¹éæ¥è¯¢å¯¹è±¡ * @param oids 对象主é®,使ç¨éå·åéï¼ä½æ¯ä¸è½è¶ è¿1000 * @return ä¸å¡å¯¹è±¡ */ // List<CodeClassify> selectByPrimaryKeyCollection(Collection<String> oids); /** * 䏻鮿¹éè·å主é¢åºåç±» * @param oidCollections 主é®éåï¼ä½æ¯åæ§è½å½±åï¼å»ºè®®ä¸æ¬¡æ¥è¯¢ä¸è¶ è¿10000个 * @return 主é¢åºåç±»æ¾ç¤ºå¯¹è±¡ */ Collection<CodeClassifyVO> listCodeClassifyByOids(Collection<String> oidCollections) ; /** * æ¹éæ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ * @param codeClassifys æ°æ®å¯¹è±¡å表 * @return æ¾ç¤ºå¯¹è±¡ */ List<CodeClassifyVO> codeClassifyDO2VOs(Collection<CodeClassify> codeClassifys); /** * æ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ * @param codeClassify æ°æ®å¯¹è±¡ * @return æ¾ç¤ºå¯¹è±¡ */ CodeClassifyVO codeClassifyDO2VO(CodeClassify codeClassify); /** * åç §æ 主é¢åºåç±» * @param treeQueryObject æ å½¢æ¥è¯¢å¯¹è±¡ * @return 主é¢åºåç±»æ¾ç¤ºæ */ List<Tree> referTree(TreeQueryObject treeQueryObject); /** * æ¥è¯¢ä¸»é¢åºåç±» æ * @param treeQueryObject æ æ¥è¯¢å¯¹è±¡ * @return 主é¢åºåç±» æ¾ç¤ºæ */ List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject); /** * 导åºåç±» * @param oid åç±»ä¸»é® * @return excelæä»¶è·¯å¾ */ String exportClassify(String oid); /** * è·åå级ç主é¢åºåç±» * * @param codeClassifyOid åç±»çä¸»é® * @param allLevel æ¯å¦ææçå±çº§ * @param fieldInPath å¨è·¯å¾ä¸çåæ®µ * @param enable æ¯å¦åªæ¾ç¤ºå¯ç¨ * @return åç±»çæ¾ç¤ºå¯¹è±¡ */ List<CodeClassifyVO> listChildrenClassify(String codeClassifyOid, boolean allLevel, String fieldInPath, boolean enable); } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/ICodeClstemplateService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,44 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill åºéª (smallchill@163.com) */ package com.vci.ubcs.code.service; import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.vci.ubcs.code.entity.CodeClstemplateEntity; import com.vci.ubcs.code.vo.CodeClstemplateVO; import org.springblade.core.mp.base.BaseService; import com.baomidou.mybatisplus.core.metadata.IPage; /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç æå¡ç±» * * @author yuxc * @since 2023-04-10 */ public interface ICodeClstemplateService extends IService<CodeClstemplateEntity> { /** * èªå®ä¹å页 * * @param page * @param plCodeClstemplate * @return */ IPage<CodeClstemplateVO> selectPlCodeClstemplatePage(IPage<CodeClstemplateVO> page, CodeClstemplateVO plCodeClstemplate); } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClstemplateServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,41 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill åºéª (smallchill@163.com) */ package com.vci.ubcs.code.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.vci.ubcs.code.entity.CodeClstemplateEntity; import com.vci.ubcs.code.vo.CodeClstemplateVO; import com.vci.ubcs.code.mapper.CodeClstemplateMapper; import com.vci.ubcs.code.service.ICodeClstemplateService; import org.springblade.core.mp.base.BaseServiceImpl; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.metadata.IPage; /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç æå¡å®ç°ç±» * * @author yuxc * @since 2023-04-10 */ @Service public class CodeClstemplateServiceImpl extends ServiceImpl<CodeClstemplateMapper, CodeClstemplateEntity> implements ICodeClstemplateService { @Override public IPage<CodeClstemplateVO> selectPlCodeClstemplatePage(IPage<CodeClstemplateVO> page, CodeClstemplateVO plCodeClstemplate) { return page.setRecords(baseMapper.selectPlCodeClstemplatePage(page, plCodeClstemplate)); } } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/ICodeClassifyServiceImpl.java
@@ -5,24 +5,42 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; import com.vci.ubcs.code.bo.TreeWrapperOptions; import com.vci.ubcs.code.entity.CodeClassify; import com.vci.ubcs.code.entity.CodeClstemplateEntity; import com.vci.ubcs.code.enumpack.FrameworkDataLCStatus; import com.vci.ubcs.code.mapper.CodeClassifyMapper; import com.vci.ubcs.code.mapper.CodeClstemplateMapper; import com.vci.ubcs.code.service.ICodeClassifyService; import com.vci.ubcs.code.service.ICodeKeyattrrepeatService; import com.vci.ubcs.code.service.ICodeRuleService; import com.vci.ubcs.code.vo.CodeClstemplateVO; import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO; import com.vci.ubcs.code.vo.pagemodel.CodeKeyAttrRepeatRuleVO; import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO; import com.vci.ubcs.code.vo.pagemodel.TreeQueryObject; import com.vci.ubcs.com.vci.starter.revision.service.RevisionModelUtil; import com.vci.ubcs.com.vci.starter.web.pagemodel.Tree; import com.vci.ubcs.com.vci.starter.web.util.BeanUtilForVCI; import com.vci.ubcs.com.vci.starter.web.util.VciBaseUtil; import com.vci.ubcs.core.log.exception.ServiceException; import jodd.bean.BeanUtil; import org.springblade.core.cache.utils.CacheUtil; import org.springblade.core.mp.support.Condition; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.io.File; import java.util.*; import java.util.stream.Collectors; import static com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant.*; import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; @Service public class ICodeClassifyServiceImpl extends ServiceImpl<CodeClassifyMapper, CodeClassify> implements ICodeClassifyService { @@ -30,6 +48,23 @@ @Resource private CodeClassifyMapper codeClassifyMapper; @Resource private CodeClstemplateMapper codeClstemplateMapper; @Resource private ICodeRuleService codeRuleService; /** * 对象çæä½ */ @Resource private RevisionModelUtil revisionModelUtil; @Resource private ICodeKeyattrrepeatService iCodeKeyattrrepeatService; /** * ä¸çº§èç¹ç屿§åç§° */ public static final String PARENT_FIELD_NAME = "parentCodeClassifyOid"; /** * ä½¿ç¨æ¥è¯¢å°è£ 卿¥æ¥è¯¢ * @param wrapper æ¥è¯¢å°è£ å¨ @@ -203,50 +238,322 @@ R result = checkIsCanDeleteForDO(codeClassify); //å ç®ç§°æ¯å¦æå ³è模æ¿ï¼ææ¨¡æ¿è¦å å é¤ Map<String,Object> condition = new HashMap<>(2); condition.put("codeClassifyOid",codeClassify.getOid()); List<CodeClstemplateEntity> codeClstemplateEntities = codeClstemplateMapper.selectByMap(condition); // VciQueryWrapperForDO queryWrapper = new VciQueryWrapperForDO(CodeClassifyTemplateDO.class); // queryWrapper.addQueryMap("codeClassifyOid",codeClassifyDTO.getOid()); // List<CodeClassifyTemplateDO> codeClassifyTemplateDOListHaveTemplate = codeClassifyTemplateMapper.selectByWrapper(queryWrapper); // if(codeClassifyTemplateDOListHaveTemplate.size()>0){ // return BaseResult.fail("åç±»å ³èæ¨¡æ¿ï¼è¯·å å é¤!"); // } // // //å¤çæ°æ®éæé»è¾,æååæ§è¡éæç¬¬ä¸æ¥,åç±»æ°æ®ç¹æ®å¤çã // //1ãæ¥è¯¢è¦å é¤çç¶ç±»æ°æ® // List<CodeClassifyDO> deletes = new ArrayList<CodeClassifyDO>(); // deletes.add(codeClassifyDO); // // if(result.isSuccess()) { // //æ¾ä¸çº§çï¼è¿ä¸ªæ¯å¯ä»¥å é¤çæ¶å // Map<String,String> childrenOids = codeClassifyMapper.selectAllLevelChildOid(codeClassifyDO.getOid().trim()); // if (!CollectionUtils.isEmpty(childrenOids)) { // Collection<Collection<String>> childrenCollections = VciBaseUtil.switchCollectionForOracleIn(childrenOids.keySet()); // for(Collection<String> s : childrenCollections){ // // //å¤çæ°æ®éæé»è¾,æååæ§è¡éæç¬¬ä¸æ¥,åç±»æ°æ®ç¹æ®å¤çã // //2ãæ¥è¯¢è¦å é¤çåç±»æ°æ® // List<CodeClassifyDO> codeClassifyDOList = codeClassifyMapper.selectByPrimaryKeyCollection(s); // deletes.addAll(codeClassifyDOList); // // codeClassifyMapper.batchDeleteByOids(s); // } // // } // }else{ // return baseResult; // } // // //æ§è¡å é¤æä½ // BatchCBO batchCBO = codeClassifyMapper.deleteByPrimaryKey(codeClassifyDO.getOid()); // // //å¤çæ°æ®éæé»è¾,æååæ§è¡éæç¬¬ä¸æ¥ // for (CodeClassifyDO codeClassifyDO1:deletes){ // //codeDuckingServiceI.insertCache1(CACHE_TYPE_CLASSIFY_DELETE,FRAMEWORK_DATA_DISABLED,DOCKING_DEFAULT_CLASSIFY, DOCKING_DEFAULT_CLASSIFYOID, codeClassifyDO1.getOid(), DateUtils.addHours(new Date(),1));//è¿éæ¯å½åæ¶é´ // // //åå¨è¦å é¤çæ°æ® // codeDuckingServiceI.cacheDeleteData(codeClassifyDO1.getOid(), codeClassifyDO1); // } // return (batchCBO!=null && batchCBO.getDeleteCbos() !=null &&batchCBO.getDeleteCbos().size() > 0)?BaseResult.successMsg(DELETE_SUCCESS):BaseResult.fail(DELETE_FAIL); return null; if(codeClstemplateEntities.size()>0){ return R.fail("åç±»å ³èæ¨¡æ¿ï¼è¯·å å é¤!"); } //å¤çæ°æ®éæé»è¾,æååæ§è¡éæç¬¬ä¸æ¥,åç±»æ°æ®ç¹æ®å¤çã //1ãæ¥è¯¢è¦å é¤çç¶ç±»æ°æ® List<CodeClassify> deletes = new ArrayList<CodeClassify>(); deletes.add(codeClassify); if(result.isSuccess()) { //æ¾ä¸çº§çï¼è¿ä¸ªæ¯å¯ä»¥å é¤çæ¶å Map<String,String> childrenOids = codeClassifyMapper.selectAllLevelChildOid(codeClassify.getOid().trim()); if (!CollectionUtils.isEmpty(childrenOids)) { Collection<Collection<String>> childrenCollections = VciBaseUtil.switchCollectionForOracleIn(childrenOids.keySet()); for(Collection<String> s : childrenCollections){ //å¤çæ°æ®éæé»è¾,æååæ§è¡éæç¬¬ä¸æ¥,åç±»æ°æ®ç¹æ®å¤çã //2ãæ¥è¯¢è¦å é¤çåç±»æ°æ® List<CodeClassify> codeClassifyDOList = codeClassifyMapper.selectBatchIds(s); deletes.addAll(codeClassifyDOList); codeClassifyMapper.deleteBatchIds(s); } } }else{ return result; } //æ§è¡å é¤æä½ int deleteCount = codeClassifyMapper.deleteById(codeClassify.getOid()); //å¤çæ°æ®éæé»è¾,æååæ§è¡éæç¬¬ä¸æ¥ for (CodeClassify codeClassifyTemp:deletes){ //codeDuckingServiceI.insertCache1(CACHE_TYPE_CLASSIFY_DELETE,FRAMEWORK_DATA_DISABLED,DOCKING_DEFAULT_CLASSIFY, DOCKING_DEFAULT_CLASSIFYOID, codeClassifyDO1.getOid(), DateUtils.addHours(new Date(),1));//è¿éæ¯å½åæ¶é´ //åå¨è¦å é¤çæ°æ® // CacheUtil.put(); CacheUtil.put("ubcs:code", "bean:id:", codeClassifyTemp.getOid(), codeClassifyTemp); // codeDuckingServiceI.cacheDeleteData(codeClassifyTemp.getOid(), codeClassifyTemp); } return R.data(deleteCount>0); // return null; } /** * å¯ç¨ãåç¨ * @param oid ä¸»é® * @param lcStatus ç¶æ * @return æ§è¡ç»æ */ @Override public R updateLcStatus(String oid, String lcStatus){ //æ¥è¯¢ä¿®æ¹åts CodeClassify codeClassify = codeClassifyMapper.selectById(oid);//ä¸»è¦æ¯ä¸ºäºæ¥è¯¢ts codeClassify.setLcStatus(lcStatus); //å¯ç¨ãåç¨ // int u = codeClassifyMapper.updateLcStatus(oid,lcStatus); int count = codeClassifyMapper.updateById(codeClassify); // //å¤çæ°æ®éæé»è¾,æååæ§è¡éæç¬¬ä¸æ¥,åç±»æ°æ®ç¹æ®å¤çã // if(u!=0) { // codeDuckingServiceI.insertCache1(lcStatus,lcStatus,DOCKING_DEFAULT_CLASSIFY, DOCKING_DEFAULT_CLASSIFYOID, oid, codeClassifyDO_old.getTs()); // } return R.data(SqlHelper.retBool(count)); } /** * 䏻鮿¹éè·å主é¢åºåç±» * @param oidCollections 主é®éåï¼ä½æ¯åæ§è½å½±åï¼å»ºè®®ä¸æ¬¡æ¥è¯¢ä¸è¶ è¿10000个 * @return 主é¢åºåç±»æ¾ç¤ºå¯¹è±¡ */ @Override public Collection<CodeClassifyVO> listCodeClassifyByOids(Collection<String> oidCollections) { VciBaseUtil.alertNotNull(oidCollections,"æ°æ®å¯¹è±¡ä¸»é®éå"); List<CodeClassify> codeClassifyDOList = listCodeClassifyDOByOidCollections(oidCollections); return codeClassifyDO2VOs(codeClassifyDOList); } /** * 使ç¨ä¸»é®éåæ¥è¯¢æ°æ®å¯¹è±¡ * @param oidCollections 主é®çéå * @return æ°æ®å¯¹è±¡å表 */ private List<CodeClassify> listCodeClassifyDOByOidCollections(Collection<String> oidCollections){ List<CodeClassify> codeClassifyList = new ArrayList<CodeClassify>(); if(!CollectionUtils.isEmpty(oidCollections)){ Collection<Collection<String>> oidCollectionsList = VciBaseUtil.switchCollectionForOracleIn(oidCollections); for(Collection<String> oids: oidCollectionsList){ List<CodeClassify> tempDOList = codeClassifyMapper.selectBatchIds(oids); if(!CollectionUtils.isEmpty(tempDOList)){ codeClassifyList.addAll(tempDOList); } } } return codeClassifyList; } /** * æ¹éæ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ * @param codeClassifys æ°æ®å¯¹è±¡å表 * @return æ¾ç¤ºå¯¹è±¡ */ @Override public List<CodeClassifyVO> codeClassifyDO2VOs(Collection<CodeClassify> codeClassifys) { List<CodeClassifyVO> voList = new ArrayList<CodeClassifyVO>(); if(!CollectionUtils.isEmpty(codeClassifys)){ for(CodeClassify s: codeClassifys){ CodeClassifyVO vo = codeClassifyDO2VO(s); if(vo != null){ voList.add(vo); } } } return voList; } /** * æ°æ®å¯¹è±¡è½¬æ¢ä¸ºæ¾ç¤ºå¯¹è±¡ * @param codeClassify æ°æ®å¯¹è±¡ * @return æ¾ç¤ºå¯¹è±¡ */ @Override public CodeClassifyVO codeClassifyDO2VO(CodeClassify codeClassify) { CodeClassifyVO vo = new CodeClassifyVO(); if(codeClassify != null){ BeanUtilForVCI.copyPropertiesIgnoreCase(codeClassify,vo); //妿ælcstatusçç±»çè¯ vo.setLcStatusText(FrameworkDataLCStatus.getTextByValue(vo.getLcStatus())); } return vo; } /** * åç §æ 主é¢åºåç±» * @param treeQueryObject æ å½¢æ¥è¯¢å¯¹è±¡ * @return 主é¢åºåç±»æ¾ç¤ºæ */ @Override public List<Tree> referTree(TreeQueryObject treeQueryObject) { if(treeQueryObject == null){ treeQueryObject = new TreeQueryObject(); } if(treeQueryObject.getConditionMap() == null){ treeQueryObject.setConditionMap(new HashMap<>()); } if(treeQueryObject.getConditionMap().containsKey(LC_STATUS)) { treeQueryObject.getConditionMap().remove(LC_STATUS); } if(treeQueryObject.getExtandParamsMap() ==null || !treeQueryObject.getExtandParamsMap().containsKey(REFER_SHOW_DISABLED_QUERY_KEY)) { } treeQueryObject.getConditionMap().put(LC_STATUS, FRAMEWORK_DATA_ENABLED); return treeCodeClassify(treeQueryObject); } /** * æ¥è¯¢ä¸»é¢åºåç±» æ * @param treeQueryObject æ æ¥è¯¢å¯¹è±¡ * @return 主é¢åºåç±» æ¾ç¤ºæ */ @Override public List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject) { List<CodeClassify> doList =codeClassifyMapper.selectCodeClassifyVOByTree(treeQueryObject.getParentOid()); List<CodeClassifyVO> voList = codeClassifyDO2VOs(doList); TreeWrapperOptions treeWrapperOptions = new TreeWrapperOptions(PARENT_FIELD_NAME.toLowerCase(Locale.ROOT)); treeWrapperOptions.copyFromTreeQuery(treeQueryObject); List<Tree> tree= revisionModelUtil.doList2Trees(voList,treeWrapperOptions,(CodeClassifyVO s) ->{ //å¯ä»¥å¨è¿éå¤çæ èç¹çæ¾ç¤º return s.getId() + " " + s.getName() + (FrameworkDataLCStatus.DISABLED.getValue().equalsIgnoreCase(s .getLcStatus()) ? (" ãåç¨ã ") : ""); }); Iterator var6 = tree.listIterator(); while(var6.hasNext()){ Tree trees = (Tree) var6.next(); boolean checkHasChild=codeClassifyMapper.checkHasChild(trees.getOid()); if(checkHasChild){ trees.setLeaf(false); }else{ trees.setLeaf(true); } } return tree; } // /** // * æ ¹æ®æ å½¢æ¥è¯¢å¯¹è±¡æ¥æ¥è¯¢æ°æ®å¯¹è±¡ // * // * @param treeQueryObject æ å½¢æ¥è¯¢å¯¹è±¡ // * @return æ¥è¯¢ç»æ,æ°æ®å¯¹è±¡ // */ // @Override // public List<CodeClassifyVO> selectCodeClassifyDOByTree(TreeQueryObject treeQueryObject) { // VciQueryWrapperForDO queryWrapperForDO = new VciQueryWrapperForDO(null,CodeClassifyDO.class); // VciParentQueryOption parentQueryOption = new VciParentQueryOption(); // parentQueryOption.setParentFieldName(PARENT_FIELD_NAME); // queryWrapperForDO.parentQueryChild(treeQueryObject,parentQueryOption); // if(StringUtils.isBlank(treeQueryObject.getSort())) { // PageHelper pageHelper = new PageHelper(-1); // pageHelper.addDefaultAsc("id"); // queryWrapperForDO.setPageHelper(pageHelper); // } // return codeClassifyMapper.selectByWrapper(queryWrapperForDO); // } /** * 导åºåç±» * * @param oid åç±»ä¸»é® * @return excelæä»¶è·¯å¾ */ @Override public String exportClassify(String oid) { // VciBaseUtil.alertNotNull(oid,"åç±»ç主é®"); // CodeClassify codeClassify = codeClassifyMapper.selectById(oid); // codeClassify.setDataLevel(0); // codeClassify.setPath(codeClassify.getId()); // List<CodeClassifyVO> codeClassifyVOS = listChildrenClassify(oid, true, "id", false); // if(codeClassifyVOS ==null){ // codeClassifyVOS = new ArrayList<>(); // } // CodeClassifyVO codeClassifyVO = new CodeClassifyVO(); // BeanUtils.copyProperties(codeClassify,codeClassifyVO); // codeClassifyVOS.add(codeClassifyVO); // // //æ¥è¯¢ä¸ä¸è§åçç¼å·ï¼åå ³é®å±æ§éå¤è§å // List<String> codeRuleOids = codeClassifyVOS.stream().filter(s -> org.apache.commons.lang3.StringUtils.isNotBlank(s.getCoderuleoid())).map(CodeClassifyVO::getCoderuleoid).collect(Collectors.toList()); // Map<String, CodeRuleVO> ruleVOMap = new HashMap<>(); // if(!CollectionUtils.isEmpty(codeRuleOids)){ // VciBaseUtil.switchCollectionForOracleIn(codeRuleOids).stream().forEach(ruleOids->{ // Collection<CodeRuleVO> ruleVOS = codeRuleService.listCodeRuleByOids(ruleOids); // ruleVOMap.putAll( Optional.ofNullable(ruleVOS).orElseGet(()->new ArrayList<>()).stream().collect(Collectors.toMap(s->s.getOid(),t->t))); // }); // } // //æ¾å ³é®å±æ§è§å // List<String> keyRuleOids = codeClassifyVOS.stream().filter(s -> org.apache.commons.lang3.StringUtils.isNotBlank(s.getCodekeyattrrepeatoid())).map(CodeClassifyVO::getCodekeyattrrepeatoid).collect(Collectors.toList()); // Map<String, CodeKeyAttrRepeatRuleVO> keyRuleVOMap = new HashMap<>(); // if(!CollectionUtils.isEmpty(keyRuleOids)){ // VciBaseUtil.switchCollectionForOracleIn(keyRuleOids).stream().forEach(ruleOids->{ // Collection<CodeKeyAttrRepeatRuleVO> ruleVOS = iCodeKeyattrrepeatService.listCodeKeyAttrRepeatRuleByOids(ruleOids); // keyRuleVOMap.putAll( Optional.ofNullable(ruleVOS).orElseGet(()->new ArrayList<>()).stream().collect(Collectors.toMap(s->s.getOid(),t->t))); // }); // } // //ok,åexcel // String excelName = LocalFileUtil.getDefaultTempFolder() + File.separator + "导åºåç±».xls"; // try { // new File(excelName).createNewFile(); // } catch (Throwable e) { // throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[]{excelName}, e); // } // List<WriteExcelData> excelDataList = new ArrayList<>(); // excelDataList.add(new WriteExcelData(0,0,"åç±»ç¼å·")); // excelDataList.add(new WriteExcelData(0,1,"åç±»åç§°")); // excelDataList.add(new WriteExcelData(0,2,"ä¸å¡ç±»åç¼å·")); // excelDataList.add(new WriteExcelData(0,3,"ä¸å¡ç±»ååç§°")); // excelDataList.add(new WriteExcelData(0,4,"ç¼ç è§åç¼å·")); // excelDataList.add(new WriteExcelData(0,5,"ç¼ç è§ååç§°")); // excelDataList.add(new WriteExcelData(0,6,"æ¥éè§åç¼å·")); // excelDataList.add(new WriteExcelData(0,7,"æ¥éè§ååç§°")); // excelDataList.add(new WriteExcelData(0,8,"å类路å¾")); // excelDataList.add(new WriteExcelData(0,9,"ç¶æ")); // excelDataList.add(new WriteExcelData(0,10,"åç±»å±çº§")); // excelDataList.add(new WriteExcelData(0,11,"æè¿°")); // for (int i = 0; i < codeClassifyVOS.size(); i++) { // CodeClassifyVO vo = codeClassifyVOS.get(i); // excelDataList.add(new WriteExcelData(i+1,0,vo.getId())); // excelDataList.add(new WriteExcelData(i+1,1,vo.getName())); // excelDataList.add(new WriteExcelData(i+1,2,vo.getBtmtypeid())); // excelDataList.add(new WriteExcelData(i+1,3,vo.getBtmtypename())); // excelDataList.add(new WriteExcelData(i+1,4, org.apache.commons.lang3.StringUtils.isNotBlank(vo.getCoderuleoid())?ruleVOMap.getOrDefault(vo.getCoderuleoid(),new CodeRuleVO()).getId():"")); // excelDataList.add(new WriteExcelData(i+1,5, org.apache.commons.lang3.StringUtils.isNotBlank(vo.getCoderuleoid())?ruleVOMap.getOrDefault(vo.getCoderuleoid(),new CodeRuleVO()).getName():"")); // excelDataList.add(new WriteExcelData(i+1,6, org.apache.commons.lang3.StringUtils.isNotBlank(vo.getCodekeyattrrepeatoid())?keyRuleVOMap.getOrDefault(vo.getCodekeyattrrepeatoid(),new CodeKeyAttrRepeatRuleVO()).getId():"")); // excelDataList.add(new WriteExcelData(i+1,7, org.apache.commons.lang3.StringUtils.isNotBlank(vo.getCodekeyattrrepeatoid())?keyRuleVOMap.getOrDefault(vo.getCodekeyattrrepeatoid(),new CodeKeyAttrRepeatRuleVO()).getName():"")); // excelDataList.add(new WriteExcelData(i+1,8,vo.getOid().equalsIgnoreCase(classifyVO.getOid())?vo.getPath():classifyVO.getPath() + vo.getPath())); // excelDataList.add(new WriteExcelData(i+1,9,FrameworkDataLCStatus.getTextByValue(vo.getLcStatus()))); // excelDataList.add(new WriteExcelData(i+1,10,vo.getDataLevel())); // excelDataList.add(new WriteExcelData(i+1,11,vo.getDescription())); // } // WriteExcelOption excelOption = new WriteExcelOption(excelDataList); // ExcelUtil.writeDataToFile(excelName, excelOption); return null; // return excelName; } /** * è·åå级ç主é¢åºåç±» * * @param codeClassifyOid åç±»çä¸»é® * @param allLevel æ¯å¦ææçå±çº§ * @param fieldInPath å¨è·¯å¾ä¸çåæ®µ * @param enable æ¯å¦åªæ¾ç¤ºå¯ç¨ * @return åç±»çæ¾ç¤ºå¯¹è±¡ */ @Override public List<CodeClassifyVO> listChildrenClassify(String codeClassifyOid, boolean allLevel, String fieldInPath, boolean enable) { if(allLevel){ List<CodeClassify> classifyDOS = codeClassifyMapper.selectAllLevelChildHasPath(codeClassifyOid); if(!CollectionUtils.isEmpty(classifyDOS)){ classifyDOS = classifyDOS.stream().filter(s->FRAMEWORK_DATA_ENABLED.equalsIgnoreCase(s.getLcStatus())).collect(Collectors.toList()); } return codeClassifyDO2VOs(classifyDOS); }else{ //åªæ¥è¯¢ä¸æ¡ï¼é£pathå°±æ²¡å¿ è¦æ¥è¯¢äº Map<String,Object> conditionMap = new HashMap<>(); conditionMap.put("parentcodeclassifyoid",codeClassifyOid); if (enable){ conditionMap.put("lcstatus",FRAMEWORK_DATA_ENABLED); } return codeClassifyDO2VOs(codeClassifyMapper.selectByMap(conditionMap)); } } } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/wrapper/PlCodeClstemplateWrapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,50 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill åºéª (smallchill@163.com) */ package com.vci.ubcs.code.wrapper; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; import com.vci.ubcs.code.entity.CodeClstemplateEntity; import com.vci.ubcs.code.vo.CodeClstemplateVO; import java.util.Objects; /** * ç¼ç åºå®ä¹-模æ¿ç®¡ç å è£ ç±»,è¿åè§å¾å±æéçåæ®µ * * @author yuxc * @since 2023-04-10 */ public class PlCodeClstemplateWrapper extends BaseEntityWrapper<CodeClstemplateEntity, CodeClstemplateVO> { public static PlCodeClstemplateWrapper build() { return new PlCodeClstemplateWrapper(); } @Override public CodeClstemplateVO entityVO(CodeClstemplateEntity plCodeClstemplate) { CodeClstemplateVO plCodeClstemplateVO = Objects.requireNonNull(BeanUtil.copy(plCodeClstemplate, CodeClstemplateVO.class)); //User createUser = UserCache.getUser(plCodeClstemplate.getCreateUser()); //User updateUser = UserCache.getUser(plCodeClstemplate.getUpdateUser()); //plCodeClstemplateVO.setCreateUserName(createUser.getName()); //plCodeClstemplateVO.setUpdateUserName(updateUser.getName()); return plCodeClstemplateVO; } } Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml
@@ -57,4 +57,90 @@ where parentCodeClassifyOid = #{oid} </select> <select id="selectCodeClassifyVOByTree" resultMap="plCodeClassifyResultMap"> select codeclassify0.OWNER as owner, codeclassify0.BTMTYPEID as btmtypeid, codeclassify0.CREATOR as creator, codeclassify0.CREATETIME as createtime, codeclassify0.LASTMODIFIER as lastmodifier, codeclassify0.DESCRIPTION as description, codeclassify0.ORDERNUM as ordernum, codeclassify0.CODERULEOID as coderuleoid, codeclassify0.OID as oid, codeclassify0.BTMNAME as btmname, codeclassify0.BTMTYPENAME as btmtypename, codeclassify0.CODEKEYATTRREPEATOID as codekeyattrrepeatoid, codeclassify0.PARENTCODECLASSIFYOID as parentcodeclassifyoid, codeclassify0.NAME as name, codeclassify0.LASTMODIFYTIME as lastmodifytime, codeclassify0.ID as id, codeclassify0.CODERESEMBLERULEOID as coderesembleruleoid, codeclassify0.LCSTATUS as lcstatus, codeclassify0.TS as ts, coderuleoid.name as codeRuleOidName, codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, coderesembleruleoid.name as codeResembleRuleOidName from pl_code_classify codeclassify0 left join pl_code_rule coderuleoid on codeclassify0.codeRuleOid = coderuleoid.oid left join pl_code_keyattrrepeat codekeyattrrepeatoid on codeclassify0.codeKeyAttrRepeatOid = codekeyattrrepeatoid.oid left join pl_code_resemblerule coderesembleruleoid on codeclassify0.codeResembleRuleOid = coderesembleruleoid.oid where <where> <if test="oid != null and oid != ''"> codeclassify0.parentcodeclassifyoid = #{oid} </if> <if test="oid = null or oid = ''"> codeclassify0.parentcodeclassifyoid is null </if> </where> order by id asc </select> <select id="selectAllLevelChildHasPath" resultMap="plCodeClassifyResultMap"> select codeclassify0.OWNER as owner, codeclassify0.BTMTYPEID as btmtypeid, codeclassify0.CREATOR as creator, codeclassify0.CREATETIME as createtime, codeclassify0.LASTMODIFIER as lastmodifier, codeclassify0.DESCRIPTION as description, codeclassify0.ORDERNUM as ordernum, codeclassify0.CODERULEOID as coderuleoid, codeclassify0.OID as oid, codeclassify0.BTMNAME as btmname, codeclassify0.BTMTYPENAME as btmtypename, codeclassify0.CODEKEYATTRREPEATOID as codekeyattrrepeatoid, codeclassify0.PARENTCODECLASSIFYOID as parentcodeclassifyoid, codeclassify0.NAME as name, codeclassify0.LASTMODIFYTIME as lastmodifytime, codeclassify0.ID as id, codeclassify0.CODERESEMBLERULEOID as coderesembleruleoid, codeclassify0.LCSTATUS as lcstatus, codeclassify0.TS as ts, coderuleoid.name as codeRuleOidName, codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, coderesembleruleoid.name as codeResembleRuleOidName, level as datalevel, SYS_CONNECT_BY_PATH(codeclassify0.id, '#') as path from pl_code_classify codeclassify0 left join pl_code_rule coderuleoid on codeclassify0.codeRuleOid = coderuleoid.oid left join pl_code_keyattrrepeat codekeyattrrepeatoid on codeclassify0.codeKeyAttrRepeatOid = codekeyattrrepeatoid.oid left join pl_code_resemblerule coderesembleruleoid on codeclassify0.codeResembleRuleOid = coderesembleruleoid.oid START WITH <where> <if test="oid != null and oid != ''"> codeclassify0.parentCodeClassifyOid = #{oid} </if> <if test="oid = null or oid = ''"> codeclassify0.parentCodeClassifyOid = is null </if> </where> CONNECT BY PRIOR codeclassify0.OID = codeclassify0.parentCodeClassifyOid </select> </mapper> Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeClstemplateMapper.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,44 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.vci.ubcs.code.mapper.CodeClstemplateMapper"> <!-- éç¨æ¥è¯¢æ å°ç»æ --> <resultMap id="plCodeClstemplateResultMap" type="com.vci.ubcs.code.entity.CodeClstemplateEntity"> <result column="OID" property="oid"/> <result column="REVISIONOID" property="revisionOid"/> <result column="NAMEOID" property="nameOid"/> <result column="BTMNAME" property="btmname"/> <result column="LASTR" property="lastR"/> <result column="FIRSTR" property="firstR"/> <result column="LASTV" property="lastV"/> <result column="FIRSTV" property="firstV"/> <result column="CREATOR" property="creator"/> <result column="CREATETIME" property="createTime"/> <result column="LASTMODIFIER" property="lastModifier"/> <result column="LASTMODIFYTIME" property="lastModifyTime"/> <result column="REVISIONRULE" property="revisionRule"/> <result column="VERSIONRULE" property="versionRule"/> <result column="REVISIONSEQ" property="revisionSeq"/> <result column="REVISIONVALUE" property="revisionValue"/> <result column="VERSIONSEQ" property="versionSeq"/> <result column="VERSIONVALUE" property="versionValue"/> <result column="LCTID" property="lctid"/> <result column="LCSTATUS" property="lcStatus"/> <result column="TS" property="ts"/> <result column="ID" property="id"/> <result column="NAME" property="name"/> <result column="DESCRIPTION" property="description"/> <result column="OWNER" property="owner"/> <result column="COPYFROMVERSION" property="copyFromVersion"/> <result column="CODECLASSIFYOID" property="codeClassifyOid"/> <result column="BTMTYPEID" property="btmTypeId"/> <result column="BTMTYPENAME" property="btmTypeName"/> </resultMap> <select id="selectPlCodeClstemplatePage" resultMap="plCodeClstemplateResultMap"> select * from PL_CODE_CLSTEMPLATE where is_deleted = 0 </select> </mapper>