devLink光伏设备数据服务
This commit is contained in:
parent
69de6ace01
commit
3d84b71d00
@ -0,0 +1,76 @@
|
||||
package com.fastbee.deviceData.api.devlink.service;
|
||||
|
||||
import com.fastbee.deviceData.domain.DeviceRealtimedataPhotovoltaic;
|
||||
import com.fastbee.deviceData.mapper.DeviceRealtimedataPhotovoltaicMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* devLink光伏设备数据服务
|
||||
*/
|
||||
@Service
|
||||
public class DevLinkPhotovoltaicDataService extends DevLinkRealTimeDataService{
|
||||
@Autowired
|
||||
private DevLinkAuthorizationService authorizationService;
|
||||
@Autowired
|
||||
private DeviceRealtimedataPhotovoltaicMapper photovoltaicMapper;
|
||||
//封装数据
|
||||
public DeviceRealtimedataPhotovoltaic setData(Map<String, String> propertiesMap){
|
||||
DeviceRealtimedataPhotovoltaic photovoltaic = DeviceRealtimedataPhotovoltaic.builder()
|
||||
.airTemp(toBigDecimalValue(propertiesMap.get("airTemp")))
|
||||
.mppTemp(toBigDecimalValue(propertiesMap.get("mppTemp")))
|
||||
.batteryCap(Long.parseLong(propertiesMap.get("batteryCap")))
|
||||
.batteryVolt(toBigDecimalValue(propertiesMap.get("batteryVolt")))
|
||||
.batteryCur(toBigDecimalValue(propertiesMap.get("batteryCur")))
|
||||
.batteryPower(toBigDecimalValue(propertiesMap.get("batteryPower")))
|
||||
.loadVolt(toBigDecimalValue(propertiesMap.get("loadVolt")))
|
||||
.loadCur(toBigDecimalValue(propertiesMap.get("loadCur")))
|
||||
.loadPower(toBigDecimalValue(propertiesMap.get("loadPower")))
|
||||
.photVolt(toBigDecimalValue(propertiesMap.get("photVolt")))
|
||||
.photCur(toBigDecimalValue(propertiesMap.get("photCur")))
|
||||
.photPower(toBigDecimalValue(propertiesMap.get("photPower")))
|
||||
.cumChargeDay(toBigDecimalValue(propertiesMap.get("cum_charge_day")))
|
||||
.cumChargeMon(toBigDecimalValue(propertiesMap.get("cum_charge_mon")))
|
||||
.cumChargeYear(toBigDecimalValue(propertiesMap.get("cum_charge_year")))
|
||||
.cumChargeAll(toBigDecimalValue(propertiesMap.get("cum_charge_all")))
|
||||
.cumEleDay(toBigDecimalValue(propertiesMap.get("cum_ele_day")))
|
||||
.cumEleMon(toBigDecimalValue(propertiesMap.get("cum_ele_mon")))
|
||||
.cumEleYear(toBigDecimalValue(propertiesMap.get("cum_ele_year")))
|
||||
.cumEleAll(toBigDecimalValue(propertiesMap.get("cum_ele_all")))
|
||||
.shoudong(toBigDecimalValue(propertiesMap.get("shoudong")))
|
||||
.control(toBigDecimalValue(propertiesMap.get("control")))
|
||||
.airTemp2(toBigDecimalValue(propertiesMap.get("airTemp_2")))
|
||||
.mppTemp2(toBigDecimalValue(propertiesMap.get("mppTemp_2")))
|
||||
.batteryCap2(Long.parseLong(propertiesMap.get("batteryCap_2")))
|
||||
.batteryVolt2(toBigDecimalValue(propertiesMap.get("batteryVolt_2")))
|
||||
.batteryCur2(toBigDecimalValue(propertiesMap.get("batteryCur_2")))
|
||||
.batteryPower2(toBigDecimalValue(propertiesMap.get("batteryPower_2")))
|
||||
.loadVolt2(toBigDecimalValue(propertiesMap.get("loadVolt_2")))
|
||||
.loadCur2(toBigDecimalValue(propertiesMap.get("loadCur_2")))
|
||||
.loadPower2(toBigDecimalValue(propertiesMap.get("loadPower_2")))
|
||||
.photVolt2(toBigDecimalValue(propertiesMap.get("photVolt_2")))
|
||||
.photCur2(toBigDecimalValue(propertiesMap.get("photCur_2")))
|
||||
.photPower2(toBigDecimalValue(propertiesMap.get("photPower_2")))
|
||||
.cumChargeDay2(toBigDecimalValue(propertiesMap.get("cum_charge_day_2")))
|
||||
.cumChargeMon2(toBigDecimalValue(propertiesMap.get("cum_charge_mon_2")))
|
||||
.cumChargeYear2(toBigDecimalValue(propertiesMap.get("cum_charge_year_2")))
|
||||
.cumChargeAll2(toBigDecimalValue(propertiesMap.get("cum_charge_all_2")))
|
||||
.cumEleDay2(toBigDecimalValue(propertiesMap.get("cum_ele_day_2")))
|
||||
.cumEleYear2(toBigDecimalValue(propertiesMap.get("cum_ele_year_2")))
|
||||
.cumEleAll2(toBigDecimalValue(propertiesMap.get("cum_ele_all_2")))
|
||||
.shoudong2(toBigDecimalValue(propertiesMap.get("shoudong_2")))
|
||||
.control2(toBigDecimalValue(propertiesMap.get("control_2")))
|
||||
.cumEleMon2(toBigDecimalValue(propertiesMap.get("cum_ele_mon_2")))
|
||||
.build();
|
||||
|
||||
System.err.println(photovoltaic);
|
||||
return photovoltaic;
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
DevLinkPhotovoltaicDataService devLinkPhotovoltaicDataService = new DevLinkPhotovoltaicDataService();
|
||||
Map<String, String> metDeviceRealData = devLinkPhotovoltaicDataService.getMetDeviceRealData("3276");
|
||||
devLinkPhotovoltaicDataService.setData(metDeviceRealData);
|
||||
|
||||
}
|
||||
}
|
@ -90,7 +90,7 @@ public class DevLinkRealTimeDataService {
|
||||
}
|
||||
|
||||
public BigDecimal toBigDecimalValue(String str) {
|
||||
if (str == null) {
|
||||
if (str == null||"".equals(str)) {
|
||||
return null;
|
||||
}
|
||||
return new BigDecimal(str);
|
||||
|
@ -5,8 +5,7 @@ import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
@ -20,6 +19,9 @@ import com.fastbee.common.core.domain.BaseEntity;
|
||||
*/
|
||||
@ApiModel(value = "DeviceRealtimedataPhotovoltaic",description = "光伏设备实时数据 iot_device_realtimedata_photovoltaic")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DeviceRealtimedataPhotovoltaic extends BaseEntity
|
||||
{
|
||||
@ -136,12 +138,12 @@ private static final long serialVersionUID = 1L;
|
||||
/** 1#手动控制模式 */
|
||||
@Excel(name = "1#手动控制模式")
|
||||
@ApiModelProperty("1#手动控制模式")
|
||||
private Long shoudong;
|
||||
private BigDecimal shoudong;
|
||||
|
||||
/** 1#远程通断电 */
|
||||
@Excel(name = "1#远程通断电")
|
||||
@ApiModelProperty("1#远程通断电")
|
||||
private Long control;
|
||||
private BigDecimal control;
|
||||
|
||||
/** 2#环境温度 */
|
||||
@Excel(name = "2#环境温度")
|
||||
@ -241,12 +243,12 @@ private static final long serialVersionUID = 1L;
|
||||
/** 2#手动控制模式 */
|
||||
@Excel(name = "2#手动控制模式")
|
||||
@ApiModelProperty("2#手动控制模式")
|
||||
private Long shoudong2;
|
||||
private BigDecimal shoudong2;
|
||||
|
||||
/** 2#远程通断电 */
|
||||
@Excel(name = "2#远程通断电")
|
||||
@ApiModelProperty("2#远程通断电")
|
||||
private Long control2;
|
||||
private BigDecimal control2;
|
||||
|
||||
/** 2#当月累计用电量 */
|
||||
@Excel(name = "2#当月累计用电量")
|
||||
|
Loading…
x
Reference in New Issue
Block a user