1.解决冀北阿里云Nacos版本兼容问题

2.解决配置bootstrap.yml兼容问题
This commit is contained in:
wr
2026-04-02 10:40:11 +08:00
parent 7b9fb1628b
commit 1aad1aa86b
42 changed files with 1753 additions and 895 deletions

View File

@@ -0,0 +1,67 @@
#当前服务的基本信息
microservice:
ename: @artifactId@
name: '@name@'
version: @version@
sentinel:
url: @sentinel.url@
gateway:
url: @gateway.url@
server:
port: 10202
max-http-header-size: 1048576
#feign接口开启服务熔断降级处理
feign:
sentinel:
enabled: true
spring:
application:
name: @artifactId@
#nacos注册中心以及配置中心的指定
cloud:
nacos:
discovery:
server-addr: @nacos.url@
namespace: @nacos.namespace@
config:
username: @nacos.username@
password: @nacos.password@
server-addr: @nacos.url@
namespace: @nacos.namespace@
file-extension: yaml
shared-configs:
- data-id: share-config.yaml
refresh: true
- data-Id: share-config-datasource-db.yaml
refresh: true
main:
allow-bean-definition-overriding: true
servlet:
multipart:
#上传文件总的最大值
max-request-size: 200MB
#上传文件的最大值
max-file-size: 200MB
#项目日志的配置
logging:
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
level:
root: info
#mybatis配置信息
mybatis-plus:
#别名扫描
type-aliases-package: com.njcn.device.pq.pojo,com.njcn.device.pms.pojo,com.njcn.device.biz.pojo.dto
#是否是冀北设备台账树
isJb: false
oracle:
isSync: false
syncLedgerLineUrl: http://localhost:8082/export/syncLedgerLine
syncLedgerUpdateLine: http://localhost:8082/export/syncLedgerUpdateLine
syncLedgerDeleteLine: http://localhost:8082/export/syncLedgerDeleteLine

View File

@@ -0,0 +1,72 @@
#当前服务的基本信息
microservice:
ename: @artifactId@
name: '@name@'
version: @version@
sentinel:
url: @sentinel.url@
gateway:
url: @gateway.url@
server:
port: 10202
max-http-header-size: 1048576
#feign接口开启服务熔断降级处理
feign:
sentinel:
enabled: true
spring:
application:
name: @artifactId@
#nacos注册中心以及配置中心的指定
cloud:
nacos:
discovery:
ip: @service.server.url@
server-addr: @nacos.url@
username: @nacos.username@
password: @nacos.password@
namespace: @nacos.namespace@
config:
server-addr: @nacos.url@
username: @nacos.username@
password: @nacos.password@
namespace: @nacos.namespace@
file-extension: yaml
shared-configs:
- data-id: share-config.yaml
refresh: true
- data-id: share-config-datasource-db.yaml
refresh: true
main:
allow-bean-definition-overriding: true
servlet:
multipart:
#上传文件总的最大值
max-request-size: 200MB
#上传文件的最大值
max-file-size: 200MB
#项目日志的配置
logging:
#config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
level:
root: info
#mybatis配置信息
mybatis-plus:
#别名扫描
type-aliases-package: com.njcn.device.pq.pojo,com.njcn.device.pms.pojo,com.njcn.device.biz.pojo.dto
#是否是冀北设备台账树
isJb: false
mqtt:
client-id: @artifactId@${random.value}
oracle:
isSync: false
syncLedgerLineUrl: http://localhost:8082/export/syncLedgerLine
syncLedgerUpdateLine: http://localhost:8082/export/syncLedgerUpdateLine
syncLedgerDeleteLine: http://localhost:8082/export/syncLedgerDeleteLine

View File

@@ -1,72 +1,3 @@
#当前服务的基本信息
microservice:
ename: @artifactId@
name: '@name@'
version: @version@
sentinel:
url: @sentinel.url@
gateway:
url: @gateway.url@
server:
port: 10202
max-http-header-size: 1048576
#feign接口开启服务熔断降级处理
feign:
sentinel:
enabled: true
spring:
application:
name: @artifactId@
#nacos注册中心以及配置中心的指定
cloud:
nacos:
discovery:
ip: @service.server.url@
server-addr: @nacos.url@
username: @nacos.username@
password: @nacos.password@
namespace: @nacos.namespace@
config:
server-addr: @nacos.url@
username: @nacos.username@
password: @nacos.password@
namespace: @nacos.namespace@
file-extension: yaml
shared-configs:
- data-id: share-config.yaml
refresh: true
- data-id: share-config-datasource-db.yaml
refresh: true
main:
allow-bean-definition-overriding: true
servlet:
multipart:
#上传文件总的最大值
max-request-size: 200MB
#上传文件的最大值
max-file-size: 200MB
#项目日志的配置
logging:
#config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
level:
root: info
#mybatis配置信息
mybatis-plus:
#别名扫描
type-aliases-package: com.njcn.device.pq.pojo,com.njcn.device.pms.pojo,com.njcn.device.biz.pojo.dto
#是否是冀北设备台账树
isJb: false
mqtt:
client-id: @artifactId@${random.value}
oracle:
isSync: false
syncLedgerLineUrl: http://localhost:8082/export/syncLedgerLine
syncLedgerUpdateLine: http://localhost:8082/export/syncLedgerUpdateLine
syncLedgerDeleteLine: http://localhost:8082/export/syncLedgerDeleteLine
profiles:
active: @spring.profiles.active@

