dashboard部分功能

修复bug
yun-zuoyi
yunhao.wang 7 years ago
parent 4a89439b30
commit bb289774d9

@ -96,16 +96,43 @@ public class BaseResultBean<Obj> {
} }
public static BaseResultBean buildBaseResultBean(boolean success,String msg){ public static BaseResultBean buildBaseResultBean(boolean success,String msg){
BaseResultBean rs = new BaseResultBean(); BaseResultBean rs = new BaseResultBean();
rs.success = success; rs.success = success;
if(success) { if (success) {
rs.msg = msg; rs.msg = msg;
rs.code = ResourceEnumUtil.MESSAGE.SUCCESS.getCode(); rs.code = ResourceEnumUtil.MESSAGE.SUCCESS.getCode();
}else { } else {
rs.code = ResourceEnumUtil.MESSAGE.FAIL.getCode(); rs.code = ResourceEnumUtil.MESSAGE.FAIL.getCode();
rs.errorMsg = msg; rs.errorMsg = msg;
} }
return rs; return rs;
} }
public BaseResultBean setResultList(List<Obj> resultList) {
this.resultList = resultList;
return this;
}
public BaseResultBean setResultObject(Obj resultObject) {
this.resultObject = resultObject;
return this;
}
public BaseResultBean setResultMap(Map<String, Object> resultMap) {
this.resultMap = resultMap;
return this;
}
public BaseResultBean setPager(Pager pager) {
this.pager = pager;
return this;
}
public BaseResultBean setListPager(ListPager<Obj> listPager) {
this.listPager = listPager;
this.setPager(listPager.getObjectPager());
this.setResultList(listPager.getObjectList());
return this;
}
} }

@ -615,27 +615,53 @@ public class CommonEnumUtil {
* *
*/ */
@JsonFormat(shape = JsonFormat.Shape.OBJECT) @JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum CLOUD_STATUS { public enum CLOUD_APP_STATUS {
REGISTERED(1, "注册"), UP(1,"UP" ,"在线"),
DISCONNECT(2, "断开"); DOWN(2, "DOWN","断线");
private int value; private int value;
private String code;
private String description; private String description;
private CLOUD_APP_STATUS(int value, String code, String description) {
this.value = value;
this.code = code;
this.description = description;
}
public int getValue() { public int getValue() {
return value; return value;
} }
public String getCode() {
return code;
}
public String getDescription() { public String getDescription() {
return description; return description;
} }
private CLOUD_STATUS(int value, String description) { public static String valueOfCode(int val) {
this.value = value; String tmp = null;
this.description = description; for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].code;
}
}
return tmp;
} }
public static String valueOf(int val) { public static int codeOfValue(String code) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].code.equals(code)) {
tmp = values()[i].value;
}
}
return tmp;
}
public static String valueOfDescription(int val) {
String tmp = null; String tmp = null;
for (int i = 0; i < values().length; i++) { for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) { if (values()[i].value == val) {
@ -644,6 +670,16 @@ public class CommonEnumUtil {
} }
return tmp; return tmp;
} }
public static String codeOfDescription(String code) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].code.equals(code)) {
tmp = values()[i].description;
}
}
return tmp;
}
} }
} }

@ -209,6 +209,16 @@ public class ImppEnumUtil {
return tmp; return tmp;
} }
public static String valueOfName(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].name;
}
}
return tmp;
}
public static String codeOfDescription(String code) { public static String codeOfDescription(String code) {
String tmp = null; String tmp = null;
for (int i = 0; i < values().length; i++) { for (int i = 0; i < values().length; i++) {

@ -1,6 +1,7 @@
package cn.estsh.i3plus.pojo.platform.bean; package cn.estsh.i3plus.pojo.platform.bean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean; import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.Data; import lombok.Data;
@ -33,6 +34,14 @@ public class SysLogException extends BaseBean {
@ApiParam(value ="系统模块(枚举)", example = "1") @ApiParam(value ="系统模块(枚举)", example = "1")
private Integer excModule; private Integer excModule;
private String excModuleName;
public String getExcModuleName(){
if(this.excModule != null){
return CommonEnumUtil.SOFT_TYPE.valueOfDescription(this.excModule);
}
return excModuleName;
}
@Column(name="EXC_CLASS_NAME") @Column(name="EXC_CLASS_NAME")
@ApiParam(value ="异常类名") @ApiParam(value ="异常类名")
private String excClassName; private String excClassName;

@ -1,6 +1,7 @@
package cn.estsh.i3plus.pojo.platform.bean; package cn.estsh.i3plus.pojo.platform.bean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean; import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -35,6 +36,14 @@ public class SysLogOperate extends BaseBean {
@ApiParam(value ="系统模块(枚举)", example = "1") @ApiParam(value ="系统模块(枚举)", example = "1")
private Integer operateModule; private Integer operateModule;
private String operateModuleName;
public String getOperateModuleName(){
if(this.operateModule != null){
return CommonEnumUtil.SOFT_TYPE.valueOfDescription(this.operateModule);
}
return operateModuleName;
}
//ImppEnumUtil.OPERATE_TYPE枚举 //ImppEnumUtil.OPERATE_TYPE枚举
@Column(name="OPERATE_TYPE") @Column(name="OPERATE_TYPE")
@ApiParam(value ="操作类型" , example = "-1") @ApiParam(value ="操作类型" , example = "-1")

Loading…
Cancel
Save