Commit e6edd17c by 翁国栋

解决导入保单时用户名为空

parent d669820f
package cn.timer.api.controller.insure.enums; package cn.timer.api.controller.insure.enums;
import io.swagger.models.auth.In; import cn.timer.api.utils.ExcelUtils;
import lombok.Data;
/** /**
* @Description TODO * @Description TODO
* @Author wgd * @Author wgd
* @Date 2022/3/24 17:20 * @Date 2022/3/24 17:20
*/ */
public enum InsuranceEnum { public enum PlanEnum {
A_30(12,"30万意外/3万医疗/扩展24小时(A类)","A类","36968","63119"), A_30(12,"30万意外/3万医疗/扩展24小时(A类)","A类","36968","63119"),
A_50(15,"50万意外/5万医疗/扩展24小时(A类)","A类","36969","63119"), A_50(15,"50万意外/5万医疗/扩展24小时(A类)","A类","36969","63119"),
A_80(18,"80万意外/10万医疗/扩展24小时(A类)","A类","36970","63119"), A_80(18,"80万意外/10万医疗/扩展24小时(A类)","A类","36970","63119"),
...@@ -27,7 +26,7 @@ public enum InsuranceEnum { ...@@ -27,7 +26,7 @@ public enum InsuranceEnum {
private String plan; private String plan;
private String category; private String category;
InsuranceEnum(Integer price, String name,String type,String plan,String category) { PlanEnum(Integer price, String name, String type, String plan, String category) {
this.price = price; this.price = price;
this.name = name; this.name = name;
this.type=type; this.type=type;
...@@ -75,11 +74,14 @@ public enum InsuranceEnum { ...@@ -75,11 +74,14 @@ public enum InsuranceEnum {
this.category = category; this.category = category;
} }
public static InsuranceEnum getEnum(String plan,String category) { public static PlanEnum getEnum(String plan, String category) {
for(InsuranceEnum v : values()) for(PlanEnum v : values())
if(v.getPlan().equals(plan)&&v.getCategory().equals(category)) return v; if(v.getPlan().equals(plan)&&v.getCategory().equals(category)) return v;
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
public static PlanEnum getEnumOfName(String name){
for(PlanEnum v : values())
if(v.getName().equals(name)) return v;
throw new IllegalArgumentException();
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment