|
|
@@ -16,9 +16,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.jdbc.core.RowMapper;
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
|
|
-import java.nio.charset.StandardCharsets;
|
|
|
-import java.security.MessageDigest;
|
|
|
-import java.security.NoSuchAlgorithmException;
|
|
|
import java.time.Instant;
|
|
|
import java.time.ZoneId;
|
|
|
import java.time.LocalDateTime;
|
|
|
@@ -117,6 +114,7 @@ public class VendorBinxiangRepository {
|
|
|
bx.setShiyanzhuId(wenDu.getDeptId_());
|
|
|
bx.setType(wenDu.getDeviceType_());
|
|
|
bx.setArea(wenDu.getArea_());
|
|
|
+ bx.setDiDian(wenDu.getDiDian_());
|
|
|
}
|
|
|
EquipRelation shiDu = getWsdRange(twksbpzb.getDeviceNo_(),"湿度");
|
|
|
if (shiDu != null){
|
|
|
@@ -126,6 +124,7 @@ public class VendorBinxiangRepository {
|
|
|
bx.setShiyanzhuId(shiDu.getDeptId_());
|
|
|
bx.setType(shiDu.getDeviceType_());
|
|
|
bx.setArea(shiDu.getArea_());
|
|
|
+ bx.setDiDian(shiDu.getDiDian_());
|
|
|
}
|
|
|
bxSet.add(bx);
|
|
|
}
|
|
|
@@ -152,6 +151,7 @@ public class VendorBinxiangRepository {
|
|
|
bx.setShiyanzhuId(wenDu.getDeptId_());
|
|
|
bx.setType(wenDu.getDeviceType_());
|
|
|
bx.setArea(wenDu.getArea_());
|
|
|
+ bx.setDiDian(wenDu.getDiDian_());
|
|
|
bxSet.add(bx);
|
|
|
}
|
|
|
}
|
|
|
@@ -178,6 +178,7 @@ public class VendorBinxiangRepository {
|
|
|
er.setArea_(rs.getString("area_"));
|
|
|
er.setDeptId_(rs.getString("dept_id_"));
|
|
|
er.setDeptName_(rs.getString("dept_name_"));
|
|
|
+ er.setDiDian_(rs.getString("di_dian_"));
|
|
|
return er;
|
|
|
});
|
|
|
} catch (Exception e) {
|
|
|
@@ -197,14 +198,14 @@ public class VendorBinxiangRepository {
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
long endTime = LocalDateTime.of(now.getYear(), now.getMonthValue(), now.getDayOfMonth(), now.getHour(), now.getMinute()).
|
|
|
atZone(ZoneId.systemDefault()).toInstant().getEpochSecond();
|
|
|
- long startTime = LocalDateTime.of(now.getYear(), now.getMonthValue(), 2, 17, 0).
|
|
|
+ long startTime = LocalDateTime.of(now.getYear(), now.getMonthValue(), 5, 13, 0).
|
|
|
atZone(ZoneId.systemDefault()).toInstant().getEpochSecond();
|
|
|
params.put("starttime",String.valueOf(startTime));
|
|
|
params.put("endtime",String.valueOf(endTime));
|
|
|
- params.put("tsign","1");
|
|
|
+ params.put("tsign","0");
|
|
|
params.put("eventfield","temperature");
|
|
|
params.put("level","1,2,3,4,5");
|
|
|
- params.put("isnormalnotification","0");
|
|
|
+ params.put("isnormalnotification","1");
|
|
|
String sql = "SELECT device_no_,serial_no_ from equip_relation WHERE enable_='是' GROUP BY device_no_";
|
|
|
RowMapper<EquipRelation> infoRowMapper = new BeanPropertyRowMapper<>(EquipRelation.class);
|
|
|
List<EquipRelation> list = jdbcTemplate.query(sql, infoRowMapper);
|
|
|
@@ -213,8 +214,8 @@ public class VendorBinxiangRepository {
|
|
|
for(EquipRelation twksbpzb : list){
|
|
|
params.put("mainserial",twksbpzb.getDeviceNo_());
|
|
|
params.put("serial",twksbpzb.getSerialNo_());
|
|
|
- String paramStr = "_endtime_"+endTime+"_eventfield_"+"temperature"+"_isnormalnotification_"+"0"+"_level_"+"1,2,3,4,5"
|
|
|
- +"_mainserial_"+twksbpzb.getDeviceNo_()+"_serial_"+twksbpzb.getSerialNo_()+"_starttime_"+startTime+"_tsign_"+"1_";
|
|
|
+ String paramStr = "_endtime_"+endTime+"_eventfield_"+"temperature"+"_isnormalnotification_"+"1"+"_level_"+"1,2,3,4,5"
|
|
|
+ +"_mainserial_"+twksbpzb.getDeviceNo_()+"_serial_"+twksbpzb.getSerialNo_()+"_starttime_"+startTime+"_tsign_"+"0_";
|
|
|
String origin = equipAppKey + paramStr + second + "_" + equipAppSecret;
|
|
|
String sign = DigestUtil.md5Hex(origin).toUpperCase();
|
|
|
headers.put("sign",sign);
|
|
|
@@ -223,10 +224,11 @@ public class VendorBinxiangRepository {
|
|
|
if (reposn.get("status").equals("0000")){
|
|
|
JSONArray data = reposn.getJSONArray("data");
|
|
|
if(!data.isEmpty()){
|
|
|
+ log.warn("alarm:{}",result);
|
|
|
for(Object object : data){
|
|
|
JSONObject alarm = (JSONObject) object;
|
|
|
TWsdyjjlb wsdyjjlb = new TWsdyjjlb();
|
|
|
- wsdyjjlb.setId(alarm.getString("serial")+alarm.getInteger("dataTime"));
|
|
|
+ wsdyjjlb.setId(alarm.getString("serial")+"-"+alarm.getInteger("dataTime"));
|
|
|
wsdyjjlb.setMainserial(alarm.getString("mainSerial"));
|
|
|
wsdyjjlb.setDevicetitle(alarm.getString("deviceTitle"));
|
|
|
wsdyjjlb.setSerial(alarm.getString("serial"));
|
|
|
@@ -237,11 +239,11 @@ public class VendorBinxiangRepository {
|
|
|
String sendTime = LocalDateTime.ofInstant(Instant.ofEpochSecond(alarm.getInteger("sendTime")), ZoneId.systemDefault()).format(formatter);
|
|
|
wsdyjjlb.setDatatime(dataTime);
|
|
|
wsdyjjlb.setSendtime(sendTime);
|
|
|
- wsdyjjlb.setTsign(alarm.get("tsign").toString());
|
|
|
+ wsdyjjlb.setTsign(alarm.getInteger("tSign")==0?"0":alarm.getString("tSign"));
|
|
|
wsdyjjlb.setEventfield(alarm.getString("eventField"));
|
|
|
wsdyjjlb.setIsnormalnotification(alarm.getString("isNormalNotification"));
|
|
|
wsdyjjlb.setLevel(alarm.getString("level"));
|
|
|
- wsdyjjlb.setIshandled(alarm.get("isHandled").toString());
|
|
|
+ wsdyjjlb.setIshandled(alarm.getInteger("isHandled")==0?"0":alarm.getString("isHandled"));
|
|
|
wsdyjjlb.setAlarmreason(alarm.getString("alarmReason"));
|
|
|
wsdyjjlb.setSolution(alarm.getString("solution"));
|
|
|
wsdyjjlb.setHandledby(alarm.getString("handledBy"));
|