瀏覽代碼

电价&峰谷配置

lv.wenbin 1 年之前
父節點
當前提交
b764fef576
共有 19 個文件被更改,包括 1306 次插入23 次删除
  1. 105 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/ElectrovalencyConfigController.java
  2. 101 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/ElectrovalencyPeakValleyController.java
  3. 9 9
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmissionFactorController.java
  4. 185 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/ElectrovalencyConfig.java
  5. 126 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/ElectrovalencyPeakValley.java
  6. 12 1
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/EmsFacsFlowRel.java
  7. 62 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/ElectrovalencyConfigMapper.java
  8. 62 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/ElectrovalencyPeakValleyMapper.java
  9. 61 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IElectrovalencyConfigService.java
  10. 62 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IElectrovalencyPeakValleyService.java
  11. 94 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/ElectrovalencyConfigServiceImpl.java
  12. 95 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/ElectrovalencyPeakValleyServiceImpl.java
  13. 54 0
      ems-cloud/ems-modules/ems-server/src/main/resources/application-demo.yml
  14. 106 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/ElectrovalencyConfigMapper.xml
  15. 81 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/ElectrovalencyPeakValleyMapper.xml
  16. 7 1
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsFacsFlowRelMapper.xml
  17. 1 6
      ems-cloud/ruoyi-gateway/src/main/resources/application-demo.yml
  18. 75 0
      ems-cloud/sql/ems_server.sql
  19. 8 6
      ems-cloud/sql/ems_sys.sql

+ 105 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/ElectrovalencyConfigController.java

