From f0a5277efeab6983f450d5052ced1085e0c0077a Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期一, 18 十一月 2024 13:41:30 +0800 Subject: [PATCH] Merge branch 'master' of http://dlindusit.com:53929/r/iailab-plat --- iailab-module-report/iailab-module-report-biz/src/main/resources/application-dev.yaml | 6 /dev/null | 14 -- iailab-module-report/iailab-module-report-biz/src/main/resources/application.yaml | 2 iailab-module-model/iailab-module-model-biz/db/mysql.sql | 16 +- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/HIKDevice.java | 1 iailab-module-bpm/iailab-module-bpm-biz/src/main/resources/application-dev.yaml | 2 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java | 2 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/common/utils/ExcelUtil.java | 292 +++++++++++++++++++++++++++++++++++++++++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/controller/admin/McsApiController.java | 45 ++++++ 9 files changed, 352 insertions(+), 28 deletions(-) diff --git a/iailab-module-bpm/iailab-module-bpm-biz/src/main/resources/application-dev.yaml b/iailab-module-bpm/iailab-module-bpm-biz/src/main/resources/application-dev.yaml index b4d979c..c596066 100644 --- a/iailab-module-bpm/iailab-module-bpm-biz/src/main/resources/application-dev.yaml +++ b/iailab-module-bpm/iailab-module-bpm-biz/src/main/resources/application-dev.yaml @@ -39,7 +39,7 @@ primary: master datasource: master: - url: jdbc:mysql://127.0.0.1:3306/iailab-plat?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + url: jdbc:mysql://127.0.0.1:3306/iailab_plat_system?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/iailab-plat?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java index e4d79db..a1788ea 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java @@ -166,7 +166,7 @@ if (end == null) { queryDto.setEnd(new Date()); } else { - queryDto.setStart(formatter.parse(end)); + queryDto.setEnd(formatter.parse(end)); } } catch (ParseException e) { e.printStackTrace(); diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/HIKDevice.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/HIKDevice.java index df8e685..9741db1 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/HIKDevice.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/HIKDevice.java @@ -180,6 +180,7 @@ String tPath = tDatePath + "/" + tImageName; // 开始抓图 if (!hCNetSDK.NET_DVR_CaptureJPEGPicture(nlUserID, nChannel, lpJpegPara, tPath)) { + VideoConfiguration.staticCameraService.setStatus(camera.getId(), CameraStatusEnum.OFFLINE.getCode()); return "失败编码:" + hCNetSDK.NET_DVR_GetLastError(); } else { Map<String, String> params = new HashMap<>(); diff --git a/iailab-module-model/iailab-module-model-biz/db/mysql.sql b/iailab-module-model/iailab-module-model-biz/db/mysql.sql index 8883c8c..0f3fb07 100644 --- a/iailab-module-model/iailab-module-model-biz/db/mysql.sql +++ b/iailab-module-model/iailab-module-model-biz/db/mysql.sql @@ -590,7 +590,7 @@ `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '文件名', `file_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '文件保存路径', `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注', - `create_time` timestamp NULL DEFAULT NULL COMMENT '生成时间', + `create_time` datetime NULL DEFAULT NULL COMMENT '生成时间', PRIMARY KEY (`id`, `mdk_id`) USING BTREE, INDEX `del_code_history`(`mdk_id` ASC) USING BTREE, CONSTRAINT `del_code_history` FOREIGN KEY (`mdk_id`) REFERENCES `t_mpk_file` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT @@ -663,8 +663,8 @@ `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'id', `project_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '项目名称', `project_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '项目编码', - `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间', - `update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '项目表' ROW_FORMAT = DYNAMIC; @@ -697,7 +697,7 @@ `version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '版本号', `log` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新日志', `model_names` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '打包模型名称(“,”分割)', - `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', PRIMARY KEY (`id`, `project_id`) USING BTREE, INDEX `del_package_history`(`project_id` ASC) USING BTREE, CONSTRAINT `del_package_history` FOREIGN KEY (`project_id`) REFERENCES `t_mpk_project` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT @@ -802,8 +802,8 @@ `id` varchar(36) NOT NULL, `chart_name` varchar(100) DEFAULT NULL COMMENT '图表名称', `chart_code` varchar(100) DEFAULT NULL COMMENT '图表编码', - `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间', - `update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`), UNIQUE KEY `uk_chart_code` (`chart_code`), KEY `index_id` (`id`) @@ -817,8 +817,8 @@ `param_code` varchar(100) DEFAULT NULL COMMENT '参数编码', `param_value` varchar(1000) DEFAULT NULL COMMENT '参数值', `remark` varchar(255) DEFAULT NULL COMMENT '备注', - `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间', - `update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', PRIMARY KEY (`id`, `chart_id`) USING BTREE, KEY `index_chart_id` (`chart_id`), CONSTRAINT `chart_id` FOREIGN KEY (`chart_id`) REFERENCES `t_chart` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/controller/admin/McsApiController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/controller/admin/McsApiController.java index 7198837..affdaac 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/controller/admin/McsApiController.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/controller/admin/McsApiController.java @@ -1,20 +1,31 @@ package com.iailab.module.model.api.controller.admin; +import com.iailab.framework.apilog.core.annotation.ApiAccessLog; import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.excel.core.util.ExcelUtils; +import com.iailab.module.data.api.point.dto.ApiPointValueQueryDTO; import com.iailab.module.model.api.mcs.McsApi; import com.iailab.module.model.api.mcs.dto.*; import com.iailab.module.model.common.utils.ApiSecurityUtils; +import com.iailab.module.model.common.utils.ExcelUtil; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.annotation.security.PermitAll; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedHashMap; import java.util.List; +import static com.iailab.framework.apilog.core.enums.OperateTypeEnum.EXPORT; /** * @author PanZhibao @@ -77,4 +88,38 @@ PreDataItemChartRespVO respVO = mcsApi.getPreDataSingleChart(reqVO); return CommonResult.success(respVO); } + + @GetMapping("/predict-data/exportValue") + @Operation(summary = "导出预测数据") + @ApiAccessLog(operateType = EXPORT) + public void exportPointValue(@RequestParam("itemId") String itemId, + @RequestParam("startTime") String startTime, + @RequestParam("endTime") String endTime, + HttpServletResponse response) throws IOException { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + PreDataItemChartReqVO reqVO = new PreDataItemChartReqVO(); + reqVO.setItemId(itemId); + try { + if (startTime == "") { + reqVO.setStartTime(new Date((new Date()).getTime() - 60*60*1000)); + } else { + reqVO.setStartTime(formatter.parse(startTime)); + + } + if (endTime == "") { + reqVO.setEndTime(new Date((new Date()).getTime() + 60*60*1000)); + } else { + reqVO.setEndTime(formatter.parse(endTime)); + } + } catch (Exception e) { + e.printStackTrace(); + } + PreDataItemChartRespVO respVO = mcsApi.getPreDataItemChart(reqVO); + try { + String sheetTitle = "sheet1"; + ExcelUtil.exportchart(sheetTitle, respVO, response); + } catch (Exception ex) { + ex.printStackTrace(); + } + } } \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/common/utils/ExcelUtil.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/common/utils/ExcelUtil.java new file mode 100644 index 0000000..ac1c313 --- /dev/null +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/common/utils/ExcelUtil.java @@ -0,0 +1,292 @@ +package com.iailab.module.model.common.utils; + +import com.iailab.module.model.api.mcs.dto.PreDataItemChartRespVO; +import com.iailab.module.model.api.mcs.dto.PreDataSampleViewRespDTO; +import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.VerticalAlignment; +import org.apache.poi.ss.util.CellRangeAddress; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Excel 导出通用工具类 + * + * @author PanZhibao + * @date 2021年06月29日 9:06 + */ +public class ExcelUtil { + + /** + * 导出PointValueExcel + * + * @param sheetTitle + * @param title + * @param list + * @param response + * @return + */ + public static byte[] exportPointValue(String sheetTitle, String[] title, List<Object> list, HttpServletResponse response) { + + HSSFWorkbook wb = new HSSFWorkbook();//创建excel表 + HSSFSheet sheet = wb.createSheet(sheetTitle); + sheet.setDefaultColumnWidth(20);//设置默认行宽 + + //表头样式(加粗,水平居中,垂直居中) + HSSFCellStyle cellStyle = wb.createCellStyle(); + cellStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中 + cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 + + HSSFFont fontStyle = wb.createFont(); + + cellStyle.setFont(fontStyle); + + //标题样式(加粗,垂直居中) + HSSFCellStyle cellStyle2 = wb.createCellStyle(); + cellStyle2.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 + cellStyle2.setFont(fontStyle); + + //字段样式(垂直居中) + HSSFCellStyle cellStyle3 = wb.createCellStyle(); + cellStyle3.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 + + //数字样式 + HSSFCellStyle cellStyle4 = wb.createCellStyle(); + HSSFDataFormat df = wb.createDataFormat(); // 此处设置数据格式 + cellStyle4.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中 + cellStyle4.setDataFormat(df.getFormat("#,##0.000000"));//设置数值类型格式为保留两位小数 + + //创建表头 + HSSFRow row = sheet.createRow(0); + //row.setHeightInPoints(20);//行高 + + HSSFCell cell = row.createCell(0); + cell.setCellValue(sheetTitle); + cell.setCellStyle(cellStyle); + + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, (title.length - 1))); + + //创建标题 + HSSFRow rowTitle = sheet.createRow(1); + //rowTitle.setHeightInPoints(20); + + HSSFCell hc; + for (int i = 0; i < title.length; i++) { + hc = rowTitle.createCell(i); + hc.setCellValue(title[i]); + hc.setCellStyle(cellStyle2); + } + + byte result[] = null; + + try { + //创建表格数据 + Field[] fields; + int i = 2; + for (Object obj : list) { + fields = obj.getClass().getDeclaredFields(); + + HSSFRow rowBody = sheet.createRow(i); + //rowBody.setHeightInPoints(20); + + int j = 0; + for (Field f : fields) { + + f.setAccessible(true); + + Object va = f.get(obj); + if (null == va) { + va = ""; + } + + hc = rowBody.createCell(j); + + if (j == 0) { + hc.setCellValue(Double.parseDouble(va.toString())); + hc.setCellStyle(cellStyle4); + } else { + hc.setCellValue(va.toString()); + hc.setCellStyle(cellStyle3); + } + + + j++; + } + + i++; + } + + //设置Http响应头告诉浏览器下载这个附件 + response.setHeader("Content-Disposition", "attachment;Filename=" + System.currentTimeMillis() + ".xls"); + OutputStream outputStream = response.getOutputStream(); + wb.write(outputStream); + outputStream.close(); + return wb.getBytes(); + } catch (Exception ex) { + Logger.getLogger(ExcelUtil.class.getName()).log(Level.SEVERE, null, ex); + return result; + } finally { + try { + wb.close(); + } catch (IOException ex) { + Logger.getLogger(ExcelUtil.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + //预测图表数据转excel + public static byte[] exportchart(String sheetTitle, PreDataItemChartRespVO respVO, HttpServletResponse response) { + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + HSSFWorkbook wb = new HSSFWorkbook(); + HSSFSheet sheet = wb.createSheet(sheetTitle); + sheet.setDefaultColumnWidth(20);//设置默认行宽 + + // 表头样式(加粗,水平居中,垂直居中) + HSSFCellStyle cellStyle = wb.createCellStyle(); + cellStyle.setAlignment(HorizontalAlignment.CENTER); + cellStyle.setVerticalAlignment(VerticalAlignment.CENTER); + HSSFFont fontStyle = wb.createFont(); + cellStyle.setFont(fontStyle); + + // 标题样式(加粗,垂直居中) + HSSFCellStyle cellStyle2 = wb.createCellStyle(); + cellStyle2.setVerticalAlignment(VerticalAlignment.CENTER); + cellStyle2.setFont(fontStyle); + + // 字段样式(垂直居中) + HSSFCellStyle cellStyle3 = wb.createCellStyle(); + cellStyle3.setVerticalAlignment(VerticalAlignment.CENTER); + + // 数字样式 + HSSFCellStyle cellStyle4 = wb.createCellStyle(); + HSSFDataFormat df = wb.createDataFormat(); + cellStyle4.setVerticalAlignment(VerticalAlignment.CENTER); + cellStyle4.setDataFormat(df.getFormat("#,##0.000000")); + + // 创建标题 + String[] title = new String[respVO.getLegend().size() * 4]; + for (int i = 0; respVO.getLegend().size() > i; i++) { + title[i * 4] = "日期时间"; + title[i * 4 + 1] = respVO.getLegend().get(i) + ":真实值"; + title[i * 4 + 2] = "日期时间"; + title[i * 4 + 3] = respVO.getLegend().get(i) + ":预测值"; + } + HSSFRow rowTitle = sheet.createRow(0); + HSSFCell hc; + for (int i = 0; i < title.length; i++) { + hc = rowTitle.createCell(i); + hc.setCellValue(title[i]); + hc.setCellStyle(cellStyle2); + } + + LinkedHashMap<String, PreDataSampleViewRespDTO> viewMap = respVO.getViewMap(); + byte result[] = null; + try { + // 创建表格数据 + //逐列插入 + for (int j = 0; viewMap.size() > j; j++) { + //去掉标题行,从第一行开始 + //逐行插入 + for (Map.Entry<String, PreDataSampleViewRespDTO> entry : viewMap.entrySet()) { + //真实值 + List<Object[]> realData = entry.getValue().getRealData(); + //预测值 + List<Object[]> preDataN = entry.getValue().getPreDataN(); + HSSFRow rowBody; + + //插入真实值 + for (int i = 0; realData.size() > i; i++) { + //判断是否创建过行,如果没有创建行,否则更新行 + if (sheet.getRow(i + 1) == null) { + rowBody = sheet.createRow(i + 1); + } else { + rowBody = sheet.getRow(i + 1); + } + //插入时间 + hc = rowBody.createCell(j * 4); + if (realData.get(i)[0] != null) { + if (realData.get(i)[0] instanceof Date) { + String formattedDate = sdf.format(realData.get(i)[0]); + hc.setCellValue(formattedDate); + } else { + hc.setCellValue(realData.get(i)[0].toString()); + } + hc.setCellStyle(cellStyle3); + } else { + hc.setCellValue(""); + hc.setCellStyle(cellStyle3); + } + //插入值 + hc = rowBody.createCell(j * 4 + 1); + if (realData.get(i)[1] != null) { + hc.setCellValue(realData.get(i)[1].toString()); + hc.setCellStyle(cellStyle4); + } else { + hc.setCellValue(""); + hc.setCellStyle(cellStyle4); + } + } + //插入预测值 + for (int i = 0; preDataN.size() > i; i++) { + //判断是否创建过行,如果没有创建行,否则更新行 + if (sheet.getRow(i + 1) == null) { + rowBody = sheet.createRow(i + 1); + } else { + rowBody = sheet.getRow(i + 1); + } + //插入时间 + hc = rowBody.createCell(j * 4 + 2); + if (preDataN.get(i)[0] != null) { + if (preDataN.get(i)[0] instanceof Date) { + String formattedDate = sdf.format(preDataN.get(i)[0]); + hc.setCellValue(formattedDate); + } else { + hc.setCellValue(preDataN.get(i)[0].toString()); + } + hc.setCellStyle(cellStyle3); + } else { + hc.setCellValue(""); + hc.setCellStyle(cellStyle3); + } + //插入值 + hc = rowBody.createCell(j * 4 + 3); + if (preDataN.get(i)[1] != null) { + hc.setCellValue(preDataN.get(i)[1].toString()); + hc.setCellStyle(cellStyle4); + } else { + hc.setCellValue(""); + hc.setCellStyle(cellStyle4); + } + } + } + } + // 设置Http响应头告诉浏览器下载这个附件 + response.setHeader("Content-Disposition", "attachment;Filename=" + System.currentTimeMillis() + ".xls"); + OutputStream outputStream = response.getOutputStream(); + wb.write(outputStream); + outputStream.close(); + return wb.getBytes(); + } catch (Exception ex) { + Logger.getLogger(ExcelUtil.class.getName()).log(Level.SEVERE, null, ex); + return result; + } finally { + try { + wb.close(); + } catch (IOException ex) { + Logger.getLogger(ExcelUtil.class.getName()).log(Level.SEVERE, null, ex); + } + } + } +} \ No newline at end of file diff --git a/iailab-module-report/iailab-module-report-biz/src/main/resources/application-dev.yaml b/iailab-module-report/iailab-module-report-biz/src/main/resources/application-dev.yaml index 42e962a..4557792 100644 --- a/iailab-module-report/iailab-module-report-biz/src/main/resources/application-dev.yaml +++ b/iailab-module-report/iailab-module-report-biz/src/main/resources/application-dev.yaml @@ -39,7 +39,7 @@ primary: master datasource: master: - url: jdbc:mysql://127.0.0.1:3306/iailab-plat?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + url: jdbc:mysql://127.0.0.1:3306/iailab_plat_system?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 username: root password: 123456 slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 @@ -50,10 +50,10 @@ # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 redis: - host: 400-infra.server.iocoder.cn # 地址 + host: 127.0.0.1 # 地址 port: 6379 # 端口 database: 1 # 数据库索引 -# password: 123456 # 密码,建议生产环境开启 + password: 123456 # 密码,建议生产环境开启 --- #################### MQ 消息队列相关配置 #################### diff --git a/iailab-module-report/iailab-module-report-biz/src/main/resources/application.yaml b/iailab-module-report/iailab-module-report-biz/src/main/resources/application.yaml index c38a700..acac737 100644 --- a/iailab-module-report/iailab-module-report-biz/src/main/resources/application.yaml +++ b/iailab-module-report/iailab-module-report-biz/src/main/resources/application.yaml @@ -3,7 +3,7 @@ name: report-server profiles: - active: ${spring.profiles.active} + active: @profiles.active@ cloud: nacos: diff --git a/iailab-module-report/iailab-module-report-biz/src/main/resources/bootstrap-local.yaml b/iailab-module-report/iailab-module-report-biz/src/main/resources/bootstrap-local.yaml deleted file mode 100644 index 07ea2f8..0000000 --- a/iailab-module-report/iailab-module-report-biz/src/main/resources/bootstrap-local.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- #################### 注册中心相关配置 #################### - -spring: - cloud: - nacos: - server-addr: @nacos.server@ - username: @nacos.username@ - password: @nacos.password@ - discovery: - namespace: @profiles.active@ # 命名空间。这里使用 dev 开发环境 - autoRegister: true - metadata: - version: @nacos.metadata.version@ # 服务实例的版本号,可用于灰度发布 - ---- #################### 配置中心相关配置 #################### - -spring: - cloud: - nacos: - # Nacos Config 配置项,对应 NacosConfigProperties 配置属性类 - config: - server-addr: @nacos.server@ # Nacos 服务器地址 - namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境 - group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP - name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name - file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties diff --git a/iailab-module-report/iailab-module-report-biz/src/main/resources/bootstrap.yaml b/iailab-module-report/iailab-module-report-biz/src/main/resources/bootstrap.yaml deleted file mode 100644 index dddb22e..0000000 --- a/iailab-module-report/iailab-module-report-biz/src/main/resources/bootstrap.yaml +++ /dev/null @@ -1,14 +0,0 @@ -spring: - application: - name: report-server - - profiles: - active: local - -server: - port: 48084 - -# 日志文件配置。注意,如果 logging.file.name 不放在 bootstrap.yaml 配置文件,而是放在 application.yaml 中,会导致出现 LOG_FILE_IS_UNDEFINED 文件 -logging: - file: - name: @log.path@/logs/${spring.application.name}.log # 日志文件名,全路径 -- Gitblit v1.9.3