package com.changhong.epc.bean.tenant.norm.extend;
|
|
import com.alibaba.fastjson.annotation.JSONField;
|
import com.changhong.epc.bean.tenant.norm.AppStanderDef;
|
import com.changhong.epc.bean.tenant.norm.way.EleType;
|
import com.iemsoft.framework.cloud.core.tools.ObjectUtil;
|
import lombok.EqualsAndHashCode;
|
|
import java.util.List;
|
import java.util.Objects;
|
|
@EqualsAndHashCode(callSuper=true)
|
public class AppStanderExtend extends AppStanderDef {
|
|
private static final long serialVersionUID = 1L;
|
|
|
private Object asDefValue;
|
|
private EleType eleType;
|
@JSONField(serialize=false)
|
public EleType getEleType() {
|
try {
|
return EleType.valueOf(this.getType());
|
} catch (Exception e) {
|
return EleType.QT;
|
}
|
}
|
|
public Object getAsDefValue() {
|
if(asDefValue instanceof String){
|
if(Objects.toString(asDefValue, "").indexOf('{') == 0){
|
return asDefValue;
|
}else {
|
return Objects.toString(asDefValue, "").split(",");
|
}
|
}else {
|
return this.getString((List<Object>)asDefValue);
|
}
|
}
|
|
public AppStanderExtend() {
|
}
|
|
public AppStanderExtend(AppStanderExtend def) {
|
this.setId(def.getId());
|
this.setElIden(def.getElIden());
|
this.setMasDefineCode(def.getMasDefineCode());
|
this.setType(def.getType());
|
this.setDefType(def.getDefType());
|
this.setDefName(def.getDefName());
|
this.setRowNo(def.getRowNo());
|
this.setSqu(def.getSqu());
|
this.setShowFlag(def.getShowFlag());
|
this.setRelation(def.getRelation());
|
this.setInverse(def.getInverse());
|
this.setShowCount(def.getShowCount());
|
this.setCount(def.getCount());
|
this.setSsId(def.getSsId());
|
this.setInsP(def.getInsP());
|
this.setInsT(def.getInsT());
|
this.setUpdP(def.getUpdP());
|
this.setUpdT(def.getUpdT());
|
this.setDataStart(def.getDataStart());
|
}
|
|
|
|
|
public void setAsDefValue(Object asDefValue) {
|
if(asDefValue instanceof Integer){
|
asDefValue = Objects.toString(asDefValue);
|
}
|
|
this.asDefValue = asDefValue;
|
}
|
|
public String getString(List<Object> array){
|
if(ObjectUtil.empty(array)){
|
return "";
|
}else{
|
StringBuilder sb = new StringBuilder();
|
for(Object str: array){
|
sb.append(str).append(',');
|
}
|
return sb.toString().replaceAll(",$", "");
|
}
|
}
|
|
}
|