Commit 97317e0e by liuyang

2024-04-25 设备日志和设备异常显示优化和调整

parent 316ce184
......@@ -386,6 +386,12 @@ public enum DdynamicEnum {
WORKER_BLOCK_ID("worker_block_id","userId","userName","HPPZ013.queryComboBox"),
PLAN_SALES_CODE_BLOCK_ID("planSalesCode_block_id","planSalesCode","yearMonth","HPPZ018.queryPlanSalesCode"),
/**
* 模块:设备编码
* 用途:设备日志下拉框
* 编写:ly
*/
DEVICE_CODE_BLOCK_ID("deviceCode_block_id","deviceCode","deviceName","HPSB003.queryDeviceCode"),
;
......
......@@ -52,7 +52,7 @@ public class LogInformationController {
if (equipmentType.equals(HPConstants.STARUS_TYPE)) {
//解析设备状态
List<CutterbarStatus> cutterbarStatusList = XmlUtils.readXml(hpsb00A.getDataContent(), CutterbarStatus.class);
hpsb002.setId(StringUtils.uuid());
//hpsb002.setId(StringUtils.uuid());
hpsb002.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb002.setEquipmentType(hpsb00A.getEquipmentType());
hpsb002.setLogValue(cutterbarStatusList.get(0).getStatus().toString());
......@@ -68,7 +68,7 @@ public class LogInformationController {
if (equipmentType.equals(HPConstants.TIME_TYPE)) {
//解析开机时间
List<CutterbarTime> cutterbarTimeList = XmlUtils.readXml(hpsb00A.getDataContent(), CutterbarTime.class);
hpsb002.setId(StringUtils.uuid());
//hpsb002.setId(StringUtils.uuid());
hpsb002.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb002.setEquipmentType(hpsb00A.getEquipmentType());
hpsb002.setLogValue(cutterbarTimeList.get(0).getTime());
......@@ -88,7 +88,7 @@ public class LogInformationController {
if (CollectionUtils.isNotEmpty(cutterbarWarningBaseList)) {
cutterbarWarning = CutterbarWarning.convertBase(cutterbarWarningBaseList.get(0));
}
hpsb001.setId(StringUtils.uuid());
//hpsb001.setId(StringUtils.uuid());
hpsb001.setErrorCode(cutterbarWarning.getErrorCode());
hpsb001.setPrio(cutterbarWarning.getPrio());
hpsb001.setProgramNo(cutterbarWarning.getProgramNo());
......
......@@ -59,7 +59,7 @@ public class CutterbarWarning {
warning.setFileName(base.getFileName());
}else if(no.compareTo(new Integer(300))>=0&&no.compareTo(new Integer(399))<=0){
warning.setRowNo(base.getArg1());
warning.setFileName(warning.getFileName());
warning.setFileName(warning.getFileName()==null?base.getFileName():warning.getFileName());
}
}
return warning;
......
......@@ -15,8 +15,54 @@ import com.baosight.iplat4j.core.util.StringUtils;
*
*/
public class HPSB001 extends DaoEPBase {
private String id = " "; /* ID*/
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* ID*/
public static final String FIELD_COMPANY_CODE = "companyCode";
public static final String FIELD_ERROR_CODE = "errorCode"; /* 异常编码*/
public static final String FIELD_PRIO = "prio"; /* 异常登记*/
public static final String FIELD_PROGRAM_NO = "programNo"; /* 程序号*/
public static final String FIELD_ROWNO = "rowno"; /* 行号*/
public static final String FIELD_GOTO_ROW_NONE = "gotoRowNone"; /* 不存在跳转行*/
public static final String FIELD_FILE_NAME = "fileName"; /* 文件名*/
public static final String FIELD_EQUIPMENT_TYPE = "equipmentType"; /* 设备状态*/
public static final String FIELD_EQUIPMENT_CODE = "equipmentCode"; /* 设备编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
public static final String FIELD_ERROR_TEXT = "errorText"; /* 异常文本*/
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE";
public static final String COL_ERROR_CODE = "ERROR_CODE"; /* 异常编码*/
public static final String COL_PRIO = "PRIO"; /* 异常登记*/
public static final String COL_PROGRAM_NO = "PROGRAM_NO"; /* 程序号*/
public static final String COL_ROWNO = "ROWNO"; /* 行号*/
public static final String COL_GOTO_ROW_NONE = "GOTO_ROW_NONE"; /* 不存在跳转行*/
public static final String COL_FILE_NAME = "FILE_NAME"; /* 文件名*/
public static final String COL_EQUIPMENT_TYPE = "EQUIPMENT_TYPE"; /* 设备状态*/
public static final String COL_EQUIPMENT_CODE = "EQUIPMENT_CODE"; /* 设备编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/
public static final String COL_ERROR_TEXT = "ERROR_TEXT"; /* 异常文本*/
public static final String QUERY = "t_hpsb001.query";
public static final String COUNT = "t_hpsb001.count";
public static final String INSERT = "t_hpsb001.insert";
public static final String UPDATE = "t_hpsb001.update";
public static final String DELETE = "t_hpsb001.delete";
private Long id = new Long(0); /* ID*/
private String companyCode = " ";
private String errorCode = " "; /* 异常编码*/
private String prio = " "; /* 异常登记*/
private String programNo = " "; /* 程序号*/
......@@ -31,103 +77,133 @@ public class HPSB001 extends DaoEPBase {
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = Integer.valueOf(0); /* 是否删除0.否1.是*/
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
private Integer deleteFlag = new Integer(0); /* 是否删除0.否1.是*/
private String errorText = " "; /* 异常文本*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("errorCode");
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ERROR_CODE);
eiColumn.setDescName("异常编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("prio");
eiColumn = new EiColumn(FIELD_PRIO);
eiColumn.setDescName("异常登记");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("programNo");
eiColumn = new EiColumn(FIELD_PROGRAM_NO);
eiColumn.setDescName("程序号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("rowno");
eiColumn = new EiColumn(FIELD_ROWNO);
eiColumn.setDescName("行号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("gotoRowNone");
eiColumn = new EiColumn(FIELD_GOTO_ROW_NONE);
eiColumn.setDescName("不存在跳转行");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("fileName");
eiColumn = new EiColumn(FIELD_FILE_NAME);
eiColumn.setDescName("文件名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("equipmentType");
eiColumn = new EiColumn(FIELD_EQUIPMENT_TYPE);
eiColumn.setDescName("设备状态");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("equipmentCode");
eiColumn = new EiColumn(FIELD_EQUIPMENT_CODE);
eiColumn.setDescName("设备编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdName");
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedName");
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("deleteFlag");
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除0.否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ERROR_TEXT);
eiColumn.setDescName("异常文本");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public HPSB001() {
initMetaData();
}
}
/**
* the constructor.
*/
public HPSB001() {
initMetaData();
}
/**
* get the id - ID
* get the id - ID.
* @return the id
*/
public String getId() {
public Long getId() {
return this.id;
}
/**
* set the id - ID
* set the id - ID.
*
* @param id - ID
*/
public void setId(String id) {
public void setId(Long id) {
this.id = id;
}
/**
* get the errorCode - 异常编码
* get the companyCode .
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode .
*
* @param companyCode
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the errorCode - 异常编码.
* @return the errorCode
*/
public String getErrorCode() {
......@@ -135,13 +211,15 @@ initMetaData();
}
/**
* set the errorCode - 异常编码
* set the errorCode - 异常编码.
*
* @param errorCode - 异常编码
*/
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
/**
* get the prio - 异常登记
* get the prio - 异常登记.
* @return the prio
*/
public String getPrio() {
......@@ -149,13 +227,15 @@ initMetaData();
}
/**
* set the prio - 异常登记
* set the prio - 异常登记.
*
* @param prio - 异常登记
*/
public void setPrio(String prio) {
this.prio = prio;
}
/**
* get the programNo - 程序号
* get the programNo - 程序号.
* @return the programNo
*/
public String getProgramNo() {
......@@ -163,13 +243,15 @@ initMetaData();
}
/**
* set the programNo - 程序号
* set the programNo - 程序号.
*
* @param programNo - 程序号
*/
public void setProgramNo(String programNo) {
this.programNo = programNo;
}
/**
* get the rowno - 行号
* get the rowno - 行号.
* @return the rowno
*/
public String getRowno() {
......@@ -177,13 +259,15 @@ initMetaData();
}
/**
* set the rowno - 行号
* set the rowno - 行号.
*
* @param rowno - 行号
*/
public void setRowno(String rowno) {
this.rowno = rowno;
}
/**
* get the gotoRowNone - 不存在跳转行
* get the gotoRowNone - 不存在跳转行.
* @return the gotoRowNone
*/
public String getGotoRowNone() {
......@@ -191,13 +275,15 @@ initMetaData();
}
/**
* set the gotoRowNone - 不存在跳转行
* set the gotoRowNone - 不存在跳转行.
*
* @param gotoRowNone - 不存在跳转行
*/
public void setGotoRowNone(String gotoRowNone) {
this.gotoRowNone = gotoRowNone;
}
/**
* get the fileName - 文件名
* get the fileName - 文件名.
* @return the fileName
*/
public String getFileName() {
......@@ -205,13 +291,15 @@ initMetaData();
}
/**
* set the fileName - 文件名
* set the fileName - 文件名.
*
* @param fileName - 文件名
*/
public void setFileName(String fileName) {
this.fileName = fileName;
}
/**
* get the equipmentType - 设备状态
* get the equipmentType - 设备状态.
* @return the equipmentType
*/
public String getEquipmentType() {
......@@ -219,13 +307,15 @@ initMetaData();
}
/**
* set the equipmentType - 设备状态
* set the equipmentType - 设备状态.
*
* @param equipmentType - 设备状态
*/
public void setEquipmentType(String equipmentType) {
this.equipmentType = equipmentType;
}
/**
* get the equipmentCode - 设备编码
* get the equipmentCode - 设备编码.
* @return the equipmentCode
*/
public String getEquipmentCode() {
......@@ -233,13 +323,15 @@ initMetaData();
}
/**
* set the equipmentCode - 设备编码
* set the equipmentCode - 设备编码.
*
* @param equipmentCode - 设备编码
*/
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
/**
* get the createdBy - 创建人
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
......@@ -247,13 +339,15 @@ initMetaData();
}
/**
* set the createdBy - 创建人
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
......@@ -261,13 +355,15 @@ initMetaData();
}
/**
* set the createdName - 创建人名称
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
......@@ -275,13 +371,15 @@ initMetaData();
}
/**
* set the createdTime - 创建时间
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
......@@ -289,13 +387,15 @@ initMetaData();
}
/**
* set the updatedBy - 更新人
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称
* get the updatedName - 更新人名称.
* @return the updatedName
*/
public String getUpdatedName() {
......@@ -303,13 +403,15 @@ initMetaData();
}
/**
* set the updatedName - 更新人名称
* set the updatedName - 更新人名称.
*
* @param updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
......@@ -317,13 +419,15 @@ initMetaData();
}
/**
* set the updatedTime - 更新时间
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除0.否1.是
* get the deleteFlag - 是否删除0.否1.是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
......@@ -331,58 +435,83 @@ initMetaData();
}
/**
* set the deleteFlag - 是否删除0.否1.是
* set the deleteFlag - 是否删除0.否1.是.
*
* @param deleteFlag - 是否删除0.否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("id")), id));
setErrorCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("errorCode")), errorCode));
setPrio(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("prio")), prio));
setProgramNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("programNo")), programNo));
setRowno(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("rowno")), rowno));
setGotoRowNone(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("gotoRowNone")), gotoRowNone));
setFileName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fileName")), fileName));
setEquipmentType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("equipmentType")), equipmentType));
setEquipmentCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("equipmentCode")), equipmentCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdName")), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedName")), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get("deleteFlag")), deleteFlag));
}
/**
* get the errorText - 异常文本.
* @return the errorText
*/
public String getErrorText() {
return this.errorText;
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("errorCode",StringUtils.toString(errorCode, eiMetadata.getMeta("errorCode")));
map.put("prio",StringUtils.toString(prio, eiMetadata.getMeta("prio")));
map.put("programNo",StringUtils.toString(programNo, eiMetadata.getMeta("programNo")));
map.put("rowno",StringUtils.toString(rowno, eiMetadata.getMeta("rowno")));
map.put("gotoRowNone",StringUtils.toString(gotoRowNone, eiMetadata.getMeta("gotoRowNone")));
map.put("fileName",StringUtils.toString(fileName, eiMetadata.getMeta("fileName")));
map.put("equipmentType",StringUtils.toString(equipmentType, eiMetadata.getMeta("equipmentType")));
map.put("equipmentCode",StringUtils.toString(equipmentCode, eiMetadata.getMeta("equipmentCode")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdName",StringUtils.toString(createdName, eiMetadata.getMeta("createdName")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedName",StringUtils.toString(updatedName, eiMetadata.getMeta("updatedName")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("deleteFlag",StringUtils.toString(deleteFlag, eiMetadata.getMeta("deleteFlag")));
return map;
/**
* set the errorText - 异常文本.
*
* @param errorText - 异常文本
*/
public void setErrorText(String errorText) {
this.errorText = errorText;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
}
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setErrorCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ERROR_CODE)), errorCode));
setPrio(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRIO)), prio));
setProgramNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROGRAM_NO)), programNo));
setRowno(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ROWNO)), rowno));
setGotoRowNone(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GOTO_ROW_NONE)), gotoRowNone));
setFileName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_NAME)), fileName));
setEquipmentType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_EQUIPMENT_TYPE)), equipmentType));
setEquipmentCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_EQUIPMENT_CODE)), equipmentCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setErrorText(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ERROR_TEXT)), errorText));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_ERROR_CODE, StringUtils.toString(errorCode, eiMetadata.getMeta(FIELD_ERROR_CODE)));
map.put(FIELD_PRIO, StringUtils.toString(prio, eiMetadata.getMeta(FIELD_PRIO)));
map.put(FIELD_PROGRAM_NO, StringUtils.toString(programNo, eiMetadata.getMeta(FIELD_PROGRAM_NO)));
map.put(FIELD_ROWNO, StringUtils.toString(rowno, eiMetadata.getMeta(FIELD_ROWNO)));
map.put(FIELD_GOTO_ROW_NONE, StringUtils.toString(gotoRowNone, eiMetadata.getMeta(FIELD_GOTO_ROW_NONE)));
map.put(FIELD_FILE_NAME, StringUtils.toString(fileName, eiMetadata.getMeta(FIELD_FILE_NAME)));
map.put(FIELD_EQUIPMENT_TYPE, StringUtils.toString(equipmentType, eiMetadata.getMeta(FIELD_EQUIPMENT_TYPE)));
map.put(FIELD_EQUIPMENT_CODE, StringUtils.toString(equipmentCode, eiMetadata.getMeta(FIELD_EQUIPMENT_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_ERROR_TEXT, StringUtils.toString(errorText, eiMetadata.getMeta(FIELD_ERROR_TEXT)));
return map;
}
}
\ No newline at end of file
......@@ -16,10 +16,50 @@ import com.baosight.iplat4j.core.util.StringUtils;
*/
public class HPSB002 extends DaoEPBase {
private String id = " "; /* ID*/
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* ID*/
public static final String FIELD_COMPANY_CODE = "companyCode";
public static final String FIELD_FILE_NAME = "fileName"; /* 文件名*/
public static final String FIELD_EQUIPMENT_TYPE = "equipmentType"; /* 设备状态*/
public static final String FIELD_EQUIPMENT_CODE = "equipmentCode"; /* 设备编码*/
public static final String FIELD_LOG_INIVALUE = "logInivalue"; /* 初始类容*/
public static final String FIELD_LOG_VALUE = "logValue"; /* 日志类容*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE";
public static final String COL_FILE_NAME = "FILE_NAME"; /* 文件名*/
public static final String COL_EQUIPMENT_TYPE = "EQUIPMENT_TYPE"; /* 设备状态*/
public static final String COL_EQUIPMENT_CODE = "EQUIPMENT_CODE"; /* 设备编码*/
public static final String COL_LOG_INIVALUE = "LOG_INIVALUE"; /* 初始类容*/
public static final String COL_LOG_VALUE = "LOG_VALUE"; /* 日志类容*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/
public static final String QUERY = "HPSB002.query";
public static final String COUNT = "HPSB002.count";
public static final String INSERT = "HPSB002.insert";
public static final String UPDATE = "HPSB002.update";
public static final String DELETE = "HPSB002.delete";
private Long id = new Long(0); /* ID*/
private String companyCode = " ";
private String fileName = " "; /* 文件名*/
private String equipmentType = " "; /* 设备状态*/
private String equipmentCode = " "; /* 设备编码*/
private String logInivalue = " "; /* 初始类容*/
private String logValue = " "; /* 日志类容*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
......@@ -27,87 +67,115 @@ public class HPSB002 extends DaoEPBase {
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = Integer.valueOf(0); /* 是否删除0.否1.是*/
/**
* initialize the metadata
*/
public void initMetaData() {
EiColumn eiColumn;
private Integer deleteFlag = new Integer(0); /* 是否删除0.否1.是*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("id");
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("fileName");
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_NAME);
eiColumn.setDescName("文件名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("equipmentType");
eiColumn = new EiColumn(FIELD_EQUIPMENT_TYPE);
eiColumn.setDescName("设备状态");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("equipmentCode");
eiColumn = new EiColumn(FIELD_EQUIPMENT_CODE);
eiColumn.setDescName("设备编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("logValue");
eiColumn = new EiColumn(FIELD_LOG_INIVALUE);
eiColumn.setDescName("初始类容");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_LOG_VALUE);
eiColumn.setDescName("日志类容");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdBy");
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdName");
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("createdTime");
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedBy");
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedName");
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("updatedTime");
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("deleteFlag");
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除0.否1.是");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor
*/
public HPSB002() {
initMetaData();
}
}
/**
* the constructor.
*/
public HPSB002() {
initMetaData();
}
/**
* get the id - ID
* get the id - ID.
* @return the id
*/
public String getId() {
public Long getId() {
return this.id;
}
/**
* set the id - ID
* set the id - ID.
*
* @param id - ID
*/
public void setId(String id) {
public void setId(Long id) {
this.id = id;
}
/**
* get the fileName - 文件名
* get the companyCode .
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode .
*
* @param companyCode
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the fileName - 文件名.
* @return the fileName
*/
public String getFileName() {
......@@ -115,13 +183,15 @@ initMetaData();
}
/**
* set the fileName - 文件名
* set the fileName - 文件名.
*
* @param fileName - 文件名
*/
public void setFileName(String fileName) {
this.fileName = fileName;
}
/**
* get the equipmentType - 设备状态
* get the equipmentType - 设备状态.
* @return the equipmentType
*/
public String getEquipmentType() {
......@@ -129,13 +199,15 @@ initMetaData();
}
/**
* set the equipmentType - 设备状态
* set the equipmentType - 设备状态.
*
* @param equipmentType - 设备状态
*/
public void setEquipmentType(String equipmentType) {
this.equipmentType = equipmentType;
}
/**
* get the equipmentCode - 设备编码
* get the equipmentCode - 设备编码.
* @return the equipmentCode
*/
public String getEquipmentCode() {
......@@ -143,13 +215,31 @@ initMetaData();
}
/**
* set the equipmentCode - 设备编码
* set the equipmentCode - 设备编码.
*
* @param equipmentCode - 设备编码
*/
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
/**
* get the logValue - 日志类容
* get the logInivalue - 初始类容.
* @return the logInivalue
*/
public String getLogInivalue() {
return this.logInivalue;
}
/**
* set the logInivalue - 初始类容.
*
* @param logInivalue - 初始类容
*/
public void setLogInivalue(String logInivalue) {
this.logInivalue = logInivalue;
}
/**
* get the logValue - 日志类容.
* @return the logValue
*/
public String getLogValue() {
......@@ -157,13 +247,15 @@ initMetaData();
}
/**
* set the logValue - 日志类容
* set the logValue - 日志类容.
*
* @param logValue - 日志类容
*/
public void setLogValue(String logValue) {
this.logValue = logValue;
}
/**
* get the createdBy - 创建人
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
......@@ -171,13 +263,15 @@ initMetaData();
}
/**
* set the createdBy - 创建人
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
......@@ -185,13 +279,15 @@ initMetaData();
}
/**
* set the createdName - 创建人名称
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
......@@ -199,13 +295,15 @@ initMetaData();
}
/**
* set the createdTime - 创建时间
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
......@@ -213,13 +311,15 @@ initMetaData();
}
/**
* set the updatedBy - 更新人
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称
* get the updatedName - 更新人名称.
* @return the updatedName
*/
public String getUpdatedName() {
......@@ -227,13 +327,15 @@ initMetaData();
}
/**
* set the updatedName - 更新人名称
* set the updatedName - 更新人名称.
*
* @param updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
......@@ -241,13 +343,15 @@ initMetaData();
}
/**
* set the updatedTime - 更新时间
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除0.否1.是
* get the deleteFlag - 是否删除0.否1.是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
......@@ -255,50 +359,59 @@ initMetaData();
}
/**
* set the deleteFlag - 是否删除0.否1.是
* set the deleteFlag - 是否删除0.否1.是.
*
* @param deleteFlag - 是否删除0.否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the value from Map
*/
public void fromMap(Map map) {
setId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("id")), id));
setFileName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fileName")), fileName));
setEquipmentType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("equipmentType")), equipmentType));
setEquipmentCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("equipmentCode")), equipmentCode));
setLogValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("logValue")), logValue));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdBy")), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdName")), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("createdTime")), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedBy")), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedName")), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("updatedTime")), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get("deleteFlag")), deleteFlag));
}
/**
* set the value to Map
*/
public Map toMap() {
Map map = new HashMap();
map.put("id",StringUtils.toString(id, eiMetadata.getMeta("id")));
map.put("fileName",StringUtils.toString(fileName, eiMetadata.getMeta("fileName")));
map.put("equipmentType",StringUtils.toString(equipmentType, eiMetadata.getMeta("equipmentType")));
map.put("equipmentCode",StringUtils.toString(equipmentCode, eiMetadata.getMeta("equipmentCode")));
map.put("logValue",StringUtils.toString(logValue, eiMetadata.getMeta("logValue")));
map.put("createdBy",StringUtils.toString(createdBy, eiMetadata.getMeta("createdBy")));
map.put("createdName",StringUtils.toString(createdName, eiMetadata.getMeta("createdName")));
map.put("createdTime",StringUtils.toString(createdTime, eiMetadata.getMeta("createdTime")));
map.put("updatedBy",StringUtils.toString(updatedBy, eiMetadata.getMeta("updatedBy")));
map.put("updatedName",StringUtils.toString(updatedName, eiMetadata.getMeta("updatedName")));
map.put("updatedTime",StringUtils.toString(updatedTime, eiMetadata.getMeta("updatedTime")));
map.put("deleteFlag",StringUtils.toString(deleteFlag, eiMetadata.getMeta("deleteFlag")));
return map;
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setFileName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_NAME)), fileName));
setEquipmentType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_EQUIPMENT_TYPE)), equipmentType));
setEquipmentCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_EQUIPMENT_CODE)), equipmentCode));
setLogInivalue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_LOG_INIVALUE)), logInivalue));
setLogValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_LOG_VALUE)), logValue));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
}
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_FILE_NAME, StringUtils.toString(fileName, eiMetadata.getMeta(FIELD_FILE_NAME)));
map.put(FIELD_EQUIPMENT_TYPE, StringUtils.toString(equipmentType, eiMetadata.getMeta(FIELD_EQUIPMENT_TYPE)));
map.put(FIELD_EQUIPMENT_CODE, StringUtils.toString(equipmentCode, eiMetadata.getMeta(FIELD_EQUIPMENT_CODE)));
map.put(FIELD_LOG_INIVALUE, StringUtils.toString(logInivalue, eiMetadata.getMeta(FIELD_LOG_INIVALUE)));
map.put(FIELD_LOG_VALUE, StringUtils.toString(logValue, eiMetadata.getMeta(FIELD_LOG_VALUE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
return map;
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.sb.domain.HPSB001;
import com.baosight.hpjx.hp.sb.domain.HPSB003;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
......@@ -18,10 +19,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
/**
*
......@@ -35,10 +33,12 @@ public class ServiceHPSB001 extends ServiceBase {
*/
@OperationLogAnnotation(operModul = "设备异常日志",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
HPSB001 hpsb001 = new HPSB001();
EiInfo outInfo = super.initLoad(inInfo, hpsb001);
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(hpsb001.eiMetadata);
return inInfo;
EiInfo outInfo = super.query(inInfo, "HPSB001.query", new HPSB001());
CommonMethod.initBlock(outInfo,
Arrays.asList(DdynamicEnum.DEVICE_CODE_BLOCK_ID),
new HashMap<String,Object>(){}
);
return outInfo;
}
......@@ -67,10 +67,12 @@ public class ServiceHPSB001 extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsb001.fromMap(map);
hpsb001.setCreatedBy(UserSession.getUserId());
hpsb001.setCreatedTime(sdf.format(new Date()));
hpsb001.setUpdatedBy(null);
hpsb001.setUpdatedTime(null);
List<HPSB003> list = this.dao.query(HPSB003.QUERY,new HashMap<String,Object>(){{
put(HPSB003.FIELD_DEVICE_CODE,hpsb001.getEquipmentCode());
}});
if (list.size() >0) {
hpsb001.setCompanyCode(list.get(0).getCompanyCode());
}
DaoUtils.insert("HPSB001.insert", hpsb001.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......
package com.baosight.hpjx.hp.sb.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.sb.domain.HPSB002;
import com.baosight.hpjx.hp.sb.domain.HPSB003;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -13,9 +16,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
/**
*
......@@ -29,10 +30,12 @@ public class ServiceHPSB002 extends ServiceBase {
*/
@OperationLogAnnotation(operModul = "设备日志",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
HPSB002 hpsb002 = new HPSB002();
EiInfo outInfo = super.initLoad(inInfo, hpsb002);
outInfo.addBlock(EiConstant.resultBlock).addBlockMeta(hpsb002.eiMetadata);
return inInfo;
EiInfo outInfo = super.query(inInfo, "HPSB002.query", new HPSB002());
CommonMethod.initBlock(outInfo,
Arrays.asList(DdynamicEnum.DEVICE_CODE_BLOCK_ID),
new HashMap<String,Object>(){}
);
return outInfo;
}
......@@ -61,10 +64,12 @@ public class ServiceHPSB002 extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpsb002.fromMap(map);
hpsb002.setCreatedBy(UserSession.getUserId());
hpsb002.setCreatedTime(sdf.format(new Date()));
hpsb002.setUpdatedBy(null);
hpsb002.setUpdatedTime(null);
List<HPSB003> list = this.dao.query(HPSB003.QUERY,new HashMap<String,Object>(){{
put(HPSB003.FIELD_DEVICE_CODE,hpsb002.getEquipmentCode());
}});
if (list.size() >0) {
hpsb002.setCompanyCode(list.get(0).getCompanyCode());
}
DaoUtils.insert("HPSB002.insert", hpsb002.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......
......@@ -23,66 +23,16 @@
-->
<sqlMap namespace="HPSB001">
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sb.domain.HPSB001">
SELECT
ID as "id", <!-- ID -->
ERROR_CODE as "errorCode", <!-- 异常编码 -->
PRIO as "prio", <!-- 异常登记 -->
PROGRAM_NO as "programNo", <!-- 程序号 -->
ROWNO as "rowno", <!-- 行号 -->
GOTO_ROW_NONE as "gotoRowNone", <!-- 不存在跳转行 -->
FILE_NAME as "fileName", <!-- 文件名 -->
EQUIPMENT_TYPE as "equipmentType", <!-- 设备状态 -->
EQUIPMENT_CODE as "equipmentCode", <!-- 设备编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 -->
FROM hpjx.t_hpsb001 WHERE 1=1
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY LIKE CONCAT('%', #createdBy#, '%')
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="errorCode">
ERROR_CODE LIKE CONCAT('%', #errorCode#, '%')
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpsb001 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY LIKE CONCAT('%', #createdBy#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="errorCode">
ERROR_CODE LIKE CONCAT('%', #errorCode#, '%')
</isNotEmpty>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="errorCode">
ERROR_CODE = #errorCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="prio">
PRIO = #prio#
</isNotEmpty>
......@@ -102,7 +52,7 @@
EQUIPMENT_TYPE = #equipmentType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="equipmentCode">
EQUIPMENT_CODE = #equipmentCode#
EQUIPMENT_CODE LIKE CONCAT('%', #equipmentCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
......@@ -125,10 +75,53 @@
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
-->
<isNotEmpty prepend=" AND " property="errorText">
ERROR_TEXT = #errorText#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sb.domain.HPSB001">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode",
ERROR_CODE as "errorCode", <!-- 异常编码 -->
PRIO as "prio", <!-- 异常登记 -->
PROGRAM_NO as "programNo", <!-- 程序号 -->
ROWNO as "rowno", <!-- 行号 -->
GOTO_ROW_NONE as "gotoRowNone", <!-- 不存在跳转行 -->
FILE_NAME as "fileName", <!-- 文件名 -->
EQUIPMENT_TYPE as "equipmentType", <!-- 设备状态 -->
EQUIPMENT_CODE as "equipmentCode", <!-- 设备编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
ERROR_TEXT as "errorText" <!-- 异常文本 -->
FROM ${hpjxSchema}.T_HPSB001 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSB001 WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO hpjx.t_hpsb001 (ID, <!-- ID -->
INSERT INTO ${hpjxSchema}.T_HPSB001 (ID, <!-- ID -->
COMPANY_CODE,
ERROR_CODE, <!-- 异常编码 -->
PRIO, <!-- 异常登记 -->
PROGRAM_NO, <!-- 程序号 -->
......@@ -143,24 +136,21 @@
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG <!-- 是否删除0.否1.是 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
ERROR_TEXT <!-- 异常文本 -->
)
VALUES (#id#, #errorCode#, #prio#, #programNo#, #rowno#, #gotoRowNone#, #fileName#, #equipmentType#, #equipmentCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#)
VALUES (#id#, #companyCode#, #errorCode#, #prio#, #programNo#, #rowno#, #gotoRowNone#, #fileName#, #equipmentType#, #equipmentCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #errorText#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpsb001 WHERE
DELETE FROM ${hpjxSchema}.T_HPSB001 WHERE
ID = #id#
</delete>
<delete id="deleteByCreatedTime">
DELETE FROM hpjx.t_hpsb001 WHERE
SUBSTR(CREATED_TIME,1,8) &lt; DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 30 day),'%Y%m%d')
</delete>
<update id="update">
UPDATE hpjx.t_hpsb001
UPDATE ${hpjxSchema}.T_HPSB001
SET
COMPANY_CODE = #companyCode#,
ERROR_CODE = #errorCode#, <!-- 异常编码 -->
PRIO = #prio#, <!-- 异常登记 -->
PROGRAM_NO = #programNo#, <!-- 程序号 -->
......@@ -175,9 +165,15 @@
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除0.否1.是 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
ERROR_TEXT = #errorText# <!-- 异常文本 -->
WHERE
ID = #id#
</update>
<delete id="deleteByCreatedTime">
DELETE FROM hpjx.t_hpsb001 WHERE
SUBSTR(CREATED_TIME,1,8) &lt; DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 30 day),'%Y%m%d')
</delete>
</sqlMap>
\ No newline at end of file
......@@ -19,13 +19,60 @@
-->
<sqlMap namespace="HPSB002">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileName">
FILE_NAME = #fileName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="equipmentType">
EQUIPMENT_TYPE = #equipmentType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="equipmentCode">
EQUIPMENT_CODE LIKE CONCAT('%', #equipmentCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="logInivalue">
LOG_INIVALUE = #logInivalue#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="logValue">
LOG_VALUE = #logValue#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.sb.domain.HPSB002">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode",
FILE_NAME as "fileName", <!-- 文件名 -->
EQUIPMENT_TYPE as "equipmentType", <!-- 设备状态 -->
EQUIPMENT_CODE as "equipmentCode", <!-- 设备编码 -->
LOG_INIVALUE as "logInivalue", <!-- 初始类容 -->
LOG_VALUE as "logValue", <!-- 日志类容 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
......@@ -34,38 +81,31 @@
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 -->
FROM hpjx.t_hpsb002 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY LIKE CONCAT('%', #createdBy#, '%')
</isNotEmpty>
FROM ${hpjxSchema}.T_HPSB002 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
CREATED_TIME DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM hpjx.t_hpsb002 WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY LIKE CONCAT('%', #createdBy#, '%')
</isNotEmpty>
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPSB002 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileName">
FILE_NAME = #fileName#
</isNotEmpty>
......@@ -75,6 +115,9 @@
<isNotEmpty prepend=" AND " property="equipmentCode">
EQUIPMENT_CODE = #equipmentCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="logInivalue">
LOG_INIVALUE = #logInivalue#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="logValue">
LOG_VALUE = #logValue#
</isNotEmpty>
......@@ -102,10 +145,12 @@
-->
<insert id="insert">
INSERT INTO hpjx.t_hpsb002 (ID, <!-- ID -->
INSERT INTO ${hpjxSchema}.T_HPSB002 (ID, <!-- ID -->
COMPANY_CODE,
FILE_NAME, <!-- 文件名 -->
EQUIPMENT_TYPE, <!-- 设备状态 -->
EQUIPMENT_CODE, <!-- 设备编码 -->
LOG_INIVALUE, <!-- 初始类容 -->
LOG_VALUE, <!-- 日志类容 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
......@@ -115,25 +160,22 @@
UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG <!-- 是否删除0.否1.是 -->
)
VALUES (#id#, #fileName#, #equipmentType#, #equipmentCode#, #logValue#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#)
VALUES (#id#, #companyCode#, #fileName#, #equipmentType#, #equipmentCode#, #logInivalue#, #logValue#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#)
</insert>
<delete id="delete">
DELETE FROM hpjx.t_hpsb002 WHERE
DELETE FROM ${hpjxSchema}.T_HPSB002 WHERE
ID = #id#
</delete>
<delete id="deleteByCreatedTime">
DELETE FROM hpjx.t_hpsb002 WHERE
SUBSTR(CREATED_TIME,1,8) &lt; DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 30 day),'%Y%m%d')
</delete>
<update id="update">
UPDATE hpjx.t_hpsb002
UPDATE ${hpjxSchema}.T_HPSB002
SET
COMPANY_CODE = #companyCode#,
FILE_NAME = #fileName#, <!-- 文件名 -->
EQUIPMENT_TYPE = #equipmentType#, <!-- 设备状态 -->
EQUIPMENT_CODE = #equipmentCode#, <!-- 设备编码 -->
LOG_INIVALUE = #logInivalue#, <!-- 初始类容 -->
LOG_VALUE = #logValue#, <!-- 日志类容 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
......@@ -146,4 +188,10 @@
ID = #id#
</update>
<delete id="deleteByCreatedTime">
DELETE FROM hpjx.t_hpsb002 WHERE
SUBSTR(CREATED_TIME,1,8) &lt; DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 30 day),'%Y%m%d')
</delete>
</sqlMap>
\ No newline at end of file
......@@ -377,4 +377,13 @@
</isNotEmpty>-->
</select>
<select id="queryDeviceCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select distinct
DEVICE_NAME as "deviceName", <!-- 设备名称 -->
DEVICE_CODE as "deviceCode" <!-- 设备编码 -->
FROM ${hpjxSchema}.T_HPSB003
WHERE 1=1
<include refid="condition" />
</select>
</sqlMap>
package com.baosight.hpjx.hp.tc.service;
import com.baosight.hpjx.common.HPConstants;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.equipment.hp.domain.CutterbarStatus;
import com.baosight.hpjx.equipment.hp.domain.CutterbarTime;
import com.baosight.hpjx.equipment.hp.domain.CutterbarWarning;
import com.baosight.hpjx.equipment.hp.domain.CutterbarWarningBase;
import com.baosight.hpjx.hp.sb.domain.HPSB001;
import com.baosight.hpjx.hp.sb.domain.HPSB002;
import com.baosight.hpjx.hp.sb.domain.HPSB003;
import com.baosight.hpjx.hp.sb.domain.HPSB00A;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.StringUtils;
......@@ -17,6 +19,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class ServiceHPTCP001 extends ServiceBase {
......@@ -36,15 +39,23 @@ public class ServiceHPTCP001 extends ServiceBase {
hpsb00A.setDataContent(dataContent);
hpsb00A.setEquipmentType(equipmentType);
hpsb00A.setEquipmentCode(equipmentCode);
List<HPSB003> list = this.dao.query(HPSB003.QUERY,new HashMap<String,Object>(){{
put(HPSB003.FIELD_DEVICE_CODE,equipmentCode);
put(HPSB003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
}});
if (list.size() >0) {
hpsb001.setCompanyCode(list.get(0).getCompanyCode());
hpsb002.setCompanyCode(list.get(0).getCompanyCode());
}
if (StringUtils.isNotEmpty(equipmentType)) {
if (equipmentType.equals(HPConstants.STARUS_TYPE)) {
//解析设备状态
List<CutterbarStatus> cutterbarStatusList = XmlUtils.readXml(hpsb00A.getDataContent(), CutterbarStatus.class);
hpsb002.setId(StringUtils.uuid());
//hpsb002.setId(StringUtils.uuid());
hpsb002.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb002.setEquipmentType(hpsb00A.getEquipmentType());
hpsb002.setLogValue(cutterbarStatusList.get(0).getStatus().toString());
hpsb002.setLogInivalue(formatStatus(cutterbarStatusList.get(0).getStatus().toString()));
hpsb002.setCreatedBy("自动化中转程序");
hpsb002.setCreatedTime(DateUtils.shortDateTime());
this.dao.insert("HPSB002.insert",hpsb002);
......@@ -55,10 +66,11 @@ public class ServiceHPTCP001 extends ServiceBase {
if (equipmentType.equals(HPConstants.TIME_TYPE)) {
//解析开机时间
List<CutterbarTime> cutterbarTimeList = XmlUtils.readXml(hpsb00A.getDataContent(), CutterbarTime.class);
hpsb002.setId(StringUtils.uuid());
//hpsb002.setId(StringUtils.uuid());
hpsb002.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb002.setEquipmentType(hpsb00A.getEquipmentType());
hpsb002.setLogValue(cutterbarTimeList.get(0).getTime());
hpsb002.setLogInivalue(String.format("开机启动时间[%s]", cutterbarTimeList.get(0).getTime()));
hpsb002.setCreatedBy("自动化中转程序");
hpsb002.setCreatedTime(DateUtils.shortDateTime());
this.dao.insert("HPSB002.insert",hpsb002);
......@@ -73,7 +85,7 @@ public class ServiceHPTCP001 extends ServiceBase {
if (CollectionUtils.isNotEmpty(cutterbarWarningBaseList)) {
cutterbarWarning = CutterbarWarning.convertBase(cutterbarWarningBaseList.get(0));
}
hpsb001.setId(StringUtils.uuid());
//hpsb001.setId(StringUtils.uuid());
hpsb001.setErrorCode(cutterbarWarning.getErrorCode());
hpsb001.setPrio(cutterbarWarning.getPrio());
hpsb001.setProgramNo(cutterbarWarning.getProgramNo());
......@@ -82,9 +94,18 @@ public class ServiceHPTCP001 extends ServiceBase {
hpsb001.setFileName(cutterbarWarning.getFileName());
hpsb001.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb001.setEquipmentType(hpsb00A.getEquipmentType());
Integer errorCode = Integer.parseInt(cutterbarWarning.getErrorCode());
if(errorCode.compareTo(new Integer(200))>=0 && errorCode.compareTo(new Integer(299))<=0){
hpsb001.setErrorText(String.format("(程序号:%s,行号 %s)goto 跳转行%s 不存在", cutterbarWarning.getProgramNo(),
cutterbarWarning.getRowNo(),cutterbarWarning.getGotoRowNone()));
}else if(errorCode.compareTo(new Integer(300))>=0 && errorCode.compareTo(new Integer(399))<=0){
hpsb001.setErrorText(String.format(" (文件:%s,行号 %s)括号不匹配", cutterbarWarning.getFileName(),
cutterbarWarning.getRowNo()));
}
hpsb001.setCreatedBy("自动化中转程序");
hpsb001.setCreatedTime(DateUtils.shortDateTime());
this.dao.insert("HPSB001.insert",hpsb002);
this.dao.insert("HPSB001.insert",hpsb001);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg(outInfo.getMsg());
return inInfo;
......@@ -95,4 +116,28 @@ public class ServiceHPTCP001 extends ServiceBase {
return inInfo;
}
public String formatStatus(String status){
String str = "";
switch (status){
case "2":
str = "运行状态";
break;
case "3":
str = "暂停状态";
break;
case "4":
str = "复位状态";
break;
case "5":
str = "一级报警状态";
break;
case "6":
str = "二级报警状态";
break;
default:
str = "默认状态";
}
return str;
}
}
......@@ -9,7 +9,7 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="操作人" ename="inqu_status-0-createdBy" colWidth="3"/>
<EF:EFInput cname="设备编码" ename="inqu_status-0-equipmentCode" colWidth="3"/>
<EF:EFInput cname="异常编码" ename="inqu_status-0-errorCode" colWidth="3"/>
</div>
</EF:EFRegion>
......@@ -17,16 +17,24 @@
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="主键id" hidden="true"/>
<EF:EFColumn ename="createdBy" cname="操作人" enable="false" readonly="true" width="150" align="center"/>
<EF:EFColumn ename="errorCode" cname="异常编码" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="programNo" cname="程序号" enable="false" readonly="true" width="80" align="center"/>
<EF:EFColumn ename="equipmentType" cname="设备状态" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="equipmentCode" cname="设备编码" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="prio" cname="数据内容" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="rowno" cname="行号" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="gotoRowNone" cname="不存在跳转行" enable="false" readonly="true" width="100" align="center"/>
<%--<EF:EFColumn ename="createdBy" cname="操作人" enable="false" readonly="true" width="150" align="center"/>--%>
<EF:EFComboColumn ename="equipmentType" cname="日志类型" enable="false" readonly="true" width="100" align="center">
<EF:EFOption label="" value=""/>
<EF:EFOption label="异常报警" value="WARNING_TYPE"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="equipmentCode" cname="设备编码" blockName="deviceCode_block_id"
columnTemplate="#=valueField#-#=textField#" itemTemplate="#=valueField#-#=textField#"
textField="#=textField#" valueField="valueField"
enable="false" readonly="true" width="100" align="center">
</EF:EFComboColumn>
<EF:EFColumn ename="errorCode" cname="异常编码" enable="false" readonly="true" width="40" align="center"/>
<EF:EFColumn ename="programNo" cname="程序号" enable="false" readonly="true" width="40" align="center"/>
<EF:EFColumn ename="prio" cname="数据内容" enable="false" readonly="true" width="40" align="center"/>
<EF:EFColumn ename="rowno" cname="行号" enable="false" readonly="true" width="30" align="center"/>
<EF:EFColumn ename="gotoRowNone" cname="不存在跳转行" enable="false" readonly="true" width="50" align="center"/>
<EF:EFColumn ename="fileName" cname="文件名" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" readonly="true" width="120" align="center"
<EF:EFColumn ename="errorText" cname="异常文本" width="150" readonly="true"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" readonly="true" width="100" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -9,17 +9,25 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="操作人" ename="inqu_status-0-createdBy" colWidth="3"/>
<EF:EFInput cname="设备编码" ename="inqu_status-0-equipmentCode" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="主键id" hidden="true"/>
<EF:EFColumn ename="createdBy" cname="操作人" enable="false" readonly="true" width="150" align="center"/>
<EF:EFColumn ename="equipmentType" cname="设备状态" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="equipmentCode" cname="设备编码" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="logValue" cname="数据内容" enable="false" readonly="true" width="100" align="center"/>
<%--<EF:EFColumn ename="createdBy" cname="操作人" enable="false" readonly="true" width="150" align="center"/>--%>
<EF:EFColumn ename="equipmentType" cname="日志类型" enable="false" readonly="true" width="100" align="center"/>
<EF:EFComboColumn ename="equipmentType" cname="日志类型" enable="false" readonly="true" width="100" align="center">
<EF:EFOption label="设备状态" value="STARUS_TYPE"/>
<EF:EFOption label="开机时间" value="TIME_TYPE"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="equipmentCode" cname="设备编码" blockName="deviceCode_block_id"
columnTemplate="#=valueField#-#=textField#" itemTemplate="#=valueField#-#=textField#"
textField="#=textField#" valueField="valueField"
enable="false" readonly="true" width="100" align="center">
</EF:EFComboColumn>
<EF:EFColumn ename="logInivalue" cname="数据内容" enable="false" readonly="true" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" readonly="true" width="120" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
......@@ -30,5 +38,3 @@
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/SB/HPSB002.js"></script>
\ No newline at end of file
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