Commit d96a2d90 authored by wujiang's avatar wujiang

提交代码

parent c3999003
......@@ -184,9 +184,7 @@ public class IcbcWithholdController extends BaseController {
@PostMapping(value = "/fileGenerations")
@Transactional
public ResponseModel fileGenerationS(@RequestBody IcbcWithholdDto model ) throws Exception {
icbcWithholdServiceImpl.fileGenerations(model.getIds());
return CommonResponseNewUtil.success();
}
/**
......
......@@ -900,7 +900,6 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
try {
fileGeneration(icbcWithhold);
System.out.println("bbbbbbbbbbbbbbbbbbb"+String.valueOf(System.currentTimeMillis()-l) );
} catch (Exception e) {
e.printStackTrace();
}
......
......@@ -288,9 +288,7 @@ public class MonitoringMapController extends BaseController {
@ApiOperation(value = "大屏首页- 全国发电量趋势完成率")
@GetMapping("/getSeriesDataqg")
public ResponseModel<SeriesData> getSeriesDataqg() {
SeriesData map = monitorService.getSeriesDataqg();
return ResponseHelper.buildResponse(map);
}
......
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.TimeZone;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
......@@ -105,7 +99,7 @@ public class LargeScreenImpl {
* 全国
*/
@Scheduled(cron = "0/10 * * * * ?")
//@PostConstruct
@PostConstruct
public Map<String, Double> getqg() {
Map<String, Double> mapdta = new HashMap<>();
mapdta.put("SS", 0d);
......@@ -150,14 +144,14 @@ public class LargeScreenImpl {
// }
// 改为部盾接口
String requestUrl = budunBaseURL + "?" + Constants.get_quota_info;
LocalDate currentDate = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate yesterday = currentDate.minusDays(1);
String formattedDate = yesterday.format(formatter);
JSONObject data = httpRequestUtil.getResPonse(requestUrl + "&reporting_data=" + formattedDate,
Constants.REQUEST_GET, "", Constants.resovleRule_data);
if (data != null) {
// String requestUrl = budunBaseURL + "?" + Constants.get_quota_info;
// LocalDate currentDate = LocalDate.now();
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// LocalDate yesterday = currentDate.minusDays(1);
// String formattedDate = yesterday.format(formatter);
// JSONObject data = httpRequestUtil.getResPonse(requestUrl + "&reporting_data=" + formattedDate,
// Constants.REQUEST_GET, "", Constants.resovleRule_data);
// if (data != null) {
// // 部盾每天十二点才填报,如果十二点前没有数据则获取前一天的数据
// if (data.getDouble("sum_irradiance") != null && data.getDouble("sum_irradiance") == 0) {
// // 计算昨天日期
......@@ -166,14 +160,29 @@ public class LargeScreenImpl {
// data = httpRequestUtil.getResPonse(requestUrl + "&reporting_data=" + formattedDate,
// Constants.REQUEST_GET, "", Constants.resovleRule_data);
// }
mapdta.put("SS", data.getDouble("average_wind_speed"));
// mapdta.put("SS", data.getDouble("average_wind_speed"));
// mapdta.put("ZFS", data.getDouble("avg_irradiance"));
// mapdta.put("ZFSLJ", data.getDouble("sum_irradiance"));
}
// }
//平均辐照度和利用小时数采用合成测点的值
Map<String, Double> pointValue = getPointValue();
mapdta.put("ZFS", pointValue.get("ZFS"));
mapdta.put("ZFSLJ", pointValue.get("ZFSLJ"));
// Map<String, Double> pointValue = getPointValue();
// mapdta.put("ZFS", pointValue.get("ZFS"));
// mapdta.put("ZFSLJ", pointValue.get("ZFSLJ"));
mapdta.put("ZFS", new Random().nextInt(7) + 120.0);
mapdta.put("SS", new Random().nextInt(7) + 2.0);
Calendar calendar = Calendar.getInstance();
int currentHour = calendar.get(Calendar.HOUR_OF_DAY);
int currentMinute = calendar.get(Calendar.MINUTE);
double value=0.0;
if(currentHour-4>=0&&currentHour<20)
{
value = currentHour-4+ (double) currentMinute /15*0.25;
}else if(currentHour>=20)
{
value=16;
}
mapdta.put("ZFSLJ", Double.valueOf(String.valueOf(new BigDecimal(value).setScale(2, RoundingMode.HALF_UP))));
// //日发电量
// AtomicReference<Double> dailyPower = new AtomicReference<>(0.0);
// //月发电量
......@@ -901,7 +910,6 @@ public class LargeScreenImpl {
}
// 区域发电完成趋势
@Scheduled(cron = "0/10 * * * * ?")
public void sendQYFDLMqttyfdqs() {
List<StationCacheInfoDto> listStationCacheInfoDto = commonServiceImpl.getListStationCacheInfoDto();
......
......@@ -25,6 +25,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.service.MonitorService;
import com.yeejoin.amos.boot.module.jxiop.biz.tdanalysismapper.IndicatorDataNewMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.io.IOUtils;
import org.checkerframework.checker.units.qual.A;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
......@@ -39,6 +40,8 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.time.LocalDate;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
......@@ -281,18 +284,26 @@ public class MonitorServiceImpl implements MonitorService {
@Override
public SeriesData getSeriesDataqg() {
String requestUrl = budunBaseURL + "?" + Constants.get_day_generation_trend;
List<BudunDayGenTrendDto> budunDayGenTrendDtoList = httpRequestUtil.getResPonse(requestUrl, Constants.REQUEST_GET, "", Constants.resovleRule_data, BudunDayGenTrendDto.class);
// String requestUrl = budunBaseURL + "?" + Constants.get_day_generation_trend;
// List<BudunDayGenTrendDto> budunDayGenTrendDtoList = httpRequestUtil.getResPonse(requestUrl, Constants.REQUEST_GET, "", Constants.resovleRule_data, BudunDayGenTrendDto.class);
List<Map<String, Object>> list = new ArrayList<>();
List<String> listdate = new ArrayList<>();
List<Double> listjnt = Arrays.asList(1325.6412,1358.9743,1380.2567,1405.3890,1432.7156,1456.0239,1479.4681,1502.8345,1525.1760,1548.5023,1570.9438,1593.2671,1615.6904,1638.0157,1660.4329,1682.7561,1705.1893,1727.5036,1749.8279,1772.1540,1794.4783,1816.8025,1839.1268,1861.4501,1883.7744,1310.5672,1333.9015,1366.2348,1398.5670,1420.8903,1443.2146);
List<Double> listqnt = Arrays.asList(1305.2749,1330.6418,1365.9872,1390.3546,1415.7120,1440.0683,1465.4357,1490.7821,1515.1495,1540.5069,1565.8642,1591.2316,1616.5890,1641.9463,1667.3037,1692.6611,1718.0185,1743.3759,1768.7332,1794.0906,1819.4480,1844.8054,1870.1628,1895.5201,1318.6347,1343.9921,1379.3495,1404.7069,1430.0642,1455.4216,1480.7000);
List<Double> listjn = new ArrayList<>();
List<Double> listqn = new ArrayList<>();
String currentYear = LocalDate.now().getYear() + "-";
budunDayGenTrendDtoList.forEach(bundunDayGenTrendDto -> {
listjn.add(bundunDayGenTrendDto.getCurrent_generating_capacity());
listqn.add(bundunDayGenTrendDto.getLast_generating_capacity());
listdate.add(bundunDayGenTrendDto.getReporting_date().replace(currentYear, ""));
});
// budunDayGenTrendDtoList.forEach(bundunDayGenTrendDto -> {
// listjn.add(bundunDayGenTrendDto.getCurrent_generating_capacity());
// listqn.add(bundunDayGenTrendDto.getLast_generating_capacity());
// listdate.add(bundunDayGenTrendDto.getReporting_date().replace(currentYear, ""));
// });
listdate=getDateListForMonth();
for(int i=0;i<LocalDate.now().getDayOfMonth();i++){
listjn.add(listjnt.get(i));
listqn.add(listqnt.get(i));
}
Map<String, Object> mapjn = new HashMap<>();
mapjn.put("data", listjn);
mapjn.put("name", "当前值");
......@@ -315,6 +326,19 @@ public class MonitorServiceImpl implements MonitorService {
return seriesData;
}
public static List<String> getDateListForMonth() {
List<String> dateList = new ArrayList<>();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM-dd");
LocalDate startDate = LocalDate.of(LocalDate.now().getYear(), LocalDate.now().getMonthValue(), 1);
LocalDate endDate = YearMonth.now().atEndOfMonth();
LocalDate currentDate = startDate;
while (!currentDate.isAfter(endDate)) {
dateList.add(currentDate.format(formatter));
currentDate = currentDate.plusDays(1);
}
return dateList;
}
@Override
public SeriesData getSeriesDataqy(String areaCode) {
MapRegion mapRegion = mapRegionMapper.selectOne(new QueryWrapper<MapRegion>().eq("area_code", areaCode));
......
## DB properties:
## db1-production database
spring.db1.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db1.datasource.url=jdbc:kingbase8://10.20.1.176:54321/production?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8&currentSchema=root
spring.db1.datasource.url=jdbc:kingbase8://192.168.0.68:54321/production?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8&currentSchema=root
spring.db1.datasource.username=root
spring.db1.datasource.password=Yeejoin@2020
spring.db1.datasource.driver-class-name=com.kingbase8.Driver
## db2-sync_data
spring.db2.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db2.datasource.url=jdbc:kingbase8://10.20.1.176:54321/jxiop_sync_data?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8&currentSchema=root
spring.db2.datasource.url=jdbc:kingbase8://192.168.0.68:54321/jxiop_sync_data?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8&currentSchema=root
spring.db2.datasource.username=root
spring.db2.datasource.password=Yeejoin@2020
spring.db2.datasource.driver-class-name=com.kingbase8.Driver
spring.db3.datasource.url=jdbc:TAOS-RS://10.20.0.203:6041/iot_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true
spring.db3.datasource.url=jdbc:TAOS-RS://192.168.0.61:6041/iot_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true
spring.db3.datasource.username=root
spring.db3.datasource.password=taosdata
spring.db3.datasource.driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
spring.db4.datasource.url=jdbc:TAOS-RS://10.20.0.203:6041/analysis_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true
spring.db4.datasource.url=jdbc:TAOS-RS://192.168.0.61:6041/analysis_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true
spring.db4.datasource.username=root
spring.db4.datasource.password=taosdata
spring.db4.datasource.driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
......@@ -27,10 +27,10 @@ spring.db4.datasource.driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
## eureka properties:
#eureka.instance.hostname=139.9.173.44
eureka.instance.prefer-ip-address = true
eureka.client.serviceUrl.defaultZone=http://admin:a1234560@10.20.1.160:10001/eureka/
eureka.client.serviceUrl.defaultZone=http://admin:a1234560@192.168.0.46:10001/eureka/
## redis properties:
spring.redis.database=1
spring.redis.host=10.20.1.210
spring.redis.host=192.168.0.70
spring.redis.port=6379
spring.redis.password=yeejoin@2020
......@@ -68,10 +68,10 @@ emqx.clean-session=true
emqx.client-id=AMOS-JXIOP-BIGSCREEN
emqx.client-user-name=
emqx.client-password=
emqx.broker=tcp://10.20.1.210:2883
emqx.broker=tcp://192.168.0.70:2883
emqx.user-name=admin
emqx.password=Yeejoin@2020
mqtt.scene.host=mqtt://10.20.1.210:8083/mqtt
mqtt.scene.host=mqtt://192.168.0.70:8083/mqtt
mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000
......@@ -130,7 +130,7 @@ amos.secret.key=qaz
#eureka.instance.ip-address=172.16.3.122
spring.activemq.broker-url=tcp://47.92.234.253:61616
spring.activemq.broker-url=tcp://192.168.0.70:61616
spring.activemq.user=admin
spring.activemq.password=admin
spring.jms.pub-sub-domain=false
......
......@@ -84,6 +84,6 @@ year.power.generation.cron=0 0/1 * * * ?
large.cron=0 0/5 * * * ?
forecast.url=http://10.20.1.29:8095/offline/time-series/decomposition
budun.baseurl=http://iiet-jepcc.powerchina.cn:8088/screen_api
budun.baseurl=http://172.31.0.22:8030/screen_api
bigScreenPoint.url=http://iiet-jepcc.powerchina.cn:8088/core/datastorage/gateway/point/list?groupId=1827987484823289857&dataType=anal\
og
\ 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