Commit 323ff25b authored by 朱晨阳's avatar 朱晨阳

Merge remote-tracking branch 'origin/developer' into developer

parents 9f5b7577 a9691c08
## DB properties:
spring.datasource.dynamic.primary= mysql-service
spring.datasource.mysql-service.driver-class-name=com.kingbase8.Driver
spring.datasource.mysql-service.jdbc-url=jdbc:kingbase8://10.20.1.176:54321/amos_project?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8&currentSchema=root
spring.datasource.mysql-service.username=root
spring.datasource.mysql-service.password=Yeejoin@2020
spring.datasource.mysql-service.type=com.zaxxer.hikari.HikariDataSource
#最小连接
spring.datasource.mysql-service.minimum-idle: 5
#最大连接
spring.datasource.mysql-service.maximum-pool-size: 15
#自动提交
spring.datasource.mysql-service.auto-commit: true
#最大空闲时常
spring.datasource.mysql-service.idle-timeout: 30000
#连接池名
spring.datasource.mysql-service.pool-name: MysqlDruidCP
#最大生命周期
spring.datasource.mysql-service.max-lifetime: 1800000
#连接超时时间
spring.datasource.mysql-service.connection-timeout: 30000
spring.datasource.tdengine-service.driver-class-name=com.taosdata.jdbc.rs.RestfulDriver
spring.datasource.tdengine-service.jdbc-url=jdbc:TAOS-RS://47.92.234.253:6041/house_pv_data?user=root&password=taosdata&timezone=GMT+8
spring.datasource.tdengine-service.username=root
spring.datasource.tdengine-service.password=taosdata
spring.datasource.tdengine-service.type=com.zaxxer.hikari.HikariDataSource
#最小连接
spring.datasource.tdengine-service.minimum-idle: 5
#最大连接
spring.datasource.tdengine-service.maximum-pool-size: 15
#自动提交
spring.datasource.tdengine-service.auto-commit: true
#最大空闲时常
spring.datasource.tdengine-service.idle-timeout: 30000
#连接池名
spring.datasource.tdengine-service.pool-name: Data_trans_HikariCP
#最大生命周期
spring.datasource.tdengine-service.max-lifetime: 1800000
#连接超时时间
spring.datasource.tdengine-service.connection-timeout: 30000
spring.datasource.tdengine-service.connection-test-query: SELECT 1
## eureka properties:
eureka.instance.hostname=10.20.1.160
eureka.client.serviceUrl.defaultZone=http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
## redis properties:
spring.redis.database=1
spring.redis.host=10.20.1.210
spring.redis.port=6379
spring.redis.password=yeejoin@2020
spring.cache.type=GENERIC
j2cache.open-spring-cache=true
j2cache.cache-clean-mode=passive
j2cache.allow-null-values=true
j2cache.redis-client=lettuce
j2cache.l2-cache-open=true
j2cache.broadcast=net.oschina.j2cache.cache.support.redis.SpringRedisPubSubPolicy
j2cache.L1.provider_class=caffeine
j2cache.L2.provider_class=net.oschina.j2cache.cache.support.redis.SpringRedisProvider
j2cache.L2.config_section=lettuce
j2cache.sync_ttl_to_redis=true
j2cache.default_cache_null_object=false
j2cache.serialization=fst
caffeine.properties=/caffeine.properties
lettuce.mode=single
lettuce.namespace=
lettuce.storage=generic
lettuce.channel=j2cache
lettuce.scheme=redis
lettuce.hosts=${spring.redis.host}:${spring.redis.port}
lettuce.password=${spring.redis.password}
lettuce.database=${spring.redis.database}
lettuce.sentinelMasterId=
lettuce.maxTotal=100
lettuce.maxIdle=10
lettuce.minIdle=10
lettuce.timeout=10000
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://10.20.1.210:2883
emqx.user-name=admin
emqx.password=public
emqx.max-inflight=1000
spring.influx.url=http://47.92.234.253:8086
spring.influx.password=Yeejoin@2020
spring.influx.user=root
spring.influx.database=iot_platform
spring.influx.retention_policy=default
spring.influx.retention_policy_time=30d
spring.influx.actions=10000
spring.influx.bufferLimit=20000
knife4j.production=false
knife4j.enable=true
knife4j.basic.enable=true
knife4j.basic.username=admin
knife4j.basic.password=a1234560
management.security.enabled=true
spring.security.user.name=admin
spring.security.user.password=a1234560
fire-rescue=123
mybatis-plus.global-config.db-config.update-strategy=ignored
# user-amos setting : This value is the secretkey for person manage moudle accout password encryption.please don't change it!!!
amos.secret.key=qaz
# if your service can't be access ,you can use this setting , you need change ip as your.
#eureka.instance.prefer-ip-address=true
#eureka.instance.ip-address=172.16.3.122
spring.activemq.broker-url=tcp://10.20.1.210:61616
spring.activemq.user=admin
spring.activemq.password=admin
spring.jms.pub-sub-domain=false
myqueue=amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness
regulator.unit.code=86*258
# ������Ӧ��code
dealer.appcode=studio_normalapp_5133538
hygf.sms.tempCode=SMS_HYGF_0001
# �������������
sms.huawei.url=https://smsapi.cn-north-4.myhuaweicloud.com:443/sms/batchSendSms/v1
sms.huawei.appKey=n3FYPWO7Heo1ze212QRBvF4VA2E2
sms.huawei.appSecret=IFhiMpWROi7w4Ei21ZbfIjKyt97b
# �id
sms.huawei.templateId=67931857f6f74e119fadc429bc25a531
# ǩ��ͨ����
sms.huawei.sender=1069368924410006092
# 签名名称
sms.huawei.signature=江西电建
# 锟斤拷站锟斤拷锟絧ageId
power.station.examine.pageId=1680853427061551106
# 锟斤拷站锟斤拷思苹锟絠d
power.station.examine.planId=c4ed1873-0dc6-4518-a7a9-dbc588ef35e5
unitInfo.station.examine.planId=51776087-a9cf-4a87-9a03-24fd24a8cf45
hygf.sms.tempCodeJXS=SMS_HYGF_0002
#工程角色id
hygf.role.gc.roleSeq=1702550832882413570
# 锟矫伙拷锟斤拷userGroupId
hygf.user.group.id=1702512164058718210
#锟斤拷锟斤拷司
regionalCompanies.company.seq=1701778292098498561
hygf.user.group.empty=1775056568031645697
#qiyuesuo.serverUrl = https://openapi.qiyuesuo.cn
#qiyuesuo.accessKey = a1lcd3WRRV
#qiyuesuo.accessSecret = haqYIOxTP20ZYiDNEN92GVBa6aoJLu
#qiyuesuo.secretKey=Fp2LQAqK5gc68hi5
qiyuesuo.serverUrl = https://openapi.qiyuesuo.com
qiyuesuo.accessKey = QcmHQu55pl
qiyuesuo.accessSecret = em0zvOMRNCAXoD1ePNTL7hGR5KpKUs
qiyuesuo.secretKey=B6OYbHyfXikAghB2
# ============================================= v20230821 add properties =============================================
security.productWeb=AMOS_STUDIO_WEB
security.appKey=AMOS_STUDIO
login.environment=dev
# 锟斤拷锟脚╋拷锟轿拷锟叫★拷锟斤拷锟斤拷锟斤拷?
hygfProgram.appid=wx0a2b054a237a3b34
hygfProgram.secret=5fc6af660920f6211b1b69bc9c451b09
# 默锟斤拷微锟斤拷小锟斤拷锟斤拷农锟斤拷锟斤拷锟斤拷锟斤拷
farmer.orgCode=86
#农锟斤拷锟斤拷锟斤拷锟斤拷位
farmer.sequenceNbr=1703583838279593985
farmer.orgNamesWithoutRole=
#农锟斤拷锟斤拷色
farmer.roleId=1702551322030534658
# 锟斤拷锟矫接匡拷锟斤拷权锟矫伙拷
platform.access.loginId=hygf_platform
platform.access.password=AC286A35E74D2DD281EB979789DECF3A
# 锟斤拷锟斤拷锟矫的撅拷锟斤拷锟斤拷userid
dealer.userId=
# 锟斤拷锟皆碉拷时锟斤拷默锟斤拷锟斤拷锟斤拷
farmer.registerPassword=a123456
#锟斤拷锟斤拷锟教碉拷位锟斤拷锟节碉拷id
dealer.managementUnitId=1702211822385393665
#锟斤拷锟斤拷锟教癸拷锟斤拷员锟斤拷色
dealer.roleId=1702512164058718210
#锟斤拷询锟斤拷锟斤拷锟斤拷锟矫伙拷锟斤拷
dealer.group=1702511386875158529
#锟斤拷锟矫癸拷锟斤拷锟斤拷探锟斤拷?
dealer.engineering=1702512052154687489
#锟斤拷时锟斤拷锟斤拷锟饺★拷锟斤拷锟斤拷锟较?
cheduled.crons=0 10 0 * * ?
dealer.appcode.manage=studio_normalapp_5155413,studio_normalapp_5133538
dealer.appcode.role=1767363928842571777
dealer.amosDealerId=1767820997374775298
#Seata Config
seata.tx-service-group=hygf-seata
seata.service.grouplist.hygf-seata=47.92.234.253:8091
# Seata 配置
seata.enabled=true
seata.enable-auto-data-source-proxy=false
#seata.client.undo.log-serialization=kryo
seata.datasource.autoproxy.datasource-proxy-mode=original
seata.datasource.autoproxy.enabled=true
seata.datasource.autoproxy.data-source-names=postgresql
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="LOG_HOME" value="log" />
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %-50.50logger{50} - %msg [%file:%line] %n" />
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/ccs.log.%d{yyyy-MM-dd}.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>7</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>${LOG_PATTERN}</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>30mb</MaxFileSize>
</triggeringPolicy>
</appender>
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!--myibatis log configure-->
<logger name="com.apache.ibatis" level="DEBUG"/>
<logger name="java.sql.Connection" level="DEBUG"/>
<logger name="java.sql.Statement" level="DEBUG"/>
<logger name="java.sql.PreparedStatement" level="DEBUG"/>
<logger name="com.baomidou.mybatisplus" level="DEBUG"/>
<logger name="org.springframework" level="DEBUG"/>
<logger name="org.typroject" level="DEBUG"/>
<logger name="com.yeejoin" level="DEBUG"/>
<!-- 日志输出级别 -->
<root level="INFO">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
......@@ -81,6 +81,9 @@ public class Constants {
public static final String get_generated_quota_trend="method=scene_screen.data_interface.get_generated_quota_trend";
public static final String get_province_station_item="method=scene_screen.data_interface.get_province_station_item";
public static final String get_day_generation_trend="method=scene_screen.data_interface.get_day_generation_trend";
public static final String get_quota_info="method=scene_screen.large_screen.get_quota_info";
public static final String get_station_actual_installed_capacity="method=scene_screen.large_screen.get_station_actual_installed_capacity";
public static final String get_quota_complate_info="method=scene_screen.large_screen.get_quota_complate_info";
public static final String resovleRule_data = "data";
public static final String areaChinese="区域";
}
......
......@@ -66,4 +66,18 @@ public class HttpRequestUtil {
}
return result;
}
public JSONObject getResPonse(String apiurl, String requestMethod, String requestParmInfo, String ResultResolveRule) {
String response = "";
String params = "";
JSONObject jsonObject = null;
try {
response = sendRequest(requestMethod, apiurl, requestParmInfo, null);
jsonObject = JSONObject.parseObject(response);
jsonObject = jsonObject.getJSONObject(ResultResolveRule);
} catch (Exception exception) {
return jsonObject;
}
return jsonObject;
}
}
......@@ -3,11 +3,14 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jxiop.api.entity.*;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.*;
import com.yeejoin.amos.boot.module.jxiop.api.util.Constants;
import com.yeejoin.amos.boot.module.jxiop.api.util.HttpRequestUtil;
import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments;
import com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.*;
......@@ -26,6 +29,8 @@ import org.typroject.tyboot.component.emq.EmqKeeper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
......@@ -75,6 +80,9 @@ public class MonitoringServiceImpl {
// @Autowired
// InfluxdbUtil influxdbUtil;
@Autowired
private HttpRequestUtil httpRequestUtil;
/**
* 根据场站编号获取该场站的装机容量
*
......@@ -1054,27 +1062,23 @@ public class MonitoringServiceImpl {
stringHashMap9.put("title",
String.format(CommonConstans.Fourdecimalplaces, powerOfDayFD.get() + powerOfDayGF.get()));
HashMap<String, String> resultMap = new HashMap<>();
resultMap.put("Day", String.format(CommonConstans.Fourdecimalplaces, powerOfDayFD.get() + powerOfDayGF.get()));
//resultMap.put("Day", String.format(CommonConstans.Fourdecimalplaces, powerOfDayFD.get() + powerOfDayGF.get()));
list2.add(stringHashMap9);
HashMap<String, String> stringHashMap10 = new HashMap<>();
stringHashMap10.put("title",
String.format(CommonConstans.Twodecimalplaces, powerOfMonthFD.get() + powerOfMonthGF.get()));
resultMap.put("Moon",
String.format(CommonConstans.Fourdecimalplaces, powerOfMonthFD.get() + powerOfMonthGF.get()));
resultMap.put("YJHWC", String.format(CommonConstans.Twodecimalplaces,
(powerOfMonthFD.get() + powerOfMonthGF.get()) / moonValue * 100));
//resultMap.put("Moon",String.format(CommonConstans.Fourdecimalplaces, powerOfMonthFD.get() + powerOfMonthGF.get()));
//resultMap.put("YJHWC", String.format(CommonConstans.Twodecimalplaces,(powerOfMonthFD.get() + powerOfMonthGF.get()) / moonValue * 100));
list2.add(stringHashMap10);
HashMap<String, String> stringHashMap11 = new HashMap<>();
stringHashMap11.put("title",
String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualFD.get() + powerOfAnnualGF.get()));
resultMap.put("Year",
String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualFD.get() + powerOfAnnualGF.get()));
//resultMap.put("Year",String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualFD.get() + powerOfAnnualGF.get()));
list2.add(stringHashMap11);
HashMap<String, String> stringHashMap12 = new HashMap<>();
stringHashMap12.put("title", String.format(CommonConstans.Twodecimalplaces,
(powerOfAnnualFD.get() + powerOfAnnualGF.get()) / yearValue * 100));
resultMap.put("NJHWC", String.format(CommonConstans.Twodecimalplaces,
(powerOfAnnualFD.get() + powerOfAnnualGF.get()) / yearValue * 100));
//resultMap.put("NJHWC", String.format(CommonConstans.Twodecimalplaces,(powerOfAnnualFD.get() + powerOfAnnualGF.get()) / yearValue * 100));
list2.add(stringHashMap12);
page2.setRecords(list2);
Double totalAnnual = (powerOfAnnualFD.get() + powerOfAnnualGF.get());
......@@ -1099,6 +1103,20 @@ public class MonitoringServiceImpl {
stringHashMap16.put("unit", "二氧化硫减排量(t)");
list3.add(stringHashMap16);
page3.setRecords(list3);
//改为部盾接口
String requestUrl = Constants.BASE_URL + "?" + Constants.get_quota_info;
LocalDate currentDate = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedDate = currentDate.format(formatter);
JSONObject data = httpRequestUtil.getResPonse(requestUrl+"&reporting_data="+formattedDate, Constants.REQUEST_GET, "",
Constants.resovleRule_data);
resultMap.put("Day", data.getString("day_generating_capacity"));
resultMap.put("Moon", data.getString("month_generating_capacity"));
resultMap.put("Year", data.getString("year_generating_capacity"));
resultMap.put("YJHWC", data.getString("year_quota_rate").replace("%", ""));
resultMap.put("NJHWC", data.getString("month_quota_rate").replace("%", ""));
try {
emqKeeper.getMqttClient().publish("bigscreen_zjrl_topic", JSON.toJSON(page).toString().getBytes("UTF-8"), 1,
true);
......
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