Commit 5451d6bb authored by chenzhao's avatar chenzhao

修改代码

parent a5335c61
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpCollector;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInverterElectricity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
......@@ -99,7 +100,8 @@ public class JpInverterDto extends BaseDto {
private List<String> stationIds;
private List<JpCollector> jpCollectors;
private List<JpInverterElectricity> JL;
private List<JpInverterElectricity> ZL;
@ApiModelProperty(value = "所属电站名称")
private String name;
......
......@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.entity.*;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpCollectorServiceImpl;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpInverterElectricityServiceImpl;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpStationServiceImpl;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.BeanUtils;
......@@ -65,7 +66,8 @@ public class JpInverterController extends BaseController {
JpStationServiceImpl jpStationServiceImpl;
@Autowired
JpCollectorServiceImpl jpCollectorService;
@Autowired
JpInverterElectricityServiceImpl jpInverterElectricityService;
@Autowired
JpPersonStationMapper pPersonStationMapper;
@Value("classpath:/json/paramsTree.json")
......@@ -401,6 +403,20 @@ public class JpInverterController extends BaseController {
wrapper.eq(BaseEntity::getIsDelete, false);
List<JpCollector> jpCollector = jpCollectorService.getBaseMapper().selectList(wrapper);
String[] names = new String[]{"PV1","PV2","PV3","PV4"};
List<String> list = Arrays.asList(names);
LambdaQueryWrapper<JpInverterElectricity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JpInverterElectricity::getSnCode,snCode);
queryWrapper.eq(JpInverterElectricity::getThirdStationId,jpInverter.getThirdStationId());
queryWrapper.and(q->q.eq(JpInverterElectricity::getType,"交流").or().in(JpInverterElectricity::getName,list));
List<JpInverterElectricity> jpInverterElectricities = jpInverterElectricityService.getBaseMapper().selectList(queryWrapper);
Map<String, List<JpInverterElectricity>> collect = jpInverterElectricities.stream().collect(Collectors.groupingBy(JpInverterElectricity::getType));
jpInverterDto.setZL(collect.get("直流"));
jpInverterDto.setJL(collect.get("交流"));
BeanUtils.copyProperties(jpInverter,jpInverterDto);
jpInverterDto.setJpCollectors(jpCollector);
......
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