View File

@@ -3,6 +3,7 @@ package com.njcn.device.pq.pojo.vo.dataClean;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@@ -72,6 +73,12 @@ public class DataVerifyExcel implements Serializable {
@Excel(name = "厂商")
private String manufacturer;
@ColumnWidth(20)
@ExcelProperty(value = "电网标志")
@Excel(name = "电网标志")
@ApiModelProperty(name = "powerFlag",value = "电网标志")
private String powerFlag;
@ColumnWidth(20)
@ExcelProperty(value = "总指标异常时间")
@Excel(name = "总指标异常时间")

View File

@@ -1,8 +1,8 @@
package com.njcn.device.pq.utils;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ObjUtil;
import com.alibaba.nacos.shaded.com.google.common.collect.Lists;
import com.njcn.device.pq.pojo.vo.dataClean.CityDataExcel;
import com.njcn.device.pq.pojo.vo.dataClean.LineDataExcel;
@@ -49,7 +49,7 @@ public class DataLineExcelUtil {
List<List<Object>> result = new ArrayList<>();
if(CollUtil.isNotEmpty(data)){
for (LineDataExcel datum : data) {
ArrayList<Object> row = Lists.newArrayList(datum.getLineNum(),
ArrayList<Object> row = ListUtil.toList(datum.getLineNum(),
datum.getLineName(),
datum.getDeptName(),
datum.getPowerSubstationName(),
@@ -89,7 +89,7 @@ public class DataLineExcelUtil {
List<List<Object>> result = new ArrayList<>();
if(CollUtil.isNotEmpty(data)){
for (CityDataExcel datum : data) {
ArrayList<Object> row = Lists.newArrayList(datum.getDeptName(),
ArrayList<Object> row = ListUtil.toList(datum.getDeptName(),
datum.getDeviceNum(),
datum.getLineNum(),
datum.getOnlineRate(),

View File

@@ -132,8 +132,9 @@ public class FixedDynamicExcelExport {
head.add(Collections.singletonList("监测对象名称"));
head.add(Collections.singletonList("电网侧变电站"));
head.add(Collections.singletonList("厂商"));
head.add(Collections.singletonList("电网标志"));
head.add(Collections.singletonList("总指标异常时间"));
List<String> sortedFields = allFields.subList(10, allFields.size());
List<String> sortedFields = allFields.subList(11, allFields.size());
for (String field : sortedFields) {
// 每个列名单独封装成ListEasyExcel才能识别为不同列
head.add(Collections.singletonList(DataVerifyExcel.FIELD_COLUMN_MAP.get(field)));
@@ -209,6 +210,7 @@ public class FixedDynamicExcelExport {
fieldAlls.add("objName");
fieldAlls.add("powerSubstationName");
fieldAlls.add("manufacturer");
fieldAlls.add("powerFlag");
fieldAlls.add("allTime");
fieldAlls.addAll(fields);
return fieldAlls;

View File

@@ -2,6 +2,7 @@ package com.njcn.device.pq.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
@@ -156,8 +157,10 @@ public class DataVerifyController extends BaseController {
public void dataVerifyExcel(HttpServletResponse response, MonitorBaseParam monitorBaseParam) throws IOException {
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
monitorBaseParam.setSearchBeginTime(DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())).toString());
monitorBaseParam.setSearchEndTime(DateUtil.endOfDay(DateUtil.parse(monitorBaseParam.getSearchEndTime())).toString());
if(StrUtil.isNotBlank(monitorBaseParam.getSearchBeginTime())&&StrUtil.isNotBlank(monitorBaseParam.getSearchEndTime())){
monitorBaseParam.setSearchBeginTime(DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())).toString());
monitorBaseParam.setSearchEndTime(DateUtil.endOfDay(DateUtil.parse(monitorBaseParam.getSearchEndTime())).toString());
}
iPqDataVerifyBakService.dataVerifyExcel(response, monitorBaseParam);
}

View File

@@ -195,7 +195,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
@Override
public List<PowerQualityIndicatorsVO> getMonitorVerifyDay(MonitorBaseParam monitorBaseParam) {
List<String> monitorIds = commTerminalService.getRunMonitorByDept(monitorBaseParam);
if(CollectionUtils.isEmpty(monitorIds)){
if (CollectionUtils.isEmpty(monitorIds)) {
return new ArrayList<>();
}
List<PqDataVerifyBak> dataVerifyList = baseDataVerifyQuery(monitorIds, monitorBaseParam);
@@ -435,6 +435,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
dataVerifyExcel.setPowerSubstationName(areaLineInfoVO.getPowerSubstationName());
dataVerifyExcel.setDevName(areaLineInfoVO.getDeviceName());
dataVerifyExcel.setIp(areaLineInfoVO.getIp());
dataVerifyExcel.setPowerFlag(areaLineInfoVO.getPowerFlag() == 0 ? "电网侧" : "非电网侧");
dataVerifyExcel.setManufacturer(areaLineInfoVO.getManufacturer());
}
}