Commit c0ac0241 authored by caotao's avatar caotao

锦浪云数据采集问题处理

parent 4353e002
......@@ -59,8 +59,8 @@ public class HouseholdTestController {
@PostMapping(value = "/golangnew")
@ApiOperation(httpMethod = "POST", value = "锦浪云", notes = "锦浪云")
public void golangnew() throws IOException {
goLangDataAcquisitionService.stationList();
// goLangDataAcquisitionService.stationDetail();
// goLangDataAcquisitionService.stationList();
goLangDataAcquisitionService.stationDetail();
// goLangDataAcquisitionService.collectorList();
//// goLangDataAcquisitionService.inverterList();
// goLangDataAcquisitionService.collectorDetail();
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.api.householdapi.face.service.impl;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.log.Log;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.api.householdapi.Utils.GolangRequestUtil;
import com.yeejoin.amos.api.householdapi.constant.GoLangConstant;
......@@ -143,6 +144,11 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
GoLangConstant.resovleRule_data,
GolangStationDetail.class
);
if (result.size() > 0) {
} else {
System.out.println(stationIds.get(i));
}
for (int j = 0; j < result.size(); j++) {
GolangStationDetail golangStationDetail = result.get(j);
golangStationDetail.setCreatedTime(System.currentTimeMillis());
......@@ -163,8 +169,9 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpStation.setUserName(golangStationDetail.getUsername());
jpStation.setUserPhone(String.valueOf(golangStationDetail.getUsermobile()));
jpStation.setStationContact(String.valueOf(golangStationDetail.getMobile()).toLowerCase().replace("null", ""));
jpStation.setModuleCount(ObjectUtils.isEmpty(Math.toIntExact(golangStationDetail.getModule())) ? 0 : Math.toIntExact(golangStationDetail.getModule()));
//并网类型
if(!ObjectUtils.isEmpty(golangStationDetail.getModule())) {
jpStation.setModuleCount(ObjectUtils.isEmpty(Math.toIntExact(golangStationDetail.getModule())) ? 0 : Math.toIntExact(golangStationDetail.getModule()));
}//并网类型
jpStation.setState(GoLangConstant.stationStaus.get(String.valueOf(golangStationDetail.getState())));
jpStation.setThirdStationId(String.valueOf(golangStationDetail.getId()));
jpStation.setThirdCode(PVProducerInfoEnum.JLY.getCode());
......@@ -189,6 +196,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpStation.setCreateTime(new Date(golangStationDetail.getCreatedate()));
jpStation.setRatedPower(Double.valueOf(golangStationDetail.getInverterpower()));
jpStation.setType("家庭户用");
jpStation.setRecDate(new Date());
if (!ObjectUtils.isEmpty(jpStation.getSequenceNbr())) {
jpStationMapper.updateById(jpStation);
} else {
......@@ -371,6 +379,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpCollector.setName(collectorDetailDto.getName());
//信号强度
jpCollector.setSignalStrength(collectorDetailDto.getRssiLevel());
jpCollector.setRecDate(new Date());
if (ObjectUtils.isEmpty(jpCollector.getSequenceNbr())) {
jpCollectorMapper.insert(jpCollector);
} else {
......@@ -466,6 +475,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpInverter.setThirdStationId(String.valueOf(inverterDetailDto.getStationId()));
jpInverter.setThirdCode(PVProducerInfoEnum.JLY.getCode());
jpInverter.setStationName(inverterDetailDto.getStationName());
jpInverter.setRecDate(new Date());
if (!ObjectUtils.isEmpty(jpInverter.getSequenceNbr())) {
jpInverterMapper.updateById(jpInverter);
} else {
......
......@@ -290,6 +290,7 @@ public class ImasterDataServiceImpl implements ImasterDataService {
// jpStation.setAccessTime(new Date(imasterStationDetail.getFisgeneratetime()));
// jpStation.setCreateTime(new Date(imasterStationDetail.getCreatedate()));
// jpStation.setRatedPower(Double.valueOf(imasterStationDetail.getInverterpower()));
jpStation.setRecDate(new Date());
if (!ObjectUtils.isEmpty(jpStation.getSequenceNbr())) {
jpStationMapper.updateById(jpStation);
} else {
......@@ -457,6 +458,7 @@ public class ImasterDataServiceImpl implements ImasterDataService {
jpCollector.setVersion(imasterCollectorList.getSoftwareVersion());
// jpCollector.setAddr(collectorDetailDto.getAddr());
// jpCollector.setName(collectorDetailDto.getName());
jpCollector.setRecDate(new Date());
if (ObjectUtils.isEmpty(jpCollector.getSequenceNbr())) {
jpCollectorMapper.insert(jpCollector);
} else {
......@@ -647,6 +649,7 @@ public class ImasterDataServiceImpl implements ImasterDataService {
jpInverter.setThirdStationId(String.valueOf(imasterInverterList.getStationCode()));
jpInverter.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
jpInverter.setStationName(imasterInverterList.getStationName());
jpInverter.setRecDate(new Date());
if (!ObjectUtils.isEmpty(jpInverter.getSequenceNbr())) {
jpInverterMapper.updateById(jpInverter);
} else {
......
......@@ -230,7 +230,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
// jpStation.setStationContact(String.valueOf(golangStationDetail.getMobile()).toLowerCase().replace("null", ""));
// 组件数量
// jpStation.setModuleCount(ObjectUtils.isEmpty(Math.toIntExact(golangStationDetail.getModule()))?0:Math.toIntExact(golangStationDetail.getModule()));
jpStation.setRecDate(new Date());
if (!ObjectUtils.isEmpty(jpStation.getSequenceNbr())) {
jpStationMapper.updateById(jpStation);
} else {
......@@ -474,13 +474,12 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
jpCollector.setType(ksolarStationCollectList.getDeviceModel());
//信号强度
jpCollector.setSignalStrength(String.valueOf(ksolarStationCollectList.getSignal()));
jpCollector.setRecDate(new Date());
if (ObjectUtils.isEmpty(jpCollector.getSequenceNbr())) {
jpCollectorMapper.insert(jpCollector);
} else {
jpCollectorMapper.updateById(jpCollector);
}
HYGFJPCollectorHistory hygfjpCollectorHistory = new HYGFJPCollectorHistory();
hygfjpCollectorHistory.setTime(System.currentTimeMillis());
hygfjpCollectorHistory.setCreatedTime(System.currentTimeMillis());
......@@ -500,8 +499,6 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
List<JpCollector> jpCollectorlist = jpCollectorMapper.selectList(new QueryWrapper<JpCollector>().
eq("third_code", PVProducerInfoEnum.KSOLAR.getCode()));
List<String> collectIds = ksolarStationCollectListMapper.getCollectIds();
if (!CollectionUtils.isEmpty(collectIds)) {
collectIds.forEach(collectId -> {
......@@ -518,7 +515,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
}
HashMap<String, Object> requestInfo = new HashMap<>(1);
String requestParaminfo = JSON.toJSONString(requestInfo);
String url = KSolarConstant.stationCollectDataUrl + "?collectId=" + ksolarStationCollectList.getCollectId();
String url = KSolarConstant.stationCollectDataUrl + "?collectId=" + collectId;
List<KsolarStationCollectData> result = kSolarRequestUtil.getResPonse(
url,
KSolarConstant.requestGET,
......@@ -526,12 +523,11 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
KSolarConstant.resovle_data,
KsolarStationCollectData.class
);
if (jpCollectorlist != null && jpCollectorlist.size() > 0) {
JpCollector jpCollectorflag = null;
for (JpCollector jpCollector : jpCollectorlist) {
if (jpCollector.getSnCode().equals(ksolarStationCollectList.getCollectId().trim()) && KSolarConstant.stationStaus.get("1").equals(jpCollector.getState())) {
if (jpCollector.getSnCode().equals(ksolarStationCollectList.getCollectId().trim()) && KSolarConstant.collectStaus.get("1").equals(jpCollector.getState())) {
jpCollectorflag = jpCollector;
break;
}
......@@ -563,6 +559,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
jpInverter.setThirdCode(PVProducerInfoEnum.KSOLAR.getCode());
jpInverter.setStationName(ksolarStationCollectList.getStationName());
jpInverter.setAddr(ksolarStationCollectList.getAddress());
jpInverter.setRecDate(new Date());
if (!ObjectUtils.isEmpty(jpInverter.getSequenceNbr())) {
jpInverterMapper.updateById(jpInverter);
} else {
......@@ -710,7 +707,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
List<JpInverter> jpInverterList = jpInverterMapper.selectList(new QueryWrapper<JpInverter>().
eq("third_station_id", ksolarStationCollectList.getThirdStationId()).
eq("third_code", PVProducerInfoEnum.KSOLAR.getCode()).
eq("sn_code", ksolarStationCollectData.getInverterId().trim())
like("sn_code", ksolarStationCollectData.getInverterId().trim())
.isNotNull("sn_code")
.orderByDesc("update_time"));
JpInverter jpInverter =jpInverterList.get(0);
......@@ -735,7 +732,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
}
jpInverter.setSnCode(ksolarStationCollectData.getInverterId().trim());
jpInverter.setId(ksolarStationCollectData.getInverterId().trim());
jpInverter.setState(KSolarConstant.stationStaus.get(ksolarStationCollectData.getStatus()));
jpInverter.setState(KSolarConstant.collectStaus.get(ksolarStationCollectData.getStatus()));
jpInverter.setCollectorId(ksolarStationCollectList.getCollectId().trim());
jpInverter.setCollectorSnCode(ksolarStationCollectList.getCollectId().trim());
jpInverter.setUpdateTime(new Date());
......@@ -810,7 +807,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
}
JpInverterElectricity jpInverterElectricityS = jpInverterElectricityMapper.selectOne(new QueryWrapper<JpInverterElectricity>().
eq("sn_code", ksolarStationCollectData.getInverterId()).
eq("sn_code", ksolarStationCollectData.getInverterId().trim()).
eq("type", "交流").
eq("name", "ST")
);
......
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