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){
BaseResultBean rs = new BaseResultBean();
BaseResultBean rs = new BaseResultBean();
rs.success = success;
if(success) {
if (success) {
rs.msg = msg;
rs.code = ResourceEnumUtil.MESSAGE.SUCCESS.getCode();
}else {
} else {
rs.code = ResourceEnumUtil.MESSAGE.FAIL.getCode();
rs.errorMsg = msg;
}
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)
public enum CLOUD_STATUS {
REGISTERED(1, "注册"),
DISCONNECT(2, "断开");
public enum CLOUD_APP_STATUS {
UP(1,"UP" ,"在线"),
DOWN(2, "DOWN","断线");
private int value;
private String code;
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() {
return value;
}
public String getCode() {
return code;
}
public String getDescription() {
return description;
}
private CLOUD_STATUS(int value, String description) {
this.value = value;
this.description = description;
public static String valueOfCode(int val) {
String tmp = null;
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;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
@ -644,6 +670,16 @@ public class CommonEnumUtil {
}
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;
}
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) {
String tmp = null;
for (int i = 0; i < values().length; i++) {

@ -1,6 +1,7 @@
package cn.estsh.i3plus.pojo.platform.bean;
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.ApiParam;
import lombok.Data;
@ -33,6 +34,14 @@ public class SysLogException extends BaseBean {
@ApiParam(value ="系统模块(枚举)", example = "1")
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")
@ApiParam(value ="异常类名")
private String excClassName;

@ -1,6 +1,7 @@
package cn.estsh.i3plus.pojo.platform.bean;
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.ser.std.ToStringSerializer;
import io.swagger.annotations.Api;
@ -35,6 +36,14 @@ public class SysLogOperate extends BaseBean {
@ApiParam(value ="系统模块(枚举)", example = "1")
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枚举
@Column(name="OPERATE_TYPE")
@ApiParam(value ="操作类型" , example = "-1")

Loading…
Cancel
Save