mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、新增BaseEnum、EnumConvert、EnumFormat:支持excel导出从枚举获取描述;2、购买记录、组织余额excel导出文件内容修正;
This commit is contained in:
+1
@@ -32,5 +32,6 @@ public class DictTypeConstants {
|
||||
|
||||
|
||||
public static final String ADVERTISEMENT_POSITION = "advertisement_position";
|
||||
public static final String PURCHASE_PAYMENT_METHOD = "diffPayStyle"; // 产品购买方式
|
||||
|
||||
}
|
||||
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
package com.cf.imes.module.system.enums.products;
|
||||
|
||||
import com.cf.imes.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 时长单位态枚举
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DurationUnitEnum implements IntArrayValuable {
|
||||
|
||||
YEAR(0, "年"),
|
||||
MONTH(1, "月"),
|
||||
DAY(2, "日");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(DurationUnitEnum::getStatus).toArray();
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
*/
|
||||
private final Integer status;
|
||||
/**
|
||||
* 状态名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
public static boolean isYear(String name) {
|
||||
return Objects.equals(YEAR.name, name);
|
||||
}
|
||||
|
||||
public static boolean isMonth(String name) {
|
||||
return Objects.equals(MONTH.name, name);
|
||||
}
|
||||
|
||||
public static boolean isDay(String name) {
|
||||
return Objects.equals(DAY.name, name);
|
||||
}
|
||||
|
||||
public static DurationUnitEnum fromStatus(Integer status) {
|
||||
return Arrays.stream(values())
|
||||
.filter(bean -> Objects.equals(bean.status, status))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user