田源
2024-08-02 7a61f5f2f29a069cd8947ea46b6b2329ac0f5d44
Merge remote-tracking branch 'origin/master'
已修改20个文件
已添加3个文件
1642 ■■■■ 文件已修改
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/OsRevisionRuleDTO.java 112 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/OsRevisionRuleVO.java 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/OsAttributePO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/OsLinkTypePO.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/OsRevisionRulePO.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/OsStatusPO.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsRevisionRuleController.java 200 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/VciOsStatusController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebEnumController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsAttributeServiceI.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsEnumServiceI.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsRevisionRuleServiceI.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsStatusServiceI.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsEnumServiceImpl.java 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java 210 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsRevisionRuleServiceImpl.java 459 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsStatusServiceImpl.java 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/dto/OsRevisionRuleDTO.java
@@ -32,27 +32,27 @@
    /**
     * è·³è·ƒå­—符
     */
    private String skipCode;
    private String jumpCharacter;
    /**
     * åˆå§‹å€¼
     */
    private String startCode;
    private String initialValue;
    /**
     * æ­¥é•¿
     */
    private Integer serialStep;
    private String stepLength;
    /**
     * å‰ç¼€
     */
    private String prefixCode;
    private String prefixion;
    /**
     * åŽç¼€
     */
    private String suffixCode;
    private String suffix;
    /**
     * æè¿°
@@ -63,6 +63,58 @@
     * æ—¶é—´æˆ³ï¼Œæ ¼å¼æ˜¯yyyy-MM-dd HH:mm:ss.SSS
     */
    private Date ts;
    /**
     * åˆ›å»ºäºº
     */
    private String creator;
    /**
     * åˆ›å»ºæ—¶é—´
     */
    private Date createTime;
    /**
     * æœ€åŽä¿®æ”¹äºº
     */
    private String lastModifier;
    /**
     * æœ€åŽä¿®æ”¹æ—¶é—´ï¼Œæ ¼å¼æ˜¯yyyy-MM-dd HH:mm:ss
     */
    private Date lastModifyTime;
    public void setCreator(String creator) {
        this.creator = creator;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public void setLastModifier(String lastModifier) {
        this.lastModifier = lastModifier;
    }
    public void setLastModifyTime(Date lastModifyTime) {
        this.lastModifyTime = lastModifyTime;
    }
    public String getCreator() {
        return creator;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public String getLastModifier() {
        return lastModifier;
    }
    public Date getLastModifyTime() {
        return lastModifyTime;
    }
    public String getOid() {
        return oid;
@@ -88,44 +140,44 @@
        this.name = name;
    }
    public String getSkipCode() {
        return skipCode;
    public void setJumpCharacter(String jumpCharacter) {
        this.jumpCharacter = jumpCharacter;
    }
    public void setSkipCode(String skipCode) {
        this.skipCode = skipCode;
    public String getJumpCharacter() {
        return jumpCharacter;
    }
    public String getStartCode() {
        return startCode;
    public String getInitialValue() {
        return initialValue;
    }
    public void setStartCode(String startCode) {
        this.startCode = startCode;
    public void setInitialValue(String initialValue) {
        this.initialValue = initialValue;
    }
    public Integer getSerialStep() {
        return serialStep;
    public void setStepLength(String stepLength) {
        this.stepLength = stepLength;
    }
    public void setSerialStep(Integer serialStep) {
        this.serialStep = serialStep;
    public String getStepLength() {
        return stepLength;
    }
    public String getPrefixCode() {
        return prefixCode;
    public void setPrefixion(String prefixion) {
        this.prefixion = prefixion;
    }
    public void setPrefixCode(String prefixCode) {
        this.prefixCode = prefixCode;
    public String getPrefixion() {
        return prefixion;
    }
    public String getSuffixCode() {
        return suffixCode;
    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }
    public void setSuffixCode(String suffixCode) {
        this.suffixCode = suffixCode;
    public String getSuffix() {
        return suffix;
    }
    public String getDescription() {
@@ -150,11 +202,11 @@
                "oid='" + oid + '\'' +
                ", id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", skipCode='" + skipCode + '\'' +
                ", startCode='" + startCode + '\'' +
                ", serialStep=" + serialStep +
                ", prefixCode='" + prefixCode + '\'' +
                ", suffixCode='" + suffixCode + '\'' +
                ", jumpCharacter='" + jumpCharacter + '\'' +
                ", initialValue='" + initialValue + '\'' +
                ", serialStep=" + stepLength +
                ", prefixion='" + prefixion + '\'' +
                ", suffix='" + suffix + '\'' +
                ", description='" + description + '\'' +
                ", ts=" + ts +
                '}';
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/pagemodel/OsRevisionRuleVO.java
@@ -32,27 +32,27 @@
    /**
     * è·³è·ƒå­—符
     */
    private String skipCode;
    private String jumpCharacter;
    /**
     * åˆå§‹å€¼
     */
    private String startCode;
    private String initialValue;
    /**
     * æ­¥é•¿
     */
    private Integer serialStep;
    private Integer stepLength;
    /**
     * å‰ç¼€
     */
    private String prefixCode;
    private String prefixion;
    /**
     * åŽç¼€
     */
    private String suffixCode;
    private String suffix;
    /**
     * æè¿°
@@ -118,44 +118,44 @@
        this.name = name;
    }
    public String getSkipCode() {
        return skipCode;
    public void setJumpCharacter(String jumpCharacter) {
        this.jumpCharacter = jumpCharacter;
    }
    public void setSkipCode(String skipCode) {
        this.skipCode = skipCode;
    public String getJumpCharacter() {
        return jumpCharacter;
    }
    public String getStartCode() {
        return startCode;
    public void setInitialValue(String initialValue) {
        this.initialValue = initialValue;
    }
    public void setStartCode(String startCode) {
        this.startCode = startCode;
    public String getInitialValue() {
        return initialValue;
    }
    public Integer getSerialStep() {
        return serialStep;
    public Integer getStepLength() {
        return stepLength;
    }
    public void setSerialStep(Integer serialStep) {
        this.serialStep = serialStep;
    public void setStepLength(Integer stepLength) {
        this.stepLength = stepLength;
    }
    public String getPrefixCode() {
        return prefixCode;
    public void setPrefixion(String prefixion) {
        this.prefixion = prefixion;
    }
    public void setPrefixCode(String prefixCode) {
        this.prefixCode = prefixCode;
    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }
    public String getSuffixCode() {
        return suffixCode;
    public String getSuffix() {
        return suffix;
    }
    public void setSuffixCode(String suffixCode) {
        this.suffixCode = suffixCode;
    public String getPrefixion() {
        return prefixion;
    }
    public String getDescription() {
@@ -228,11 +228,11 @@
                "oid='" + oid + '\'' +
                ", id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", skipCode='" + skipCode + '\'' +
                ", startCode='" + startCode + '\'' +
                ", serialStep=" + serialStep +
                ", prefixCode='" + prefixCode + '\'' +
                ", suffixCode='" + suffixCode + '\'' +
                ", jumpCharacter='" + jumpCharacter + '\'' +
                ", initialValue='" + initialValue + '\'' +
                ", stepLength=" + stepLength +
                ", prefixion='" + prefixion + '\'' +
                ", suffix='" + suffix + '\'' +
                ", description='" + description + '\'' +
                ", btmname='" + btmname + '\'' +
                ", owner='" + owner + '\'' +
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/OsAttributePO.java
@@ -52,7 +52,7 @@
    /**
     * å±žæ€§ç±»åž‹
     */
    @ExcelColumn(value="属性类型(请参照新增界面的属性类型填写)",nullable = false)
    @ExcelColumn(value="属性类型(参照新增界面的属性类型如VTString)",nullable = false)
    private String attributeDataType;
    /**
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/OsLinkTypePO.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 OsLinkTypePO extends BaseModelVO {
    /**
     * ç¦æ­¢ä¿®æ”¹è¿™ä¸ªå€¼
     */
    private static final long serialVersionUID = -2239512786206928201L;
    /**
     * æ‰€åœ¨æ•°æ®è¡Œ
     */
    @ExcelColumn(rowIndexColumn = true,value = "")
    private String rowIndex;
    /**
     * æ ‡ç­¾
     */
    @ExcelColumn(value="标签",nullable = false)
    private String tag;
    /**
     * åç§°
     */
    @ExcelColumn(value="名称",nullable = false)
    private String name;
    /**
     * æè¿°
     */
    @ExcelColumn(value="描述")
    private String description;
    /**
     * å½¢çж
     */
    @ExcelColumn(value="形状")
    private String shape;
    /**
     * to端对应关系
     */
    @ExcelColumn(value="To端对应关系")
    private String relationTo;
    /**
     * From端对应关系
     */
    @ExcelColumn(value="From端对应关系")
    private String relationFrom;
//    /**
//     * å¯¹åº”关系,from端在前,to端在后
//     */
//    @ExcelColumn(value="对应关系,from端在前,to端在后")
//    private String relation;
    /**
     * To端主类型
     */
    @ExcelColumn(value="To端主类型")
    private String primitivesTo;
    /**
     * From端主类型
     */
    @ExcelColumn(value="From端主类型")
    private String primitivesFrom;
    /**
     * å®žçŽ°ç±»
     */
    @ExcelColumn(value="实现类")
    private String implClass;
    /**
     * From端类型列表
     */
    @ExcelColumn(value="From端类型列表")
    private String btmItemsFrom;
    /**
     * To端类型列表
     */
    @ExcelColumn(value="To端类型列表")
    private String btmItemsTo;
    /**
     * å±žæ€§åˆ—表
     */
    @ExcelColumn(value="属性列表")
    private String attributes;
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/OsRevisionRulePO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
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 ludc
 * @date 2024/7/19 11:11
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class OsRevisionRulePO extends BaseModelVO {
    /**
     * ç¦æ­¢ä¿®æ”¹è¿™ä¸ªå€¼
     */
    private static final long serialVersionUID = -2239512786206928201L;
    /**
     * æ‰€åœ¨æ•°æ®è¡Œ
     */
    @ExcelColumn(rowIndexColumn = true,value = "")
    private String rowIndex;
    /**
     * å±žæ€§è‹±æ–‡åç§°
     */
    @ExcelColumn(value="名称",nullable = false)
    private String id;
    /**
     * æ ‡ç­¾
     */
    @ExcelColumn(value="标签")
    private String name;
    /**
     * è·³è·ƒå­—符
     */
    @ExcelColumn(value="跳跃字符")
    private String jumpCharacter;
    /**
     * åˆå§‹å€¼
     */
    @ExcelColumn(value="初始值",nullable = false)
    private String initialValue;
    /**
     * æ­¥é•¿
     */
    @ExcelColumn(value="步长",nullable = false)
    private String stepLength;
    /**
     * å‰ç¼€
     */
    @ExcelColumn(value="前缀")
    private String prefixion;
    /**
     * åŽç¼€
     */
    @ExcelColumn(value="后缀")
    private String suffix;
    /**
     * æè¿°
     */
    @ExcelColumn(value="描述")
    private String description;
}
Source/plt-web/plt-web-parent/plt-web-api/src/main/java/com/vci/po/OsStatusPO.java
@@ -7,7 +7,7 @@
import lombok.NoArgsConstructor;
/**
 * å±žæ€§æ± å¯¼å…¥å¯¹è±¡
 * çŠ¶æ€æ± å¯¼å…¥å¯¹è±¡
 * @author ludc
 * @date 2024/7/19 11:11
 */
@@ -42,8 +42,8 @@
    /**
     * å±žæ€§ç±»åž‹
     */
    @ExcelColumn(value="图片(路径)")
    private String imagePath;
    //@ExcelColumn(value="图片(路径)")
    //private String imagePath;
    /**
     * æè¿°
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsAttributeController.java
@@ -164,7 +164,7 @@
    @VciBusinessLog(operateName = "导出属性")
    public void exportAttributes(String exportFileName,String attrNames, HttpServletResponse response){
        try {
            String excelPath = attributeService.exportAttributes(exportFileName,attrNames);
            String excelPath = attributeService.exportAttributes(exportFileName,attrNames,false);
            ControllerUtil.writeFileToResponse(response,excelPath);
        } catch (Exception e) {
            String msg = "导出枚举时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsLinkTypeController.java
@@ -1,14 +1,17 @@
package com.vci.web.controller;
import com.vci.constant.FrameWorkLangCodeConstant;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.ltm.LinkType;
import com.vci.pagemodel.OsBtmTypeAttributeVO;
import com.vci.pagemodel.OsLinkTypeAttributeVO;
import com.vci.pagemodel.OsLinkTypeVO;
import com.vci.starter.web.annotation.controller.VciUnCheckRight;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.util.LocalFileUtil;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.web.service.OsLinkTypeServiceI;
import org.apache.commons.lang3.StringUtils;
@@ -17,7 +20,10 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
@@ -227,4 +233,28 @@
            return objectBaseResult;
        }
    }
    /**
     * å¯¼å‡ºé“¾æŽ¥ç±»åž‹
     * name é“¾æŽ¥ç±»åž‹åç§°
     * @return
     */
    @GetMapping("/expData")
    public void expData(String name,HttpServletResponse response) throws PLException, IOException {
        linkTypeService.expData(name, response);
    }
    /**
     * å¯¼å…¥é“¾æŽ¥ç±»åž‹
     * @param file ä¸Šä¼ çš„æ–‡ä»¶
     * @return
     */
    @PostMapping("/impData")
    @VciUnCheckRight
    public BaseResult impData(MultipartFile file){try {
             return linkTypeService.impData(file);
        }catch (Throwable e) {
            throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
        }
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/OsRevisionRuleController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,200 @@
package com.vci.web.controller;
import com.vci.constant.FrameWorkLangCodeConstant;
import com.vci.dto.OsRevisionRuleDTO;
import com.vci.pagemodel.OsRevisionRuleVO;
import com.vci.starter.web.annotation.controller.VciUnCheckRight;
import com.vci.starter.web.annotation.log.VciBusinessLog;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.util.ControllerUtil;
import com.vci.starter.web.util.LocalFileUtil;
import com.vci.starter.web.util.VciBaseUtil;
import com.vci.web.service.OsRevisionRuleServiceI;
import com.vci.web.util.Func;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List;
/**
 * ç‰ˆæœ¬è§„则控制器
 * @author ludc
 * @date 2024/7/30 16:02
 */
@RequestMapping("/revisionRuleController")
@RestController
public class OsRevisionRuleController {
    @Autowired
    private OsRevisionRuleServiceI revisionRuleServiceI;
    /**
     * æ—¥å¿—
     */
    private Logger logger = LoggerFactory.getLogger(getClass());
    /**
     * ç‰ˆæœ¬è§„则列表(全查询)
     * @return
     */
    @GetMapping("/getVersionRuleAllList")
    public BaseResult getVersionRuleAllList(){
        try {
            return BaseResult.dataList(revisionRuleServiceI.selectAllRevision());
        }catch (Exception e) {
            e.printStackTrace();
            String exceptionMessage = "版本规则管理列表查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * æŸ¥è¯¢åº”用范围
     * @param vrName ç‰ˆæœ¬è§„则英文名称
     * @return
     */
    @GetMapping("/getUsedVersionRuleList")
    public BaseResult getUsedVersionRuleList(String vrName){
        try {
            return BaseResult.dataList(revisionRuleServiceI.getUsedVersionRuleList(vrName));
        }catch (Exception e) {
            e.printStackTrace();
            String exceptionMessage = "版本规则应用范围查询时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * åˆ›å»ºç‰ˆæœ¬è§„则
     * @param osRevisionRuleDTO ç‰ˆæœ¬è§„则数据传输对象
     * @return
     */
    @PostMapping("/addVersionRule")
    public BaseResult addVersionRule(@RequestBody OsRevisionRuleDTO osRevisionRuleDTO){
        try {
            return revisionRuleServiceI.addVersionRule(osRevisionRuleDTO) ? BaseResult.success("版本规则添加成功!"):BaseResult.fail("版本规则添加失败!");
        }catch (Exception e) {
            e.printStackTrace();
            String exceptionMessage = "增加属性时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * ä¿®æ”¹ç‰ˆæœ¬è§„则
     * @param osRevisionRuleDTO ç‰ˆæœ¬è§„则数据传输对象
     * @return
     */
    @PutMapping("/updateVersionRule")
    public BaseResult updateVersionRule(@RequestBody OsRevisionRuleDTO osRevisionRuleDTO){
        try {
            return revisionRuleServiceI.updateVersionRule(osRevisionRuleDTO) ? BaseResult.success("版本规则修改成功!"):BaseResult.fail("版本规则修改失败!");
        }catch (Exception e) {
            e.printStackTrace();
            String exceptionMessage = "修改版本规则时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * åˆ é™¤ç‰ˆæœ¬è§„则
     * @param osRevisionRuleDTOS ç‰ˆæœ¬è§„则数据传输对象
     * @return
     */
    @DeleteMapping("/deleteVersionRule")
    public BaseResult deleteVersionRule(@RequestBody List<OsRevisionRuleDTO> osRevisionRuleDTOS){
        try {
            return revisionRuleServiceI.deleteVersionRule(osRevisionRuleDTOS) ? BaseResult.success("版本规则删除成功!"):BaseResult.fail("版本规则删除失败!");
        }catch (Exception e) {
            e.printStackTrace();
            String exceptionMessage = "删除版本规则时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            logger.error(exceptionMessage);
            return BaseResult.fail(exceptionMessage);
        }
    }
    /**
     * å¯¼å‡ºé€‰ä¸­çš„版本规则
     * @param exportFileName å¯¼å‡ºçš„æ–‡ä»¶å
     * @param vrNames éœ€è¦å¯¼å‡ºçš„规则英文名称
     * @param response
     */
    @GetMapping( "/exportVersionRule")
    @VciBusinessLog(operateName = "导出版本规则")
    public void exportVersionRule(String exportFileName,String vrNames, HttpServletResponse response){
        try {
            String excelPath = revisionRuleServiceI.exportVersionRule(exportFileName,vrNames,false);
            ControllerUtil.writeFileToResponse(response,excelPath);
        } catch (Exception e) {
            String msg = "导出版本规则时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            try {
                //出错时
                e.printStackTrace();
                ControllerUtil.writeDataToResponse(response,"error_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss") + ".txt", StringUtils.isNotBlank(msg)?msg.getBytes():new byte[0],null);
            } catch (IOException ioException) {
                ioException.printStackTrace();
            }
        }
    }
    /**
     * ä¸‹è½½ç‰ˆæœ¬è§„则导入模板
     * @param exportFileName
     * @param response
     */
    @GetMapping( "/downloadAttributeTemplate")
    @VciBusinessLog(operateName = "导出版本规则")
    public void downloadVersionRuleTemplate(String exportFileName, HttpServletResponse response){
        try {
            String excelPath = revisionRuleServiceI.downloadVersionRuleTemplate(exportFileName);
            ControllerUtil.writeFileToResponse(response,excelPath);
        } catch (Exception e) {
            String msg = "下载版本规则导入模板时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
            try {
                //出错时
                e.printStackTrace();
                ControllerUtil.writeDataToResponse(response,"error_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss") + ".txt", StringUtils.isNotBlank(msg)?msg.getBytes():new byte[0],null);
            } catch (IOException ioException) {
                ioException.printStackTrace();
            }
        }
    }
    /**
     * å¯¼å…¥ç‰ˆæœ¬è§„则
     * @param file
     * @return
     */
    @PostMapping("/importVersionRules")
    @VciBusinessLog(operateName = "导入版本规则")
    public BaseResult importVersionRules(MultipartFile file){
        String excelFileName = LocalFileUtil.getDefaultTempFolder() + File.separator + LocalFileUtil.getFileNameForIE(file.getOriginalFilename());
        File file1 = new File(excelFileName);
        try {
            file.transferTo(new File(excelFileName));
            if (file != null) {
                return revisionRuleServiceI.importVersionRules(file1);
            } else {
                return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"无导入的文件"});
            }
        }catch (Throwable e) {
            throw new VciBaseException(VciBaseUtil.getExceptionMessage(e),new String[0],e);
        }finally {
            file1.delete();
        }
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/VciOsStatusController.java
@@ -165,7 +165,7 @@
    @VciBusinessLog(operateName = "导出状态")
    public void exportStatus(String exportFileName,String statusOids, HttpServletResponse response){
        try {
            String excelPath = statusService.exportStatus(exportFileName,statusOids);
            String excelPath = statusService.exportStatus(exportFileName,statusOids,true);
            ControllerUtil.writeFileToResponse(response,excelPath);
        } catch (Exception e) {
            String msg = "导出状态时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/controller/WebEnumController.java
@@ -216,7 +216,7 @@
    @VciBusinessLog(operateName = "导出枚举类型")
    public void exportEnumTypes(String exportFileName,String enumNames, HttpServletResponse response){
        try {
            String excelPath = enumService.exportEnumTypes(exportFileName,enumNames);
            String excelPath = enumService.exportEnumTypes(exportFileName,enumNames,false);
            ControllerUtil.writeFileToResponse(response,excelPath);
        } catch (Exception e) {
            String msg = "导出枚举时出现错误,原因:" + VciBaseUtil.getExceptionMessage(e);
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsAttributeServiceI.java
@@ -150,9 +150,10 @@
     * å¯¼å‡ºé€‰ä¸­çš„属性
     * @param exportFileName å¯¼å‡ºçš„æ–‡ä»¶å
     * @param attrNames éœ€è¦å¯¼å‡ºçš„属性名称
     * @param flag æŽ§åˆ¶å¯¼å‡ºçš„列名是否和导入模板一致
     * @return
     */
    String exportAttributes(String exportFileName,String attrNames) throws PLException;
    String exportAttributes(String exportFileName,String attrNames,boolean flag/*控制导出的列名是否和导入模板一致*/) throws PLException;
    /**
     * ä¸‹è½½å±žæ€§å¯¼å…¥æ¨¡æ¿
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsEnumServiceI.java
@@ -110,9 +110,10 @@
     * å¯¼å‡ºæžšä¸¾ç±»åž‹
     * @param exportFileName å¯¼å‡ºçš„æ–‡ä»¶å
     * @param enumNames éœ€è¦å¯¼å‡ºçš„æžšä¸¾åç§°
     * @param flag æŽ§åˆ¶å¯¼å‡ºçš„列名是否和导入模板一致
     * @return
     */
    String exportEnumTypes(String exportFileName,String enumNames) throws PLException;
    String exportEnumTypes(String exportFileName,String enumNames,boolean flag/*控制导出的列名是否和导入模板一致*/) throws PLException;
    /**
     * å¯¼å…¥æžšä¸¾
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsLinkTypeServiceI.java
@@ -8,7 +8,9 @@
import com.vci.pagemodel.OsBtmTypeAttributeVO;
import com.vci.pagemodel.OsLinkTypeAttributeVO;
import com.vci.pagemodel.OsLinkTypeVO;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
@@ -145,4 +147,16 @@
     * @return åˆ›å»ºç»“æžœ
     */
    BaseResult createView() 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/OsRevisionRuleServiceI.java
@@ -1,8 +1,12 @@
package com.vci.web.service;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.vrm.VersionRule;
import com.vci.dto.OsRevisionRuleDTO;
import com.vci.pagemodel.OsRevisionRuleVO;
import com.vci.starter.web.pagemodel.BaseResult;
import java.io.File;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -27,6 +31,27 @@
    Map<String,OsRevisionRuleVO> selectAllRevisionMap();
    /**
     * åˆ›å»ºç‰ˆæœ¬è§„则
     * @param osRevisionRuleDTO
     * @return
     */
    boolean addVersionRule(OsRevisionRuleDTO osRevisionRuleDTO) throws PLException;
    /**
     * ä¿®æ”¹ç‰ˆæœ¬è§„则
     * @param osRevisionRuleDTO
     * @return
     */
    boolean updateVersionRule(OsRevisionRuleDTO osRevisionRuleDTO) throws PLException;
    /**
     * åˆ é™¤ç‰ˆæœ¬è§„则
     * @param osRevisionRuleDTOS
     * @return
     */
    boolean deleteVersionRule(List<OsRevisionRuleDTO> osRevisionRuleDTOS) throws PLException;
    /**
     * æ•°æ®å¯¹è±¡è½¬æ¢ä¸ºæ˜¾ç¤ºå¯¹è±¡
     * @param versionRules æ•°æ®å¯¹è±¡
     * @return æ˜¾ç¤ºå¯¹è±¡
@@ -46,4 +71,43 @@
     * @return æ˜¾ç¤ºå¯¹è±¡
     */
    OsRevisionRuleVO getRevisionRuleById(String id);
    /**
     * ä½¿ç”¨å¤šä¸ªç¼–号获取规则的值
     * @param vrIdList ç¼–号
     * @return æ˜¾ç¤ºå¯¹è±¡
     */
    List<OsRevisionRuleVO> getRevisionRuleByIds(Collection<String> vrIdList);
    /**
     * æŸ¥è¯¢åº”用范围
     * @param vrName ç‰ˆæœ¬è§„则英文名称
     * @return
     */
    List<Map<String, String>> getUsedVersionRuleList(String vrName) throws PLException;
    /**
     * å¯¼å‡ºé€‰ä¸­çš„版本规则
     * @param exportFileName å¯¼å‡ºçš„æ–‡ä»¶å
     * @param vrNames éœ€è¦å¯¼å‡ºçš„版本规则名称
     * @param flag æŽ§åˆ¶å¯¼å‡ºçš„列名是否和导入模板一致
     * @return
     */
    String exportVersionRule(String exportFileName,String vrNames,boolean flag/*控制导出的列名是否和导入模板一致*/) throws PLException;
    /**
     * ä¸‹è½½ç‰ˆæœ¬è§„则导入模板
     * @param exportFileName
     * @return
     * @throws PLException
     */
    String downloadVersionRuleTemplate(String exportFileName) throws Exception;
    /**
     * å¯¼å…¥ç‰ˆæœ¬è§„则
     * @param file
     * @return
     */
    BaseResult importVersionRules(File file) throws Exception;
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/OsStatusServiceI.java
@@ -118,7 +118,7 @@
     * @param statusOids éœ€è¦å¯¼å‡ºçš„属性名称
     * @return
     */
    String exportStatus(String exportFileName,String statusOids) throws PLException;
    String exportStatus(String exportFileName,String statusOids,boolean flag/*控制导出的列名是否和导入模板一致*/) throws PLException;
    /**
     * ä¸‹è½½çŠ¶æ€å¯¼å…¥æ¨¡æ¿
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsAttributeServiceImpl.java
@@ -7,6 +7,7 @@
import com.vci.client.mw.ClientSessionUtility;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.atm.AttributeDef;
import com.vci.corba.omd.vrm.VersionRule;
import com.vci.dto.OsAttributeDTO;
import com.vci.dto.OsEnumDTO;
import com.vci.dto.OsEnumItemDTO;
@@ -206,14 +207,10 @@
    public List<OsAttributeVO> getByAttributeNames(String[] attrNames) throws PLException {
        VciBaseUtil.alertNotNull(attrNames,"属性名");
        List<OsAttributeVO> osAttributeVOS = new ArrayList<>();
        for (int i = 0; i < attrNames.length; i++) {
            AttributeDef[] attributeDefs = platformClientUtil.getAttributeService().getAttributeDefs(attrNames[i].toLowerCase(Locale.ROOT),1,1);
            if(Func.isNotEmpty(attributeDefs)){
                Arrays.stream(attributeDefs).forEach(attributeDef -> {
                    osAttributeVOS.add(attributeDO2VO(attributeDef));
                });
            }
        }
        AttributeDef[] attributeDefs = platformClientUtil.getAttributeService().getAttributeDefsByNames(attrNames);
        Arrays.stream(attributeDefs).forEach(attr->{
            osAttributeVOS.add(attributeDO2VO(attr));
        });
        return osAttributeVOS;
    }
@@ -484,8 +481,7 @@
        checkName(osAttributeDTO.getId());
        //检查默认值与属性类型是否匹配
        checkDefValue(osAttributeDTO);
        //dto对象转换为存储所需对象
        osAttributeDTO.setOid(VciBaseUtil.getPk().toUpperCase(Locale.ROOT));
        //osAttributeDTO.setOid(VciBaseUtil.getPk().toUpperCase(Locale.ROOT));
        AttributeDef attributeDef = this.osAttributeDTO2AttributeDef(osAttributeDTO);
        return platformClientUtil.getAttributeService().addAttributeDef(attributeDef);
    }
@@ -698,7 +694,7 @@
        }
        //检查属性名是否已存在与系统中
        if(platformClientUtil.getAttributeService().checkRowIsExists(abName)){
            throw new PLException("500",new String[]{"属性名称在系统中已存在!"});
            throw new PLException("500",new String[]{"属性名称【" + abName + "】在系统中已存在!"});
        }
    }
@@ -866,22 +862,18 @@
     * å¯¼å‡ºé€‰ä¸­çš„属性
     * @param exportFileName å¯¼å‡ºçš„æ–‡ä»¶å
     * @param attrNames éœ€è¦å¯¼å‡ºçš„属性名称
     * @param flag æŽ§åˆ¶å¯¼å‡ºçš„列名是否和导入模板一致
     * @return
     */
    @Override
    public String exportAttributes(String exportFileName, String attrNames) throws PLException {
    public String exportAttributes(String exportFileName, String attrNames,boolean flag/*控制导出的列名是否和导入模板一致*/) throws PLException {
        if(Func.isBlank(attrNames)){
            throw new PLException("500",new String[]{"请勾选要导出的属性!"});
        }
        //界面没传名称,使用默认导出名称
        exportFileName = Func.isBlank(exportFileName) ?  "属性池中属性导出_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName;
        //设置列名
        List<String> columns = new ArrayList<>(
                Arrays.asList("属性名", "标签", "描述",
                        "属性类型", "允许为空", "默认值", "使用的枚举英文名称(枚举名)",
                        "使用的枚举中文名称(标签)", "参照的业务类型编号", "参照的业务类型名称",
                        "参照的链接类型名称","版本版次","属性长度", "小数精度位数","小数刻度位数","取值范围","创建时间")
        );
        List<String> columns = this.getCloumns(flag);
        //写excel
        String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName +  ".xls";
@@ -897,8 +889,8 @@
            excelDataList.add(new WriteExcelData(0,index, columns.get(index)));
        }
        //按照属性名查询属性,然后处理属性导出
        List<String> enumNameList = Func.toStrList(attrNames);
        List<OsAttributeVO> osAttributeVOS = this.listAttrByIds(enumNameList);
        List<String> attrameList = Func.toStrList(attrNames);
        List<OsAttributeVO> osAttributeVOS = this.listAttrByIds(attrameList);
        if(Func.isEmpty(osAttributeVOS)){
            excelDataList.add(new WriteExcelData(1,1, "根据属性名称未查询到属性信息,请刷新后尝试重新导出!"));
        }else{
@@ -909,25 +901,54 @@
                excelDataList.add(new WriteExcelData(i+1,0, osAttributeVO.getId()));
                excelDataList.add(new WriteExcelData(i+1,1, osAttributeVO.getName()));
                excelDataList.add(new WriteExcelData(i+1,2, osAttributeVO.getDescription()));
                excelDataList.add(new WriteExcelData(i+1,3, osAttributeVO.getAttributeDataTypeText()+"("+osAttributeVO.getAttributeDataType()+")"));
                if(flag){
                    excelDataList.add(new WriteExcelData(i+1,3, osAttributeVO.getAttributeDataType()));
                }else{
                    excelDataList.add(new WriteExcelData(i+1,3, osAttributeVO.getAttributeDataType()+"("+osAttributeVO.getAttributeDataTypeText()+")"));
                }
                excelDataList.add(new WriteExcelData(i+1,4, osAttributeVO.isNullableFlag()));
                excelDataList.add(new WriteExcelData(i+1,5, osAttributeVO.getDefaultValue()));
                excelDataList.add(new WriteExcelData(i+1,6, osAttributeVO.getEnumId()));
                excelDataList.add(new WriteExcelData(i+1,7, osAttributeVO.getEnumName()));
                excelDataList.add(new WriteExcelData(i+1,8, osAttributeVO.getBtmTypeId()));
                excelDataList.add(new WriteExcelData(i+1,9, osAttributeVO.getBtmTypeName()));
                excelDataList.add(new WriteExcelData(i+1,10, osAttributeVO.getAttrLength()));
                excelDataList.add(new WriteExcelData(i+1,11, osAttributeVO.getLinkTypeName()));
                excelDataList.add(new WriteExcelData(i+1,12, osAttributeVO.getVersion()));
                excelDataList.add(new WriteExcelData(i+1,13, osAttributeVO.getPrecisionLength()));
                excelDataList.add(new WriteExcelData(i+1,14, osAttributeVO.getScaleLength()));
                excelDataList.add(new WriteExcelData(i+1,15, osAttributeVO.getRange()));
                excelDataList.add(new WriteExcelData(i+1,16, osAttributeVO.getCreateTime()));
                //excelDataList.add(new WriteExcelData(i+1,7, osAttributeVO.getEnumName()));
                excelDataList.add(new WriteExcelData(i+1,7, osAttributeVO.getBtmTypeId()));
                //excelDataList.add(new WriteExcelData(i+1,9, osAttributeVO.getBtmTypeName()));
                excelDataList.add(new WriteExcelData(i+1,8, osAttributeVO.getAttrLength()));
                excelDataList.add(new WriteExcelData(i+1,9, osAttributeVO.getLinkTypeName()));
                excelDataList.add(new WriteExcelData(i+1,10, osAttributeVO.getVersion()));
                excelDataList.add(new WriteExcelData(i+1,11, osAttributeVO.getPrecisionLength()));
                excelDataList.add(new WriteExcelData(i+1,12, osAttributeVO.getScaleLength()));
                excelDataList.add(new WriteExcelData(i+1,13, osAttributeVO.getRange()));
                if(!flag){
                    excelDataList.add(new WriteExcelData(i+1,14, Func.format(osAttributeVO.getCreateTime(),"yyyyå¹´MM月dd日 hh:mm:ss")));
                }
            }
        }
        WriteExcelOption excelOption = new WriteExcelOption(excelDataList);
        ExcelUtil.writeDataToFile(excelPath, excelOption);
        return excelPath;
    }
    /**
     * èŽ·å–å¯¼å‡ºæˆ–å¯¼å…¥æ¨¡æ¿çš„åˆ—å
     * @param flag æ˜¯å¦èŽ·å–å¯¼å…¥æ¨¡æ¿åˆ—å
     * @return
     */
    private List<String> getCloumns(boolean flag){
        if(flag){
            return new ArrayList<>(
                    Arrays.asList("属性名", "标签", "描述",
                            "属性类型(参照新增界面的属性类型如VTString)", "允许为空(是/否)", "默认值", "使用的枚举英文名称"
                            , "参照的业务类型编号","参照的链接类型编号","版本版次","属性长度", "小数精度位数","小数刻度位数"
                            ,"取值范围"
                    )
            );
        }
        return new ArrayList<>(
                Arrays.asList("属性名", "标签", "描述",
                        "属性类型", "允许为空", "默认值", "使用的枚举英文名称(枚举名)",
                        "参照的业务类型编号", "参照的链接类型编号","版本版次","属性长度",
                        "小数精度位数","小数刻度位数","取值范围","创建时间")
        );
    }
    /**
@@ -941,11 +962,7 @@
        //界面没传名称,使用默认导出名称
        exportFileName = Func.isBlank(exportFileName) ?  "属性池导入模板_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName;
        //设置列名
        List<String> columns = new ArrayList<>(
                Arrays.asList("属性名", "标签", "描述",
                        "属性类型(请参照新增界面的属性类型填写)", "允许为空(是/否)", "默认值", "使用的枚举英文名称", "参照的业务类型编号",
                        "参照的链接类型编号","版本版次","属性长度", "小数精度位数","小数刻度位数","取值范围")
        );
        List<String> columns = this.getCloumns(true);
        //设置必填列
        ColumnNameisRed.clear();
        ColumnNameisRed.add(0);
@@ -1000,10 +1017,9 @@
            List<OsAttributeDTO> dtoList = new ArrayList<>();
            //当前excel中是否重复用的判重Map:(key:判重属性,value:行号)
            Map<String, String> excelReapeat = new HashMap<>();
            //判断必填属性是否为空,用户是否已存在,以及部门是否填错等校验逻辑
            poList.stream().forEach(osAttributePO -> {
                if(Func.isBlank(osAttributePO.getId())){//属性名判空
                    throw new VciBaseException("第【"+osAttributePO.getRowIndex()+"】行,enumnameerror");
                    throw new VciBaseException("第【"+osAttributePO.getRowIndex()+"】行,attrnameerror");
                }else if(Func.isBlank(osAttributePO.getAttributeDataType())){
                    throw new VciBaseException("第【"+osAttributePO.getRowIndex()+"】行,typeerror");
                }else if(excelReapeat.containsKey(osAttributePO.getId())){//属性名表格中判重
@@ -1019,7 +1035,7 @@
                //属性名excel中判重处理
                excelReapeat.put(osAttributePO.getId(),osAttributePO.getRowIndex());
                OsAttributeDTO osAttributeDTO = new OsAttributeDTO();
                //查询枚举是否存在,填写了枚举但没填写取值范围,这时候直接使用枚举项值作为默认的range
                //查询属性是否存在,填写了枚举但没填写取值范围,这时候直接使用枚举项值作为默认的range
                if(Func.isNotBlank(osAttributePO.getEnumId()) && Func.isBlank(osAttributePO.getRange())){
                    try {
                        OsEnumVO enumVO = enumService.getEnumTypeById(osAttributePO.getEnumId());
@@ -1057,7 +1073,7 @@
                    checkDefValue(osAttributeDTO);
                } catch (PLException e) {
                    e.printStackTrace();
                    throw new VciBaseException(e.getMessage());
                    throw new VciBaseException(VciBaseUtil.getExceptionMessage(e));
                }
                dtoList.add(osAttributeDTO);
            });
@@ -1080,7 +1096,7 @@
            e.printStackTrace();
            return BaseResult.fail(VciBaseUtil.getExceptionMessage(e),new String[]{},e);
        }
        return BaseResult.success("枚举导入成功!");
        return BaseResult.success("属性导入成功!");
    }
    /**
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsEnumServiceImpl.java
@@ -385,14 +385,14 @@
     * @return
     */
    @Override
    public String exportEnumTypes(String exportFileName,String enumNames) throws PLException {
    public String exportEnumTypes(String exportFileName,String enumNames,boolean flag/*控制导出的列名是否和导入模板一致*/) throws PLException {
        if(Func.isBlank(enumNames)){
            throw new PLException("500",new String[]{"请勾选要导出的枚举!"});
        }
        //界面没传名称,使用默认导出名称
        exportFileName = Func.isBlank(exportFileName) ?  "枚举类型导出_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName;
        //设置列名
        List<String> columns = new ArrayList<>(Arrays.asList("枚举名称", "标签", "返回类型", "长度","创建时间", "枚举项名称", "枚举值", "描述"));
        List<String> columns = this.getCloumns(flag);
        //写excel
        String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName +  ".xls";
@@ -418,39 +418,54 @@
            if(Func.isEmpty(osEnumVO) && Func.isBlank(osEnumVO.getOid())){
                throw new PLException("500",new String[]{"未查询到枚举名为【" + enumNameList.get(i) + "】的枚举,请刷新后重新导出!"});
            }
            //枚举项不为空时需要考虑合并行问题
            //按照导出列名控制变量和枚举项不为空时决定是否需要考虑合并行问题
            List<OsEnumItemVO> enumVOItems = osEnumVO.getItems();
            //枚举项不为空时需要进行合并行处理
            if(Func.isNotEmpty(enumVOItems) || enumVOItems.size() > 1){
                //excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,0, osEnumVO.getOid()));
                excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,0, osEnumVO.getId()));
                excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,1, osEnumVO.getName()));
                excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,2, osEnumVO.getEnumValueDataType()+"("+osEnumVO.getEnumValueDataTypeText()+")"));
                excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,3, osEnumVO.getLength()));
                //excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,5, osEnumVO.getCreator()));
                excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,4, Func.format(osEnumVO.getCreateTime(),"yyyyå¹´MM月dd日 hh:mm:ss")));
                //处理枚举项写入
            //判断是按照什么列名导出
            if(flag){
                for (int j = 0; j < enumVOItems.size(); j++) {
                    OsEnumItemVO osEnumItemVO = enumVOItems.get(j);
                    excelDataList.add(new WriteExcelData(startRow+j,5, true,osEnumItemVO.getName()));
                    excelDataList.add(new WriteExcelData(startRow+j,6, true, osEnumItemVO.getValue()));
                    excelDataList.add(new WriteExcelData(startRow+j,7, true, osEnumItemVO.getDescription()));
                }
                    excelDataList.add(new WriteExcelData(i+j+1,0, osEnumVO.getId()));
                    excelDataList.add(new WriteExcelData(i+j+1,1, osEnumVO.getName()));
                    excelDataList.add(new WriteExcelData(i+j+1,2, osEnumVO.getEnumValueDataType()));
                    excelDataList.add(new WriteExcelData(i+j+1,3, osEnumVO.getLength()));
                startRow += enumVOItems.size();
                    excelDataList.add(new WriteExcelData(i+j+1,4,osEnumItemVO.getName()));
                    excelDataList.add(new WriteExcelData(i+j+1,5, osEnumItemVO.getValue()));
                    excelDataList.add(new WriteExcelData(i+j+1,6, osEnumItemVO.getDescription()));
                }
            }else{
                //枚举项为空时就不需要合并行
                //excelDataList.add(new WriteExcelData(startRow,0, true,osEnumVO.getOid()));
                excelDataList.add(new WriteExcelData(startRow,0, true, osEnumVO.getId()));
                excelDataList.add(new WriteExcelData(startRow,1, true, osEnumVO.getName()));
                excelDataList.add(new WriteExcelData(startRow,1, true, osEnumVO.getEnumValueDataType()+"("+osEnumVO.getEnumValueDataTypeText()+")"));
                excelDataList.add(new WriteExcelData(startRow,3, true, osEnumVO.getLength()));
                //excelDataList.add(new WriteExcelData(startRow,5, true, osEnumVO.getCreator()));
                excelDataList.add(new WriteExcelData(startRow,4, true, Func.format(osEnumVO.getCreateTime(),"yyyyå¹´MM月dd日 hh:mm:ss")));
                //枚举项不为空时需要进行合并行处理
                if(Func.isNotEmpty(enumVOItems) || enumVOItems.size() > 1){
                    //excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,0, osEnumVO.getOid()));
                    excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,0, osEnumVO.getId()));
                    excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,1, osEnumVO.getName()));
                    excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,2, osEnumVO.getEnumValueDataType()+"("+osEnumVO.getEnumValueDataTypeText()+")"));
                    excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,3, osEnumVO.getLength()));
                    //excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,5, osEnumVO.getCreator()));
                    excelDataList.add(new WriteExcelData(startRow,(enumVOItems.size()+startRow)-1,true,true,4, Func.format(osEnumVO.getCreateTime(),"yyyyå¹´MM月dd日 hh:mm:ss")));
                    //处理枚举项写入
                    for (int j = 0; j < enumVOItems.size(); j++) {
                        OsEnumItemVO osEnumItemVO = enumVOItems.get(j);
                        excelDataList.add(new WriteExcelData(startRow+j,5, true,osEnumItemVO.getName()));
                        excelDataList.add(new WriteExcelData(startRow+j,6, true, osEnumItemVO.getValue()));
                        excelDataList.add(new WriteExcelData(startRow+j,7, true, osEnumItemVO.getDescription()));
                    }
                    startRow += enumVOItems.size();
                }else{
                    //枚举项为空时就不需要合并行
                    //excelDataList.add(new WriteExcelData(startRow,0, true,osEnumVO.getOid()));
                    excelDataList.add(new WriteExcelData(startRow,0, true, osEnumVO.getId()));
                    excelDataList.add(new WriteExcelData(startRow,1, true, osEnumVO.getName()));
                    excelDataList.add(new WriteExcelData(startRow,1, true, osEnumVO.getEnumValueDataType()+"("+osEnumVO.getEnumValueDataTypeText()+")"));
                    excelDataList.add(new WriteExcelData(startRow,3, true, osEnumVO.getLength()));
                    //excelDataList.add(new WriteExcelData(startRow,5, true, osEnumVO.getCreator()));
                    excelDataList.add(new WriteExcelData(startRow,4, true, Func.format(osEnumVO.getCreateTime(),"yyyyå¹´MM月dd日 hh:mm:ss")));
                }
                //记录下上一组数据结束时的行号,方便用做合并行的起始行
                startRow += 1;
            }
            //记录下上一组数据结束时的行号,方便用做合并行的起始行
            startRow += 1;
        }
        WriteExcelOption excelOption = new WriteExcelOption(excelDataList);
        ExcelUtil.writeDataToFile(excelPath, excelOption);
@@ -467,7 +482,7 @@
        //界面没传名称,使用默认导出名称
        exportFileName = Func.isBlank(exportFileName) ?  "枚举导入模板_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName;
        //设置列名
        List<String> columns = new ArrayList<>(Arrays.asList("枚举名称", "标签", "返回类型", "长度", "枚举项名称(当前枚举下有枚举项时必填)", "枚举值(当前枚举下有枚举项时必填)", "描述","*注意*:第二行开始的数据为示例数据,导入前请将其删除,当导入的枚举下具备多个枚举项时,应按照示例enum2的写法"));
        List<String> columns = this.getCloumns(true);
        //写excel
        String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName +  ".xls";
        //设置必填列
@@ -514,6 +529,27 @@
        WriteExcelOption excelOption = new WriteExcelOption(excelDataList);
        ExcelUtil.writeDataToFile(excelPath, excelOption);
        return excelPath;
    }
    /**
     * èŽ·å–å¯¼å‡ºæˆ–å¯¼å…¥æ¨¡æ¿çš„åˆ—å
     * @param flag æ˜¯å¦èŽ·å–å¯¼å…¥æ¨¡æ¿åˆ—å
     * @return
     */
    private List<String> getCloumns(boolean flag){
        if(flag){
            return new ArrayList<>(
                Arrays.asList("枚举名称", "标签", "返回类型", "长度", "枚举项名称(当前枚举下有枚举项时必填)",
                        "枚举值(当前枚举下有枚举项时必填)", "描述","*注意*:第二行开始的数据为示例数据,导入前请将其删除," +
                                "当导入的枚举下具备多个枚举项时,应按照示例enumb的写法"
                )
            );
        }
        return new ArrayList<>(
            Arrays.asList("枚举名称", "标签", "返回类型", "长度",
                "创建时间", "枚举项名称", "枚举值", "描述"
            )
        );
    }
    /**
@@ -569,7 +605,7 @@
            }
            //当前excel中是否重复用的判重Map:(key:判重属性,value:行号)
            Map<String, String> excelReapeat = new HashMap<>();
            //判断必填属性是否为空,用户是否已存在,以及部门是否填错等校验逻辑
            //判断必填属性是否为空等等
            List<String> finalRepeatEnumId = repeatEnumId;
            newPOList.stream().forEach(osEnumPO -> {
                if(Func.isBlank(osEnumPO.getId())){//枚举名
@@ -582,7 +618,7 @@
                    throw new VciBaseException("第【"+osEnumPO.getRowIndex()+"】行数据,枚举名称只能为英文字母");
                }else if(excelReapeat.containsKey(osEnumPO.getId())){//枚举名表格中判重
                    throw new VciBaseException("第【"+excelReapeat.get(osEnumPO.getId())+"】行和第【"+osEnumPO.getRowIndex()+"】行数据,枚举名重复");
                }else if (Func.isNotEmpty(osEnumVOList) && finalRepeatEnumId.contains(osEnumPO.getId())){//2、判断枚举名是否与系统中重复
                }else if (Func.isNotEmpty(finalRepeatEnumId) && finalRepeatEnumId.contains(osEnumPO.getId())){//2、判断枚举名是否与系统中重复
                    throw new VciBaseException("第【"+osEnumPO.getRowIndex()+"】行,枚举名在系统中已经存在,请修改!");
                }
                //先对枚举名excel中需要判重处理
@@ -619,7 +655,7 @@
     * @return
     */
    private List<OsEnumVO> getExportEnumTempExample(){
        String testJosn = "[{\"enumValueDataType\":\"String\",\"id\":\"enum1\",\"items\":[{\"description\":\"enumitem1.1\",\"name\":\"enumitem1.1\",\"value\":\"1\"},{\"description\":\"enumitem1.2\",\"name\":\"enumitem1.2\",\"value\":\"2\"}],\"length\":2,\"name\":\"enum1\"},{\"enumValueDataType\":\"String\",\"id\":\"enum2\",\"items\":[{\"description\":\"enumitem2.1\",\"name\":\"enumitem2.1\",\"value\":\"1\"},{\"description\":\"enumitem2.2\",\"name\":\"enumitem2.2\",\"value\":\"2\"},{\"description\":\"enumitem2.3\",\"name\":\"enumitem2.3\",\"value\":\"3\"}],\"length\":6,\"name\":\"enum2\"}]";
        String testJosn = "[{\"enumValueDataType\":\"String\",\"id\":\"enuma\",\"items\":[{\"description\":\"enumitem1.1\",\"name\":\"enumitem1.1\",\"value\":\"1\"},{\"description\":\"enumitem1.2\",\"name\":\"enumitem1.2\",\"value\":\"2\"}],\"length\":2,\"name\":\"enuma\"},{\"enumValueDataType\":\"String\",\"id\":\"enumb\",\"items\":[{\"description\":\"enumitem2.1\",\"name\":\"enumitem2.1\",\"value\":\"1\"},{\"description\":\"enumitem2.2\",\"name\":\"enumitem2.2\",\"value\":\"2\"},{\"description\":\"enumitem2.3\",\"name\":\"enumitem2.3\",\"value\":\"3\"}],\"length\":6,\"name\":\"enumb\"}]";
        List<OsEnumVO> OsEnumVOs = JSON.parseArray(testJosn,OsEnumVO.class);
        return OsEnumVOs;
    }
@@ -661,7 +697,7 @@
     */
    private EnumType osEnumDTO2EnumType(OsEnumDTO osEnumDTO){
        EnumType enumType = new EnumType();
        enumType.oid = osEnumDTO.getOid();
        //enumType.oid = osEnumDTO.getOid();
        //枚举名统一转成小写,避免后期出现其他问题
        enumType.name = osEnumDTO.getId().toLowerCase(Locale.ROOT);
        enumType.label = osEnumDTO.getName();
@@ -952,7 +988,12 @@
            for(int k = 0; k < emChildren.length; k++){
                EnumItem emChild = emChildren[k];
                String value = emChild.value;
                valueList.add(value);
                String symbol = "";
                //当为Integer时需要将枚举项值拼接上=
                if("Integer".equals(enumType)){
                    symbol = "=";
                }
                valueList.add(symbol + value);
            }
            Map<String, List<String>> enumMap = new HashMap<>();
            enumMap.put(emItem.name, valueList);
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsLinkTypeServiceImpl.java
@@ -1,26 +1,40 @@
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.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.BusinessObject;
import com.vci.corba.omd.ltm.LinkType;
import com.vci.corba.omd.ltm.LinkTypeServicePrx;
import com.vci.dto.OsAttributeDTO;
import com.vci.omd.constants.LinkTypeConstants;
import com.vci.omd.utils.ObjectTool;
import com.vci.pagemodel.*;
import com.vci.po.OsAttributePO;
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.VciFieldTypeEnum;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseQueryObject;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.pagemodel.DataGrid;
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.*;
import com.vci.model.OsLinkTypeDO;
import com.vci.web.service.*;
import com.vci.web.util.Func;
import com.vci.web.util.PlatformClientUtil;
import com.vci.web.util.WebUtil;
import javafx.scene.shape.HLineTo;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -28,8 +42,10 @@
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.*;
import java.util.stream.Collectors;
@@ -40,6 +56,16 @@
 */
@Service
public class OsLinkTypeServiceImpl implements OsLinkTypeServiceI {
    private static final String OID = "oid";
    private static final String NAME = "name";
    private static final String LABEL = "label";
    private static final String DESCRIPTION = "description";
    private static final String TS = "ts";
    private static final String CREATOR = "creator";
    private static final String CREATETIME = "createTime";
    private static final String MODIFIER = "modifier";
    private static final String MODIFYTIME = "modifyTime";
    /**
     * æ—¥å¿—
@@ -487,6 +513,182 @@
        }
    }
    /**
     * å¯¼å‡ºé“¾æŽ¥ç±»åž‹
     * name é“¾æŽ¥ç±»åž‹åç§°
     * @return åˆ›å»ºç»“æžœ
     */
    @Override
    public void expData(String names, HttpServletResponse response) throws PLException, IOException {
        String defaultTempFolder = LocalFileUtil.getDefaultTempFolder();
        //写excel
        String excelPath = defaultTempFolder + File.separator + "lt.xls";
        //设置列名
        List<String> columns = new ArrayList<>(
                Arrays.asList("名称", "标签", "实现类", "形状", "From端类型列表", "From端主类型", "From端对应关系",
                        "To端类型列表", "To端主类型", "To端对应关系", "属性列表", "描述")
        );
        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(",")) {
                LinkType lt = platformClientUtil.getLinkTypeService().getLinkType(name);
                excelDataList.add(new WriteExcelData(i+1,0, lt.name));
                excelDataList.add(new WriteExcelData(i+1,1, lt.tag));
                excelDataList.add(new WriteExcelData(i+1,2, lt.implClass));
                excelDataList.add(new WriteExcelData(i+1,3, lt.shape));
                excelDataList.add(new WriteExcelData(i+1,4, String.join(",",lt.btmItemsFrom)));
                excelDataList.add(new WriteExcelData(i+1,5, lt.primitivesFrom));
                excelDataList.add(new WriteExcelData(i+1,6, lt.relationFrom));
                excelDataList.add(new WriteExcelData(i+1,7, String.join(",",lt.btmItemsTo)));
                excelDataList.add(new WriteExcelData(i+1,8, lt.primitivesTo));
                excelDataList.add(new WriteExcelData(i+1,9, lt.relationTo));
                excelDataList.add(new WriteExcelData(i+1,10, String.join(",",lt.attributes)));
                excelDataList.add(new WriteExcelData(i+1,11, lt.description));
                attributes.addAll(Arrays.asList(lt.attributes));
                i++;
            }
            WriteExcelOption excelOption = new WriteExcelOption(excelDataList);
            ExcelUtil.writeDataToFile(excelPath, excelOption);
            //导出属性
            String attrPath = attributeService.exportAttributes("attr",
                    String.valueOf(attributes.stream().collect(Collectors.joining(","))),true);
            //移动属性到链接类型文件夹里面去
            FileUtil.move(new File(attrPath), new File(defaultTempFolder),true);
            FileUtil.del(attrPath.substring(0,attrPath.lastIndexOf("\\")));
            //todo å¯¼å‡ºä¸šåŠ¡ç±»åž‹è¿˜æ²¡æœ‰å®žçŽ°
//            List<BizType> bts = new ArrayList<BizType>();
//            for (String btName : btNameSet) {
//                BizType bt = BtmProvider.getBtmItemByName(btName);
//                bts.add(bt);
//            }
//            boolean btFlag = BtmProvider.expData(rootPath, bts.toArray(new BizType[0]));
        }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")) {
            throw new VciBaseException("仅能上传zip压缩文件,请重新上传!");
        }
        File unzip = ZipUtil.unzip(fileName);
        File ltExcel = new File(unzip.getAbsolutePath() + File.separator + "lt.xls");
        File attrExcel = new File(unzip.getAbsolutePath() + File.separator + "attr.xls");
        if (!attrExcel.exists()) {
            //增加解压的路径,看文件还在没有
            attrExcel = new File(unzip.getAbsolutePath() + File.separator + unzip.getName() + File.separator + "attr.xls");
            if (!attrExcel.exists()) {
                return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"没有导入的属性文件。导入终止!"});
            }
        }
        BaseResult baseResult = attributeService.importAttributes(attrExcel);
        if(!baseResult.isSuccess()){
            //删除上传的文件夹
            FileUtil.del(defaultTempFolder + File.separator);
            return baseResult;
        }
        //todo è¿˜éœ€å¯¼å…¥ä¸šåŠ¡ç±»åž‹ï¼Œç­‰å¾…åŠŸèƒ½å®žçŽ°
        if (!ltExcel.exists()) {
            //增加解压的路径,看文件还在没有
            ltExcel = new File(unzip.getAbsolutePath() + File.separator + unzip.getName() + File.separator + "lt.xls");
            if (!ltExcel.exists()) {
                //删除上传的文件夹
                FileUtil.del(defaultTempFolder + File.separator);
                return BaseResult.fail(FrameWorkLangCodeConstant.IMPORT_FAIL, new String[]{"没有导入的链接文件。导入终止!"});
            }
        }
        try{
            //1、读取excel中的数据,组成对象
            ReadExcelOption excelOption = new ReadExcelOption();
            List<OsLinkTypePO> poList = ExcelUtil.readDataObjectFromExcel(ltExcel, OsLinkTypePO.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(osLinkTypePO -> {
                if(Func.isBlank(osLinkTypePO.getName())){//属性名判空
                    throw new VciBaseException("第【"+osLinkTypePO.getRowIndex()+"】行,name");
                }else if(osLinkTypePO.getName().length() > maxLength){
                    throw new VciBaseException("第【"+osLinkTypePO.getRowIndex()+"】行,链接类型名长度不能超过" + maxLength);
                }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()+"】行数据,属性名重复");
                }
                try {
                    LinkType historyLink = platformClientUtil.getLinkTypeService().getLinkType(osLinkTypePO.getName());
                    //已有此数据进行删除覆盖
                    if(historyLink != null && !historyLink.name.equals("")){
                        platformClientUtil.getLinkTypeService().deleteLinkType(historyLink);
                    }
                } catch (PLException e) {
                    throw new RuntimeException(e);
                }
                //属性名excel中判重处理
                excelReapeat.put(osLinkTypePO.getName(),osLinkTypePO.getRowIndex());
                LinkType linkType = new LinkType();
                linkType.name = osLinkTypePO.getName();
                linkType.attributes = osLinkTypePO.getAttributes().split(",");
                linkType.btmItemsFrom = osLinkTypePO.getBtmItemsFrom().split(",");
                linkType.primitivesFrom = osLinkTypePO.getPrimitivesFrom();
                linkType.relationFrom = osLinkTypePO.getRelationFrom();
                linkType.btmItemsTo = osLinkTypePO.getBtmItemsTo().split(",");
                linkType.primitivesTo = osLinkTypePO.getPrimitivesTo();
                linkType.relationTo = osLinkTypePO.getRelationTo();
                linkType.relation = osLinkTypePO.getRelationFrom() + ":" + osLinkTypePO.getRelationTo();
                linkType.description = osLinkTypePO.getDescription();
                linkType.tag = osLinkTypePO.getTag();
                linkType.shape = osLinkTypePO.getShape();
                linkType.implClass = osLinkTypePO.getImplClass();
                linkType.modifier = WebUtil.getCurrentUserId();
                linkType.creator = WebUtil.getCurrentUserId();
                try {
                    platformClientUtil.getLinkTypeService().addLinkType(linkType);
                } 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("链接类型导入成功!");
    }
    /**
     * ä¿®å¤é“¾æŽ¥ç±»åž‹çš„xml文件
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsRevisionRuleServiceImpl.java
@@ -1,19 +1,46 @@
package com.vci.web.service.impl;
import com.vci.client.mw.ClientSessionUtility;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.stm.StatePool;
import com.vci.corba.omd.vrm.VersionRule;
import com.vci.dto.OsAttributeDTO;
import com.vci.dto.OsRevisionRuleDTO;
import com.vci.dto.OsStatusDTO;
import com.vci.pagemodel.OsAttributeVO;
import com.vci.pagemodel.OsEnumVO;
import com.vci.pagemodel.OsStatusVO;
import com.vci.po.OsAttributePO;
import com.vci.po.OsEnumPO;
import com.vci.po.OsRevisionRulePO;
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.util.VciDateUtil;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.BaseResult;
import com.vci.starter.web.util.*;
import com.vci.pagemodel.OsRevisionRuleVO;
import com.vci.web.service.OsRevisionRuleServiceI;
import com.vci.web.util.Func;
import com.vci.web.util.PlatformClientUtil;
import com.vci.web.util.WebUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.util.HSSFColor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.util.*;
import java.util.List;
import java.util.stream.Collectors;
/**
@@ -36,6 +63,17 @@
    @Autowired(required = false)
    @Lazy
    private OsRevisionRuleServiceI self;
    /**
     * æ—¥å¿—
     */
    private Logger logger = LoggerFactory.getLogger(getClass());
    /**
     *  å¿…填列
     */
    private List<Integer> ColumnNameisRed = new ArrayList<Integer>();
    /**
     * æŸ¥è¯¢æ‰€æœ‰çš„版本规则
     *
@@ -59,6 +97,163 @@
    @VciUnLog
    public Map<String, OsRevisionRuleVO> selectAllRevisionMap() {
        return Optional.ofNullable(self.selectAllRevision()).orElseGet(()->new ArrayList<>()).stream().collect(Collectors.toMap(s->s.getId().toLowerCase(),t->t,(o1,o2)->o1));
    }
    /**
     * åˆ›å»ºç‰ˆæœ¬è§„则
     * @param osRevisionRuleDTO
     * @return
     */
    @Override
    public boolean addVersionRule(OsRevisionRuleDTO osRevisionRuleDTO) throws PLException {
        //判空
        VciBaseUtil.alertNotNull(osRevisionRuleDTO,"版本规则对象",osRevisionRuleDTO.getId(),"版本规则名称");
        //版本规则合规检验
        this.checkVersionRule(osRevisionRuleDTO);
        //查重
        VersionRule vr = platformClientUtil.getVersionService().getVersionRule(osRevisionRuleDTO.getId());
        //name不为空
        if(Func.isNotEmpty(vr) && !"".equals(vr.name)){
            throw new PLException("500",new String[]{"名称重复请更换名称!"});
        }
        return platformClientUtil.getVersionService().addVersionRule(this.dto2VersionRule(osRevisionRuleDTO));
    }
    /**
     * ä¿®æ”¹ç‰ˆæœ¬è§„则
     * @param osRevisionRuleDTO
     * @return
     */
    @Override
    public boolean updateVersionRule(OsRevisionRuleDTO osRevisionRuleDTO) throws PLException {
        //判空
        VciBaseUtil.alertNotNull(osRevisionRuleDTO,"版本规则对象",osRevisionRuleDTO.getId(),"版本规则名称");
        //判断是否在系统中存在
        VersionRule vr = platformClientUtil.getVersionService().getVersionRule(osRevisionRuleDTO.getName());
        //版本规则合规检验
        this.checkVersionRule(osRevisionRuleDTO);
        //name不为空
        if(Func.isEmpty(vr) && !"".equals(vr.name)){
            throw new PLException("500",new String[]{"修改的版本规则在系统中不存在!"});
        }
        return platformClientUtil.getVersionService().modifyVersionRule(this.dto2VersionRule(osRevisionRuleDTO));
    }
    /**
     * åˆ é™¤ç‰ˆæœ¬è§„则
     * @param osRevisionRuleDTOS
     * @return
     */
    @Override
    public boolean deleteVersionRule(List<OsRevisionRuleDTO> osRevisionRuleDTOS) throws PLException {
        VciBaseUtil.alertNotNull(osRevisionRuleDTOS,"待删除的属性列表");
        //判断要删除的版本规则是否有被引用
        osRevisionRuleDTOS.stream().forEach(item->{
            String vrName = item.getId();
            try {
                String[] btNamesByVerName = platformClientUtil.getBtmService().getBTNamesByVerName(vrName);
                if(btNamesByVerName != null && btNamesByVerName.length > 0){
                    throw new VciBaseException("该版本已被使用不允许删除");
                }
            } catch (PLException e) {
                logger.error(e.getMessage());
                e.printStackTrace();
                throw new VciBaseException(e.getMessage());
            }
        });
        //平台的deleteStatus方法必传三个参数,oid、name和ts
        List<VersionRule> vrList = new ArrayList<>();
        for(OsRevisionRuleDTO vrDTO : osRevisionRuleDTOS){
            //oid和ts判空
            String oid = vrDTO.getOid();
            //id主要用来对缓存数据删除
            String id = vrDTO.getId();
            //后台会用ts进行数据一致性校验
            Date ts = vrDTO.getTs();
            if(Func.isBlank(oid) || Func.isBlank(id) || Func.isEmpty(ts)){
                throw new PLException("500",new String[]{"待删除的状态列表中主键【oid】、调整时间【ts】、状态名称【name】不能为空!"});
            }
            VersionRule vr = new VersionRule();
            vr.oid = oid;
            vr.name = id;
            vr.ts = Func.format(ts,VciDateUtil.DateTimeMillFormat);
            vrList.add(vr);
        }
        return platformClientUtil.getVersionService().deleteVersionRules(vrList.toArray(new VersionRule[vrList.size()]));
    }
    /**
     * æ£€æŸ¥ç‰ˆæœ¬è§„则设置的是否合理
     * @param dto
     */
    private void checkVersionRule(OsRevisionRuleDTO dto) throws PLException {
        //版本规则名称只能为英文字母
        String regex = "[a-z A-Z]*";
        if (!dto.getId().matches(regex)) {
            throw new PLException("500",new String[]{"名称只能为英文!"});
        }
        //跳跃字符只能为数字或者字母
        if(Func.isNotBlank(dto.getJumpCharacter()) && (!(dto.getJumpCharacter().matches(regex)))){
            throw new PLException("500",new String[]{"跳跃字符只能为数字或者字母!"});
        }
        //初始值不能为空且只能为数字或者字母或英文状态下的符号
        String regex1 = "[A-Za-z0-9!@#$%^&*()-_=+{}':|;,.?/]+$";
        if(Func.isBlank(dto.getInitialValue()) || !dto.getInitialValue().matches(regex1)){
            throw new PLException("500",new String[]{"初始值不能为空且只能为数字或者字母或英文状态下的符号!"});
        }
        if(dto.getInitialValue().length() + dto.getInitialValue().length() > 32) {
            throw new PLException("500",new String[]{"初始值不能超过32个字符!"});
        }
        //步长不能为空且必须为1-9的正整数
        String regex2 = "[1-9]";
        if(Func.isBlank(dto.getStepLength()) || (!dto.getStepLength().matches(regex2))){
            throw new PLException("500",new String[]{"步长不能为空且必须为1-9的正整数"});
        }
        //前缀相关判断
        String regex3 = "^\\s+.*";
        if(Func.isNotBlank(dto.getPrefixion()) && (dto.getPrefixion().matches(regex3))){
            throw new PLException("500",new String[]{"前缀不能以空格开头"});
        }
        if (Func.isNotBlank(dto.getPrefixion()) && dto.getPrefixion().length() > 32) {
            throw new PLException("500",new String[]{"前缀不能超过32个字符"});
        }
        //后缀相关判断
        String regex4 = "^*.\\s+$";
        if(Func.isNotBlank(dto.getSuffix()) && (dto.getSuffix().matches(regex4))){
            throw new PLException("500",new String[]{"后缀不能以空格结尾"});
        }
        if (Func.isNotBlank(dto.getSuffix()) && dto.getSuffix().length() > 32) {
            throw new PLException("500",new String[]{"后缀不能超过32个字符"});
        }
        if (dto.getId().length() > 255) {
            throw new PLException("500",new String[]{"名称不能超过255个字符"});
        }
    }
    /**
     * dto对象转换为VersionRule对象
     * @return
     */
    private VersionRule dto2VersionRule(OsRevisionRuleDTO osRevisionRuleDTO){
        VersionRule newVR = new VersionRule();
        newVR.oid = osRevisionRuleDTO.getOid();
        newVR.name = osRevisionRuleDTO.getId();
        newVR.tag = osRevisionRuleDTO.getName();
        newVR.description = osRevisionRuleDTO.getDescription();
        newVR.jumpCharacter = osRevisionRuleDTO.getJumpCharacter();
        newVR.initialValue = osRevisionRuleDTO.getInitialValue();
        newVR.stepLength = osRevisionRuleDTO.getStepLength();
        newVR.prefixion = osRevisionRuleDTO.getPrefixion();
        newVR.suffix = osRevisionRuleDTO.getSuffix();
        String userName = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
        long timeMillis = System.currentTimeMillis();
        newVR.ts = Func.format((Func.isNotEmpty(osRevisionRuleDTO.getTs()) ? osRevisionRuleDTO.getTs():new Date()),VciDateUtil.DateTimeMillFormat);
        newVR.creator = Func.isBlank(osRevisionRuleDTO.getCreator()) ? userName:osRevisionRuleDTO.getCreator();
        newVR.createTime = Func.isEmpty(osRevisionRuleDTO.getCreateTime()) ? timeMillis:osRevisionRuleDTO.getCreateTime().getTime();
        newVR.modifier = userName;
        newVR.modifyTime = timeMillis;
        return newVR;
    }
    /**
@@ -93,18 +288,18 @@
            try {
                ruleVO.setCreateTime(VciDateUtil.long2Date(versionRule.createTime));
                ruleVO.setLastModifyTime(VciDateUtil.long2Date(versionRule.modifyTime));
                ruleVO.setTs(VciDateUtil.str2Date(versionRule.ts,VciDateUtil.DateTimeFormat));
                ruleVO.setTs(VciDateUtil.str2Date(versionRule.ts,VciDateUtil.DateTimeMillFormat));
            } catch (Exception e) {
                e.printStackTrace();
            }
            ruleVO.setDescription(versionRule.description);
            ruleVO.setId(versionRule.name);
            ruleVO.setName(versionRule.tag);
            ruleVO.setSerialStep(WebUtil.getInt(versionRule.stepLength));
            ruleVO.setSkipCode(versionRule.jumpCharacter);
            ruleVO.setPrefixCode(versionRule.prefixion);
            ruleVO.setSuffixCode(versionRule.suffix);
            ruleVO.setStartCode(versionRule.initialValue);
            ruleVO.setStepLength(WebUtil.getInt(versionRule.stepLength));
            ruleVO.setJumpCharacter(versionRule.jumpCharacter);
            ruleVO.setPrefixion(versionRule.prefixion);
            ruleVO.setSuffix(versionRule.suffix);
            ruleVO.setInitialValue(versionRule.initialValue);
            //associated暂时没有使用
        }
        return ruleVO;
@@ -125,10 +320,260 @@
    }
    /**
     * ä½¿ç”¨å¤šä¸ªç¼–号获取规则的值
     * @param vrIdList ç¼–号
     * @return æ˜¾ç¤ºå¯¹è±¡
     */
    @Override
    public List<OsRevisionRuleVO> getRevisionRuleByIds(Collection<String> vrIdList) {
        if(Func.isEmpty(vrIdList)){
            return null;
        }
        Map<String, OsRevisionRuleVO> revisionRuleVOMap = self.selectAllRevisionMap();
        List<OsRevisionRuleVO> versionRuleList = new ArrayList<>();
        vrIdList.stream().forEach(vrId->{
            OsRevisionRuleVO versionRuleVO = revisionRuleVOMap.getOrDefault(vrId.toLowerCase(Locale.ROOT),null);
            if(versionRuleVO!=null){
                versionRuleList.add(versionRuleVO);
            }
        });
        return versionRuleList;
    }
    /**
     * æŸ¥è¯¢åº”用范围
     * @param vrName ç‰ˆæœ¬è§„则英文名称
     * @return
     */
    @Override
    public List<Map<String, String>> getUsedVersionRuleList(String vrName) throws PLException {
        if(Func.isBlank(vrName)){
            throw new PLException("500",new String[]{"请选择要查询应用范围的属性!"});
        }
        String[] btNames = platformClientUtil.getBtmService().getBTNamesByVerName(vrName);
        if(Func.isEmpty(btNames)){
            return new ArrayList<>();
        }
        List<Map<String,String>> btmNameMapList = new ArrayList<>();
        Arrays.stream(btNames).forEach(btName->{
            Map<String, String> itemMap = new HashMap<>();
            itemMap.put("versionRuleName",vrName);
            itemMap.put("source",btName);
            btmNameMapList.add(itemMap);
        });
        return btmNameMapList;
    }
    /**
     * å¯¼å‡ºé€‰ä¸­çš„版本规则
     * @param exportFileName å¯¼å‡ºçš„æ–‡ä»¶å
     * @param vrNames éœ€è¦å¯¼å‡ºçš„版本规则名称
     * @param flag æŽ§åˆ¶å¯¼å‡ºçš„列名是否和导入模板一致
     * @return
     */
    @Override
    public String exportVersionRule(String exportFileName, String vrNames, boolean flag) throws PLException {
        if(Func.isBlank(vrNames)){
            throw new PLException("500",new String[]{"请勾选要导出的版本规则!"});
        }
        //界面没传名称,使用默认导出名称
        exportFileName = Func.isBlank(exportFileName) ?  "版本规则导出_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName;
        //设置列名
        List<String> columns = this.getCloumns(flag);
        //写excel
        String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName +  ".xls";
        try {
            new File(excelPath).createNewFile();
        } catch (Throwable e) {
            throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[]{excelPath}, e);
        }
        //设置列
        List<WriteExcelData> excelDataList = new ArrayList<>();
        //设置列头
        for (int index = 0; index < columns.size(); index++) {
            excelDataList.add(new WriteExcelData(0,index, columns.get(index)));
        }
        //按照版本规则名查询,然后处理版本规则导出
        List<String> vrIdList = Func.toStrList(vrNames);
        List<OsRevisionRuleVO> revisionRuleVOList = this.getRevisionRuleByIds(vrIdList);
        if(Func.isEmpty(revisionRuleVOList)){
            excelDataList.add(new WriteExcelData(1,1, "根据名称未查询到版本规则信息,请刷新后尝试重新导出!"));
        }else{
            for (int i = 0; i < revisionRuleVOList.size(); i++) {
                OsRevisionRuleVO revisionRuleVO = revisionRuleVOList.get(i);
                excelDataList.add(new WriteExcelData(i+1,0, revisionRuleVO.getId()));
                excelDataList.add(new WriteExcelData(i+1,1, revisionRuleVO.getName()));
                excelDataList.add(new WriteExcelData(i+1,2, revisionRuleVO.getJumpCharacter()));
                excelDataList.add(new WriteExcelData(i+1,3, revisionRuleVO.getInitialValue()));
                excelDataList.add(new WriteExcelData(i+1,4, revisionRuleVO.getStepLength()));
                excelDataList.add(new WriteExcelData(i+1,5, revisionRuleVO.getPrefixion()));
                excelDataList.add(new WriteExcelData(i+1,6, revisionRuleVO.getSuffix()));
                excelDataList.add(new WriteExcelData(i+1,7, revisionRuleVO.getDescription()));
                if(!flag){
                    excelDataList.add(new WriteExcelData(i+1,8, Func.format(revisionRuleVO.getCreateTime(),"yyyyå¹´MM月dd日 hh:mm:ss")));
                }
            }
        }
        WriteExcelOption excelOption = new WriteExcelOption(excelDataList);
        ExcelUtil.writeDataToFile(excelPath, excelOption);
        return excelPath;
    }
    /**
     * ä¸‹è½½ç‰ˆæœ¬è§„则导入模板
     * @param exportFileName
     * @return
     * @throws PLException
     */
    @Override
    public String downloadVersionRuleTemplate(String exportFileName) throws Exception {
        //界面没传名称,使用默认导出名称
        exportFileName = Func.isBlank(exportFileName) ?  "版本规则导入模板_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName;
        //设置列名
        List<String> columns = this.getCloumns(true);
        //设置必填列
        ColumnNameisRed.clear();
        ColumnNameisRed.add(0);
        ColumnNameisRed.add(3);
        ColumnNameisRed.add(4);
        //写excel
        String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName +  ".xls";
        try {
            new File(excelPath).createNewFile();
        } catch (Throwable e) {
            throw new VciBaseException(LangBaseUtil.getErrorMsg(e), new String[]{excelPath}, e);
        }
        //设置列
        List<WriteExcelData> excelDataList = new ArrayList<>();
        //设置列头
        for (int index = 0; index < columns.size(); index++) {
            //判断是否为必填列,给必填列设置颜色
            if(ColumnNameisRed.contains(index)){
                WriteExcelData excelData = new WriteExcelData(0, index, columns.get(index));
                excelData.setFontColor(String.valueOf(HSSFColor.HSSFColorPredefined.RED.getIndex()));
                excelDataList.add(excelData);
            }else{
                excelDataList.add(new WriteExcelData(0,index, columns.get(index)));
            }
        }
        WriteExcelOption excelOption = new WriteExcelOption(excelDataList);
        ExcelUtil.writeDataToFile(excelPath, excelOption);
        return excelPath;
    }
    /**
     * å¯¼å…¥ç‰ˆæœ¬è§„则
     * @param file
     * @return
     */
    @Override
    public BaseResult importVersionRules(File file) throws Exception {
        VciBaseUtil.alertNotNull(file,"excel文件");
        if(!file.exists()){
            throw new VciBaseException("导入的excel文件不存在,{0}",new String[]{file.getPath()});
        }
        try{
            //1、读取excel中的数据,组成对象
            ReadExcelOption excelOption = new ReadExcelOption();
            List<OsRevisionRulePO> poList = ExcelUtil.readDataObjectFromExcel(file, OsRevisionRulePO.class,excelOption,(value, po, fieldName)->{});
            //去除都是空的情况
            if(CollectionUtils.isEmpty(poList)){
                return BaseResult.fail(ExcelLangCodeConstant.IMPORT_CONTENT_NULL,new String[]{});
            }
            //excel判重,数据校验,dto对象转换,存储对象转换,执行保存
            List<OsRevisionRuleDTO> dtoList = new ArrayList<>();
            //当前excel中是否重复用的判重Map:(key:判重版本规则名,value:行号)
            Map<String, String> excelReapeat = new HashMap<>();
            //数据库查询是否有已存在的枚举名,方便后续做判重处理
            List<OsRevisionRuleVO> versionRuleVOList = this.getRevisionRuleByIds(poList.stream().map(OsRevisionRulePO::getId).collect(Collectors.toSet()));
            List<String> repeatVrId = new ArrayList<>();
            if(Func.isNotEmpty(versionRuleVOList)){
                repeatVrId = versionRuleVOList.stream().map(OsRevisionRuleVO::getId).collect(Collectors.toList());
            }
            //判断必填属性是否为空和其他校验
            List<String> finalRepeatVrId = repeatVrId;
            poList.stream().forEach(vrPO -> {
                if(Func.isBlank(vrPO.getId())){//版本规则名判空
                    throw new VciBaseException("第【"+vrPO.getRowIndex()+"】行,versionrulenameerror");
                }else if(excelReapeat.containsKey(vrPO.getId())){//版本规则名表格中判重
                    throw new VciBaseException("第【"+excelReapeat.get(vrPO.getId())+"】行和第【"+vrPO.getRowIndex()+"】行数据,名称重复");
                }else if (Func.isNotEmpty(finalRepeatVrId) && finalRepeatVrId.contains(vrPO.getId())){//判断名称是否与系统中重复
                    throw new VciBaseException("第【"+vrPO.getRowIndex()+"】行,名称在系统中已经存在,请修改!");
                }
                //版本规则名excel中判重处理
                excelReapeat.put(vrPO.getId(),vrPO.getRowIndex());
                OsRevisionRuleDTO revisionRuleDTO = new OsRevisionRuleDTO();
                //revisionRuleDTO.setOid(VciBaseUtil.getPk().toUpperCase(Locale.ROOT));
                revisionRuleDTO.setId(vrPO.getId());
                revisionRuleDTO.setName(vrPO.getName());
                revisionRuleDTO.setJumpCharacter(vrPO.getJumpCharacter());
                revisionRuleDTO.setInitialValue(vrPO.getInitialValue());
                revisionRuleDTO.setStepLength(vrPO.getStepLength());
                revisionRuleDTO.setPrefixion(vrPO.getPrefixion());
                revisionRuleDTO.setSuffix(vrPO.getSuffix());
                revisionRuleDTO.setDescription(vrPO.getDescription());
                try {
                    //检查版本规则是否合规
                    checkVersionRule(revisionRuleDTO);
                } catch (PLException e) {
                    e.printStackTrace();
                    throw new VciBaseException(VciBaseUtil.getExceptionMessage(e));
                }
                dtoList.add(revisionRuleDTO);
            });
            //执行保存操作
            dtoList.stream().forEach(dto->{
                try {
                    boolean b = platformClientUtil.getVersionService().addVersionRule(dto2VersionRule(dto));
                    if(!b){
                        throw new VciBaseException("save and return false");
                    }
                } catch (PLException e) {
                    e.printStackTrace();
                    throw new VciBaseException("执行保存时出现错误,错误版本规则对象名为:【" + dto.getId() + "】,原因:"+VciBaseUtil.getExceptionMessage(e));
                }
            });
        }catch (Exception e){
            if(logger.isErrorEnabled()){
                logger.error("读取excel内容时或保存用户信息时出现了错误,具体原因:",VciBaseUtil.getExceptionMessage(e));
            }
            e.printStackTrace();
            return BaseResult.fail(VciBaseUtil.getExceptionMessage(e),new String[]{},e);
        }
        return BaseResult.success("枚举导入成功!");
    }
    /**
     * èŽ·å–å¯¼å‡ºæˆ–å¯¼å…¥æ¨¡æ¿çš„åˆ—å
     * @param flag æ˜¯å¦èŽ·å–å¯¼å…¥æ¨¡æ¿åˆ—å
     * @return
     */
    private List<String> getCloumns(boolean flag){
        if(flag){
            return new ArrayList<>(
                    Arrays.asList(
                            "名称", "标签", "跳跃字符(以逗号分隔)",
                            "初始值", "步长", "前缀", "后缀", "描述"
                    )
            );
        }
        return new ArrayList<>(
                Arrays.asList(
                        "名称", "标签", "跳跃字符", "初始值", "步长",
                        "前缀", "后缀", "描述", "创建时间"
                )
        );
    }
    /**
     * æ¸…除缓存
     */
    @Override
    public void clearCache() {
    }
}
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsStatusServiceImpl.java
@@ -1,11 +1,7 @@
package com.vci.web.service.impl;
import com.vci.corba.common.PLException;
import com.vci.corba.omd.atm.AttributeDef;
import com.vci.corba.omd.stm.StatePool;
import com.vci.dto.OsAttributeDTO;
import com.vci.pagemodel.OsEnumVO;
import com.vci.po.OsAttributePO;
import com.vci.po.OsStatusPO;
import com.vci.starter.poi.bo.ReadExcelOption;
import com.vci.starter.poi.bo.WriteExcelData;
@@ -280,17 +276,19 @@
    public boolean addSave(OsStatusDTO statusDTO) throws Exception {
        VciBaseUtil.alertNotNull(
            statusDTO,"状态的信息",
            statusDTO.getId(),"状态的英文名称",
            statusDTO.getName(),"状态的中文名称"
            statusDTO.getId(),"状态的英文名称"
        );
        StatePool dbStatePool = platformClientUtil.getStatePoolService().getStatePool(statusDTO.getId());
        if (Func.isNotEmpty(dbStatePool) && Func.isNotBlank(dbStatePool.oid)) {
            throw new PLException("500",new String[]{"名称重复请更换名称!"});
        if (statusDTO.getId().length()>50) {
            throw new PLException("500",new String[]{"状态英文名称不能超过50个字符!"});
        }
        // çŠ¶æ€æ± åç§°åªèƒ½ä¸ºè‹±æ–‡å­—æ¯
        String regex = "[a-z A-Z]*";
        if ((!statusDTO.getId().matches(regex))) {
        if (!statusDTO.getId().matches(regex)) {
            throw new PLException("500",new String[]{"名称只能为英文!"});
        }
        StatePool dbStatePool = platformClientUtil.getStatePoolService().getStatePool(statusDTO.getId());
        if (Func.isNotEmpty(dbStatePool) && Func.isNotBlank(dbStatePool.oid)) {
            throw new PLException("500",new String[]{"名称重复请更换名称!"});
        }
        //虽然会自动生成oid,但是这儿设置主键,避免放入缓存的数据是没有oid的
        statusDTO.setOid(VciBaseUtil.getPk().toUpperCase(Locale.ROOT));
@@ -351,26 +349,23 @@
        for(OsStatusDTO statusDTO : osStatusDTOS){
            //oid和ts判空
            String oid = statusDTO.getOid();
            //name主要用来对缓存数据删除
            String name = statusDTO.getName();
            //id主要用来对缓存数据删除
            String id = statusDTO.getId();
            //后台会用ts进行数据一致性校验
            Date ts = statusDTO.getTs();
            if(Func.isBlank(oid) || Func.isBlank(name) || Func.isEmpty(ts)){
            if(Func.isBlank(oid) || Func.isBlank(id) || Func.isEmpty(ts)){
                throw new PLException("500",new String[]{"待删除的状态列表中主键【oid】、调整时间【ts】、状态名称【name】不能为空!"});
            }
            StatePool statePool = new StatePool();
            statePool.oid = oid;
            statePool.name = name;
            statePool.name = id;
            statePool.ts = Func.format(ts,VciDateUtil.DateTimeMillFormat);
            statePoolList.add(statePool);
            boolean res = platformClientUtil.getStatePoolService().deleteStatePool(statePool);
            if(!res){
                throw new PLException("500",new String[]{"删除状态名称为【" + name + "】的数据时出现错误!"});
            }
        }
        boolean res = platformClientUtil.getStatePoolService().deleteStatePools(statePoolList.toArray(new StatePool[statePoolList.size()]));
        //clearCache();
        self.selectAllStatusMap();
        return true;
        return res;
    }
    /**
@@ -384,7 +379,7 @@
        statePool.oid = statusDTO.getOid();
        statePool.id = "";
        statePool.name = statusDTO.getId();
        statePool.imagePath = statusDTO.getImagePath();
        //statePool.imagePath = statusDTO.getImagePath();
        statePool.description = statusDTO.getDescription()==null?"":statusDTO.getDescription();
        String userId = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
        long now = VciDateUtil.getNowTime();
@@ -404,14 +399,14 @@
     * @return
     */
    @Override
    public String exportStatus(String exportFileName, String statusOids) throws PLException {
    public String exportStatus(String exportFileName, String statusOids,boolean flag/*控制导出的列名是否和导入模板一致*/) throws PLException {
        if(Func.isBlank(statusOids)){
            throw new PLException("500",new String[]{"请勾选要导出的属性!"});
        }
        //界面没传名称,使用默认导出名称
        exportFileName = Func.isBlank(exportFileName) ?  "状态池状态导出_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName;
        //设置列名
        List<String> columns = new ArrayList<>(Arrays.asList("名称", "标签", "图片", "描述"));
        List<String> columns = this.getCloumns(flag);
        //写excel
        String excelPath = LocalFileUtil.getDefaultTempFolder() + File.separator + exportFileName +  ".xls";
@@ -433,7 +428,7 @@
            OsStatusVO osStatusVO = this.getObjectByOid(oid);
            excelDataList.add(new WriteExcelData(i.get(),0, osStatusVO.getId()));
            excelDataList.add(new WriteExcelData(i.get(),1, osStatusVO.getName()));
            excelDataList.add(new WriteExcelData(i.get(),2, osStatusVO.getImagePath()));
            //excelDataList.add(new WriteExcelData(i.get(),2, osStatusVO.getImagePath()));
            excelDataList.add(new WriteExcelData(i.get(),3, osStatusVO.getDescription()));
            i.getAndIncrement();
        });
@@ -453,9 +448,7 @@
        //界面没传名称,使用默认导出名称
        exportFileName = Func.isBlank(exportFileName) ?  "状态池导入模板_" + Func.format(new Date(),"yyyy-MM-dd HHmmss.sss"):exportFileName;
        //设置列名
        List<String> columns = new ArrayList<>(
                Arrays.asList("名称(不能为空)", "标签(对名称的解释)","图片(路径)", "描述(可以为空)")
        );
        List<String> columns = this.getCloumns(true);
        //设置必填列
        ColumnNameisRed.clear();
        ColumnNameisRed.add(0);
@@ -486,6 +479,20 @@
    }
    /**
     * èŽ·å–å¯¼å‡ºæˆ–å¯¼å…¥æ¨¡æ¿çš„åˆ—å
     * @param flag æ˜¯å¦èŽ·å–å¯¼å…¥æ¨¡æ¿åˆ—å
     * @return
     */
    private List<String> getCloumns(boolean flag){
        if(flag){
            return new ArrayList<>(
                    Arrays.asList("名称(不能为空)", "标签(对名称的解释)"/*,"图片(路径)"*/, "描述(可以为空)")
            );
        }
        return new ArrayList<>(Arrays.asList("名称", "标签"/*, "图片"*/, "描述"));
    }
    /**
     * å¯¼å…¥çŠ¶æ€
     * @param file
     * @return
@@ -508,7 +515,6 @@
            List<StatePool> statePoolList = new ArrayList<>();
            //当前excel中是否重复用的判重Map:(key:判重属性,value:行号)
            Map<String, String> excelReapeat = new HashMap<>();
            //判断必填属性是否为空,用户是否已存在,以及部门是否填错等校验逻辑
            poList.stream().forEach(osStatusPO -> {
                try {
                    StatePool dbStatePool = platformClientUtil.getStatePoolService().getStatePool(osStatusPO.getId());
@@ -518,14 +524,14 @@
                } catch (PLException e) {
                    e.printStackTrace();
                    logger.error(e.getMessage());
                    throw new VciBaseException(e.getMessage());
                    throw new VciBaseException(VciBaseUtil.getExceptionMessage(e));
                }
                if(Func.isBlank(osStatusPO.getId())){//属性名判空
                    throw new VciBaseException("第【"+osStatusPO.getRowIndex()+"】行,enumnameerror");
                if(Func.isBlank(osStatusPO.getId())){//状态名判空
                    throw new VciBaseException("第【"+osStatusPO.getRowIndex()+"】行,statusnameerror");
                }else if(!osStatusPO.getId().matches("[a-z A-Z]*")){
                    // çŠ¶æ€æ± åç§°åªèƒ½ä¸ºè‹±æ–‡å­—æ¯
                    throw new VciBaseException("名称只能为英文!");
                }else if(excelReapeat.containsKey(osStatusPO.getId())){//属性名表格中判重
                }else if(excelReapeat.containsKey(osStatusPO.getId())){//状态名表格中判重
                    throw new VciBaseException("第【"+excelReapeat.get(osStatusPO.getId())+"】行和第【"+osStatusPO.getRowIndex()+"】行数据,名称重复");
                }
                //状态名excel中判重处理
@@ -534,7 +540,7 @@
                osStatusDTO.setOid(VciBaseUtil.getPk().toUpperCase(Locale.ROOT));
                osStatusDTO.setId(osStatusPO.getId());
                osStatusDTO.setName(osStatusPO.getName());
                osStatusDTO.setImagePath(osStatusPO.getImagePath());
                //osStatusDTO.setImagePath(osStatusPO.getImagePath());
                osStatusDTO.setDescription(osStatusPO.getDescription());
                statePoolList.add(statusDTO2DO(osStatusDTO));
@@ -548,7 +554,7 @@
            e.printStackTrace();
            return BaseResult.fail(VciBaseUtil.getExceptionMessage(e),new String[]{},e);
        }
        return BaseResult.success("枚举导入成功!");
        return BaseResult.success("状态导入成功!");
    }
    /**
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/UIDataServiceImpl.java
@@ -2042,7 +2042,7 @@
                    if (ruleVO == null || StringUtils.isBlank(ruleVO.getOid())) {
                        throw new VciBaseException("{0}里的版本规则设置得不正确,在系统中没有找到{1}这个版本规则", new String[]{btmTypeVO.getName(), btmTypeVO.getRevisionRuleId()});
                    }
                    cbo.revisionValue = ruleVO.getStartCode();
                    cbo.revisionValue = ruleVO.getInitialValue();
                }
                if (StringUtils.isBlank(cbo.nameoid)) {
                    cbo.nameoid = VciBaseUtil.getPk();
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebBoServiceImpl.java
@@ -196,7 +196,7 @@
        bo.versionRule = String.valueOf(btmTypeVO.getVersionRule());
        if(StringUtils.isNotBlank(btmTypeVO.getRevisionRuleId())){
            OsRevisionRuleVO revisionRuleVO = revisionRuleService.getRevisionRuleById(btmTypeVO.getRevisionRuleId());
            bo.revisionValue = revisionRuleVO.getStartCode();
            bo.revisionValue = revisionRuleVO.getInitialValue();
        }
        bo.revisionSeq = (short) 1;