Commit 1e732fdf authored by tangwei's avatar tangwei

解决冲突

parents af40e454 2154cf0f
......@@ -27,5 +27,5 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato
@Param("gateway") String gateway,
@Param("frontModule") String frontModule,
@Param("offset") int offset);
Object getIndicatoralueAvage(String gateway,String indicator);
}
......@@ -66,4 +66,10 @@
</if>
</where>
</select>
<select id="getIndicatoralueAvage" resultType="Object">
SELECT AVG(indicator_value) wind_speed
FROM monitor_fan_indicator
WHERE gateway=#{gateway} and
indicator like concat('%',#{indicator},'%')
</select>
</mapper>
......@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.Test;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.SjglZsjZsbtzServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.StationBasicServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.TestServiceImpl;
......@@ -47,6 +48,9 @@ public class DemoController extends BaseController {
InfluxDbConnection influxDbConnection;
@Autowired
SjglZsjZsbtzServiceImpl sjglZsjZsbtzServiceImpl;
@Autowired
MonitorFanIndicatorImpl monitorFanIndicatorImpl;
@Autowired
InfluxDButils influxDButils;
......@@ -72,10 +76,11 @@ public class DemoController extends BaseController {
System.out.println(list.size());
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "测试数据同步逻辑")
@ApiOperation(value = "测试获取风速平均值")
@GetMapping("/test4")
public void demoTest3() {
Object o=this.monitorFanIndicatorImpl.getIndicatoralueAvage("1668801435891929089","60秒平均风速");
System.out.println(o.toString());
}
......
......@@ -12,4 +12,11 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz;
*/
public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> {
/**
* 根据场站信息获取装机容量
* @param WERKS
* @return
*/
Double getStationCapactityByStationWerks(String WERKS);
}
......@@ -94,4 +94,15 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
treeDto.setChildren(treeDtos);
return treeDto;
}
/**
* 根据网关与指标获取指标的平均值
* @param gateway
* @param indicator
* @return
*/
public Object getIndicatoralueAvage(String gateway,String indicator){
return monitorFanIndicatorregionMapper.getIndicatoralueAvage(gateway,indicator);
}
}
......@@ -19,29 +19,58 @@ import java.util.concurrent.atomic.AtomicReference;
@Service
public class MonitoringServiceImpl {
/**
* 区域mapper
*/
@Autowired
RegionMapper regionMapper;
/**
* 场站mapper
*/
@Autowired
StationBasicMapper stationBasicMapper;
/**
* 场站坐标mapper
*/
@Autowired
StationCoordinateMapper stationCoordinateMapper;
/***
* 设备基础信息中间表数据-热工院
*/
@Autowired
SjglZsjZsbtzServiceImpl SjglZsjZsbtzServiceImpl;
/**
* 热工院-数据字典表
*/
@Autowired
TpriDmpDatabookServiceImpl TpriDmpDatabookServiceImpl;
@Autowired
MonitorFanIndicatorImpl monitorFanIndicatorImpl;
/**
* 根据省份名称查询电站详情
* @param provinceName
* @return
*/
public List<RegionNationWideDto> getNationWideInfo(String provinceName){
List<RegionNationWideDto> regionNationWideDtoList= new ArrayList<>();
if(ObjectUtils.isEmpty(provinceName)||provinceName.equals("")){
List<Region> regionList = this.regionMapper.selectList(new QueryWrapper<Region>().eq("level",1));
for (int i = 0; i < regionList.size(); i++) {
RegionNationWideDto regionNationWideDto = new RegionNationWideDto();
AtomicReference<Double> guangfuMW = new AtomicReference<>(0.0);
AtomicReference<Double> fengdianMW = new AtomicReference<>(0.0);
AtomicReference<Integer> guangfu = new AtomicReference<>(0);
AtomicReference<Integer> fengdian = new AtomicReference<>(0);
Region region = regionList.get(i);
List<StationBasic> list = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().like("belong_area",region.getRegionCode()));
list.forEach(stationBasic -> {
if(stationBasic.getStationType().equals("FDZ")){
fengdianMW.set(getStationCaPACITYL(stationBasic.getStationNumber()));
fengdian.getAndSet(fengdian.get() + 1);
}else {
guangfuMW.set(getStationCaPACITYL(stationBasic.getStationNumber()));
guangfu.getAndSet(guangfu.get() + 1);
}
});
......@@ -59,7 +88,11 @@ public class MonitoringServiceImpl {
RegionNationWideDto regionNationWideDto =new RegionNationWideDto();
regionNationWideDto.setStaitionName(stationBasic.getStationName());
regionNationWideDto.setStaitionType(stationBasic.getStationType());
if(stationBasic.getStationType().equals("FDZ")){
}else{
regionNationWideDto.setSpeendOrirradiate(String.valueOf(Math.random()*1000));
}
StationCoordinate stationCoordinate = stationCoordinateMapper.selectOne(new QueryWrapper<StationCoordinate>().eq("station_id",stationBasic.getSequenceNbr()).eq("is_main_coordinate",0));
hashMap.put("lng", Double.valueOf(stationCoordinate.getLongitude()));
hashMap.put("lat", Double.valueOf(stationCoordinate.getLaitude()));
......@@ -70,4 +103,13 @@ public class MonitoringServiceImpl {
}
return regionNationWideDtoList;
}
/**
* 根据场站编号获取该场站的装机容量
* @param werks
* @return
*/
public Double getStationCaPACITYL(String werks){
return this.SjglZsjZsbtzServiceImpl.getStationCapactityByStationWerks(werks);
}
}
......@@ -56,5 +56,7 @@ public class SjglZsjZsbtzServiceImpl {
sjglZsjZsbtzList = sjglZsjZsbtzMapper.selectList(new QueryWrapper<SjglZsjZsbtz>().isNotNull("DBID"));
return sjglZsjZsbtzList;
}
public Double getStationCapactityByStationWerks(String WERKS){
return this.sjglZsjZsbtzMapper.getStationCapactityByStationWerks(WERKS);
}
}
\ No newline at end of file
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