lv.wenbin 9 mēneši atpakaļ
vecāks
revīzija
ff5e4f37ee

+ 2 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/OpEnergyStrategyController.java

@@ -264,6 +264,7 @@ public class OpEnergyStrategyController extends BaseController {
                     option.put("paramName", param.getParamName());
                     option.put("paramValue", param.getParamValue());
                     option.put("editEnable", param.getEditEnable());
+                    option.put("paramValueFormat", param.getParamValueFormat());
                     groupParamMap.put(param.getParamKey(), option);
                 }
             }
@@ -275,6 +276,7 @@ public class OpEnergyStrategyController extends BaseController {
                     option.put("paramName", param.getParamName());
                     option.put("paramValue", param.getParamValue());
                     option.put("editEnable", param.getEditEnable());
+                    option.put("paramValueFormat", param.getParamValueFormat());
                     groupParamMap.put(param.getParamKey(), option);
                 }
 

+ 12 - 1
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/OpEnergyStrategyParam.java

@@ -31,6 +31,9 @@ public class OpEnergyStrategyParam
     /** 参数值 */
     private String paramValue;
 
+    /** 参数值格式  */
+    private String paramValueFormat;
+
     /** 可编辑 */
     private Long editEnable;
 
@@ -93,7 +96,15 @@ public class OpEnergyStrategyParam
         this.editEnable = editEnable;
     }
 
-    public Long getEditEnable() 
+    public String getParamValueFormat() {
+        return paramValueFormat;
+    }
+
+    public void setParamValueFormat(String paramValueFormat) {
+        this.paramValueFormat = paramValueFormat;
+    }
+
+    public Long getEditEnable()
     {
         return editEnable;
     }

+ 2 - 1
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/OpEnergyStrategyParamMapper.xml

@@ -11,11 +11,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="paramKey"    column="param_key"    />
         <result property="paramName"    column="param_name"    />
         <result property="paramValue"    column="param_value"    />
+        <result property="paramValueFormat"    column="param_value_format"    />
         <result property="editEnable"    column="edit_enable"    />
     </resultMap>
 
     <sql id="selectAdmOpEnergyStrategyParamVo">
-        select id, strategy_code, param_group, param_key, param_name, param_value, edit_enable from adm_op_energy_strategy_param
+        select id, strategy_code, param_group, param_key, param_name, param_value, param_value_format, edit_enable from adm_op_energy_strategy_param
     </sql>
 
     <select id="selectParamByStrategyCode" parameterType="java.lang.String" resultMap="opEnergyStrategyParamResult">

+ 9 - 9
ems-cloud/sql/ems_init_data.sql

@@ -141,15 +141,15 @@ INSERT INTO `adm_op_energy_strategy` (`area_code`, `strategy_code`, `strategy_na
 -- 源网 控制模式 逆变器控制 策略
 -- inverterControl.inverterControl:[{"code":"svpwm", "name":"空间矢量控制(SVPWM)", "desc":"通过对逆变器开关状态的优化控制,实现并网电流的高精度控制"},{"code":"dtc", "name":"直流转矩控制", "desc":"以控制逆变器输出转矩和磁链为目标,快速响应"}]
 
-INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `edit_enable`) VALUES ('CL_YW_01', 'default', 'controlMode', '控制模式', 'maxPowerTrack', 1);
-INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `edit_enable`) VALUES ('CL_YW_01', 'inverterControl', 'controlMode', '逆变器控制策略', null, 1);
-INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `edit_enable`) VALUES ('CL_YW_01', 'powerAndVoltage', 'reactivePower', '无功功率', null, 1);
-INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `edit_enable`) VALUES ('CL_YW_01', 'powerAndVoltage', 'voltage', '电压', null, 1);
-
-INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `edit_enable`) VALUES ('CL_YW_02', 'default', 'controlMode', '控制模式', 'maxPowerTrack', 1);
-INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `edit_enable`) VALUES ('CL_YW_02', 'inverterControl', 'controlMode', '逆变器控制策略', null, 1);
-INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `edit_enable`) VALUES ('CL_YW_02', 'powerAndVoltage', 'reactivePower', '无功功率', null, 1);
-INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `edit_enable`) VALUES ('CL_YW_02', 'powerAndVoltage', 'voltage', '电压', null, 1);
+INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `param_value_format`, `edit_enable`) VALUES ('CL_YW_01', 'default', 'controlMode', '控制模式', 'maxPowerTrack', 'enum', 1);
+INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `param_value_format`, `edit_enable`) VALUES ('CL_YW_01', 'inverterControl', 'controlMode', '逆变器控制策略', null, 'enum', 1);
+INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `param_value_format`, `edit_enable`) VALUES ('CL_YW_01', 'powerAndVoltage', 'reactivePower', '无功功率', null, 'text', 1);
+INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `param_value_format`, `edit_enable`) VALUES ('CL_YW_01', 'powerAndVoltage', 'voltage', '电压', null, 'text', 1);
+
+INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `param_value_format`, `edit_enable`) VALUES ('CL_YW_02', 'default', 'controlMode', '控制模式', 'maxPowerTrack', 'enum', 1);
+INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `param_value_format`, `edit_enable`) VALUES ('CL_YW_02', 'inverterControl', 'controlMode', '逆变器控制策略', null, 'enum', 1);
+INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `param_value_format`, `edit_enable`) VALUES ('CL_YW_02', 'powerAndVoltage', 'reactivePower', '无功功率', null, 'text', 1);
+INSERT INTO `adm_op_energy_strategy_param` (`strategy_code`, `param_group`, `param_key`, `param_name`, `param_value`, `param_value_format`, `edit_enable`) VALUES ('CL_YW_02', 'powerAndVoltage', 'voltage', '电压', null, 'text', 1);
 
 
 -- 对象模型表

+ 8 - 8
ems-cloud/sql/ems_server.sql

@@ -701,14 +701,14 @@ create table adm_op_energy_strategy  (
 -- ----------------------------
 drop table if exists adm_op_energy_strategy_param;
 create table adm_op_energy_strategy_param  (
-  `id`                bigint(20)      not null auto_increment      comment '序号',
-  `strategy_code`     varchar(16)     not null                     comment '策略代码',
-  `param_group`       varchar(128)    not null                     comment '策略分组',
-  `param_key`         varchar(128)    not null                     comment '参数键值',
-  `param_name`        varchar(256)    not null                     comment '参数名称',
-  `param_value`       varchar(1024)   default null                 comment '参数值',
-  `param_value_desc`  varchar(1024)   default null                 comment '参数值描述',
-  `edit_enable`       int             default 0                    comment '可编辑',
+  `id`                  bigint(20)      not null auto_increment      comment '序号',
+  `strategy_code`       varchar(16)     not null                     comment '策略代码',
+  `param_group`         varchar(128)    not null                     comment '策略分组',
+  `param_key`           varchar(128)    not null                     comment '参数键值',
+  `param_name`          varchar(256)    not null                     comment '参数名称',
+  `param_value`         varchar(1024)   default null                 comment '参数值',
+  `param_value_format`  varchar(128)    default null                 comment '参数值格式',
+  `edit_enable`         int             default 0                    comment '可编辑',
   primary key (`id`),
   unique key ux_op_energy_strategy_param(`strategy_code`, `param_group`, `param_key`)
 ) engine=innodb auto_increment=1 comment = '能源策略参数表';