Commit 991f2048 authored by 耿迪迪's avatar 耿迪迪

设备上报修改 gengdidi

parent fef6c767
......@@ -89,10 +89,10 @@ public class PressureDecryptReportedData {
private String getDeviceStatus(){
String deviceStatus = reportedDataStr.substring(32, 34);
switch (deviceStatus){
case "01":
case "00":
deviceStatus = "预热";
break;
case "02":
case "01":
deviceStatus = "正常";
break;
case "03":
......
......@@ -41,7 +41,12 @@ public class FlowmeterDecryptReportedData implements DecryptReportedData{
tDeviceReportData.setStandardConditionAccumulation(new BigDecimal(standardConditionAccumulation));
// 工况累计量
double workingConditionAccumulation = HexUtils.hexToDouble(reportedDataStr.substring(64, 80));
tDeviceReportData.setWorkingConditionAccumulation(new BigDecimal(workingConditionAccumulation));
if("苍南EVC300体积修正仪".equals(deviceType)){
tDeviceReportData.setWorkingConditionAccumulation(new BigDecimal(workingConditionAccumulation));
}else{
tDeviceReportData.setResidualQuantity(new BigDecimal(workingConditionAccumulation));
}
// 标况流量
float standardConditionFlow = HexUtils.hexToFloat(reportedDataStr.substring(80, 88));
tDeviceReportData.setStandardConditionFlow(new BigDecimal(standardConditionFlow));
......@@ -89,6 +94,9 @@ public class FlowmeterDecryptReportedData implements DecryptReportedData{
*/
private Date getReportedTime() throws ParseException {
String reportTime = reportedDataStr.substring(36,48);
if("00".equals(reportTime.substring(0,2))){
return new Date();
}
StringBuilder timeStr = new StringBuilder("");
timeStr.append(reportTime.substring(0,2));
timeStr.append("-");
......
......@@ -82,6 +82,9 @@ public class Tian5cFlowmeterDecryptReportedData implements DecryptReportedData{
*/
private Date getReportedTime() throws ParseException {
String reportTime = reportedDataStr.substring(36,48);
if("00".equals(reportTime.substring(0,2))){
return new Date();
}
StringBuilder timeStr = new StringBuilder("");
timeStr.append(reportTime.substring(0,2));
timeStr.append("-");
......
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