Commit 34f11413 by yukang

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

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