|
|
@@ -3,6 +3,8 @@ package com.shkpr.service.customgateway.core.constants;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.Getter;
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
+
|
|
|
/**
|
|
|
* 营销抄表类型
|
|
|
*
|
|
|
@@ -11,25 +13,25 @@ import lombok.Getter;
|
|
|
*/
|
|
|
@Getter
|
|
|
@AllArgsConstructor
|
|
|
-public enum CustomerReadType implements ExcelEnum{
|
|
|
+public enum CustomerReadType implements ExcelEnum {
|
|
|
//无抄表周期信息
|
|
|
NO_CYCLE_INFO((short) 0, "无抄表周期信息"),
|
|
|
//每月抄表
|
|
|
- MONTHLY((short)1, "月抄"),
|
|
|
+ MONTHLY((short) 1, "月抄"),
|
|
|
//单月抄表
|
|
|
- SINGLE_MONTH((short)2, "单月抄"),
|
|
|
+ SINGLE_MONTH((short) 2, "单月抄"),
|
|
|
//双月抄表
|
|
|
- DOUBLE_MONTH((short)3, "双月抄"),
|
|
|
+ DOUBLE_MONTH((short) 3, "双月抄"),
|
|
|
//季度上抄表
|
|
|
- QUARTER_FIRST((short)4, "季度上抄"),
|
|
|
+ QUARTER_FIRST((short) 4, "季度上抄"),
|
|
|
//季度中抄表
|
|
|
- QUARTER_MID((short)5, "季度中抄"),
|
|
|
+ QUARTER_MID((short) 5, "季度中抄"),
|
|
|
//季度下抄表
|
|
|
- QUARTER_LAST((short)6, "季度下抄"),
|
|
|
+ QUARTER_LAST((short) 6, "季度下抄"),
|
|
|
//半年抄表
|
|
|
- SEMI_ANNUAL((short)7, "半年抄"),
|
|
|
+ SEMI_ANNUAL((short) 7, "半年抄"),
|
|
|
//一月多抄
|
|
|
- MULTIPLE_PER_MONTH((short)9, "一月多抄"),
|
|
|
+ MULTIPLE_PER_MONTH((short) 9, "一月多抄"),
|
|
|
;
|
|
|
/**
|
|
|
* 码
|
|
|
@@ -40,6 +42,19 @@ public enum CustomerReadType implements ExcelEnum{
|
|
|
*/
|
|
|
private final String name;
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取code
|
|
|
+ *
|
|
|
+ * @param name 名称
|
|
|
+ * @return code
|
|
|
+ */
|
|
|
+ public static short getCode(String name) {
|
|
|
+ return Arrays.stream(values())
|
|
|
+ .filter(it -> it.getName().equals(name))
|
|
|
+ .findFirst().orElse(NO_CYCLE_INFO)
|
|
|
+ .getCode();
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public String getLabel() {
|
|
|
return this.name;
|