@@ -0,0 +1,105 @@
+package com.ruoyi.ems.controller;
+
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.ems.domain.ElectrovalencyConfig;
+import com.ruoyi.ems.service.IElectrovalencyConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 电价配置Controller
+ * 
+ * @author ruoyi
+ * @date 2024-07-12
+ */
+@RestController
+@RequestMapping("/basecfg/electrovalency")
+public class ElectrovalencyConfigController extends BaseController
+{
+    @Autowired
+    private IElectrovalencyConfigService electrovalencyConfigService;
+
+    /**
+     * 查询电价配置列表
+     */
+    @RequiresPermissions("basecfg:electrovalency:list")
+    @GetMapping("/list")
+    public TableDataInfo list(ElectrovalencyConfig electrovalencyConfig)
+    {
+        startPage();
+        List<ElectrovalencyConfig> list = electrovalencyConfigService.selectElectrovalencyConfigList(electrovalencyConfig);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出电价配置列表
+     */
+    @RequiresPermissions("basecfg:electrovalency:export")
+    @Log(title = "电价配置", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ElectrovalencyConfig electrovalencyConfig)
+    {
+        List<ElectrovalencyConfig> list = electrovalencyConfigService.selectElectrovalencyConfigList(electrovalencyConfig);
+        ExcelUtil<ElectrovalencyConfig> util = new ExcelUtil<ElectrovalencyConfig>(ElectrovalencyConfig.class);
+        util.exportExcel(response, list, "电价配置数据");
+    }
+
+    /**
+     * 获取电价配置详细信息
+     */
+    @RequiresPermissions("basecfg:electrovalency:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(electrovalencyConfigService.selectElectrovalencyConfigById(id));
+    }
+
+    /**
+     * 新增电价配置
+     */
+    @RequiresPermissions("basecfg:electrovalency:add")
+    @Log(title = "电价配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ElectrovalencyConfig electrovalencyConfig)
+    {
+        return toAjax(electrovalencyConfigService.insertElectrovalencyConfig(electrovalencyConfig));
+    }
+
+    /**
+     * 修改电价配置
+     */
+    @RequiresPermissions("basecfg:electrovalency:edit")
+    @Log(title = "电价配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ElectrovalencyConfig electrovalencyConfig)
+    {
+        return toAjax(electrovalencyConfigService.updateElectrovalencyConfig(electrovalencyConfig));
+    }
+
+    /**
+     * 删除电价配置
+     */
+    @RequiresPermissions("basecfg:electrovalency:remove")
+    @Log(title = "电价配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(electrovalencyConfigService.deleteElectrovalencyConfigByIds(ids));
+    }
+}

+ 101 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/ElectrovalencyPeakValleyController.java

@@ -0,0 +1,101 @@
+package com.ruoyi.ems.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.ems.domain.ElectrovalencyPeakValley;
+import com.ruoyi.ems.service.IElectrovalencyPeakValleyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+
+/**
+ * 电价峰谷Controller
+ *
+ * @author ruoyi
+ * @date 2024-07-12
+ */
+@RestController
+@RequestMapping("/basecfg/peakvalley")
+public class ElectrovalencyPeakValleyController extends BaseController {
+    @Autowired
+    private IElectrovalencyPeakValleyService electrovalencyPeakValleyService;
+
+    /**
+     * 查询电价峰谷列表
+     */
+    @RequiresPermissions("basecfg:peakvalley:list")
+    @GetMapping("/list")
+    public TableDataInfo list(ElectrovalencyPeakValley electrovalencyPeakValley) {
+        startPage();
+        List<ElectrovalencyPeakValley> list = electrovalencyPeakValleyService.selectElectrovalencyPeakValleyList(
+            electrovalencyPeakValley);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出电价峰谷列表
+     */
+    @RequiresPermissions("basecfg:peakvalley:export")
+    @Log(title = "电价峰谷", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ElectrovalencyPeakValley electrovalencyPeakValley) {
+        List<ElectrovalencyPeakValley> list = electrovalencyPeakValleyService.selectElectrovalencyPeakValleyList(
+            electrovalencyPeakValley);
+        ExcelUtil<ElectrovalencyPeakValley> util = new ExcelUtil<ElectrovalencyPeakValley>(
+            ElectrovalencyPeakValley.class);
+        util.exportExcel(response, list, "电价峰谷数据");
+    }
+
+    /**
+     * 获取电价峰谷详细信息
+     */
+    @RequiresPermissions("basecfg:peakvalley:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(electrovalencyPeakValleyService.selectElectrovalencyPeakValleyById(id));
+    }
+
+    /**
+     * 新增电价峰谷
+     */
+    @RequiresPermissions("basecfg:peakvalley:add")
+    @Log(title = "电价峰谷", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ElectrovalencyPeakValley electrovalencyPeakValley) {
+        return toAjax(electrovalencyPeakValleyService.insertElectrovalencyPeakValley(electrovalencyPeakValley));
+    }
+
+    /**
+     * 修改电价峰谷
+     */
+    @RequiresPermissions("basecfg:peakvalley:edit")
+    @Log(title = "电价峰谷", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ElectrovalencyPeakValley electrovalencyPeakValley) {
+        return toAjax(electrovalencyPeakValleyService.updateElectrovalencyPeakValley(electrovalencyPeakValley));
+    }
+
+    /**
+     * 删除电价峰谷
+     */
+    @RequiresPermissions("basecfg:peakvalley:remove")
+    @Log(title = "电价峰谷", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(electrovalencyPeakValleyService.deleteElectrovalencyPeakValleyByIds(ids));
+    }
+}

+ 9 - 9
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmissionFactorController.java

@@ -23,7 +23,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 
 /**
- * 排放因子Controller
+ * 排放因子Controller
  * 
  * @author ruoyi
  * @date 2024-07-11
@@ -51,7 +51,7 @@ public class EmissionFactorController extends BaseController
      * 导出排放因子维列表
      */
     @RequiresPermissions("basecfg:emissionFactor:export")
-    @Log(title = "排放因子", businessType = BusinessType.EXPORT)
+    @Log(title = "排放因子", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, EmissionFactor emissionFactor)
     {
@@ -63,7 +63,7 @@ public class EmissionFactorController extends BaseController
     /**
      * 获取排放因子维详细信息
      */
-    @RequiresPermissions("ems:factor:query")
+    @RequiresPermissions("basecfg:emissionFactor:query")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -73,8 +73,8 @@ public class EmissionFactorController extends BaseController
     /**
      * 新增排放因子维
      */
-    @RequiresPermissions("ems:factor:add")
-    @Log(title = "排放因子", businessType = BusinessType.INSERT)
+    @RequiresPermissions("basecfg:emissionFactor:add")
+    @Log(title = "排放因子", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody EmissionFactor emissionFactor)
     {
@@ -84,8 +84,8 @@ public class EmissionFactorController extends BaseController
     /**
      * 修改排放因子维
      */
-    @RequiresPermissions("ems:factor:edit")
-    @Log(title = "排放因子", businessType = BusinessType.UPDATE)
+    @RequiresPermissions("basecfg:emissionFactor:edit")
+    @Log(title = "排放因子", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody EmissionFactor emissionFactor)
     {
@@ -95,8 +95,8 @@ public class EmissionFactorController extends BaseController
     /**
      * 删除排放因子维
      */
-    @RequiresPermissions("ems:factor:remove")
-    @Log(title = "排放因子", businessType = BusinessType.DELETE)
+    @RequiresPermissions("basecfg:emissionFactor:remove")
+    @Log(title = "排放因子", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {

+ 185 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/ElectrovalencyConfig.java

@@ -0,0 +1,185 @@
+package com.ruoyi.ems.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 电价配置对象 sys_electrovalency_config
+ * 
+ * @author ruoyi
+ * @date 2024-07-12
+ */
+public class ElectrovalencyConfig extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 配置代码 */
+    @Excel(name = "配置代码")
+    private String cfgCode;
+
+    /** 用电分类 */
+    @Excel(name = "用电分类")
+    private Long elecClass;
+
+    /** 价格类型 */
+    @Excel(name = "价格类型")
+    private Long priceType;
+
+    /** 年用电量下限 */
+    @Excel(name = "年用电量下限")
+    private Long quantityLowerLimit;
+
+    /** 年用电量上限 */
+    @Excel(name = "年用电量上限")
+    private Long quantityUpperLimit;
+
+    /** 不满1千伏(价格) */
+    @Excel(name = "不满1千伏")
+    private Double priceLess1kv;
+
+    /** 不满10千伏(价格) */
+    @Excel(name = "不满10千伏")
+    private Double price1kv10kv;
+
+    /** 20-30千伏(价格) */
+    @Excel(name = "20-30千伏")
+    private Double price20kv35kv;
+
+    /** 35-110千伏(价格) */
+    @Excel(name = "35-110千伏")
+    private Double price35kv110kv;
+
+    /** 110千伏(价格) */
+    @Excel(name = "110千伏")
+    private Double price110kv;
+
+    /** 220千伏(价格) */
+    @Excel(name = "220千伏")
+    private Double price220kv;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setCfgCode(String cfgCode) 
+    {
+        this.cfgCode = cfgCode;
+    }
+
+    public String getCfgCode() 
+    {
+        return cfgCode;
+    }
+    public void setElecClass(Long elecClass) 
+    {
+        this.elecClass = elecClass;
+    }
+
+    public Long getElecClass() 
+    {
+        return elecClass;
+    }
+    public void setPriceType(Long priceType) 
+    {
+        this.priceType = priceType;
+    }
+
+    public Long getPriceType() 
+    {
+        return priceType;
+    }
+    public void setQuantityLowerLimit(Long quantityLowerLimit) 
+    {
+        this.quantityLowerLimit = quantityLowerLimit;
+    }
+
+    public Long getQuantityLowerLimit() 
+    {
+        return quantityLowerLimit;
+    }
+    public void setQuantityUpperLimit(Long quantityUpperLimit) 
+    {
+        this.quantityUpperLimit = quantityUpperLimit;
+    }
+
+    public Long getQuantityUpperLimit() 
+    {
+        return quantityUpperLimit;
+    }
+
+    public Double getPriceLess1kv() {
+        return priceLess1kv;
+    }
+
+    public void setPriceLess1kv(Double priceLess1kv) {
+        this.priceLess1kv = priceLess1kv;
+    }
+
+    public Double getPrice1kv10kv() {
+        return price1kv10kv;
+    }
+
+    public void setPrice1kv10kv(Double price1kv10kv) {
+        this.price1kv10kv = price1kv10kv;
+    }
+
+    public Double getPrice20kv35kv() {
+        return price20kv35kv;
+    }
+
+    public void setPrice20kv35kv(Double price20kv35kv) {
+        this.price20kv35kv = price20kv35kv;
+    }
+
+    public Double getPrice35kv110kv() {
+        return price35kv110kv;
+    }
+
+    public void setPrice35kv110kv(Double price35kv110kv) {
+        this.price35kv110kv = price35kv110kv;
+    }
+
+    public Double getPrice110kv() {
+        return price110kv;
+    }
+
+    public void setPrice110kv(Double price110kv) {
+        this.price110kv = price110kv;
+    }
+
+    public Double getPrice220kv() {
+        return price220kv;
+    }
+
+    public void setPrice220kv(Double price220kv) {
+        this.price220kv = price220kv;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("cfgCode", getCfgCode())
+            .append("elecClass", getElecClass())
+            .append("priceType", getPriceType())
+            .append("quantityLowerLimit", getQuantityLowerLimit())
+            .append("quantityUpperLimit", getQuantityUpperLimit())
+            .append("priceLess1kv", getPriceLess1kv())
+            .append("price1kv10kv", getPrice1kv10kv())
+            .append("price20kv35kv", getPrice20kv35kv())
+            .append("price35kv110kv", getPrice35kv110kv())
+            .append("price110kv", getPrice110kv())
+            .append("price220kv", getPrice220kv())
+            .toString();
+    }
+}

+ 126 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/ElectrovalencyPeakValley.java

@@ -0,0 +1,126 @@
+package com.ruoyi.ems.domain;
+
+import java.sql.Time;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 电价峰谷对象 sys_electrovalency_peak_valley
+ * 
+ * @author ruoyi
+ * @date 2024-07-12
+ */
+public class ElectrovalencyPeakValley extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 时间标识 */
+    @Excel(name = "时间标识")
+    private String timeKey;
+
+    /** 时间序列 */
+    @Excel(name = "时间序列")
+    private Long timeIndex;
+
+    /** 开始时间HH:mm:ss */
+    @JsonFormat(pattern = "HH:mm:ss")
+    @Excel(name = "开始时间", width = 30, dateFormat = "HH:mm:ss")
+    private Date startTime;
+
+    /** 结束时间HH:mm:ss */
+    @JsonFormat(pattern = "HH:mm:ss")
+    @Excel(name = "结束时间", width = 30, dateFormat = "HH:mm:ss")
+    private Date endTime;
+
+    /** 计量类型 */
+    @Excel(name = "计量类型")
+    private Long type;
+
+    /** 浮动值 */
+    @Excel(name = "浮动值")
+    private Double floatingValue;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setTimeKey(String timeKey) 
+    {
+        this.timeKey = timeKey;
+    }
+
+    public String getTimeKey() 
+    {
+        return timeKey;
+    }
+    public void setTimeIndex(Long timeIndex) 
+    {
+        this.timeIndex = timeIndex;
+    }
+
+    public Long getTimeIndex() 
+    {
+        return timeIndex;
+    }
+    public void setStartTime(Time startTime)
+    {
+        this.startTime = startTime;
+    }
+
+    public Date getStartTime() 
+    {
+        return startTime;
+    }
+    public void setEndTime(Time endTime)
+    {
+        this.endTime = endTime;
+    }
+
+    public Date getEndTime() 
+    {
+        return endTime;
+    }
+    public void setType(Long type) 
+    {
+        this.type = type;
+    }
+
+    public Long getType() 
+    {
+        return type;
+    }
+    public void setFloatingValue(Double floatingValue)
+    {
+        this.floatingValue = floatingValue;
+    }
+
+    public Double getFloatingValue()
+    {
+        return floatingValue;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("timeKey", getTimeKey())
+            .append("timeIndex", getTimeIndex())
+            .append("startTime", getStartTime())
+            .append("endTime", getEndTime())
+            .append("type", getType())
+            .append("floatingValue", getFloatingValue())
+            .toString();
+    }
+}

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

@@ -37,9 +37,12 @@ public class EmsFacsFlowRel extends BaseEntity
     private String inputFacsName;
 
     /** 能源流动介质 */
-    @Excel(name = "能源流动介质")
     private String emsCls;
 
+    /** 能源流动介质名称 */
+    @Excel(name = "能源流动介质")
+    private String emsClsName;
+
     /** 供能状态
      *  0-停止,1-供应中
      */
@@ -133,6 +136,14 @@ public class EmsFacsFlowRel extends BaseEntity
         this.inputFacsName = inputFacsName;
     }
 
+    public String getEmsClsName() {
+        return emsClsName;
+    }
+
+    public void setEmsClsName(String emsClsName) {
+        this.emsClsName = emsClsName;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 62 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/ElectrovalencyConfigMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.ems.mapper;
+
+import java.util.List;
+
+import com.ruoyi.ems.domain.ElectrovalencyConfig;
+
+/**
+ * 电价配置Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-07-12
+ */
+public interface ElectrovalencyConfigMapper
+{
+    /**
+     * 查询电价配置
+     * 
+     * @param id 电价配置主键
+     * @return 电价配置
+     */
+    ElectrovalencyConfig selectElectrovalencyConfigById(Long id);
+
+    /**
+     * 查询电价配置列表
+     * 
+     * @param electrovalencyConfig 电价配置
+     * @return 电价配置集合
+     */
+    List<ElectrovalencyConfig> selectElectrovalencyConfigList(ElectrovalencyConfig electrovalencyConfig);
+
+    /**
+     * 新增电价配置
+     * 
+     * @param electrovalencyConfig 电价配置
+     * @return 结果
+     */
+     int insertElectrovalencyConfig(ElectrovalencyConfig electrovalencyConfig);
+
+    /**
+     * 修改电价配置
+     * 
+     * @param electrovalencyConfig 电价配置
+     * @return 结果
+     */
+     int updateElectrovalencyConfig(ElectrovalencyConfig electrovalencyConfig);
+
+    /**
+     * 删除电价配置
+     * 
+     * @param id 电价配置主键
+     * @return 结果
+     */
+     int deleteElectrovalencyConfigById(Long id);
+
+    /**
+     * 批量删除电价配置
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+     int deleteElectrovalencyConfigByIds(Long[] ids);
+}

+ 62 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/ElectrovalencyPeakValleyMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.ems.mapper;
+
+import java.util.List;
+
+import com.ruoyi.ems.domain.ElectrovalencyPeakValley;
+
+/**
+ * 电价峰谷Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-07-12
+ */
+public interface ElectrovalencyPeakValleyMapper
+{
+    /**
+     * 查询电价峰谷
+     * 
+     * @param id 电价峰谷主键
+     * @return 电价峰谷
+     */
+    ElectrovalencyPeakValley selectElectrovalencyPeakValleyById(Long id);
+
+    /**
+     * 查询电价峰谷列表
+     * 
+     * @param electrovalencyPeakValley 电价峰谷
+     * @return 电价峰谷集合
+     */
+     List<ElectrovalencyPeakValley> selectElectrovalencyPeakValleyList(ElectrovalencyPeakValley electrovalencyPeakValley);
+
+    /**
+     * 新增电价峰谷
+     * 
+     * @param electrovalencyPeakValley 电价峰谷
+     * @return 结果
+     */
+     int insertElectrovalencyPeakValley(ElectrovalencyPeakValley electrovalencyPeakValley);
+
+    /**
+     * 修改电价峰谷
+     * 
+     * @param electrovalencyPeakValley 电价峰谷
+     * @return 结果
+     */
+     int updateElectrovalencyPeakValley(ElectrovalencyPeakValley electrovalencyPeakValley);
+
+    /**
+     * 删除电价峰谷
+     * 
+     * @param id 电价峰谷主键
+     * @return 结果
+     */
+     int deleteElectrovalencyPeakValleyById(Long id);
+
+    /**
+     * 批量删除电价峰谷
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+     int deleteElectrovalencyPeakValleyByIds(Long[] ids);
+}

+ 61 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IElectrovalencyConfigService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.ems.service;
+
+import java.util.List;
+
+import com.ruoyi.ems.domain.ElectrovalencyConfig;
+
+/**
+ * 电价配置Service接口
+ *
+ * @author ruoyi
+ * @date 2024-07-12
+ */
+public interface IElectrovalencyConfigService {
+    /**
+     * 查询电价配置
+     *
+     * @param id 电价配置主键
+     * @return 电价配置
+     */
+    ElectrovalencyConfig selectElectrovalencyConfigById(Long id);
+
+    /**
+     * 查询电价配置列表
+     *
+     * @param electrovalencyConfig 电价配置
+     * @return 电价配置集合
+     */
+    List<ElectrovalencyConfig> selectElectrovalencyConfigList(ElectrovalencyConfig electrovalencyConfig);
+
+    /**
+     * 新增电价配置
+     *
+     * @param electrovalencyConfig 电价配置
+     * @return 结果
+     */
+    int insertElectrovalencyConfig(ElectrovalencyConfig electrovalencyConfig);
+
+    /**
+     * 修改电价配置
+     *
+     * @param electrovalencyConfig 电价配置
+     * @return 结果
+     */
+    int updateElectrovalencyConfig(ElectrovalencyConfig electrovalencyConfig);
+
+    /**
+     * 批量删除电价配置
+     *
+     * @param ids 需要删除的电价配置主键集合
+     * @return 结果
+     */
+    int deleteElectrovalencyConfigByIds(Long[] ids);
+
+    /**
+     * 删除电价配置信息
+     *
+     * @param id 电价配置主键
+     * @return 结果
+     */
+    int deleteElectrovalencyConfigById(Long id);
+}

+ 62 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IElectrovalencyPeakValleyService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.ems.service;
+
+import com.ruoyi.ems.domain.ElectrovalencyPeakValley;
+
+import java.util.List;
+
+/**
+ * 电价峰谷Service接口
+ *
+ * @author ruoyi
+ * @date 2024-07-12
+ */
+public interface IElectrovalencyPeakValleyService {
+    /**
+     * 查询电价峰谷
+     *
+     * @param id 电价峰谷主键
+     * @return 电价峰谷
+     */
+    ElectrovalencyPeakValley selectElectrovalencyPeakValleyById(Long id);
+
+    /**
+     * 查询电价峰谷列表
+     *
+     * @param electrovalencyPeakValley 电价峰谷
+     * @return 电价峰谷集合
+     */
+    List<ElectrovalencyPeakValley> selectElectrovalencyPeakValleyList(
+        ElectrovalencyPeakValley electrovalencyPeakValley);
+
+    /**
+     * 新增电价峰谷
+     *
+     * @param electrovalencyPeakValley 电价峰谷
+     * @return 结果
+     */
+    int insertElectrovalencyPeakValley(ElectrovalencyPeakValley electrovalencyPeakValley);
+
+    /**
+     * 修改电价峰谷
+     *
+     * @param electrovalencyPeakValley 电价峰谷
+     * @return 结果
+     */
+    int updateElectrovalencyPeakValley(ElectrovalencyPeakValley electrovalencyPeakValley);
+
+    /**
+     * 批量删除电价峰谷
+     *
+     * @param ids 需要删除的电价峰谷主键集合
+     * @return 结果
+     */
+    int deleteElectrovalencyPeakValleyByIds(Long[] ids);
+
+    /**
+     * 删除电价峰谷信息
+     *
+     * @param id 电价峰谷主键
+     * @return 结果
+     */
+    int deleteElectrovalencyPeakValleyById(Long id);
+}

+ 94 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/ElectrovalencyConfigServiceImpl.java

@@ -0,0 +1,94 @@
+package com.ruoyi.ems.service.impl;
+
+import com.ruoyi.ems.domain.ElectrovalencyConfig;
+import com.ruoyi.ems.mapper.ElectrovalencyConfigMapper;
+import com.ruoyi.ems.service.IElectrovalencyConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 电价配置Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-07-12
+ */
+@Service
+public class ElectrovalencyConfigServiceImpl implements IElectrovalencyConfigService
+{
+    @Autowired
+    private ElectrovalencyConfigMapper electrovalencyConfigMapper;
+
+    /**
+     * 查询电价配置
+     * 
+     * @param id 电价配置主键
+     * @return 电价配置
+     */
+    @Override
+    public ElectrovalencyConfig selectElectrovalencyConfigById(Long id)
+    {
+        return electrovalencyConfigMapper.selectElectrovalencyConfigById(id);
+    }
+
+    /**
+     * 查询电价配置列表
+     * 
+     * @param electrovalencyConfig 电价配置
+     * @return 电价配置
+     */
+    @Override
+    public List<ElectrovalencyConfig> selectElectrovalencyConfigList(ElectrovalencyConfig electrovalencyConfig)
+    {
+        return electrovalencyConfigMapper.selectElectrovalencyConfigList(electrovalencyConfig);
+    }
+
+    /**
+     * 新增电价配置
+     * 
+     * @param electrovalencyConfig 电价配置
+     * @return 结果
+     */
+    @Override
+    public int insertElectrovalencyConfig(ElectrovalencyConfig electrovalencyConfig)
+    {
+        return electrovalencyConfigMapper.insertElectrovalencyConfig(electrovalencyConfig);
+    }
+
+    /**
+     * 修改电价配置
+     * 
+     * @param electrovalencyConfig 电价配置
+     * @return 结果
+     */
+    @Override
+    public int updateElectrovalencyConfig(ElectrovalencyConfig electrovalencyConfig)
+    {
+        return electrovalencyConfigMapper.updateElectrovalencyConfig(electrovalencyConfig);
+    }
+
+    /**
+     * 批量删除电价配置
+     * 
+     * @param ids 需要删除的电价配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteElectrovalencyConfigByIds(Long[] ids)
+    {
+        return electrovalencyConfigMapper.deleteElectrovalencyConfigByIds(ids);
+    }
+
+    /**
+     * 删除电价配置信息
+     * 
+     * @param id 电价配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteElectrovalencyConfigById(Long id)
+    {
+        return electrovalencyConfigMapper.deleteElectrovalencyConfigById(id);
+    }
+}

+ 95 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/ElectrovalencyPeakValleyServiceImpl.java

@@ -0,0 +1,95 @@
+package com.ruoyi.ems.service.impl;
+
+import com.ruoyi.ems.domain.ElectrovalencyPeakValley;
+import com.ruoyi.ems.mapper.ElectrovalencyPeakValleyMapper;
+import com.ruoyi.ems.service.IElectrovalencyPeakValleyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/**
+ * 电价峰谷Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-07-12
+ */
+@Service
+public class ElectrovalencyPeakValleyServiceImpl implements IElectrovalencyPeakValleyService
+{
+    @Autowired
+    private ElectrovalencyPeakValleyMapper electrovalencyPeakValleyMapper;
+
+    /**
+     * 查询电价峰谷
+     * 
+     * @param id 电价峰谷主键
+     * @return 电价峰谷
+     */
+    @Override
+    public ElectrovalencyPeakValley selectElectrovalencyPeakValleyById(Long id)
+    {
+        return electrovalencyPeakValleyMapper.selectElectrovalencyPeakValleyById(id);
+    }
+
+    /**
+     * 查询电价峰谷列表
+     * 
+     * @param electrovalencyPeakValley 电价峰谷
+     * @return 电价峰谷
+     */
+    @Override
+    public List<ElectrovalencyPeakValley> selectElectrovalencyPeakValleyList(ElectrovalencyPeakValley electrovalencyPeakValley)
+    {
+        return electrovalencyPeakValleyMapper.selectElectrovalencyPeakValleyList(electrovalencyPeakValley);
+    }
+
+    /**
+     * 新增电价峰谷
+     * 
+     * @param electrovalencyPeakValley 电价峰谷
+     * @return 结果
+     */
+    @Override
+    public int insertElectrovalencyPeakValley(ElectrovalencyPeakValley electrovalencyPeakValley)
+    {
+        return electrovalencyPeakValleyMapper.insertElectrovalencyPeakValley(electrovalencyPeakValley);
+    }
+
+    /**
+     * 修改电价峰谷
+     * 
+     * @param electrovalencyPeakValley 电价峰谷
+     * @return 结果
+     */
+    @Override
+    public int updateElectrovalencyPeakValley(ElectrovalencyPeakValley electrovalencyPeakValley)
+    {
+        return electrovalencyPeakValleyMapper.updateElectrovalencyPeakValley(electrovalencyPeakValley);
+    }
+
+    /**
+     * 批量删除电价峰谷
+     * 
+     * @param ids 需要删除的电价峰谷主键
+     * @return 结果
+     */
+    @Override
+    public int deleteElectrovalencyPeakValleyByIds(Long[] ids)
+    {
+        return electrovalencyPeakValleyMapper.deleteElectrovalencyPeakValleyByIds(ids);
+    }
+
+    /**
+     * 删除电价峰谷信息
+     * 
+     * @param id 电价峰谷主键
+     * @return 结果
+     */
+    @Override
+    public int deleteElectrovalencyPeakValleyById(Long id)
+    {
+        return electrovalencyPeakValleyMapper.deleteElectrovalencyPeakValleyById(id);
+    }
+}

+ 54 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/application-demo.yml

@@ -0,0 +1,54 @@
+# spring配置
+spring:
+  redis:
+    host: 172.10.0.18
+    port: 6379
+    password:
+  datasource:
+    druid:
+      stat-view-servlet:
+        enabled: true
+        loginUsername: admin
+        loginPassword: 123456
+    dynamic:
+      druid:
+        initial-size: 5
+        min-idle: 5
+        maxActive: 20
+        maxWait: 60000
+        timeBetweenEvictionRunsMillis: 60000
+        minEvictableIdleTimeMillis: 300000
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: false
+        testOnReturn: false
+        poolPreparedStatements: true
+        maxPoolPreparedStatementPerConnectionSize: 20
+        filters: stat,slf4j
+        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
+      datasource:
+        # 主库数据源
+        master:
+          driver-class-name: com.mysql.cj.jdbc.Driver
+          url: jdbc:mysql://172.10.0.10:3306/ems?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+          username: root
+          password: abc123
+          # 从库数据源
+          # slave:
+          # username:
+          # password:
+          # url:
+          # driver-class-name:
+
+# mybatis配置
+mybatis:
+  # 搜索指定包别名
+  typeAliasesPackage: com.ruoyi.system
+  # 配置mapper的扫描,找到所有的mapper.xml映射文件
+  mapperLocations: classpath:mapper/**/*.xml
+
+# swagger配置
+swagger:
+  title: 系统模块接口文档
+  license: Powered By ruoyi
+  licenseUrl: https://ruoyi.vip

+ 106 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/ElectrovalencyConfigMapper.xml

@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.ems.mapper.ElectrovalencyConfigMapper">
+    
+    <resultMap type="com.ruoyi.ems.domain.ElectrovalencyConfig" id="ElectrovalencyConfigResult">
+        <result property="id"    column="id"    />
+        <result property="cfgCode"    column="cfg_code"    />
+        <result property="elecClass"    column="elec_class"    />
+        <result property="priceType"    column="price_type"    />
+        <result property="quantityLowerLimit"    column="quantity_lower_limit"    />
+        <result property="quantityUpperLimit"    column="quantity_upper_limit"    />
+        <result property="priceLess1kv"    column="price_less_1kv"    />
+        <result property="price1kv10kv"    column="price_1kv_10kv"    />
+        <result property="price20kv35kv"    column="price_20kv_35kv"    />
+        <result property="price35kv110kv"    column="price_35kv_110kv"    />
+        <result property="price110kv"    column="price_110kv"    />
+        <result property="price220kv"    column="price_220kv"    />
+    </resultMap>
+
+    <sql id="selectElectrovalencyConfigVo">
+        select id, cfg_code, elec_class, price_type, quantity_lower_limit, quantity_upper_limit, price_less_1kv, price_1kv_10kv, price_20kv_35kv, price_35kv_110kv, price_110kv, price_220kv from sys_electrovalency_config
+    </sql>
+
+    <select id="selectElectrovalencyConfigList" parameterType="com.ruoyi.ems.domain.ElectrovalencyConfig" resultMap="ElectrovalencyConfigResult">
+        <include refid="selectElectrovalencyConfigVo"/>
+        <where>  
+            <if test="cfgCode != null  and cfgCode != ''"> and cfg_code = #{cfgCode}</if>
+            <if test="elecClass != null "> and elec_class = #{elecClass}</if>
+            <if test="priceType != null "> and price_type = #{priceType}</if>
+            <if test="quantityLowerLimit != null "> and quantity_lower_limit = #{quantityLowerLimit}</if>
+            <if test="quantityUpperLimit != null "> and quantity_upper_limit = #{quantityUpperLimit}</if>
+            <if test="priceLess1kv != null "> and price_less_1kv = #{priceLess1kv}</if>
+            <if test="price1kv10kv != null "> and price_1kv_10kv = #{price1kv10kv}</if>
+            <if test="price20kv35kv != null "> and price_20kv_35kv = #{price20kv35kv}</if>
+            <if test="price35kv110kv != null "> and price_35kv_110kv = #{price35kv110kv}</if>
+            <if test="price110kv != null "> and price_110kv = #{price110kv}</if>
+            <if test="price220kv != null "> and price_220kv = #{price220kv}</if>
+        </where>
+    </select>
+    
+    <select id="selectElectrovalencyConfigById" parameterType="Long" resultMap="ElectrovalencyConfigResult">
+        <include refid="selectElectrovalencyConfigVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertElectrovalencyConfig" parameterType="com.ruoyi.ems.domain.ElectrovalencyConfig" useGeneratedKeys="true" keyProperty="id">
+        insert into sys_electrovalency_config
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="cfgCode != null and cfgCode != ''">cfg_code,</if>
+            <if test="elecClass != null">elec_class,</if>
+            <if test="priceType != null">price_type,</if>
+            <if test="quantityLowerLimit != null">quantity_lower_limit,</if>
+            <if test="quantityUpperLimit != null">quantity_upper_limit,</if>
+            <if test="priceLess1kv != null">price_less_1kv,</if>
+            <if test="price1kv10kv != null">price_1kv_10kv,</if>
+            <if test="price20kv35kv != null">price_20kv_35kv,</if>
+            <if test="price35kv110kv != null">price_35kv_110kv,</if>
+            <if test="price110kv != null">price_110kv,</if>
+            <if test="price220kv != null">price_220kv,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="cfgCode != null and cfgCode != ''">#{cfgCode},</if>
+            <if test="elecClass != null">#{elecClass},</if>
+            <if test="priceType != null">#{priceType},</if>
+            <if test="quantityLowerLimit != null">#{quantityLowerLimit},</if>
+            <if test="quantityUpperLimit != null">#{quantityUpperLimit},</if>
+            <if test="priceLess1kv != null">#{priceLess1kv},</if>
+            <if test="price1kv10kv != null">#{price1kv10kv},</if>
+            <if test="price20kv35kv != null">#{price20kv35kv},</if>
+            <if test="price35kv110kv != null">#{price35kv110kv},</if>
+            <if test="price110kv != null">#{price110kv},</if>
+            <if test="price220kv != null">#{price220kv},</if>
+         </trim>
+    </insert>
+
+    <update id="updateElectrovalencyConfig" parameterType="com.ruoyi.ems.domain.ElectrovalencyConfig">
+        update sys_electrovalency_config
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="cfgCode != null and cfgCode != ''">cfg_code = #{cfgCode},</if>
+            <if test="elecClass != null">elec_class = #{elecClass},</if>
+            <if test="priceType != null">price_type = #{priceType},</if>
+            <if test="quantityLowerLimit != null">quantity_lower_limit = #{quantityLowerLimit},</if>
+            <if test="quantityUpperLimit != null">quantity_upper_limit = #{quantityUpperLimit},</if>
+            <if test="priceLess1kv != null">price_less_1kv = #{priceLess1kv},</if>
+            <if test="price1kv10kv != null">price_1kv_10kv = #{price1kv10kv},</if>
+            <if test="price20kv35kv != null">price_20kv_35kv = #{price20kv35kv},</if>
+            <if test="price35kv110kv != null">price_35kv_110kv = #{price35kv110kv},</if>
+            <if test="price110kv != null">price_110kv = #{price110kv},</if>
+            <if test="price220kv != null">price_220kv = #{price220kv},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteElectrovalencyConfigById" parameterType="Long">
+        delete from sys_electrovalency_config where id = #{id}
+    </delete>
+
+    <delete id="deleteElectrovalencyConfigByIds" parameterType="String">
+        delete from sys_electrovalency_config where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 81 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/ElectrovalencyPeakValleyMapper.xml

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.ems.mapper.ElectrovalencyPeakValleyMapper">
+    
+    <resultMap type="com.ruoyi.ems.domain.ElectrovalencyPeakValley" id="electrovalencyPeakValleyResult">
+        <result property="id"    column="id"    />
+        <result property="timeKey"    column="time_key"    />
+        <result property="timeIndex"    column="time_index"    />
+        <result property="startTime"    column="start_time"    />
+        <result property="endTime"    column="end_time"    />
+        <result property="type"    column="type"    />
+        <result property="floatingValue"    column="floating_value"    />
+    </resultMap>
+
+    <sql id="selectElectrovalencyPeakValleyVo">
+        select id, time_key, time_index, start_time, end_time, type, floating_value from sys_electrovalency_peak_valley
+    </sql>
+
+    <select id="selectElectrovalencyPeakValleyList" parameterType="com.ruoyi.ems.domain.ElectrovalencyPeakValley" resultMap="electrovalencyPeakValleyResult">
+        <include refid="selectElectrovalencyPeakValleyVo"/>
+        <where>  
+            <if test="timeKey != null  and timeKey != ''"> and time_key = #{timeKey}</if>
+            <if test="timeIndex != null "> and time_index = #{timeIndex}</if>
+            <if test="startTime != null "> and start_time = #{startTime}</if>
+            <if test="endTime != null "> and end_time = #{endTime}</if>
+            <if test="type != null "> and type = #{type}</if>
+            <if test="floatingValue != null "> and floating_value = #{floatingValue}</if>
+        </where>
+    </select>
+    
+    <select id="selectElectrovalencyPeakValleyById" parameterType="Long" resultMap="electrovalencyPeakValleyResult">
+        <include refid="selectElectrovalencyPeakValleyVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertElectrovalencyPeakValley" parameterType="com.ruoyi.ems.domain.ElectrovalencyPeakValley" useGeneratedKeys="true" keyProperty="id">
+        insert into sys_electrovalency_peak_valley
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="timeKey != null and timeKey != ''">time_key,</if>
+            <if test="timeIndex != null">time_index,</if>
+            <if test="startTime != null">start_time,</if>
+            <if test="endTime != null">end_time,</if>
+            <if test="type != null">type,</if>
+            <if test="floatingValue != null">floating_value,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="timeKey != null and timeKey != ''">#{timeKey},</if>
+            <if test="timeIndex != null">#{timeIndex},</if>
+            <if test="startTime != null">#{startTime},</if>
+            <if test="endTime != null">#{endTime},</if>
+            <if test="type != null">#{type},</if>
+            <if test="floatingValue != null">#{floatingValue},</if>
+         </trim>
+    </insert>
+
+    <update id="updateElectrovalencyPeakValley" parameterType="com.ruoyi.ems.domain.ElectrovalencyPeakValley">
+        update sys_electrovalency_peak_valley
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="timeKey != null and timeKey != ''">time_key = #{timeKey},</if>
+            <if test="timeIndex != null">time_index = #{timeIndex},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="floatingValue != null">floating_value = #{floatingValue},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteElectrovalencyPeakValleyById" parameterType="Long">
+        delete from sys_electrovalency_peak_valley where id = #{id}
+    </delete>
+
+    <delete id="deleteElectrovalencyPeakValleyByIds" parameterType="String">
+        delete from sys_electrovalency_peak_valley where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 7 - 1
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/EmsFacsFlowRelMapper.xml

@@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="inputFacsCode"    column="input_facs_code"    />
         <result property="inputFacsName"    column="input_facs_name"    />
         <result property="emsCls"    column="ems_cls"    />
+        <result property="emsClsName" column="ems_cls_name" />
         <result property="state"    column="state"    />
         <result property="actionType"    column="action_type"    />
         <result property="createTime"    column="create_time"    />
@@ -19,7 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectEmsFacsFlowRelVo">
-        select r.`id`, r.`code`, r.`export_facs_code`, f1.`facs_name` as export_facs_name, r.`input_facs_code`, f2.`facs_name` as input_facs_name, r.`ems_cls`, r.`state`, r.`action_type`, r.`create_time`, r.`update_time` from adm_ems_facs_flow_rel r LEFT JOIN adm_ems_facs f1 ON r.`export_facs_code` = f1.`facs_code` LEFT JOIN adm_ems_facs f2 ON r.input_facs_code = f2.`facs_code`
+        select
+            r.`id`, r.`code`, r.`export_facs_code`, f1.`facs_name` as export_facs_name, r.`input_facs_code`, f2.`facs_name` as input_facs_name, r.`ems_cls`, c.`name` as ems_cls_name, r.`state`, r.`action_type`, r.`create_time`, r.`update_time`
+        from adm_ems_facs_flow_rel r
+            LEFT JOIN adm_ems_facs f1 ON r.`export_facs_code` = f1.`facs_code`
+            LEFT JOIN adm_ems_facs f2 ON r.input_facs_code = f2.`facs_code`
+            LEFT JOIN dim_gb_ems_cls c ON r.`ems_cls` = c.`code`
     </sql>
 
     <select id="selectEmsFacsFlowRelList" parameterType="com.ruoyi.ems.domain.EmsFacsFlowRel" resultMap="EmsFacsFlowRelResult">

+ 1 - 6
ems-cloud/ruoyi-gateway/src/main/resources/application-demo.yml

@@ -31,14 +31,9 @@ spring:
         - id: ems-server
           uri: lb://ems-server
           predicates:
-            - Path=/nrg/**
+            - Path=/ems/**
           filters:
             - StripPrefix=0
-        # Ali任务执行器
-        - id: executer-ali-collect
-          uri: lb://executer-ali-collect
-          predicates:
-            - Path=/job-ali-col/**
         # 定时任务
         - id: ruoyi-job
           uri: lb://ruoyi-job

+ 75 - 0
ems-cloud/sql/ems_server.sql

@@ -645,6 +645,81 @@ create table adm_op_inspection_report (
 
 
 -- ----------------------------
+-- 电价配置表
+-- ----------------------------
+drop table if exists sys_electrovalency_config;
+create table sys_electrovalency_config (
+  `id`                   bigint(20)      not null auto_increment      comment '序号',
+  `cfg_code`             varchar(4)      not null                     comment '配置代码',
+  `elec_class`           int             not null                     comment '用电分类',
+  `price_type`           int             not null                     comment '价格类型',
+  `quantity_lower_limit` int             default null                 comment '年用电量下限',
+  `quantity_upper_limit` int             default null                 comment '年用电量上限',
+  `price_less_1kv`       double          default null                 comment '不满1千伏(价格)',
+  `price_1kv_10kv`       double          default null                 comment '不满10千伏(价格)',
+  `price_20kv_35kv`      double          default null                 comment '20-30千伏(价格)',
+  `price_35kv_110kv`     double          default null                 comment '35-110千伏(价格)',
+  `price_110kv`          double          default null                 comment '110千伏(价格)',
+  `price_220kv`          double          default null                 comment '220千伏(价格)',
+  primary key (`id`),
+  unique key ux_electrovalency_config(`cfg_code`)
+) engine=innodb auto_increment=1 comment = '电价配置表';
+
+-- 电价初始数据(江苏省电网销售电价表 2018年4.1日执行)
+-- 1.居民生活用电
+INSERT INTO sys_electrovalency_config (`cfg_code`, `elec_class`, `price_type`, `quantity_lower_limit`, `quantity_upper_limit`, `price_less_1kv`, `price_1kv_10kv`, `price_20kv_35kv`, `price_35kv_110kv`, `price_110kv`, `price_220kv`) VALUES ('1001', 1, 1, 0, 2760, 0.5283, 0.5183, NULL, NULL, NULL, NULL);
+INSERT INTO sys_electrovalency_config (`cfg_code`, `elec_class`, `price_type`, `quantity_lower_limit`, `quantity_upper_limit`, `price_less_1kv`, `price_1kv_10kv`, `price_20kv_35kv`, `price_35kv_110kv`, `price_110kv`, `price_220kv`) VALUES ('1002', 1, 1, 2760, 4800, 0.5783, 0.5683, NULL, NULL, NULL, NULL);
+INSERT INTO sys_electrovalency_config (`cfg_code`, `elec_class`, `price_type`, `quantity_lower_limit`, `quantity_upper_limit`, `price_less_1kv`, `price_1kv_10kv`, `price_20kv_35kv`, `price_35kv_110kv`, `price_110kv`, `price_220kv`) VALUES ('1003', 1, 1, 4800, NULL, 0.8283, 0.8183, NULL, NULL, NULL, NULL);
+INSERT INTO sys_electrovalency_config (`cfg_code`, `elec_class`, `price_type`, `quantity_lower_limit`, `quantity_upper_limit`, `price_less_1kv`, `price_1kv_10kv`, `price_20kv_35kv`, `price_35kv_110kv`, `price_110kv`, `price_220kv`) VALUES ('1004', 1, 0, NULL, NULL, 0.5483, 0.5383, NULL, NULL, NULL, NULL);
+-- 工商业、大工业、农业
+INSERT INTO sys_electrovalency_config (`cfg_code`, `elec_class`, `price_type`, `quantity_lower_limit`, `quantity_upper_limit`, `price_less_1kv`, `price_1kv_10kv`, `price_20kv_35kv`, `price_35kv_110kv`, `price_110kv`, `price_220kv`) VALUES ('2001', 2, 0, NULL, NULL, 0.7954, 0.7804, 0.7744, 0.7654, NULL, NULL);
+INSERT INTO sys_electrovalency_config (`cfg_code`, `elec_class`, `price_type`, `quantity_lower_limit`, `quantity_upper_limit`, `price_less_1kv`, `price_1kv_10kv`, `price_20kv_35kv`, `price_35kv_110kv`, `price_110kv`, `price_220kv`) VALUES ('3001', 3, 0, NULL, NULL, NULL, 0.6418, 0.6358, 0.6268, 0.6118, 0.5968);
+INSERT INTO sys_electrovalency_config (`cfg_code`, `elec_class`, `price_type`, `quantity_lower_limit`, `quantity_upper_limit`, `price_less_1kv`, `price_1kv_10kv`, `price_20kv_35kv`, `price_35kv_110kv`, `price_110kv`, `price_220kv`) VALUES ('4001', 4, 0, NULL, NULL, 0.5090, 0.4990, 0.4930, 0.4840, NULL, NULL);
+
+
+-- ----------------------------
+-- 电价峰谷表
+-- ----------------------------
+drop table if exists sys_electrovalency_peak_valley;
+create table sys_electrovalency_peak_valley (
+  `id`                   bigint(20)      not null auto_increment      comment '序号',
+  `time_key`             varchar(2)      not null                     comment '时间标识',
+  `time_index`           int             not null                     comment '时间序列',
+  `start_time`           time            not null                     comment '开始时间HH:mm:ss',
+  `end_time`             time            not null                     comment '结束时间HH:mm:ss',
+  `type`                 int             not null                     comment '计量类型',
+  `floating_value`       double          default null                 comment '浮动值',
+   primary key (`id`),
+   unique key ux_electrovalency_config(`time_index`)
+) engine=innodb auto_increment=1 comment = '电价峰谷表';
+
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('00', 1, '00:00:00', '01:00:00', 2, -0.17);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('01', 2, '01:00:00', '02:00:00', 2, -0.17);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('02', 3, '02:00:00', '03:00:00', 2, -0.17);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('03', 4, '03:00:00', '04:00:00', 2, -0.17);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('04', 5, '04:00:00', '05:00:00', 2, -0.17);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('05', 6, '05:00:00', '06:00:00', 2, -0.17);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('06', 7, '06:00:00', '07:00:00', 2, -0.17);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('07', 8, '07:00:00', '08:00:00', 1, 0.03);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('08', 9, '08:00:00', '09:00:00', 1, 0.03);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('09', 10, '09:00:00', '10:00:00', 1, 0.03);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('10', 11, '10:00:00', '11:00:00', 1, 0.03);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('11', 12, '11:00:00', '12:00:00', 2, -0.17);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('12', 13, '12:00:00', '13:00:00', 2, -0.17);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('13', 14, '13:00:00', '14:00:00', 1, 0.03);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('14', 15, '14:00:00', '15:00:00', 1, 0.03);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('15', 16, '15:00:00', '16:00:00', 1, 0.03);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('16', 17, '16:00:00', '17:00:00', 1, 0.03);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('17', 18, '17:00:00', '18:00:00', 1, 0.03);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('18', 19, '18:00:00', '19:00:00', 1, 0.03);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('19', 20, '19:00:00', '20:00:00', 1, 0.03);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('20', 21, '20:00:00', '21:00:00', 1, 0.03);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('21', 22, '21:00:00', '22:00:00', 1, 0.03);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('22', 23, '22:00:00', '23:00:00', 2, -0.17);
+INSERT INTO sys_electrovalency_peak_valley (`time_key`, `time_index`, `start_time`, `end_time`, `type`, `floating_value`) VALUES ('23', 24, '23:00:00', '00:00:00', 2, -0.17);
+
+
+-- ----------------------------
 -- 电网供应计量表
 -- ----------------------------
 drop table if exists adm_ems_pg_supply_h;

+ 8 - 6
ems-cloud/sql/ems_sys.sql

@@ -231,8 +231,9 @@ insert into sys_menu values ('538',  '能源设施',   '124', '2',  'basecfg-fac
 insert into sys_menu values ('539',  '能流关系',   '124', '3',  'basecfg-flowrel',        'basecfg/flowrel/index',          '', 1, 0, 'C', '0', '0',   'basecfg:flowrel:list',         'cfgwrite',   'admin', sysdate(), '', null, '设备配置');
 insert into sys_menu values ('540',  '能源设备',   '124', '4',  'basecfg-devccfg',        'basecfg/device/index',           '', 1, 0, 'C', '0', '0',   'basecfg:device:list',          'cfgwrite',   'admin', sysdate(), '', null, '设备配置');
 insert into sys_menu values ('541',  '电价配置',   '125', '1',  'basecfg-electrovalency', 'basecfg/electrovalency/index',   '', 1, 0, 'C', '0', '0',   'basecfg:electrovalency:list',  'cfgwrite',   'admin', sysdate(), '', null, '电价配置');
-insert into sys_menu values ('542',  '碳核算',     '125', '2',  'basecfg-carbon',          'basecfg/carbon/index',          '', 1, 0, 'C', '0', '0',   'basecfg:carbon:list',          'cfgwrite',   'admin', sysdate(), '', null, '核算配置');
-insert into sys_menu values ('543',  '排放因子',   '125', '3',  'basecfg-emissionFactor',  'basecfg/emissionfactor/index',  '', 1, 0, 'C', '0', '0',   'basecfg:emissionFactor:list',  'cfgwrite',   'admin', sysdate(), '', null, '碳排因子');
+insert into sys_menu values ('542',  '峰谷配置',   '125', '2',  'basecfg-peakvalley',     'basecfg/peakvalley/index',       '', 1, 0, 'C', '0', '0',   'basecfg:peakvalley:list',      'cfgwrite',   'admin', sysdate(), '', null, '峰谷配置');
+insert into sys_menu values ('543',  '碳核算',     '125', '3',  'basecfg-carbon',          'basecfg/carbon/index',          '', 1, 0, 'C', '0', '0',   'basecfg:carbon:list',          'cfgwrite',   'admin', sysdate(), '', null, '核算配置');
+insert into sys_menu values ('544',  '排放因子',   '125', '4',  'basecfg-emissionFactor',  'basecfg/emissionfactor/index',  '', 1, 0, 'C', '0', '0',   'basecfg:emissionFactor:list',  'cfgwrite',   'admin', sysdate(), '', null, '碳排因子');
 
 
 -- 用户管理按钮
@@ -329,10 +330,10 @@ insert into sys_menu values ('1072', '设备修改', '540', '2', '#', '', '', 1,
 insert into sys_menu values ('1073', '设备删除', '540', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:remove','#', 'admin', sysdate(), '', null, '');
 insert into sys_menu values ('1074', '设备导出', '540', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:flowrel:export','#', 'admin', sysdate(), '', null, '');
 -- 碳排因子配置按钮
-insert into sys_menu values ('1075', '新增因子', '543', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emissionFactor:add',   '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values ('1076', '修改因子', '543', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emissionFactor:edit',  '#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values ('1077', '删除因子', '543', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emissionFactor:remove','#', 'admin', sysdate(), '', null, '');
-insert into sys_menu values ('1078', '因子导出', '543', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emissionFactor:export','#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1075', '新增因子', '544', '1', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emissionFactor:add',   '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1076', '修改因子', '544', '2', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emissionFactor:edit',  '#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1077', '删除因子', '544', '3', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emissionFactor:remove','#', 'admin', sysdate(), '', null, '');
+insert into sys_menu values ('1078', '因子导出', '544', '4', '#', '', '', 1, 0, 'F', '0', '0', 'basecfg:emissionFactor:export','#', 'admin', sysdate(), '', null, '');
 
 
 -- ----------------------------
@@ -436,6 +437,7 @@ insert into sys_role_menu values ('2', '540');
 insert into sys_role_menu values ('2', '541');
 insert into sys_role_menu values ('2', '542');
 insert into sys_role_menu values ('2', '543');
+insert into sys_role_menu values ('2', '544');
 insert into sys_role_menu values ('2', '1000');
 insert into sys_role_menu values ('2', '1001');
 insert into sys_role_menu values ('2', '1002');