Commit 04233124 authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/first' into first

parents 96883dac 055f2daf
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 子证状态(0.禁用,1.启用)枚举类
*
* @author zxfei
*/
public enum ChildStatusEnum {
禁用(0, "禁用"),
启用(1, "启用");
private Integer value;
private String desc;
ChildStatusEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static ChildStatusEnum getByValue(Integer value) {
for (ChildStatusEnum childStatusEnum : ChildStatusEnum.values()) {
if (childStatusEnum.getValue() == value) {
return childStatusEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (ChildStatusEnum item : ChildStatusEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 删除状态(0.未删除,1.已删除)枚举类
*
* @author zxfei
*/
public enum DeletedEnum {
未删除(0, "未删除"),
已删除(1, "已删除");
private Integer value;
private String desc;
DeletedEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static DeletedEnum getByValue(Integer value) {
for (DeletedEnum deletedEnum : DeletedEnum.values()) {
if (deletedEnum.getValue() == value) {
return deletedEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (DeletedEnum item : DeletedEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
......@@ -57,11 +57,10 @@ public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<Ch
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "legalPersonName", LegalPersonNameEnum.getEnumMap());
this.addDict(model, "processStatus", ProcessStatusEnum.getEnumMap());
this.addDict(model, "childStatus", ChildStatusEnum.getEnumMap());
this.addDict(model, "deleted", DeletedEnum.getEnumMap());
this.addDict(model, "documentId", certificateDocumentService.find(new CertificateDocumentQuery())
.stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getDocumentName(), (o, n) -> n)));
super.init(model, context);
}
......
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