Commit 6076fdbc authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 6f25e1ab 7bf1379a
......@@ -120,6 +120,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
for (String stationId : stationIds) {
LambdaQueryWrapper<KsolarStationList> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(KsolarStationList::getStationId, stationId);
wrapper.orderByDesc(KsolarStationList::getCreatedTime);
List<KsolarStationList> ksolarStationLists = kSolarStationMapper.selectList(wrapper);
if (!CollectionUtils.isEmpty(ksolarStationLists)) {
KsolarStationList ksolarStation = ksolarStationLists.get(0);
......@@ -170,11 +171,11 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
jpStation.setState(KSolarConstant.stationStaus.get(String.valueOf(ksolarStation.getStatus())));
jpStation.setRealTimePower(ksolarStation.getPowerInter());
jpStation.setDayGenerate(ksolarStation.getDayGeneration());
jpStation.setDayGenerate(ksolarStation.getDayGeneration() * KSolarConstant.kwhToMwh);
jpStation.setAccumulatedPower(ksolarStation.getTotalGeneration());
jpStation.setArea(ksolarStation.getAddress());
// 日收益
jpStation.setDayIncome(stationEarn.getDayEarn() * KSolarConstant.kwhToMwh);
jpStation.setDayIncome(stationEarn.getDayEarn());
// 月发电量
jpStation.setMonthGenerate(stationEarn.getMonthGeneration() * KSolarConstant.kwhToMwh);
// 年发电量
......@@ -331,6 +332,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
for (String stationId : stationIds) {
LambdaQueryWrapper<KsolarStationList> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(KsolarStationList::getStationId, stationId);
wrapper.orderByDesc(KsolarStationList::getCreatedTime);
List<KsolarStationList> ksolarStationLists = kSolarStationMapper.selectList(wrapper);
if (!CollectionUtils.isEmpty(ksolarStationLists)) {
KsolarStationList ksolarStationList = ksolarStationLists.get(0);
......@@ -416,6 +418,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
collectIds.forEach(collectId -> {
LambdaQueryWrapper<KsolarStationCollectList> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(KsolarStationCollectList::getCollectId, collectId);
wrapper.orderByDesc(KsolarStationCollectList::getCreatedTime);
List<KsolarStationCollectList> ksolarStationCollectLists = ksolarStationCollectListMapper.selectList(wrapper);
if (!CollectionUtils.isEmpty(ksolarStationCollectLists)) {
KsolarStationCollectList ksolarStationCollectList = ksolarStationCollectLists.get(0);
......@@ -461,7 +464,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
jpInverter.setUpdateTime(new Date());
jpInverter.setCurrentPower(ksolarStationCollectData.getPowerApparent());
jpInverter.setDayPowerGeneration(ksolarStationCollectData.getDayGeneration());
jpInverter.setDayPowerGeneration(ksolarStationCollectData.getDayGeneration() * KSolarConstant.kwhToMwh);
jpInverter.setMonthPowerGeneration(ksolarStationCollectData.getMonthGeneration() * KSolarConstant.kwhToMwh);
jpInverter.setYearPowerGeneration(ksolarStationCollectData.getYearGeneration() * KSolarConstant.kwhToMwh);
jpInverter.setTotalPowerGeneration(ksolarStationCollectData.getTotalGeneration() * KSolarConstant.kwhToMwh);
......@@ -470,6 +473,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
jpInverter.setThirdStationId(ksolarStationCollectList.getThirdStationId());
jpInverter.setThirdCode(PVProducerInfoEnum.KSOLAR.getCode());
jpInverter.setStationName(ksolarStationCollectList.getStationName());
jpInverter.setAddr(ksolarStationCollectList.getAddress());
if (!ObjectUtils.isEmpty(jpInverter.getSequenceNbr())) {
jpInverterMapper.updateById(jpInverter);
} else {
......
......@@ -954,4 +954,24 @@ public class BigScreenAnalyseController extends BaseController {
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取区域信息,根据层级查询单位信息 key 和 value都是区域名称")
@GetMapping("/getAreaListByLevel")
public ResponseModel<List<Map<String, String>>> getAreaListByLevel(@RequestParam("level") String level) throws Exception {
FeignClientResult<List<CompanyModel>> listFeignClientResult = Privilege.companyClient.queryAgencyList(level);
ArrayList<Map<String, String>> maps = new ArrayList<>();
if (!ObjectUtils.isEmpty(listFeignClientResult)) {
if (listFeignClientResult.getStatus() == 200) {
listFeignClientResult.getResult().forEach(item -> {
HashMap<String, String> resultMap = new HashMap<>();
resultMap.put("text", item.getCompanyName());
resultMap.put("value", item.getCompanyName());
maps.add(resultMap);
});
} else {
throw new RuntimeException(listFeignClientResult.getMessage());
}
}
return ResponseHelper.buildResponse(maps);
}
}
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