|
@@ -31,27 +31,43 @@ public class HuaTuRepository {
|
|
|
@Value("${fetch.condition}")
|
|
@Value("${fetch.condition}")
|
|
|
private String condition;
|
|
private String condition;
|
|
|
|
|
|
|
|
|
|
+ @Value("${config.testmode}")
|
|
|
|
|
+ private String testmode;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IBPSRepository ibpsRepository;
|
|
|
|
|
|
|
|
public List<WSDEntity> query(List<String> existIDList) throws ParseException {
|
|
public List<WSDEntity> query(List<String> existIDList) throws ParseException {
|
|
|
|
|
+ List<CollectorEntity> collectorList = ibpsRepository.getCollectorlist();
|
|
|
|
|
+ StringBuilder colIDList = new StringBuilder();
|
|
|
|
|
+ for (CollectorEntity collector : collectorList) {
|
|
|
|
|
+ if(colIDList.length() > 0) {
|
|
|
|
|
+ colIDList.append(",'").append(collector.getCollectID()).append("'");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ colIDList.append("'").append(collector.getCollectID()).append("'");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ String colIDListString = colIDList.toString();
|
|
|
/**
|
|
/**
|
|
|
* 正式启用开启这一段
|
|
* 正式启用开启这一段
|
|
|
|
|
+ * * */
|
|
|
String sqlStr ="select LOGGER_SN as LOGSN,GROUP_ID,LOGGER_NAME as LOGNAME,LOGGER_CHNUM as CHNUM,"+
|
|
String sqlStr ="select LOGGER_SN as LOGSN,GROUP_ID,LOGGER_NAME as LOGNAME,LOGGER_CHNUM as CHNUM,"+
|
|
|
"CHONE_TYPE as TYPE1,CHONE_HIGH as HIGH1,CHONE_LOW as LOW1,CHONE_DOT as DOT1,"+
|
|
"CHONE_TYPE as TYPE1,CHONE_HIGH as HIGH1,CHONE_LOW as LOW1,CHONE_DOT as DOT1,"+
|
|
|
"CHTWO_TYPE as TYPE2,CHTWO_HIGH as HIGH2,CHTWO_LOW as LOW2,CHTWO_DOT as DOT2,"+
|
|
"CHTWO_TYPE as TYPE2,CHTWO_HIGH as HIGH2,CHTWO_LOW as LOW2,CHTWO_DOT as DOT2,"+
|
|
|
"CHTHR_TYPE as TYPE3,CHTHR_HIGH as HIGH3,CHTHR_LOW as LOW3,CHTHR_DOT as DOT3,"+
|
|
"CHTHR_TYPE as TYPE3,CHTHR_HIGH as HIGH3,CHTHR_LOW as LOW3,CHTHR_DOT as DOT3,"+
|
|
|
"CHFOU_TYPE as TYPE4,CHFOU_HIGH as HIGH4,CHFOU_LOW as LOW4,CHFOU_DOT as DOT4 "+
|
|
"CHFOU_TYPE as TYPE4,CHFOU_HIGH as HIGH4,CHFOU_LOW as LOW4,CHFOU_DOT as DOT4 "+
|
|
|
- "from TO_LOGGER_INFO where LOGGER_STATE='1'"
|
|
|
|
|
|
|
+ "from TO_LOGGER_INFO where LOGGER_STATE='1' and LOGGER_SN in ("+colIDListString+")";
|
|
|
|
|
|
|
|
- * */
|
|
|
|
|
- String sql = "select * from TO_LOGGER_INFO";
|
|
|
|
|
- log.info("excute sql:" + sql);
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 测试调试开启这一段
|
|
|
|
|
+ *
|
|
|
|
|
+ String sqlStr = "select * from TO_LOGGER_INFO where LOGSN in ("+colIDListString+")";
|
|
|
|
|
+ * */
|
|
|
|
|
+ log.info("excute sql:" + sqlStr);
|
|
|
RowMapper<ToLoggerInfo> infoRowMapper = new BeanPropertyRowMapper<>(ToLoggerInfo.class);
|
|
RowMapper<ToLoggerInfo> infoRowMapper = new BeanPropertyRowMapper<>(ToLoggerInfo.class);
|
|
|
RowMapper<EquipResult> humitureRowMapper = new BeanPropertyRowMapper<>(EquipResult.class);
|
|
RowMapper<EquipResult> humitureRowMapper = new BeanPropertyRowMapper<>(EquipResult.class);
|
|
|
- RowMapper<CollectorEntity> collectorRowMapper = new BeanPropertyRowMapper<>(CollectorEntity.class);
|
|
|
|
|
- String collectorSql = "select id_,DeviceID,DeviceNo,DeviceName,DeviceType,CollectID,CollectName from equip_relation where enable='1'";
|
|
|
|
|
- List<CollectorEntity> collectorList = jdbcTemplate.query(collectorSql, collectorRowMapper);
|
|
|
|
|
- List<ToLoggerInfo> equipList = jdbcTemplate.query(sql, infoRowMapper);
|
|
|
|
|
- Set<WSDEntity> wsdSet = new LinkedHashSet<>();
|
|
|
|
|
|
|
+ List<ToLoggerInfo> equipList = jdbcTemplate.query(sqlStr, infoRowMapper);
|
|
|
|
|
+ List<WSDEntity> wsdlist = new LinkedList<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat saveToIDFormat = new SimpleDateFormat("yyyyMMddHHmm");
|
|
SimpleDateFormat saveToIDFormat = new SimpleDateFormat("yyyyMMddHHmm");
|
|
@@ -67,15 +83,23 @@ public class HuaTuRepository {
|
|
|
String equipSn = toLoggerInfo.getLOGSN();
|
|
String equipSn = toLoggerInfo.getLOGSN();
|
|
|
/**
|
|
/**
|
|
|
* 正式启用开启这一段
|
|
* 正式启用开启这一段
|
|
|
|
|
+ * **/
|
|
|
String subSql = "SELECT * FROM LOGS_"+equipSn+" WHERE "+condition + " order by LOGS_TIME";
|
|
String subSql = "SELECT * FROM LOGS_"+equipSn+" WHERE "+condition + " order by LOGS_TIME";
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 测试调试开启这一段
|
|
|
|
|
+ *String subSql = "SELECT * FROM LOGS_" + equipSn + " WHERE DATE(LOGS_TIME) = CURDATE() ORDER BY LOGS_TIME";
|
|
|
**/
|
|
**/
|
|
|
- String subSql = "SELECT * FROM LOGS_" + equipSn + " WHERE DATE(LOGS_TIME) = CURDATE()-5 ORDER BY LOGS_TIME";
|
|
|
|
|
log.info("Execute SQL: " + subSql);
|
|
log.info("Execute SQL: " + subSql);
|
|
|
/**
|
|
/**
|
|
|
* 正式启用开启这一段
|
|
* 正式启用开启这一段
|
|
|
- String sqlQry = "SELECT COUNT(*) as result FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'huatu' AND TABLE_NAME = 'LOGS_"+ equipSn +"'";
|
|
|
|
|
- **/
|
|
|
|
|
- String sqlQry = "SELECT COUNT(*) as result FROM information_schema.tables WHERE table_schema = 'klims-ibps3' AND table_name = 'LOGS_"+ equipSn +"'";
|
|
|
|
|
|
|
+ * **/
|
|
|
|
|
+ String sqlQry = "SELECT COUNT(*) as result FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'sql' AND TABLE_NAME = 'LOGS_"+ equipSn +"'";
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 测试调试开启这一段
|
|
|
|
|
+ *
|
|
|
|
|
+ * String sqlQry = "SELECT COUNT(*) as result FROM information_schema.tables WHERE table_schema = 'klims-ibps3' AND table_name = 'LOGS_"+ equipSn +"'";
|
|
|
|
|
+ */
|
|
|
List<String> hastable = jdbcTemplate.queryForList(sqlQry, String.class);
|
|
List<String> hastable = jdbcTemplate.queryForList(sqlQry, String.class);
|
|
|
// log.info("hastable: " + hastable.get(0));
|
|
// log.info("hastable: " + hastable.get(0));
|
|
|
if (Objects.equals(hastable.get(0), "1")) {
|
|
if (Objects.equals(hastable.get(0), "1")) {
|
|
@@ -88,86 +112,160 @@ public class HuaTuRepository {
|
|
|
log.warn("时间格式化异常{},设备编号:{}",equipResult.getLogsTime(),equipSn);
|
|
log.warn("时间格式化异常{},设备编号:{}",equipResult.getLogsTime(),equipSn);
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
- WSDEntity wsdEntity = new WSDEntity();
|
|
|
|
|
- wsdEntity.setId(equipSn+"-"+saveToIDFormat.format(equipResult.getLogsTime()));
|
|
|
|
|
- wsdEntity.setCollectID(equipSn);
|
|
|
|
|
- wsdEntity.setCollectName(toLoggerInfo.getLOGNAME());
|
|
|
|
|
- wsdEntity.setCollectTime(equipResult.getLogsTime());
|
|
|
|
|
- wsdEntity.setCreateTime(currentDate);
|
|
|
|
|
- List<CollectorEntity> currentCollectorList = getDeviceInfo(equipSn, collectorList);
|
|
|
|
|
- if(!currentCollectorList.isEmpty()){
|
|
|
|
|
- for (CollectorEntity collectorEntity : currentCollectorList) {
|
|
|
|
|
- wsdEntity.setDeviceID(collectorEntity.getDeviceID());
|
|
|
|
|
- wsdEntity.setDeviceNo(collectorEntity.getDeviceNo());
|
|
|
|
|
- wsdEntity.setDeviceName(collectorEntity.getDeviceName());
|
|
|
|
|
- wsdEntity.setDeviceID(collectorEntity.getDeviceID());
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
if (toLoggerInfo.getCHNUM()==1){
|
|
if (toLoggerInfo.getCHNUM()==1){
|
|
|
|
|
+ WSDEntity wsdEntity = new WSDEntity();
|
|
|
|
|
+ List<CollectorEntity> currentCollectorList = getDeviceInfo(equipSn, collectorList);
|
|
|
|
|
+ if(!currentCollectorList.isEmpty()){
|
|
|
|
|
+ for (CollectorEntity collectorEntity : currentCollectorList) {
|
|
|
|
|
+ wsdEntity.setDeviceNo(collectorEntity.getDeviceNo());
|
|
|
|
|
+ wsdEntity.setDeviceName(collectorEntity.getDeviceName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ wsdEntity.setId(equipSn+"-"+saveToIDFormat.format(equipResult.getLogsTime()));
|
|
|
|
|
+ wsdEntity.setCollectID(equipSn);
|
|
|
|
|
+ wsdEntity.setCollectName(toLoggerInfo.getLOGNAME());
|
|
|
|
|
+ wsdEntity.setCollectTime(equipResult.getLogsTime());
|
|
|
|
|
+ wsdEntity.setCreateTime(currentDate);
|
|
|
|
|
+ wsdEntity.setShiYanZu(equipSn);
|
|
|
Integer type1 = toLoggerInfo.getTYPE1();
|
|
Integer type1 = toLoggerInfo.getTYPE1();
|
|
|
//0 温度 1 湿度
|
|
//0 温度 1 湿度
|
|
|
if (type1==0){
|
|
if (type1==0){
|
|
|
- wsdEntity.setType("温度计");
|
|
|
|
|
- wsdEntity.setTemperature(equipResult.getLogsChone());
|
|
|
|
|
- wsdEntity.setTemperatureHigh(String.valueOf(toLoggerInfo.getHIGH1()));
|
|
|
|
|
- wsdEntity.setTemperatureLow(String.valueOf(toLoggerInfo.getLOW1()));
|
|
|
|
|
|
|
+ wsdEntity.setType("温度");
|
|
|
|
|
+ if(toLoggerInfo.getLOW1()>0){
|
|
|
|
|
+ wsdEntity.setNote("冷藏");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(toLoggerInfo.getHIGH1()<0){
|
|
|
|
|
+ wsdEntity.setNote("冷冻");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (type1==1){
|
|
if (type1==1){
|
|
|
- wsdEntity.setType("湿度计");
|
|
|
|
|
- wsdEntity.setHumidity(equipResult.getLogsChone());
|
|
|
|
|
- wsdEntity.setHumidityHigh(String.valueOf(toLoggerInfo.getHIGH1()));
|
|
|
|
|
- wsdEntity.setHumidityLow(String.valueOf(toLoggerInfo.getLOW1()));
|
|
|
|
|
|
|
+ wsdEntity.setType("湿度");
|
|
|
|
|
+ wsdEntity.setNote("湿度");
|
|
|
}
|
|
}
|
|
|
- } else if (toLoggerInfo.getCHNUM()==2){
|
|
|
|
|
- Integer type1 = toLoggerInfo.getTYPE1();
|
|
|
|
|
- //0 温度 1 湿度
|
|
|
|
|
- if (type1==0){
|
|
|
|
|
-// wsdEntity.setType("温度计");
|
|
|
|
|
- wsdEntity.setTemperature(equipResult.getLogsChone());
|
|
|
|
|
- wsdEntity.setTemperatureHigh(String.valueOf(toLoggerInfo.getHIGH1()));
|
|
|
|
|
- wsdEntity.setTemperatureLow(String.valueOf(toLoggerInfo.getLOW1()));
|
|
|
|
|
|
|
+ wsdEntity.setResult(equipResult.getLogsChone());
|
|
|
|
|
+ wsdEntity.setResultHigh(String.valueOf(toLoggerInfo.getHIGH1()));
|
|
|
|
|
+ wsdEntity.setResultLow(String.valueOf(toLoggerInfo.getLOW1()));
|
|
|
|
|
+ wsdEntity.setControlFlag(isLoseControl(wsdEntity.getResult(), wsdEntity.getResultHigh(), wsdEntity.getResultLow()));
|
|
|
|
|
+ if((!existIDList.contains(wsdEntity.getId()))&&(!testmode.equals("2"))){
|
|
|
|
|
+ wsdlist.add(wsdEntity);
|
|
|
}
|
|
}
|
|
|
- if (type1==1){
|
|
|
|
|
-// wsdEntity.setType("湿度计");
|
|
|
|
|
- wsdEntity.setHumidity(equipResult.getLogsChone());
|
|
|
|
|
- wsdEntity.setHumidityHigh(String.valueOf(toLoggerInfo.getHIGH1()));
|
|
|
|
|
- wsdEntity.setHumidityLow(String.valueOf(toLoggerInfo.getLOW1()));
|
|
|
|
|
|
|
+ if(testmode.equals("2")){
|
|
|
|
|
+ wsdlist.add(wsdEntity);
|
|
|
}
|
|
}
|
|
|
- Integer type2 = toLoggerInfo.getTYPE2();
|
|
|
|
|
- //0 温度 1 湿度
|
|
|
|
|
- if (type2==0){
|
|
|
|
|
- if (type1==0){
|
|
|
|
|
- wsdEntity.setType("温度计");
|
|
|
|
|
- } else if (type1==1){
|
|
|
|
|
- wsdEntity.setType("温湿度计");
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ for (int i = 1; i<=toLoggerInfo.getCHNUM(); i++){
|
|
|
|
|
+ WSDEntity wsdEntity = new WSDEntity();
|
|
|
|
|
+ List<CollectorEntity> currentCollectorList = getDeviceInfo(equipSn, collectorList);
|
|
|
|
|
+ if(!currentCollectorList.isEmpty()){
|
|
|
|
|
+ for (CollectorEntity collectorEntity : currentCollectorList) {
|
|
|
|
|
+ wsdEntity.setDeviceNo(collectorEntity.getDeviceNo());
|
|
|
|
|
+ wsdEntity.setDeviceName(collectorEntity.getDeviceName());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- wsdEntity.setTemperature(equipResult.getLogsChtwo());
|
|
|
|
|
- wsdEntity.setTemperatureHigh(String.valueOf(toLoggerInfo.getHIGH2()));
|
|
|
|
|
- wsdEntity.setTemperatureLow(String.valueOf(toLoggerInfo.getLOW2()));
|
|
|
|
|
- }
|
|
|
|
|
- if (type2==1){
|
|
|
|
|
- if (type1==0){
|
|
|
|
|
- wsdEntity.setType("温湿度计");
|
|
|
|
|
- } else if (type1==1){
|
|
|
|
|
- wsdEntity.setType("湿度计");
|
|
|
|
|
|
|
+ wsdEntity.setId(equipSn+"-"+i+"-"+saveToIDFormat.format(equipResult.getLogsTime()));
|
|
|
|
|
+ wsdEntity.setCollectID(equipSn);
|
|
|
|
|
+ wsdEntity.setCollectName(toLoggerInfo.getLOGNAME());
|
|
|
|
|
+ wsdEntity.setCollectTime(equipResult.getLogsTime());
|
|
|
|
|
+ wsdEntity.setCreateTime(currentDate);
|
|
|
|
|
+ wsdEntity.setShiYanZu(equipSn+"-"+i);
|
|
|
|
|
+ if(i==1){
|
|
|
|
|
+ Integer type1 = toLoggerInfo.getTYPE1();
|
|
|
|
|
+ //0 温度 1 湿度
|
|
|
|
|
+ if (type1==0){
|
|
|
|
|
+ wsdEntity.setType("温度");
|
|
|
|
|
+ if(toLoggerInfo.getLOW1()>0){
|
|
|
|
|
+ wsdEntity.setNote("冷藏");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(toLoggerInfo.getHIGH1()<0){
|
|
|
|
|
+ wsdEntity.setNote("冷冻");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (type1==1){
|
|
|
|
|
+ wsdEntity.setType("湿度");
|
|
|
|
|
+ wsdEntity.setNote("湿度");
|
|
|
|
|
+ }
|
|
|
|
|
+ wsdEntity.setResult(equipResult.getLogsChone());
|
|
|
|
|
+ wsdEntity.setResultHigh(String.valueOf(toLoggerInfo.getHIGH1()));
|
|
|
|
|
+ wsdEntity.setResultLow(String.valueOf(toLoggerInfo.getLOW1()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(i==2){
|
|
|
|
|
+ Integer type2 = toLoggerInfo.getTYPE2();
|
|
|
|
|
+ //0 温度 1 湿度
|
|
|
|
|
+ if (type2==0){
|
|
|
|
|
+ wsdEntity.setType("温度");
|
|
|
|
|
+ if(toLoggerInfo.getLOW2()>0){
|
|
|
|
|
+ wsdEntity.setNote("冷藏");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(toLoggerInfo.getHIGH2()<0){
|
|
|
|
|
+ wsdEntity.setNote("冷冻");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (type2==1){
|
|
|
|
|
+ wsdEntity.setType("湿度");
|
|
|
|
|
+ wsdEntity.setNote("湿度");
|
|
|
|
|
+ }
|
|
|
|
|
+ wsdEntity.setResult(equipResult.getLogsChtwo());
|
|
|
|
|
+ wsdEntity.setResultHigh(String.valueOf(toLoggerInfo.getHIGH2()));
|
|
|
|
|
+ wsdEntity.setResultLow(String.valueOf(toLoggerInfo.getLOW2()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(i==3){
|
|
|
|
|
+ Integer type3 = toLoggerInfo.getTYPE3();
|
|
|
|
|
+ //0 温度 1 湿度
|
|
|
|
|
+ if (type3==0){
|
|
|
|
|
+ wsdEntity.setType("温度");
|
|
|
|
|
+ if(toLoggerInfo.getLOW3()>0){
|
|
|
|
|
+ wsdEntity.setNote("冷藏");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(toLoggerInfo.getHIGH3()<0){
|
|
|
|
|
+ wsdEntity.setNote("冷冻");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (type3==1){
|
|
|
|
|
+ wsdEntity.setType("湿度");
|
|
|
|
|
+ wsdEntity.setNote("湿度");
|
|
|
|
|
+ }
|
|
|
|
|
+ wsdEntity.setResult(equipResult.getLogsChthr());
|
|
|
|
|
+ wsdEntity.setResultHigh(String.valueOf(toLoggerInfo.getHIGH3()));
|
|
|
|
|
+ wsdEntity.setResultLow(String.valueOf(toLoggerInfo.getLOW3()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(i==4){
|
|
|
|
|
+ Integer type4 = toLoggerInfo.getTYPE4();
|
|
|
|
|
+ //0 温度 1 湿度
|
|
|
|
|
+ if (type4==0){
|
|
|
|
|
+ wsdEntity.setType("温度");
|
|
|
|
|
+ if(toLoggerInfo.getLOW4()>0){
|
|
|
|
|
+ wsdEntity.setNote("冷藏");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(toLoggerInfo.getHIGH4()<0){
|
|
|
|
|
+ wsdEntity.setNote("冷冻");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (type4==1){
|
|
|
|
|
+ wsdEntity.setType("湿度");
|
|
|
|
|
+ wsdEntity.setNote("湿度");
|
|
|
|
|
+ }
|
|
|
|
|
+ wsdEntity.setResult(equipResult.getLogsChfou());
|
|
|
|
|
+ wsdEntity.setResultHigh(String.valueOf(toLoggerInfo.getHIGH4()));
|
|
|
|
|
+ wsdEntity.setResultLow(String.valueOf(toLoggerInfo.getLOW4()));
|
|
|
|
|
+ }
|
|
|
|
|
+ wsdEntity.setControlFlag(isLoseControl(wsdEntity.getResult(), wsdEntity.getResultHigh(), wsdEntity.getResultLow()));
|
|
|
|
|
+ if((!existIDList.contains(wsdEntity.getId()))&&(!testmode.equals("2"))){
|
|
|
|
|
+ wsdlist.add(wsdEntity);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(testmode.equals("2")){
|
|
|
|
|
+ wsdlist.add(wsdEntity);
|
|
|
}
|
|
}
|
|
|
- wsdEntity.setHumidity(equipResult.getLogsChtwo());
|
|
|
|
|
- wsdEntity.setHumidityHigh(String.valueOf(toLoggerInfo.getHIGH2()));
|
|
|
|
|
- wsdEntity.setHumidityLow(String.valueOf(toLoggerInfo.getLOW2()));
|
|
|
|
|
}
|
|
}
|
|
|
- }else if (toLoggerInfo.getCHNUM()==3){
|
|
|
|
|
- //暂时没发现有
|
|
|
|
|
}
|
|
}
|
|
|
- wsdSet.add(wsdEntity);
|
|
|
|
|
}
|
|
}
|
|
|
}else{
|
|
}else{
|
|
|
log.info("table:LOGS_"+equipSn+" not exist!");
|
|
log.info("table:LOGS_"+equipSn+" not exist!");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return new ArrayList<>(wsdSet);
|
|
|
|
|
|
|
+ return new LinkedList<>(wsdlist);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
public List<CollectorEntity> getDeviceInfo(String CollectID, List<CollectorEntity> collectorList){
|
|
public List<CollectorEntity> getDeviceInfo(String CollectID, List<CollectorEntity> collectorList){
|
|
|
List<CollectorEntity> retEntity = new ArrayList<>();
|
|
List<CollectorEntity> retEntity = new ArrayList<>();
|
|
|
for (CollectorEntity collectorEntity:collectorList){
|
|
for (CollectorEntity collectorEntity:collectorList){
|
|
@@ -178,5 +276,20 @@ public class HuaTuRepository {
|
|
|
return retEntity;
|
|
return retEntity;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public String isLoseControl(String result, String resultHigh, String resultLow) {
|
|
|
|
|
+ String retVal = "失控";
|
|
|
|
|
+ try {
|
|
|
|
|
+ double res = Double.parseDouble(result);
|
|
|
|
|
+ double high = Double.parseDouble(resultHigh);
|
|
|
|
|
+ double low = Double.parseDouble(resultLow);
|
|
|
|
|
+ if (res > low && res < high) {
|
|
|
|
|
+ retVal = "正常";
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
|
|
+ // 如果字符串无法转换为数字,保持默认返回值1
|
|
|
|
|
+ }
|
|
|
|
|
+ return retVal;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|