Commit f08f6ac4 authored by tangwei's avatar tangwei

修改sn——code

parent 1e423742
......@@ -1035,8 +1035,8 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
}
// List<JpInverter> jpInverter1 = jpInverterMapper.selectList(new QueryWrapper<JpInverter>().
// eq("third_code", PVProducerInfoEnum.KSOLAR.getCode()));
List<JpInverter> jpInverter1 = jpInverterMapper.selectList(new QueryWrapper<JpInverter>().
eq("third_code", PVProducerInfoEnum.KSOLAR.getCode()));
......@@ -1059,8 +1059,19 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
Date startTimeL = sdf.parse(startTime);
Date recoverTimeL = sdf.parse(recoverTime);
String snCode=null;
if(jpInverter1!=null&&!jpInverter1.isEmpty()){
for (JpInverter jpInverter : jpInverter1) {
if(jpInverter.getCollectorId().equals(ksolarAlarmDto.getDeviceId())){
snCode=jpInverter.getCollectorSnCode();
break;
}
}
}
HYGFJPInverterWarn hygfjpInverterWarn = hygfjpInverterWarnMapper.selectOne(new QueryWrapper<HYGFJPInverterWarn>()
.eq("sn_code", ksolarAlarmDto.getAlarmId())
.eq("sn_code",snCode)
.eq("start_time", startTimeL.getTime())
.eq("third_code", PVProducerInfoEnum.KSOLAR.getCode())
.eq("third_station_id", ksolarAlarmDto.getStationId())
......@@ -1071,15 +1082,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
hygfjpInverterWarn.setTime(System.currentTimeMillis());
hygfjpInverterWarn.setTimeLong(System.currentTimeMillis());
// if(jpInverter1!=null&&!jpInverter1.isEmpty()){
// for (JpInverter jpInverter : jpInverter1) {
// if(jpInverter.getCollectorId().equals(ksolarAlarmDto.getDeviceId())){
// hygfjpInverterWarn.setSnCode(jpInverter.getCollectorSnCode());
// break;
// }
// }
// }
hygfjpInverterWarn.setSnCode(snCode);
hygfjpInverterWarn.setThirdStationId(ksolarAlarmDto.getStationId());
hygfjpInverterWarn.setLevel(KSolarConstant.alarmLevel.get(ksolarAlarmDto.getLevels()));
hygfjpInverterWarn.setContent(ksolarAlarmDto.getMessage());
......
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