|
|
@ -13,6 +13,7 @@ import com.ruoyi.common.core.domain.AjaxResult; |
|
|
|
import com.ruoyi.common.core.page.TableDataInfo; |
|
|
|
import com.ruoyi.common.enums.BusinessType; |
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil; |
|
|
|
import com.ruoyi.common.utils.spring.SpringUtils; |
|
|
|
import com.ruoyi.system.service.ISysConfigService; |
|
|
|
import com.zc.business.constant.DeviceTypeConstants; |
|
|
|
import com.zc.business.domain.DcDevice; |
|
|
@ -33,6 +34,7 @@ import okhttp3.Request; |
|
|
|
import okhttp3.Response; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.scheduling.annotation.Scheduled; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
@ -52,6 +54,7 @@ import java.util.stream.Collectors; |
|
|
|
* |
|
|
|
* @author zhaoxianglong |
|
|
|
*/ |
|
|
|
@Component() |
|
|
|
@Api(tags = {"设备"}) |
|
|
|
@RestController |
|
|
|
@RequestMapping("/business/device") |
|
|
@ -315,7 +318,7 @@ public class DcDeviceController extends BaseController { |
|
|
|
/** |
|
|
|
* 根据物联设备id获取最新属性数据 |
|
|
|
* |
|
|
|
* @param deviceId 物联设备id |
|
|
|
* @param deviceId 物联设备id SolarPanelTimingTask |
|
|
|
* @return 获取属性数据操作结果 |
|
|
|
*/ |
|
|
|
@ApiOperation("获取设备最新属性数据") |
|
|
@ -471,7 +474,7 @@ public class DcDeviceController extends BaseController { |
|
|
|
// parameters.put("deviceState", "1");
|
|
|
|
|
|
|
|
// List<String> propertyIds = Arrays.asList("visibility", "wetSlipperyCoefficient", "waterFilmIceSnowValue");
|
|
|
|
|
|
|
|
//generatingPower 发电功率 //"cumulativeElectricityConsumptionInTheYear", //当年累计用电量
|
|
|
|
List<String> propertyIds = Arrays.asList("cumulativeElectricityConsumptionInTheYear", //当年累计用电量
|
|
|
|
"cumulativeElectricityConsumptionOnTheDay",//当日累计用电量
|
|
|
|
"theAccumulatedChargeOfTheYear",//当年累计充电量
|
|
|
@ -514,8 +517,10 @@ public class DcDeviceController extends BaseController { |
|
|
|
double formattedStandardCoal = Double.parseDouble(decimalFormat.format(standardCoal)); |
|
|
|
|
|
|
|
attributeMap.put("standardCoal", formattedStandardCoal); |
|
|
|
/* |
|
|
|
attributeMap.forEach((key, value) -> System.out.println(String.format("属性:%s,格式值:%s", key, value))); |
|
|
|
System.out.println(carbonEmissionReduction); |
|
|
|
*/ |
|
|
|
|
|
|
|
return AjaxResult.success(attributeMap); |
|
|
|
} |
|
|
@ -1380,6 +1385,8 @@ public class DcDeviceController extends BaseController { |
|
|
|
public AjaxResult ConfluenceAreaEarlyWarningDeviceBatteryLowWarning() throws HttpException, IOException, InterruptedException { |
|
|
|
DcDevice dcDevice = new DcDevice(); |
|
|
|
dcDevice.setDeviceType(UniversalEnum.FIFTEEN.getValue()); |
|
|
|
IDcDeviceService dcDeviceService = SpringUtils.getBean(IDcDeviceService.class); |
|
|
|
|
|
|
|
List<DcDevice> dcDeviceList = dcDeviceService.listDevice(dcDevice); |
|
|
|
ArrayList devices = new ArrayList<>(); |
|
|
|
|
|
|
@ -1394,17 +1401,17 @@ public class DcDeviceController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
ArrayList functions = new ArrayList(); |
|
|
|
// for (int i = UniversalEnum.ZERO.getNumber(); i < UniversalEnum.SIX.getNumber(); i++) {
|
|
|
|
// JSONObject function = new JSONObject();
|
|
|
|
// function.put("functionId", UniversalEnum.A.getValue() + (i + UniversalEnum.ONE.getNumber()));
|
|
|
|
// function.put("params", new JSONObject());
|
|
|
|
// functions.add(function);
|
|
|
|
// }
|
|
|
|
for (int i = UniversalEnum.ZERO.getNumber(); i < UniversalEnum.SIX.getNumber(); i++) { |
|
|
|
JSONObject function = new JSONObject(); |
|
|
|
function.put("functionId", UniversalEnum.A.getValue() + (i + UniversalEnum.ONE.getNumber())); |
|
|
|
function.put("params", new JSONObject()); |
|
|
|
functions.add(function); |
|
|
|
} |
|
|
|
|
|
|
|
JSONObject function = new JSONObject(); |
|
|
|
/* JSONObject function = new JSONObject(); |
|
|
|
function.put("functionId", UniversalEnum.A_ONE.getValue()); |
|
|
|
function.put("params", new JSONObject()); |
|
|
|
functions.add(function); |
|
|
|
functions.add(function);*/ |
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
jsonObject.put("devices", devices); |
|
|
|
jsonObject.put("functions", functions); |
|
|
|