Ver código fonte

风机信息增加 投产运行日期 ,涉及:查询、新增、修改、批量修改、导入等功能

zhouyang.xie 1 mês atrás
pai
commit
6b882aeaff

+ 8 - 0
energy-manage-common/src/main/java/com/energy/manage/common/po/windenginegroup/WindEngineGroupPO.java

@@ -1,10 +1,13 @@
 package com.energy.manage.common.po.windenginegroup;
 
+import com.alibaba.excel.annotation.ExcelProperty;
 import com.energy.manage.common.base.NewBaseDomain;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import java.util.Date;
+
 import javax.persistence.GeneratedValue;
 import javax.persistence.Table;
 
@@ -85,4 +88,9 @@ public class WindEngineGroupPO extends NewBaseDomain {
      */
     private Integer dataSource;
 
+    /**
+     * 投产运行日期
+     */
+    private Date commissioningDate;
+
 }

+ 54 - 0
energy-manage-service/docker-compose/mysql/energy.sql

@@ -923,4 +923,58 @@ CREATE TABLE `wind_relation` (
   KEY `code_number` (`code_number`)
 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='风场关系表 ';
 
+
+-- ----------------------------
+-- Table structure for auto_analysis_config_detail
+-- ----------------------------
+DROP TABLE IF EXISTS `auto_analysis_config_detail`;
+
+CREATE TABLE `auto_analysis_config_detail` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `field_code` varchar(100) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '风场编号',
+  `interval_days` int(11) NOT NULL DEFAULT '0' COMMENT '间隔天数',
+  `start_time` date NOT NULL COMMENT '起始时间',
+  `startup_state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '自动分析启动状态:1:启动 0:取消',
+  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  `config_unique_id` varchar(50) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '配置id',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=30006 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='自动分析配置表';
+
+-- ----------------------------
+-- Table structure for auto_analysis_config_detail_option_records
+-- ----------------------------
+DROP TABLE IF EXISTS `auto_analysis_config_detail_option_records`;
+
+CREATE TABLE `auto_analysis_config_detail_option_records` (
+  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `field_code` varchar(50) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '风场编号',
+  `source_inteval_days` int(11) NOT NULL DEFAULT '0' COMMENT '原始天数(当操作行为是”新增”的时候为0)',
+  `source_start_time` date DEFAULT NULL COMMENT '原始起始时间(当操作行为是"新增"的时候为空)',
+  `source_startup_state` tinyint(1) DEFAULT NULL COMMENT '原始启动状态(当操作行为是”新增”的时候为空)',
+  `option_flag` tinyint(1) NOT NULL DEFAULT '0' COMMENT '操作行为标识(0:新增 1:编辑 2:关停 3:启动)',
+  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '操作记录创建时间',
+  `config_unique_id` varchar(50) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '配置标识',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=30015 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='自动分析配置操作记录表';
+
+-- ----------------------------
+-- Table structure for auto_analysis_config_relations
+-- ----------------------------
+DROP TABLE IF EXISTS `auto_analysis_config_relations`;
+
+CREATE TABLE `auto_analysis_config_relations` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `config_unique_id` varchar(50) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '配置的唯一标识',
+  `batch_code` varchar(100) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '批次编号',
+  `start_time` date NOT NULL COMMENT '开始日期',
+  `end_time` date NOT NULL COMMENT '当前批次结束日期',
+  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=30052 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='自动分析配置与批次关系表';
+
+ALTER TABLE wind_engine_group ADD commissioning_date date NULL COMMENT '投产运行日期';
+
 SET FOREIGN_KEY_CHECKS = 1;
+
+

+ 12 - 0
energy-manage-service/src/main/java/com/energy/manage/service/controller/analysis/AutoAnalysisConfigController.java

@@ -6,6 +6,7 @@ import com.energy.manage.service.config.annotations.UserLoginToken;
 import com.energy.manage.service.controller.base.BaseServiceController;
 import com.energy.manage.service.domain.dto.analysis.AutoAnalysisConfigDetailDto;
 import com.energy.manage.service.domain.vo.analysis.AutoAnalysisConfigDetailVo;
+import com.energy.manage.service.service.analysis.AutoAnalysisService;
 import com.energy.manage.service.service.autoanalysisconfig.AutoAnalysisConfigService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -54,4 +55,15 @@ public class AutoAnalysisConfigController extends BaseServiceController {
     public ResultResp onOff(@RequestBody AutoAnalysisConfigDetailDto autoAnalysisConfigDetailDto) {
         return autoAnalysisConfigService.onOff(autoAnalysisConfigDetailDto);
     }
+
+    @Autowired
+    private AutoAnalysisService autoAnalysisService;
+
+    @ApiOperation(value = "自动分析测试")
+    @UserLoginToken
+    @PostMapping("/testAutoAnalysis")
+    public ResultResp autoAnalysis() {
+        autoAnalysisService.autoAnalysis();
+        return success();
+    }
 }

+ 7 - 1
energy-manage-service/src/main/java/com/energy/manage/service/domain/dto/windenginegroup/WindEngineGroupCreateDto.java

@@ -8,6 +8,8 @@ import lombok.Data;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.Date;
+
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 
@@ -103,5 +105,9 @@ public class WindEngineGroupCreateDto {
     @ApiModelProperty(value = "创建人")
     private Integer createBy;
 
-
+    /**
+     * 投产运行日期
+     */
+    @ApiModelProperty(value = "投产运行日期")
+    private Date commissioningDate;
 }

+ 8 - 0
energy-manage-service/src/main/java/com/energy/manage/service/domain/dto/windenginegroup/WindEngineGroupUpdateDto.java

@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.Date;
+
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 
@@ -88,4 +90,10 @@ public class WindEngineGroupUpdateDto {
      */
     @ApiModelProperty("切出风速")
     private Double ratedCutOutWindspeed;
+
+    /**
+     * 投产运行日期
+     */
+    @ApiModelProperty(value = "投产运行日期")
+    private Date commissioningDate;
 }

+ 7 - 1
energy-manage-service/src/main/java/com/energy/manage/service/domain/vo/excel/WindEngineGroupExcelVo.java

@@ -1,6 +1,8 @@
 package com.energy.manage.service.domain.vo.excel;
 
 
+import java.util.Date;
+
 import com.alibaba.excel.annotation.ExcelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -80,5 +82,9 @@ public class WindEngineGroupExcelVo {
     @ExcelProperty(value = "是否标杆风机", index = 11)
     private String sightcingString;
 
-
+    /**
+     * 是否标杆风机
+     */
+    @ExcelProperty(value = "投产运行日期", index = 12)
+    private Date commissioningDate‌;
 }

+ 6 - 0
energy-manage-service/src/main/java/com/energy/manage/service/domain/vo/windenginegroup/WindEngineGroupPageVo.java

@@ -103,4 +103,10 @@ public class WindEngineGroupPageVo {
     @ApiModelProperty("切出风速")
     private Double ratedCutOutWindspeed;
 
+    /**
+     * 投产运行日期
+     */
+    @ApiModelProperty(value = "投产运行日期")
+    private Date commissioningDate;
+
 }

+ 7 - 0
energy-manage-service/src/main/java/com/energy/manage/service/domain/vo/windenginegroup/WindEngineGroupVo.java

@@ -1,5 +1,7 @@
 package com.energy.manage.service.domain.vo.windenginegroup;
 
+import java.util.Date;
+
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -97,4 +99,9 @@ public class WindEngineGroupVo {
     @ApiModelProperty("异常状态-电子地图显示使用,true 有异常,false无异常")
     private boolean errorState = false;
 
+    /**
+     * 投产运行日期
+     */
+    @ApiModelProperty(value = "投产运行日期")
+    private Date commissioningDate;
 }

+ 7 - 0
energy-manage-service/src/main/java/com/energy/manage/service/service/windenginegroup/impl/WindEngineGroupServiceImpl.java

@@ -99,6 +99,8 @@ public class WindEngineGroupServiceImpl extends BaseServiceImpl<WindEngineGroupP
         if (!StringUtils.isEmpty(windEngineGroupCreateDto.getEngineId())) {
             windEngineGroupPO.setEngineId(windEngineGroupCreateDto.getEngineId());
         }
+        // 投产运行日期
+        windEngineGroupPO.setCommissioningDate(windEngineGroupCreateDto.getCommissioningDate());
         if (windEngineGroupMapper.insertUseGeneratedKeys(windEngineGroupPO) <= 0) {
             return false;
         }
@@ -202,6 +204,9 @@ public class WindEngineGroupServiceImpl extends BaseServiceImpl<WindEngineGroupP
             if (!StringUtils.isEmpty(windFieldExceVos.getEngineId())) {
                 windEngineGroupPO.setEngineId(windFieldExceVos.getEngineId());
             }
+
+            // windEngineGroupPO.setCommissioningDate(windFieldExceVos.getCommissioningDate());
+
             list.add(windEngineGroupPO);
         }
         if (CollectionUtils.isEmpty(list)) {
@@ -306,6 +311,8 @@ public class WindEngineGroupServiceImpl extends BaseServiceImpl<WindEngineGroupP
             if (!StringUtils.isEmpty(windFieldExceVos.getEngineId())) {
                 windEngineGroupPO.setEngineId(windFieldExceVos.getEngineId());
             }
+
+            windEngineGroupPO.setCommissioningDate(windFieldExceVos.getCommissioningDate());
             list.add(windEngineGroupPO);
         }
         if (CollectionUtils.isEmpty(list)) {

+ 2 - 2
energy-manage-service/src/main/resources/bootstrap.properties

@@ -1,7 +1,7 @@
 #============================nacos配置=========================================
 # spring.cloud.nacos.config.server-addr = 106.120.102.238:28488
-# spring.cloud.nacos.config.server-addr = 192.168.50.234:8848
-spring.cloud.nacos.config.server-addr = 10.172.12.211:8848
+spring.cloud.nacos.config.server-addr = 192.168.50.234:8848
+# spring.cloud.nacos.config.server-addr = 10.172.12.211:8848
 spring.cloud.nacos.config.namespace = 79c42a7a-2c7d-4dcf-8a2c-b334271e2191
 spring.cloud.nacos.config.name=application.properties
 spring.cloud.nacos.config.group = @profiles.active@

+ 10 - 4
energy-manage-service/src/main/resources/mybatis/windenginegroup/WindEngineGroupMapper.xml

@@ -19,6 +19,7 @@
         weg.state,
         wem.machine_type_code as machineTypeCode,
         wem.manufacturer_name as manufacturerName,
+        weg.commissioning_date as commissioningDate,
         weg.create_time as createTime
         from
         wind_company wc
@@ -29,15 +30,15 @@
         left JOIN
         wind_engine_mill wem on weg.mill_type_code = wem.mill_type_code and wem.del_state = 0
         where 1=1 and weg.del_state = 0
-        <if test="item.engineName!=null">
+        <if test="item.engineName!=null and item.engineName != ''">
             and
             weg.engine_name like CONCAT("%", #{item.engineName} ,"%")
         </if>
-        <if test="item.fieldName!=null">
+        <if test="item.fieldName!=null and item.fieldName != ''">
             AND
             wf.field_name = #{item.fieldName}
         </if>
-        <if test="item.fieldCode!=null">
+        <if test="item.fieldCode!=null and item.fieldCode != ''">
             AND
             wf.field_code = #{item.fieldCode}
         </if>
@@ -66,6 +67,7 @@
         weg.state,
         wem.machine_type_code as machineTypeCode,
         wem.manufacturer_name as manufacturerName,
+        weg.commissioning_date as commissioningDate,
         weg.create_time as createTime
         from
         wind_field wf
@@ -99,6 +101,7 @@
         wem.rated_wind_speed as ratedWindSpeed,
         wem.rated_cut_in_windspeed as ratedCutInWindspeed,
         wem.rated_cut_out_windspeed as ratedCutOutWindspeed,
+        weg.commissioning_date as commissioningDate,
         weg.create_time as createTime
         from
         wind_field wf
@@ -118,7 +121,7 @@
     <select id="selectWindEngineGroupByRoleId" parameterType="java.lang.Integer" resultType="com.energy.manage.service.domain.vo.windenginegroup.WindEngineGroupVo">
         select
             engine.field_code as fieldCode,
-            engine.field_name as fieldName,
+            <!-- engine.field_name as fieldName, -->
             engine.engine_code AS engineCode,
             engine.engine_name as engineName
         from wind_engine_group engine
@@ -184,6 +187,9 @@
             <if test="item.latitude!=null">
                 latitude = #{item.latitude},
             </if>
+            <if test="item.commissioningDate!=null">
+                commissioning_date = #{item.commissioningDate},
+            </if>
             update_time = now()
             </set>
             where

+ 8 - 2
pom.xml

@@ -335,15 +335,21 @@
     <!-- 配置环境 -->
     <profiles>
         <profile>
-            <id>dev</id>
+            <id>datang</id>
             <properties>
-                <profiles.active>dev</profiles.active>
+                <profiles.active>datang</profiles.active>
             </properties>
             <activation>
                 <activeByDefault>true</activeByDefault>
             </activation>
         </profile>
         <profile>
+            <id>dev</id>
+            <properties>
+                <profiles.active>dev</profiles.active>
+            </properties>
+        </profile>
+        <profile>
             <id>show</id>
             <properties>
                 <profiles.active>show</profiles.active>