Commit 34f11413 by yukang

设备日志表结构变更ID自增

parent c13a35d9
......@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
*/
public class HPSB001 extends DaoEPBase {
private String id = " "; /* ID*/
private Long id; /* ID*/
private String errorCode = " "; /* 异常编码*/
private String prio = " "; /* 异常登记*/
private String programNo = " "; /* 程序号*/
......@@ -116,14 +116,14 @@ initMetaData();
* get the id - ID
* @return the id
*/
public String getId() {
public Long getId() {
return this.id;
}
/**
* set the id - ID
*/
public void setId(String id) {
public void setId(Long id) {
this.id = id;
}
/**
......@@ -340,8 +340,7 @@ initMetaData();
* get the value from Map
*/
public void fromMap(Map map) {
setId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("id")), id));
setId(NumberUtils.toLong(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));
......
......@@ -16,7 +16,7 @@ import com.baosight.iplat4j.core.util.StringUtils;
*/
public class HPSB002 extends DaoEPBase {
private String id = " "; /* ID*/
private Long id; /* ID*/
private String fileName = " "; /* 文件名*/
private String equipmentType = " "; /* 设备状态*/
private String equipmentCode = " "; /* 设备编码*/
......@@ -96,14 +96,14 @@ initMetaData();
* get the id - ID
* @return the id
*/
public String getId() {
public Long getId() {
return this.id;
}
/**
* set the id - ID
*/
public void setId(String id) {
public void setId(Long id) {
this.id = id;
}
/**
......@@ -264,8 +264,7 @@ initMetaData();
* get the value from Map
*/
public void fromMap(Map map) {
setId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("id")), id));
setId(NumberUtils.toLong(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));
......
......@@ -41,7 +41,6 @@ public class ServiceHPTCP001 extends ServiceBase {
if (equipmentType.equals(HPConstants.STARUS_TYPE)) {
//解析设备状态
List<CutterbarStatus> cutterbarStatusList = XmlUtils.readXml(hpsb00A.getDataContent(), CutterbarStatus.class);
hpsb002.setId(StringUtils.uuid());
hpsb002.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb002.setEquipmentType(hpsb00A.getEquipmentType());
hpsb002.setLogValue(cutterbarStatusList.get(0).getStatus().toString());
......@@ -55,7 +54,6 @@ 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.setEquipmentCode(hpsb00A.getEquipmentCode());
hpsb002.setEquipmentType(hpsb00A.getEquipmentType());
hpsb002.setLogValue(cutterbarTimeList.get(0).getTime());
......@@ -73,7 +71,6 @@ public class ServiceHPTCP001 extends ServiceBase {
if (CollectionUtils.isNotEmpty(cutterbarWarningBaseList)) {
cutterbarWarning = CutterbarWarning.convertBase(cutterbarWarningBaseList.get(0));
}
hpsb001.setId(StringUtils.uuid());
hpsb001.setErrorCode(cutterbarWarning.getErrorCode());
hpsb001.setPrio(cutterbarWarning.getPrio());
hpsb001.setProgramNo(cutterbarWarning.getProgramNo());
......
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