瀏覽代碼

增加是否临时增补字段

master
WendyYang 1 年之前
父節點
當前提交
2de8c4f544
共有 2 個檔案被更改,包括 24 行新增3 行删除
  1. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java
  2. +22
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sys/model/enumeration/DataScopeEnum.java

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java 查看文件

@@ -145,7 +145,7 @@ public class AnnualPlanLibManage {
try (InputStream inputStream = file.getInputStream()) {
EasyExcel.read(inputStream, new AnalysisEventListener<AnnualLibImportDTO>() {

private List<Project> records = new ArrayList<>();
private final List<Project> records = new ArrayList<>();

@Override
public void onException(Exception exception, AnalysisContext context) throws Exception {
@@ -179,7 +179,7 @@ public class AnnualPlanLibManage {
project.setBeginTime(dataArr[0].trim());
project.setEndTime(dataArr[1].trim());
project.setProjectIntroduction(data.getProjectIntroduction());
project.setIsFirst(data.getIsFirst().equals("新建") ? 1 : 0);
project.setIsFirst("新建".equals(data.getIsFirst()) ? 1 : 0);
records.add(project);
}



+ 22
- 1
pmapi/src/main/java/com/ningdatech/pmapi/sys/model/enumeration/DataScopeEnum.java 查看文件

@@ -2,9 +2,11 @@ package com.ningdatech.pmapi.sys.model.enumeration;

import lombok.Getter;

import java.util.Arrays;

/**
* <p>
* DataScopeEnum
* 数据权限可见范围枚举
* </p>
*
* @author WendyYang
@@ -28,4 +30,23 @@ public enum DataScopeEnum {
this.code = code;
this.desc = desc;
}

public boolean eq(Integer code) {
return this.code.equals(code);
}

/**
* 根据code获取枚举实例
*
* @param code 编码
* @return {@link DataScopeEnum}
* @author WendyYang
**/
public static DataScopeEnum getByCode(Integer code) {
return Arrays.stream(values())
.filter(w -> w.eq(code))
.findFirst()
.orElseThrow(() -> new IllegalArgumentException("无效的数据权限可见范围编码"));
}

}

Loading…
取消
儲存