Browse Source

集成kafka,新增定时任务(每分钟生成点位数据 tagtype = 4需量、5电流、6电压、7电量)

lw 1 year ago
parent
commit
87cef3e1ec
72 changed files with 6104 additions and 1 deletions
  1. 6 1
      jeecg-boot-base-core/pom.xml
  2. 37 0
      jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml
  3. 28 0
      jeecg_module_ems/src/main/java/org/jeecg/kafka/consumer/TestConsumer.java
  4. 22 0
      jeecg_module_ems/src/main/java/org/jeecg/kafka/controller/TestController.java
  5. 44 0
      jeecg_module_ems/src/main/java/org/jeecg/kafka/producer/TestProducer.java
  6. 132 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/cronJob/GenerateDataJob.java
  7. 177 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/controller/DataCurrentController.java
  8. 93 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/entity/DataCurrent.java
  9. 17 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/mapper/DataCurrentMapper.java
  10. 5 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/mapper/xml/DataCurrentMapper.xml
  11. 14 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/service/IDataCurrentService.java
  12. 19 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/service/impl/DataCurrentServiceImpl.java
  13. 252 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/vue/DataCurrentList.vue
  14. 26 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/vue/DataCurrent_menu_insert.sql
  15. 178 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/vue/modules/DataCurrentForm.vue
  16. 84 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/vue/modules/DataCurrentModal.Style#Drawer.vue
  17. 60 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/vue/modules/DataCurrentModal.vue
  18. 177 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/controller/DataDemandController.java
  19. 89 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/entity/DataDemand.java
  20. 17 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/mapper/DataDemandMapper.java
  21. 5 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/mapper/xml/DataDemandMapper.xml
  22. 14 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/service/IDataDemandService.java
  23. 19 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/service/impl/DataDemandServiceImpl.java
  24. 246 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/vue/DataDemandList.vue
  25. 26 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/vue/DataDemand_menu_insert.sql
  26. 173 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/vue/modules/DataDemandForm.vue
  27. 84 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/vue/modules/DataDemandModal.Style#Drawer.vue
  28. 60 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/vue/modules/DataDemandModal.vue
  29. 177 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/controller/DataElectricityController.java
  30. 137 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/entity/DataElectricity.java
  31. 17 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/mapper/DataElectricityMapper.java
  32. 5 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/mapper/xml/DataElectricityMapper.xml
  33. 14 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/service/IDataElectricityService.java
  34. 19 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/service/impl/DataElectricityServiceImpl.java
  35. 318 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/vue/DataElectricityList.vue
  36. 26 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/vue/DataElectricity_menu_insert.sql
  37. 233 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/vue/modules/DataElectricityForm.vue
  38. 84 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/vue/modules/DataElectricityModal.Style#Drawer.vue
  39. 60 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/vue/modules/DataElectricityModal.vue
  40. 177 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/controller/DataElectricityDayController.java
  41. 129 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/entity/DataElectricityDay.java
  42. 17 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/mapper/DataElectricityDayMapper.java
  43. 5 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/mapper/xml/DataElectricityDayMapper.xml
  44. 14 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/service/IDataElectricityDayService.java
  45. 19 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/service/impl/DataElectricityDayServiceImpl.java
  46. 306 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/vue/DataElectricityDayList.vue
  47. 26 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/vue/DataElectricityDay_menu_insert.sql
  48. 223 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/vue/modules/DataElectricityDayForm.vue
  49. 84 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/vue/modules/DataElectricityDayModal.Style#Drawer.vue
  50. 60 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/vue/modules/DataElectricityDayModal.vue
  51. 177 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/controller/DataPowerController.java
  52. 93 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/entity/DataPower.java
  53. 17 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/mapper/DataPowerMapper.java
  54. 5 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/mapper/xml/DataPowerMapper.xml
  55. 14 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/service/IDataPowerService.java
  56. 19 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/service/impl/DataPowerServiceImpl.java
  57. 252 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/vue/DataPowerList.vue
  58. 26 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/vue/DataPower_menu_insert.sql
  59. 178 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/vue/modules/DataPowerForm.vue
  60. 84 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/vue/modules/DataPowerModal.Style#Drawer.vue
  61. 60 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/vue/modules/DataPowerModal.vue
  62. 177 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/controller/DataVoltageController.java
  63. 93 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/entity/DataVoltage.java
  64. 17 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/mapper/DataVoltageMapper.java
  65. 5 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/mapper/xml/DataVoltageMapper.xml
  66. 14 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/service/IDataVoltageService.java
  67. 19 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/service/impl/DataVoltageServiceImpl.java
  68. 252 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/vue/DataVoltageList.vue
  69. 26 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/vue/DataVoltage_menu_insert.sql
  70. 178 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/vue/modules/DataVoltageForm.vue
  71. 84 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/vue/modules/DataVoltageModal.Style#Drawer.vue
  72. 60 0
      jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/vue/modules/DataVoltageModal.vue

+ 6 - 1
jeecg-boot-base-core/pom.xml

@@ -11,6 +11,11 @@
 	<artifactId>jeecg-boot-base-core</artifactId>
 
 	<dependencies>
+		<dependency>
+			<groupId>org.springframework.kafka</groupId>
+			<artifactId>spring-kafka</artifactId>
+			<version>2.8.0</version>
+		</dependency>
 		<!--jeecg-tools-->
 		<dependency>
 			<groupId>org.jeecgframework.boot</groupId>
@@ -211,4 +216,4 @@
 		</dependency>
 	</dependencies>
 
-</project>
+</project>

+ 37 - 0
jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml

@@ -35,6 +35,43 @@ spring:
           starttls:
             enable: true
             required: true
+  ## kafka配置
+  kafka:
+      bootstrap-servers: 192.168.2.154:9092,192.168.2.176:9092,192.168.2.114:9092
+      producer:
+        # 发生错误后,消息重发的次数。
+        retries: 0
+        #当有多个消息需要被发送到同一个分区时,生产者会把它们放在同一个批次里。该参数指定了一个批次可以使用的内存大小,按照字节数计算。
+        batch-size: 16384
+        # 设置生产者内存缓冲区的大小。
+        buffer-memory: 33554432
+        # 键的序列化方式
+        key-serializer: org.apache.kafka.common.serialization.StringSerializer
+        # 值的序列化方式
+        value-serializer: org.apache.kafka.common.serialization.StringSerializer
+        # acks=0 : 生产者在成功写入消息之前不会等待任何来自服务器的响应。
+        # acks=1 : 只要集群的首领节点收到消息,生产者就会收到一个来自服务器成功响应。
+        # acks=all :只有当所有参与复制的节点全部收到消息时,生产者才会收到一个来自服务器的成功响应。
+        acks: 0
+      consumer:
+        # 自动提交的时间间隔 在spring boot 2.X 版本中这里采用的是值的类型为Duration 需要符合特定的格式,如1S,1M,2H,5D
+        auto-commit-interval: 1S
+        # 该属性指定了消费者在读取一个没有偏移量的分区或者偏移量无效的情况下该作何处理:
+        # latest(默认值)在偏移量无效的情况下,消费者将从最新的记录开始读取数据(在消费者启动之后生成的记录)
+        # earliest :在偏移量无效的情况下,消费者将从起始位置读取分区的记录
+        auto-offset-reset: earliest
+        # 是否自动提交偏移量,默认值是true,为了避免出现重复数据和数据丢失,可以把它设置为false,然后手动提交偏移量
+        enable-auto-commit: false
+        # 键的反序列化方式
+        key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
+        # 值的反序列化方式
+        value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
+      listener:
+        # 在侦听器容器中运行的线程数。
+        concurrency: 5
+        #listner负责ack,每调用一次,就立即commit
+        ack-mode: manual_immediate
+        missing-topics-fatal: false
   ## quartz定时任务,采用数据库方式
   quartz:
     job-store-type: jdbc

+ 28 - 0
jeecg_module_ems/src/main/java/org/jeecg/kafka/consumer/TestConsumer.java

@@ -0,0 +1,28 @@
+package org.jeecg.kafka.consumer;
+
+
+import org.apache.kafka.clients.consumer.ConsumerRecord;
+import org.jeecg.kafka.producer.TestProducer;
+import org.springframework.kafka.annotation.KafkaListener;
+import org.springframework.stereotype.Component;
+
+@Component
+public class TestConsumer {
+
+    /**
+     * 指定一个消费者组,一个主题主题。
+     */
+    @KafkaListener(topics = TestProducer.TOPIC_TEST,groupId = TestProducer.GROUP_TEST)
+    public void simpleConsumer(ConsumerRecord<String, Object> record) {
+        System.out.println("进入simpleConsumer方法");
+        System.out.printf(
+                "分区 = %d, 偏移量 = %d, key = %s, 内容 = %s,创建消息的时间戳 =%d%n",
+                record.partition(),
+                record.offset(),
+                record.key(),
+                record.value(),
+                record.timestamp()
+        );
+    }
+
+}

+ 22 - 0
jeecg_module_ems/src/main/java/org/jeecg/kafka/controller/TestController.java

@@ -0,0 +1,22 @@
+package org.jeecg.kafka.controller;
+
+
+import org.jeecg.kafka.producer.TestProducer;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+@RestController
+@RequestMapping("/kafka/test")
+public class TestController {
+
+    @Resource
+    private TestProducer testProducer;
+
+    @GetMapping("/send")
+    public void sendMsg(){
+        testProducer.send("------------测试消息-----------");
+    }
+}

+ 44 - 0
jeecg_module_ems/src/main/java/org/jeecg/kafka/producer/TestProducer.java

@@ -0,0 +1,44 @@
+package org.jeecg.kafka.producer;
+
+import com.alibaba.fastjson.JSON;
+import lombok.extern.slf4j.Slf4j;
+import org.jetbrains.annotations.NotNull;
+import org.springframework.kafka.core.KafkaTemplate;
+import org.springframework.kafka.support.SendResult;
+import org.springframework.stereotype.Component;
+import org.springframework.util.concurrent.ListenableFuture;
+import org.springframework.util.concurrent.ListenableFutureCallback;
+
+import javax.annotation.Resource;
+
+@Component
+@Slf4j
+public class TestProducer {
+
+    @Resource
+    private KafkaTemplate<String, Object> kafkaTemplate;
+
+    //自定义topic
+    public static final String TOPIC_TEST = "visible";
+
+    public static final String GROUP_TEST = "grout.test";
+    public void send(Object obj) {
+        String obj2String = JSON.toJSONString(obj);
+        log.info("准备发送消息为:{}", obj2String);
+        //发送消息
+        ListenableFuture<SendResult<String, Object>> future = kafkaTemplate.send("TOPIC_TEST", obj);
+        future.addCallback(new ListenableFutureCallback<SendResult<String, Object>>() {
+            @Override
+            public void onFailure(@NotNull Throwable throwable) {
+                //发送失败的处理
+                log.info(TOPIC_TEST + " - 生产者 发送消息失败:" + throwable.getMessage());
+            }
+
+            @Override
+            public void onSuccess(SendResult<String, Object> stringObjectSendResult) {
+                //成功的处理
+                log.info(TOPIC_TEST + " - 生产者 发送消息成功:" + stringObjectSendResult.toString());
+            }
+        });
+    }
+}

+ 132 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/cronJob/GenerateDataJob.java

@@ -0,0 +1,132 @@
+package org.jeecg.modules.cronJob;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.jeecg.modules.dataCurrent.entity.DataCurrent;
+import org.jeecg.modules.dataCurrent.service.IDataCurrentService;
+import org.jeecg.modules.dataDemand.entity.DataDemand;
+import org.jeecg.modules.dataDemand.service.IDataDemandService;
+import org.jeecg.modules.dataElectricity.entity.DataElectricity;
+import org.jeecg.modules.dataElectricity.service.IDataElectricityService;
+import org.jeecg.modules.dataVoltage.entity.DataVoltage;
+import org.jeecg.modules.dataVoltage.service.IDataVoltageService;
+import org.jeecg.modules.tpmEquipment.entity.TpmEquipment;
+import org.jeecg.modules.tpmEquipment.service.ITpmEquipmentService;
+import org.jeecg.modules.tpmTag.entity.TpmTag;
+import org.jeecg.modules.tpmTag.service.ITpmTagService;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Component
+public class GenerateDataJob implements Job {
+
+    @Autowired
+    private ITpmEquipmentService equipmentService; //设备service
+    @Autowired
+    private ITpmTagService tagService; //点位service
+    @Autowired
+    private IDataCurrentService currentService; //实时电流service
+    @Autowired
+    private IDataDemandService demandService; //实时需量service
+    @Autowired
+    private IDataElectricityService electricityService; // 分时用电量service
+    @Autowired
+    private IDataVoltageService voltageService; //设备实时电压service
+
+    @Override
+    public void execute(JobExecutionContext context) throws JobExecutionException {
+        // 电流值范围:20-50、电压值范围:350-450、需量:400-1500、用电量、0-1.5
+        // tagtype:4需量、5电流、6电压、7电量
+
+        ArrayList<DataDemand> dataDemands = new ArrayList<>();
+        ArrayList<DataCurrent> dataCurrents = new ArrayList<>();
+        ArrayList<DataVoltage> dataVoltages = new ArrayList<>();
+        ArrayList<DataElectricity> dataElectricities = new ArrayList<>();
+
+        List<TpmEquipment> equipments = equipmentService.list();
+        for (TpmEquipment equipment : equipments) {
+            LambdaQueryWrapper<TpmTag> tagLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            List<TpmTag> list = tagService.list(tagLambdaQueryWrapper.eq(TpmTag::getEquipmentid, equipment.getId()));
+            if (list == null || list.isEmpty()) continue;
+            for (TpmTag tpmTag : list) {
+                if (StringUtils.isEmpty(tpmTag.getTagtype())) tpmTag.setTagtype("nil");
+                String tagType = tpmTag.getTagtype();
+                DataDemand dataDemand = new DataDemand();
+                dataDemand.setTagid(tpmTag.getId());
+                dataDemand.setTagname(tpmTag.getTagname());
+                dataDemand.setEquipmentid(equipment.getId());
+                dataDemand.setEquipmentname(equipment.getEquipmentname());
+                dataDemand.setLogtime(new Date());
+                if (tagType.equals("4")) {
+                    dataDemand.setTagvalue(randomData(4));
+                    dataDemands.add(dataDemand);
+                } else if (tagType.equals("5")) {
+                    DataCurrent dataCurrent = new DataCurrent();
+                    BeanUtils.copyProperties(dataDemand, dataCurrent);
+                    dataCurrent.setTagvalue(randomData(5));
+                    dataCurrents.add(dataCurrent);
+                } else if (tagType.equals("6")) {
+                    DataVoltage dataVoltage = new DataVoltage();
+                    BeanUtils.copyProperties(dataDemand, dataVoltage);
+                    dataVoltage.setTagvalue(randomData(6));
+                    dataVoltages.add(dataVoltage);
+                } else if (tagType.equals("7")) {
+                    DataElectricity dataElectricity = new DataElectricity();
+                    BeanUtils.copyProperties(dataDemand, dataElectricity);
+                    Double value = randomData(7);
+                    dataElectricity.setElectricityvalue(value);
+/*
+                    LambdaQueryWrapper<DataElectricity> wrapper = new LambdaQueryWrapper<>();
+                    wrapper.eq(DataElectricity::getEquipmentid, equipment.getId());
+                    wrapper.eq(DataElectricity::getTagid, tpmTag.getId());
+                    Page<DataElectricity> page = electricityService.page(new Page<>(1, 1), wrapper);
+                    DataElectricity one = page.getRecords().get(0);
+                    if (one != null && ObjectUtils.isNotEmpty(one.getTagvalue())) {
+                        dataElectricity.setTagvalue(one.getTagvalue() + value);
+                    } else {
+                        dataElectricity.setTagvalue(value);
+                    }*/
+                    dataElectricities.add(dataElectricity);
+                }
+            }
+        }
+
+        demandService.saveBatch(dataDemands);
+        currentService.saveBatch(dataCurrents);
+        voltageService.saveBatch(dataVoltages);
+        electricityService.saveBatch(dataElectricities);
+
+    }
+
+    public Double GenerateData(int tagType) {
+        switch (tagType) {
+            case 4:
+                return 400 + Math.random() * (1500 - 400);
+            case 5:
+                return 20 + Math.random() * (50 - 20);
+            case 6:
+                return 350 + Math.random() * (450 - 350);
+            case 7:
+                return Math.random() * 1.5;
+        }
+        return null;
+    }
+
+    public Double randomData(int tagType) {
+        Double aDouble = GenerateData(tagType);
+        BigDecimal bd = new BigDecimal(aDouble).setScale(2, RoundingMode.HALF_UP);
+        return bd.doubleValue();
+    }
+}

+ 177 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/controller/DataCurrentController.java

@@ -0,0 +1,177 @@
+package org.jeecg.modules.dataCurrent.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.dataCurrent.entity.DataCurrent;
+import org.jeecg.modules.dataCurrent.service.IDataCurrentService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: ems_data_current
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Api(tags="ems_data_current")
+@RestController
+@RequestMapping("/dataCurrent/dataCurrent")
+@Slf4j
+public class DataCurrentController extends JeecgController<DataCurrent, IDataCurrentService> {
+	@Autowired
+	private IDataCurrentService dataCurrentService;
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param dataCurrent
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "ems_data_current-分页列表查询")
+	@ApiOperation(value="ems_data_current-分页列表查询", notes="ems_data_current-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<DataCurrent>> queryPageList(DataCurrent dataCurrent,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<DataCurrent> queryWrapper = QueryGenerator.initQueryWrapper(dataCurrent, req.getParameterMap());
+		Page<DataCurrent> page = new Page<DataCurrent>(pageNo, pageSize);
+		IPage<DataCurrent> pageList = dataCurrentService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
+	/**
+	 *   添加
+	 *
+	 * @param dataCurrent
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_current-添加")
+	@ApiOperation(value="ems_data_current-添加", notes="ems_data_current-添加")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_current:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody DataCurrent dataCurrent) {
+		dataCurrentService.save(dataCurrent);
+		return Result.OK("添加成功!");
+	}
+
+	/**
+	 *  编辑
+	 *
+	 * @param dataCurrent
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_current-编辑")
+	@ApiOperation(value="ems_data_current-编辑", notes="ems_data_current-编辑")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_current:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody DataCurrent dataCurrent) {
+		dataCurrentService.updateById(dataCurrent);
+		return Result.OK("编辑成功!");
+	}
+
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_current-通过id删除")
+	@ApiOperation(value="ems_data_current-通过id删除", notes="ems_data_current-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_current:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		dataCurrentService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_current-批量删除")
+	@ApiOperation(value="ems_data_current-批量删除", notes="ems_data_current-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_current:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.dataCurrentService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "ems_data_current-通过id查询")
+	@ApiOperation(value="ems_data_current-通过id查询", notes="ems_data_current-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<DataCurrent> queryById(@RequestParam(name="id",required=true) String id) {
+		DataCurrent dataCurrent = dataCurrentService.getById(id);
+		if(dataCurrent==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(dataCurrent);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param dataCurrent
+    */
+    //@RequiresPermissions("org.jeecg.modules:ems_data_current:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, DataCurrent dataCurrent) {
+        return super.exportXls(request, dataCurrent, DataCurrent.class, "ems_data_current");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("ems_data_current:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, DataCurrent.class);
+    }
+
+}

+ 93 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/entity/DataCurrent.java

@@ -0,0 +1,93 @@
+package org.jeecg.modules.dataCurrent.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: ems_data_current
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Data
+@TableName("ems_data_current")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="ems_data_current对象", description="ems_data_current")
+public class DataCurrent implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**设备实时电流ID*/
+	@Excel(name = "设备实时电流ID", width = 15)
+    @ApiModelProperty(value = "设备实时电流ID")
+    private java.lang.Integer currentid;
+	/**点位ID*/
+	@Excel(name = "点位ID", width = 15)
+    @ApiModelProperty(value = "点位ID")
+    private java.lang.String tagid;
+	/**点位名*/
+	@Excel(name = "点位名", width = 15)
+    @ApiModelProperty(value = "点位名")
+    private java.lang.String tagname;
+	/**设备ID*/
+	@Excel(name = "设备ID", width = 15)
+    @ApiModelProperty(value = "设备ID")
+    private java.lang.String equipmentid;
+	/**设备名称*/
+	@Excel(name = "设备名称", width = 15)
+    @ApiModelProperty(value = "设备名称")
+    private java.lang.String equipmentname;
+	/**时间*/
+	@Excel(name = "时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "时间")
+    private java.util.Date logtime;
+	/**点位值(电流)*/
+	@Excel(name = "点位值(电流)", width = 15)
+    @ApiModelProperty(value = "点位值(电流)")
+    private java.lang.Double tagvalue;
+	/**所属年*/
+	@Excel(name = "所属年", width = 15)
+    @ApiModelProperty(value = "所属年")
+    private java.lang.Integer year;
+	/**所属月*/
+	@Excel(name = "所属月", width = 15)
+    @ApiModelProperty(value = "所属月")
+    private java.lang.Integer month;
+	/**日期*/
+	@Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private java.lang.String day;
+	/**时间*/
+	@Excel(name = "时间", width = 15)
+    @ApiModelProperty(value = "时间")
+    private java.lang.String time;
+	/**所属年月*/
+	@Excel(name = "所属年月", width = 15)
+    @ApiModelProperty(value = "所属年月")
+    private java.lang.String yearmonth;
+	/**所属周*/
+	@Excel(name = "所属周", width = 15)
+    @ApiModelProperty(value = "所属周")
+    private java.lang.Integer week;
+	/**周几*/
+	@Excel(name = "周几", width = 15)
+    @ApiModelProperty(value = "周几")
+    private java.lang.Integer dayofweek;
+}

+ 17 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/mapper/DataCurrentMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.dataCurrent.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.dataCurrent.entity.DataCurrent;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: ems_data_current
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+public interface DataCurrentMapper extends BaseMapper<DataCurrent> {
+
+}

+ 5 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/mapper/xml/DataCurrentMapper.xml

@@ -0,0 +1,5 @@
+<?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="org.jeecg.modules.dataCurrent.mapper.DataCurrentMapper">
+
+</mapper>

+ 14 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/service/IDataCurrentService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.dataCurrent.service;
+
+import org.jeecg.modules.dataCurrent.entity.DataCurrent;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: ems_data_current
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+public interface IDataCurrentService extends IService<DataCurrent> {
+
+}

+ 19 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/service/impl/DataCurrentServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.dataCurrent.service.impl;
+
+import org.jeecg.modules.dataCurrent.entity.DataCurrent;
+import org.jeecg.modules.dataCurrent.mapper.DataCurrentMapper;
+import org.jeecg.modules.dataCurrent.service.IDataCurrentService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: ems_data_current
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Service
+public class DataCurrentServiceImpl extends ServiceImpl<DataCurrentMapper, DataCurrent> implements IDataCurrentService {
+
+}

+ 252 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/vue/DataCurrentList.vue

@@ -0,0 +1,252 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('ems_data_current')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <data-current-modal ref="modalForm" @ok="modalFormOk"></data-current-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import DataCurrentModal from './modules/DataCurrentModal'
+
+  export default {
+    name: 'DataCurrentList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      DataCurrentModal
+    },
+    data () {
+      return {
+        description: 'ems_data_current管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'设备实时电流ID',
+            align:"center",
+            dataIndex: 'currentid'
+          },
+          {
+            title:'点位ID',
+            align:"center",
+            dataIndex: 'tagid'
+          },
+          {
+            title:'点位名',
+            align:"center",
+            dataIndex: 'tagname'
+          },
+          {
+            title:'设备ID',
+            align:"center",
+            dataIndex: 'equipmentid'
+          },
+          {
+            title:'设备名称',
+            align:"center",
+            dataIndex: 'equipmentname'
+          },
+          {
+            title:'时间',
+            align:"center",
+            dataIndex: 'logtime',
+            customRender:function (text) {
+              return !text?"":(text.length>10?text.substr(0,10):text)
+            }
+          },
+          {
+            title:'点位值(电流)',
+            align:"center",
+            dataIndex: 'tagvalue'
+          },
+          {
+            title:'所属年',
+            align:"center",
+            dataIndex: 'year'
+          },
+          {
+            title:'所属月',
+            align:"center",
+            dataIndex: 'month'
+          },
+          {
+            title:'日期',
+            align:"center",
+            dataIndex: 'day'
+          },
+          {
+            title:'时间',
+            align:"center",
+            dataIndex: 'time'
+          },
+          {
+            title:'所属年月',
+            align:"center",
+            dataIndex: 'yearmonth'
+          },
+          {
+            title:'所属周',
+            align:"center",
+            dataIndex: 'week'
+          },
+          {
+            title:'周几',
+            align:"center",
+            dataIndex: 'dayofweek'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/dataCurrent/dataCurrent/list",
+          delete: "/dataCurrent/dataCurrent/delete",
+          deleteBatch: "/dataCurrent/dataCurrent/deleteBatch",
+          exportXlsUrl: "/dataCurrent/dataCurrent/exportXls",
+          importExcelUrl: "dataCurrent/dataCurrent/importExcel",
+
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'int',value:'currentid',text:'设备实时电流ID'})
+        fieldList.push({type:'int',value:'tagid',text:'点位ID'})
+        fieldList.push({type:'string',value:'tagname',text:'点位名'})
+        fieldList.push({type:'int',value:'equipmentid',text:'设备ID'})
+        fieldList.push({type:'string',value:'equipmentname',text:'设备名称'})
+        fieldList.push({type:'date',value:'logtime',text:'时间'})
+        fieldList.push({type:'number',value:'tagvalue',text:'点位值(电流)'})
+        fieldList.push({type:'int',value:'year',text:'所属年'})
+        fieldList.push({type:'int',value:'month',text:'所属月'})
+        fieldList.push({type:'string',value:'day',text:'日期'})
+        fieldList.push({type:'string',value:'time',text:'时间'})
+        fieldList.push({type:'string',value:'yearmonth',text:'所属年月'})
+        fieldList.push({type:'int',value:'week',text:'所属周'})
+        fieldList.push({type:'int',value:'dayofweek',text:'周几'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 26 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/vue/DataCurrent_menu_insert.sql

@@ -0,0 +1,26 @@
+-- 注意:该页面对应的前台目录为views/dataCurrent文件夹下
+-- 如果你想更改到其他目录,请修改sql中component字段对应的值
+
+
+INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
+VALUES ('2024011903064680470', NULL, 'ems_data_current', '/dataCurrent/dataCurrentList', 'dataCurrent/DataCurrentList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 1, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-01-19 15:06:47', NULL, NULL, 0);
+
+-- 权限控制sql
+-- 新增
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903064680471', '2024011903064680470', '添加ems_data_current', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_current:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:06:47', NULL, NULL, 0, 0, '1', 0);
+-- 编辑
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903064680472', '2024011903064680470', '编辑ems_data_current', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_current:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:06:47', NULL, NULL, 0, 0, '1', 0);
+-- 删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903064680473', '2024011903064680470', '删除ems_data_current', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_current:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:06:47', NULL, NULL, 0, 0, '1', 0);
+-- 批量删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903064680474', '2024011903064680470', '批量删除ems_data_current', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_current:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:06:47', NULL, NULL, 0, 0, '1', 0);
+-- 导出excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903064680475', '2024011903064680470', '导出excel_ems_data_current', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_current:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:06:47', NULL, NULL, 0, 0, '1', 0);
+-- 导入excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903064680476', '2024011903064680470', '导入excel_ems_data_current', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_current:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:06:47', NULL, NULL, 0, 0, '1', 0);

+ 178 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/vue/modules/DataCurrentForm.vue

@@ -0,0 +1,178 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="设备实时电流ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="currentid">
+              <a-input-number v-model="model.currentid" placeholder="请输入设备实时电流ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagid">
+              <a-input-number v-model="model.tagid" placeholder="请输入点位ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagname">
+              <a-input v-model="model.tagname" placeholder="请输入点位名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
+              <a-input-number v-model="model.equipmentid" placeholder="请输入设备ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentname">
+              <a-input v-model="model.equipmentname" placeholder="请输入设备名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logtime">
+              <j-date placeholder="请选择时间" v-model="model.logtime"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位值(电流)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagvalue">
+              <a-input-number v-model="model.tagvalue" placeholder="请输入点位值(电流)" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="year">
+              <a-input-number v-model="model.year" placeholder="请输入所属年" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="month">
+              <a-input-number v-model="model.month" placeholder="请输入所属月" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="day">
+              <a-input v-model="model.day" placeholder="请输入日期"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="time">
+              <a-input v-model="model.time" placeholder="请输入时间"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yearmonth">
+              <a-input v-model="model.yearmonth" placeholder="请输入所属年月"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属周" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="week">
+              <a-input-number v-model="model.week" placeholder="请输入所属周" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="周几" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dayofweek">
+              <a-input-number v-model="model.dayofweek" placeholder="请输入周几" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'DataCurrentForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+           currentid: [
+              { required: true, message: '请输入设备实时电流ID!'},
+           ],
+           tagid: [
+              { required: true, message: '请输入点位ID!'},
+           ],
+           tagname: [
+              { required: true, message: '请输入点位名!'},
+           ],
+        },
+        url: {
+          add: "/dataCurrent/dataCurrent/add",
+          edit: "/dataCurrent/dataCurrent/edit",
+          queryById: "/dataCurrent/dataCurrent/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/vue/modules/DataCurrentModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <data-current-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></data-current-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import DataCurrentForm from './DataCurrentForm'
+
+  export default {
+    name: 'DataCurrentModal',
+    components: {
+      DataCurrentForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataCurrent/vue/modules/DataCurrentModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <data-current-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></data-current-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import DataCurrentForm from './DataCurrentForm'
+  export default {
+    name: 'DataCurrentModal',
+    components: {
+      DataCurrentForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 177 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/controller/DataDemandController.java

@@ -0,0 +1,177 @@
+package org.jeecg.modules.dataDemand.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.dataDemand.entity.DataDemand;
+import org.jeecg.modules.dataDemand.service.IDataDemandService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: ems_data_demand
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Api(tags="ems_data_demand")
+@RestController
+@RequestMapping("/dataDemand/dataDemand")
+@Slf4j
+public class DataDemandController extends JeecgController<DataDemand, IDataDemandService> {
+	@Autowired
+	private IDataDemandService dataDemandService;
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param dataDemand
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "ems_data_demand-分页列表查询")
+	@ApiOperation(value="ems_data_demand-分页列表查询", notes="ems_data_demand-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<DataDemand>> queryPageList(DataDemand dataDemand,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<DataDemand> queryWrapper = QueryGenerator.initQueryWrapper(dataDemand, req.getParameterMap());
+		Page<DataDemand> page = new Page<DataDemand>(pageNo, pageSize);
+		IPage<DataDemand> pageList = dataDemandService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
+	/**
+	 *   添加
+	 *
+	 * @param dataDemand
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_demand-添加")
+	@ApiOperation(value="ems_data_demand-添加", notes="ems_data_demand-添加")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_demand:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody DataDemand dataDemand) {
+		dataDemandService.save(dataDemand);
+		return Result.OK("添加成功!");
+	}
+
+	/**
+	 *  编辑
+	 *
+	 * @param dataDemand
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_demand-编辑")
+	@ApiOperation(value="ems_data_demand-编辑", notes="ems_data_demand-编辑")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_demand:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody DataDemand dataDemand) {
+		dataDemandService.updateById(dataDemand);
+		return Result.OK("编辑成功!");
+	}
+
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_demand-通过id删除")
+	@ApiOperation(value="ems_data_demand-通过id删除", notes="ems_data_demand-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_demand:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		dataDemandService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_demand-批量删除")
+	@ApiOperation(value="ems_data_demand-批量删除", notes="ems_data_demand-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_demand:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.dataDemandService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "ems_data_demand-通过id查询")
+	@ApiOperation(value="ems_data_demand-通过id查询", notes="ems_data_demand-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<DataDemand> queryById(@RequestParam(name="id",required=true) String id) {
+		DataDemand dataDemand = dataDemandService.getById(id);
+		if(dataDemand==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(dataDemand);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param dataDemand
+    */
+    //@RequiresPermissions("org.jeecg.modules:ems_data_demand:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, DataDemand dataDemand) {
+        return super.exportXls(request, dataDemand, DataDemand.class, "ems_data_demand");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("ems_data_demand:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, DataDemand.class);
+    }
+
+}

+ 89 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/entity/DataDemand.java

@@ -0,0 +1,89 @@
+package org.jeecg.modules.dataDemand.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: ems_data_demand
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Data
+@TableName("ems_data_demand")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="ems_data_demand对象", description="ems_data_demand")
+public class DataDemand implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**需量值ID*/
+	@Excel(name = "需量值ID", width = 15)
+    @ApiModelProperty(value = "需量值ID")
+    private java.lang.Integer demandid;
+	/**点位ID*/
+	@Excel(name = "点位ID", width = 15)
+    @ApiModelProperty(value = "点位ID")
+    private java.lang.String tagid;
+	/**点位名*/
+	@Excel(name = "点位名", width = 15)
+    @ApiModelProperty(value = "点位名")
+    private java.lang.String tagname;
+	/**设备ID*/
+	@Excel(name = "设备ID", width = 15)
+    @ApiModelProperty(value = "设备ID")
+    private java.lang.String equipmentid;
+	/**设备名称*/
+	@Excel(name = "设备名称", width = 15)
+    @ApiModelProperty(value = "设备名称")
+    private java.lang.String equipmentname;
+	/**时间*/
+	@Excel(name = "时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "时间")
+    private java.util.Date logtime;
+	/**点位值(最大需量)*/
+	@Excel(name = "点位值(最大需量)", width = 15)
+    @ApiModelProperty(value = "点位值(最大需量)")
+    private java.lang.Double tagvalue;
+	/**所属年*/
+	@Excel(name = "所属年", width = 15)
+    @ApiModelProperty(value = "所属年")
+    private java.lang.Integer year;
+	/**所属月*/
+	@Excel(name = "所属月", width = 15)
+    @ApiModelProperty(value = "所属月")
+    private java.lang.Integer month;
+	/**日期*/
+	@Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private java.lang.String day;
+	/**所属年月*/
+	@Excel(name = "所属年月", width = 15)
+    @ApiModelProperty(value = "所属年月")
+    private java.lang.String yearmonth;
+	/**所属周*/
+	@Excel(name = "所属周", width = 15)
+    @ApiModelProperty(value = "所属周")
+    private java.lang.Integer week;
+	/**周几*/
+	@Excel(name = "周几", width = 15)
+    @ApiModelProperty(value = "周几")
+    private java.lang.Integer dayofweek;
+}

+ 17 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/mapper/DataDemandMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.dataDemand.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.dataDemand.entity.DataDemand;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: ems_data_demand
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+public interface DataDemandMapper extends BaseMapper<DataDemand> {
+
+}

+ 5 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/mapper/xml/DataDemandMapper.xml

@@ -0,0 +1,5 @@
+<?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="org.jeecg.modules.dataDemand.mapper.DataDemandMapper">
+
+</mapper>

+ 14 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/service/IDataDemandService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.dataDemand.service;
+
+import org.jeecg.modules.dataDemand.entity.DataDemand;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: ems_data_demand
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+public interface IDataDemandService extends IService<DataDemand> {
+
+}

+ 19 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/service/impl/DataDemandServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.dataDemand.service.impl;
+
+import org.jeecg.modules.dataDemand.entity.DataDemand;
+import org.jeecg.modules.dataDemand.mapper.DataDemandMapper;
+import org.jeecg.modules.dataDemand.service.IDataDemandService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: ems_data_demand
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Service
+public class DataDemandServiceImpl extends ServiceImpl<DataDemandMapper, DataDemand> implements IDataDemandService {
+
+}

+ 246 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/vue/DataDemandList.vue

@@ -0,0 +1,246 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('ems_data_demand')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <data-demand-modal ref="modalForm" @ok="modalFormOk"></data-demand-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import DataDemandModal from './modules/DataDemandModal'
+
+  export default {
+    name: 'DataDemandList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      DataDemandModal
+    },
+    data () {
+      return {
+        description: 'ems_data_demand管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'需量值ID',
+            align:"center",
+            dataIndex: 'demandid'
+          },
+          {
+            title:'点位ID',
+            align:"center",
+            dataIndex: 'tagid'
+          },
+          {
+            title:'点位名',
+            align:"center",
+            dataIndex: 'tagname'
+          },
+          {
+            title:'设备ID',
+            align:"center",
+            dataIndex: 'equipmentid'
+          },
+          {
+            title:'设备名称',
+            align:"center",
+            dataIndex: 'equipmentname'
+          },
+          {
+            title:'时间',
+            align:"center",
+            dataIndex: 'logtime',
+            customRender:function (text) {
+              return !text?"":(text.length>10?text.substr(0,10):text)
+            }
+          },
+          {
+            title:'点位值(最大需量)',
+            align:"center",
+            dataIndex: 'tagvalue'
+          },
+          {
+            title:'所属年',
+            align:"center",
+            dataIndex: 'year'
+          },
+          {
+            title:'所属月',
+            align:"center",
+            dataIndex: 'month'
+          },
+          {
+            title:'日期',
+            align:"center",
+            dataIndex: 'day'
+          },
+          {
+            title:'所属年月',
+            align:"center",
+            dataIndex: 'yearmonth'
+          },
+          {
+            title:'所属周',
+            align:"center",
+            dataIndex: 'week'
+          },
+          {
+            title:'周几',
+            align:"center",
+            dataIndex: 'dayofweek'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/dataDemand/dataDemand/list",
+          delete: "/dataDemand/dataDemand/delete",
+          deleteBatch: "/dataDemand/dataDemand/deleteBatch",
+          exportXlsUrl: "/dataDemand/dataDemand/exportXls",
+          importExcelUrl: "dataDemand/dataDemand/importExcel",
+
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'int',value:'demandid',text:'需量值ID'})
+        fieldList.push({type:'int',value:'tagid',text:'点位ID'})
+        fieldList.push({type:'string',value:'tagname',text:'点位名'})
+        fieldList.push({type:'int',value:'equipmentid',text:'设备ID'})
+        fieldList.push({type:'string',value:'equipmentname',text:'设备名称'})
+        fieldList.push({type:'date',value:'logtime',text:'时间'})
+        fieldList.push({type:'number',value:'tagvalue',text:'点位值(最大需量)'})
+        fieldList.push({type:'int',value:'year',text:'所属年'})
+        fieldList.push({type:'int',value:'month',text:'所属月'})
+        fieldList.push({type:'string',value:'day',text:'日期'})
+        fieldList.push({type:'string',value:'yearmonth',text:'所属年月'})
+        fieldList.push({type:'int',value:'week',text:'所属周'})
+        fieldList.push({type:'int',value:'dayofweek',text:'周几'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 26 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/vue/DataDemand_menu_insert.sql

@@ -0,0 +1,26 @@
+-- 注意:该页面对应的前台目录为views/dataDemand文件夹下
+-- 如果你想更改到其他目录,请修改sql中component字段对应的值
+
+
+INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
+VALUES ('2024011903073830080', NULL, 'ems_data_demand', '/dataDemand/dataDemandList', 'dataDemand/DataDemandList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 1, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-01-19 15:07:08', NULL, NULL, 0);
+
+-- 权限控制sql
+-- 新增
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903073830081', '2024011903073830080', '添加ems_data_demand', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_demand:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:08', NULL, NULL, 0, 0, '1', 0);
+-- 编辑
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903073830082', '2024011903073830080', '编辑ems_data_demand', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_demand:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:08', NULL, NULL, 0, 0, '1', 0);
+-- 删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903073830083', '2024011903073830080', '删除ems_data_demand', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_demand:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:08', NULL, NULL, 0, 0, '1', 0);
+-- 批量删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903073830084', '2024011903073830080', '批量删除ems_data_demand', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_demand:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:08', NULL, NULL, 0, 0, '1', 0);
+-- 导出excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903073830085', '2024011903073830080', '导出excel_ems_data_demand', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_demand:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:08', NULL, NULL, 0, 0, '1', 0);
+-- 导入excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903073830086', '2024011903073830080', '导入excel_ems_data_demand', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_demand:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:08', NULL, NULL, 0, 0, '1', 0);

+ 173 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/vue/modules/DataDemandForm.vue

@@ -0,0 +1,173 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="需量值ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="demandid">
+              <a-input-number v-model="model.demandid" placeholder="请输入需量值ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagid">
+              <a-input-number v-model="model.tagid" placeholder="请输入点位ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagname">
+              <a-input v-model="model.tagname" placeholder="请输入点位名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
+              <a-input-number v-model="model.equipmentid" placeholder="请输入设备ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentname">
+              <a-input v-model="model.equipmentname" placeholder="请输入设备名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logtime">
+              <j-date placeholder="请选择时间" v-model="model.logtime"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位值(最大需量)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagvalue">
+              <a-input-number v-model="model.tagvalue" placeholder="请输入点位值(最大需量)" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="year">
+              <a-input-number v-model="model.year" placeholder="请输入所属年" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="month">
+              <a-input-number v-model="model.month" placeholder="请输入所属月" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="day">
+              <a-input v-model="model.day" placeholder="请输入日期"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yearmonth">
+              <a-input v-model="model.yearmonth" placeholder="请输入所属年月"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属周" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="week">
+              <a-input-number v-model="model.week" placeholder="请输入所属周" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="周几" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dayofweek">
+              <a-input-number v-model="model.dayofweek" placeholder="请输入周几" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'DataDemandForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+           demandid: [
+              { required: true, message: '请输入需量值ID!'},
+           ],
+           tagid: [
+              { required: true, message: '请输入点位ID!'},
+           ],
+           tagname: [
+              { required: true, message: '请输入点位名!'},
+           ],
+        },
+        url: {
+          add: "/dataDemand/dataDemand/add",
+          edit: "/dataDemand/dataDemand/edit",
+          queryById: "/dataDemand/dataDemand/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/vue/modules/DataDemandModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <data-demand-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></data-demand-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import DataDemandForm from './DataDemandForm'
+
+  export default {
+    name: 'DataDemandModal',
+    components: {
+      DataDemandForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataDemand/vue/modules/DataDemandModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <data-demand-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></data-demand-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import DataDemandForm from './DataDemandForm'
+  export default {
+    name: 'DataDemandModal',
+    components: {
+      DataDemandForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 177 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/controller/DataElectricityController.java

@@ -0,0 +1,177 @@
+package org.jeecg.modules.dataElectricity.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.dataElectricity.entity.DataElectricity;
+import org.jeecg.modules.dataElectricity.service.IDataElectricityService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: ems_data_electricity
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Api(tags="ems_data_electricity")
+@RestController
+@RequestMapping("/dataElectricity/dataElectricity")
+@Slf4j
+public class DataElectricityController extends JeecgController<DataElectricity, IDataElectricityService> {
+	@Autowired
+	private IDataElectricityService dataElectricityService;
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param dataElectricity
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "ems_data_electricity-分页列表查询")
+	@ApiOperation(value="ems_data_electricity-分页列表查询", notes="ems_data_electricity-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<DataElectricity>> queryPageList(DataElectricity dataElectricity,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<DataElectricity> queryWrapper = QueryGenerator.initQueryWrapper(dataElectricity, req.getParameterMap());
+		Page<DataElectricity> page = new Page<DataElectricity>(pageNo, pageSize);
+		IPage<DataElectricity> pageList = dataElectricityService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
+	/**
+	 *   添加
+	 *
+	 * @param dataElectricity
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_electricity-添加")
+	@ApiOperation(value="ems_data_electricity-添加", notes="ems_data_electricity-添加")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_electricity:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody DataElectricity dataElectricity) {
+		dataElectricityService.save(dataElectricity);
+		return Result.OK("添加成功!");
+	}
+
+	/**
+	 *  编辑
+	 *
+	 * @param dataElectricity
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_electricity-编辑")
+	@ApiOperation(value="ems_data_electricity-编辑", notes="ems_data_electricity-编辑")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_electricity:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody DataElectricity dataElectricity) {
+		dataElectricityService.updateById(dataElectricity);
+		return Result.OK("编辑成功!");
+	}
+
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_electricity-通过id删除")
+	@ApiOperation(value="ems_data_electricity-通过id删除", notes="ems_data_electricity-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_electricity:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		dataElectricityService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_electricity-批量删除")
+	@ApiOperation(value="ems_data_electricity-批量删除", notes="ems_data_electricity-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_electricity:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.dataElectricityService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "ems_data_electricity-通过id查询")
+	@ApiOperation(value="ems_data_electricity-通过id查询", notes="ems_data_electricity-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<DataElectricity> queryById(@RequestParam(name="id",required=true) String id) {
+		DataElectricity dataElectricity = dataElectricityService.getById(id);
+		if(dataElectricity==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(dataElectricity);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param dataElectricity
+    */
+    //@RequiresPermissions("org.jeecg.modules:ems_data_electricity:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, DataElectricity dataElectricity) {
+        return super.exportXls(request, dataElectricity, DataElectricity.class, "ems_data_electricity");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("ems_data_electricity:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, DataElectricity.class);
+    }
+
+}

+ 137 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/entity/DataElectricity.java

@@ -0,0 +1,137 @@
+package org.jeecg.modules.dataElectricity.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: ems_data_electricity
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Data
+@TableName("ems_data_electricity")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="ems_data_electricity对象", description="ems_data_electricity")
+public class DataElectricity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**电量ID*/
+	@Excel(name = "电量ID", width = 15)
+    @ApiModelProperty(value = "电量ID")
+    private java.lang.Integer electricityid;
+	/**点位ID*/
+	@Excel(name = "点位ID", width = 15)
+    @ApiModelProperty(value = "点位ID")
+    private java.lang.String tagid;
+	/**点位名*/
+	@Excel(name = "点位名", width = 15)
+    @ApiModelProperty(value = "点位名")
+    private java.lang.String tagname;
+	/**设备ID*/
+	@Excel(name = "设备ID", width = 15)
+    @ApiModelProperty(value = "设备ID")
+    private java.lang.String equipmentid;
+	/**设备名称*/
+	@Excel(name = "设备名称", width = 15)
+    @ApiModelProperty(value = "设备名称")
+    private java.lang.String equipmentname;
+	/**时间*/
+	@Excel(name = "时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "时间")
+    private java.util.Date logtime;
+	/**点位值(总电量)*/
+	@Excel(name = "点位值(总电量)", width = 15)
+    @ApiModelProperty(value = "点位值(总电量)")
+    private java.lang.Double tagvalue;
+	/**分时电量*/
+	@Excel(name = "分时电量", width = 15)
+    @ApiModelProperty(value = "分时电量")
+    private java.lang.Double electricityvalue;
+	/**所属年*/
+	@Excel(name = "所属年", width = 15)
+    @ApiModelProperty(value = "所属年")
+    private java.lang.Integer year;
+	/**所属月*/
+	@Excel(name = "所属月", width = 15)
+    @ApiModelProperty(value = "所属月")
+    private java.lang.Integer month;
+	/**日期*/
+	@Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private java.lang.String day;
+	/**时间*/
+	@Excel(name = "时间", width = 15)
+    @ApiModelProperty(value = "时间")
+    private java.lang.String time;
+	/**所属年月*/
+	@Excel(name = "所属年月", width = 15)
+    @ApiModelProperty(value = "所属年月")
+    private java.lang.String yearmonth;
+	/**所属周*/
+	@Excel(name = "所属周", width = 15)
+    @ApiModelProperty(value = "所属周")
+    private java.lang.Integer week;
+	/**周几*/
+	@Excel(name = "周几", width = 15)
+    @ApiModelProperty(value = "周几")
+    private java.lang.Integer dayofweek;
+	/**电费*/
+	@Excel(name = "电费", width = 15)
+    @ApiModelProperty(value = "电费")
+    private java.lang.Double amount;
+	/**基本电费ID*/
+	@Excel(name = "基本电费ID", width = 15)
+    @ApiModelProperty(value = "基本电费ID")
+    private java.lang.Integer elecfeebaseid;
+	/**基本电费*/
+	@Excel(name = "基本电费", width = 15)
+    @ApiModelProperty(value = "基本电费")
+    private java.lang.Double baseamount;
+	/**电度电费ID*/
+	@Excel(name = "电度电费ID", width = 15)
+    @ApiModelProperty(value = "电度电费ID")
+    private java.lang.Integer elecfeedegreeid;
+	/**电度电费*/
+	@Excel(name = "电度电费", width = 15)
+    @ApiModelProperty(value = "电度电费")
+    private java.lang.Double degreeamount;
+	/**电度电费类型:峰平谷、售电、光伏*/
+	@Excel(name = "电度电费类型:峰平谷、售电、光伏", width = 15)
+    @ApiModelProperty(value = "电度电费类型:峰平谷、售电、光伏")
+    private java.lang.String degreetype;
+	/**力调系数ID*/
+	@Excel(name = "力调系数ID", width = 15)
+    @ApiModelProperty(value = "力调系数ID")
+    private java.lang.Integer elecfeeratioid;
+	/**力调电费*/
+	@Excel(name = "力调电费", width = 15)
+    @ApiModelProperty(value = "力调电费")
+    private java.lang.Double ratioamount;
+	/**附加电费ID*/
+	@Excel(name = "附加电费ID", width = 15)
+    @ApiModelProperty(value = "附加电费ID")
+    private java.lang.Integer elecfeeaddid;
+	/**附加电费*/
+	@Excel(name = "附加电费", width = 15)
+    @ApiModelProperty(value = "附加电费")
+    private java.lang.Double addamount;
+}

+ 17 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/mapper/DataElectricityMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.dataElectricity.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.dataElectricity.entity.DataElectricity;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: ems_data_electricity
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+public interface DataElectricityMapper extends BaseMapper<DataElectricity> {
+
+}

+ 5 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/mapper/xml/DataElectricityMapper.xml

@@ -0,0 +1,5 @@
+<?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="org.jeecg.modules.dataElectricity.mapper.DataElectricityMapper">
+
+</mapper>

+ 14 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/service/IDataElectricityService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.dataElectricity.service;
+
+import org.jeecg.modules.dataElectricity.entity.DataElectricity;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: ems_data_electricity
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+public interface IDataElectricityService extends IService<DataElectricity> {
+
+}

+ 19 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/service/impl/DataElectricityServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.dataElectricity.service.impl;
+
+import org.jeecg.modules.dataElectricity.entity.DataElectricity;
+import org.jeecg.modules.dataElectricity.mapper.DataElectricityMapper;
+import org.jeecg.modules.dataElectricity.service.IDataElectricityService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: ems_data_electricity
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Service
+public class DataElectricityServiceImpl extends ServiceImpl<DataElectricityMapper, DataElectricity> implements IDataElectricityService {
+
+}

+ 318 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/vue/DataElectricityList.vue

@@ -0,0 +1,318 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('ems_data_electricity')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <data-electricity-modal ref="modalForm" @ok="modalFormOk"></data-electricity-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import DataElectricityModal from './modules/DataElectricityModal'
+
+  export default {
+    name: 'DataElectricityList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      DataElectricityModal
+    },
+    data () {
+      return {
+        description: 'ems_data_electricity管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'电量ID',
+            align:"center",
+            dataIndex: 'electricityid'
+          },
+          {
+            title:'点位ID',
+            align:"center",
+            dataIndex: 'tagid'
+          },
+          {
+            title:'点位名',
+            align:"center",
+            dataIndex: 'tagname'
+          },
+          {
+            title:'设备ID',
+            align:"center",
+            dataIndex: 'equipmentid'
+          },
+          {
+            title:'设备名称',
+            align:"center",
+            dataIndex: 'equipmentname'
+          },
+          {
+            title:'时间',
+            align:"center",
+            dataIndex: 'logtime',
+            customRender:function (text) {
+              return !text?"":(text.length>10?text.substr(0,10):text)
+            }
+          },
+          {
+            title:'点位值(总电量)',
+            align:"center",
+            dataIndex: 'tagvalue'
+          },
+          {
+            title:'分时电量',
+            align:"center",
+            dataIndex: 'electricityvalue'
+          },
+          {
+            title:'所属年',
+            align:"center",
+            dataIndex: 'year'
+          },
+          {
+            title:'所属月',
+            align:"center",
+            dataIndex: 'month'
+          },
+          {
+            title:'日期',
+            align:"center",
+            dataIndex: 'day'
+          },
+          {
+            title:'时间',
+            align:"center",
+            dataIndex: 'time'
+          },
+          {
+            title:'所属年月',
+            align:"center",
+            dataIndex: 'yearmonth'
+          },
+          {
+            title:'所属周',
+            align:"center",
+            dataIndex: 'week'
+          },
+          {
+            title:'周几',
+            align:"center",
+            dataIndex: 'dayofweek'
+          },
+          {
+            title:'电费',
+            align:"center",
+            dataIndex: 'amount'
+          },
+          {
+            title:'基本电费ID',
+            align:"center",
+            dataIndex: 'elecfeebaseid'
+          },
+          {
+            title:'基本电费',
+            align:"center",
+            dataIndex: 'baseamount'
+          },
+          {
+            title:'电度电费ID',
+            align:"center",
+            dataIndex: 'elecfeedegreeid'
+          },
+          {
+            title:'电度电费',
+            align:"center",
+            dataIndex: 'degreeamount'
+          },
+          {
+            title:'电度电费类型:峰平谷、售电、光伏',
+            align:"center",
+            dataIndex: 'degreetype'
+          },
+          {
+            title:'力调系数ID',
+            align:"center",
+            dataIndex: 'elecfeeratioid'
+          },
+          {
+            title:'力调电费',
+            align:"center",
+            dataIndex: 'ratioamount'
+          },
+          {
+            title:'附加电费ID',
+            align:"center",
+            dataIndex: 'elecfeeaddid'
+          },
+          {
+            title:'附加电费',
+            align:"center",
+            dataIndex: 'addamount'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/dataElectricity/dataElectricity/list",
+          delete: "/dataElectricity/dataElectricity/delete",
+          deleteBatch: "/dataElectricity/dataElectricity/deleteBatch",
+          exportXlsUrl: "/dataElectricity/dataElectricity/exportXls",
+          importExcelUrl: "dataElectricity/dataElectricity/importExcel",
+
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'int',value:'electricityid',text:'电量ID'})
+        fieldList.push({type:'int',value:'tagid',text:'点位ID'})
+        fieldList.push({type:'string',value:'tagname',text:'点位名'})
+        fieldList.push({type:'int',value:'equipmentid',text:'设备ID'})
+        fieldList.push({type:'string',value:'equipmentname',text:'设备名称'})
+        fieldList.push({type:'date',value:'logtime',text:'时间'})
+        fieldList.push({type:'number',value:'tagvalue',text:'点位值(总电量)'})
+        fieldList.push({type:'number',value:'electricityvalue',text:'分时电量'})
+        fieldList.push({type:'int',value:'year',text:'所属年'})
+        fieldList.push({type:'int',value:'month',text:'所属月'})
+        fieldList.push({type:'string',value:'day',text:'日期'})
+        fieldList.push({type:'string',value:'time',text:'时间'})
+        fieldList.push({type:'string',value:'yearmonth',text:'所属年月'})
+        fieldList.push({type:'int',value:'week',text:'所属周'})
+        fieldList.push({type:'int',value:'dayofweek',text:'周几'})
+        fieldList.push({type:'number',value:'amount',text:'电费'})
+        fieldList.push({type:'int',value:'elecfeebaseid',text:'基本电费ID'})
+        fieldList.push({type:'number',value:'baseamount',text:'基本电费'})
+        fieldList.push({type:'int',value:'elecfeedegreeid',text:'电度电费ID'})
+        fieldList.push({type:'number',value:'degreeamount',text:'电度电费'})
+        fieldList.push({type:'string',value:'degreetype',text:'电度电费类型:峰平谷、售电、光伏'})
+        fieldList.push({type:'int',value:'elecfeeratioid',text:'力调系数ID'})
+        fieldList.push({type:'number',value:'ratioamount',text:'力调电费'})
+        fieldList.push({type:'int',value:'elecfeeaddid',text:'附加电费ID'})
+        fieldList.push({type:'number',value:'addamount',text:'附加电费'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 26 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/vue/DataElectricity_menu_insert.sql

@@ -0,0 +1,26 @@
+-- 注意:该页面对应的前台目录为views/dataElectricity文件夹下
+-- 如果你想更改到其他目录,请修改sql中component字段对应的值
+
+
+INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
+VALUES ('2024011903078610250', NULL, 'ems_data_electricity', '/dataElectricity/dataElectricityList', 'dataElectricity/DataElectricityList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 1, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-01-19 15:07:25', NULL, NULL, 0);
+
+-- 权限控制sql
+-- 新增
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903078610251', '2024011903078610250', '添加ems_data_electricity', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_electricity:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:25', NULL, NULL, 0, 0, '1', 0);
+-- 编辑
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903078610252', '2024011903078610250', '编辑ems_data_electricity', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_electricity:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:25', NULL, NULL, 0, 0, '1', 0);
+-- 删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903078610253', '2024011903078610250', '删除ems_data_electricity', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_electricity:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:25', NULL, NULL, 0, 0, '1', 0);
+-- 批量删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903078610254', '2024011903078610250', '批量删除ems_data_electricity', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_electricity:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:25', NULL, NULL, 0, 0, '1', 0);
+-- 导出excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903078610255', '2024011903078610250', '导出excel_ems_data_electricity', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_electricity:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:25', NULL, NULL, 0, 0, '1', 0);
+-- 导入excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903078610256', '2024011903078610250', '导入excel_ems_data_electricity', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_electricity:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:25', NULL, NULL, 0, 0, '1', 0);

+ 233 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/vue/modules/DataElectricityForm.vue

@@ -0,0 +1,233 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="电量ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="electricityid">
+              <a-input-number v-model="model.electricityid" placeholder="请输入电量ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagid">
+              <a-input-number v-model="model.tagid" placeholder="请输入点位ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagname">
+              <a-input v-model="model.tagname" placeholder="请输入点位名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
+              <a-input-number v-model="model.equipmentid" placeholder="请输入设备ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentname">
+              <a-input v-model="model.equipmentname" placeholder="请输入设备名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logtime">
+              <j-date placeholder="请选择时间" v-model="model.logtime"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位值(总电量)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagvalue">
+              <a-input-number v-model="model.tagvalue" placeholder="请输入点位值(总电量)" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="分时电量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="electricityvalue">
+              <a-input-number v-model="model.electricityvalue" placeholder="请输入分时电量" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="year">
+              <a-input-number v-model="model.year" placeholder="请输入所属年" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="month">
+              <a-input-number v-model="model.month" placeholder="请输入所属月" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="day">
+              <a-input v-model="model.day" placeholder="请输入日期"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="time">
+              <a-input v-model="model.time" placeholder="请输入时间"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yearmonth">
+              <a-input v-model="model.yearmonth" placeholder="请输入所属年月"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属周" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="week">
+              <a-input-number v-model="model.week" placeholder="请输入所属周" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="周几" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dayofweek">
+              <a-input-number v-model="model.dayofweek" placeholder="请输入周几" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="电费" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="amount">
+              <a-input-number v-model="model.amount" placeholder="请输入电费" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="基本电费ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="elecfeebaseid">
+              <a-input-number v-model="model.elecfeebaseid" placeholder="请输入基本电费ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="基本电费" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="baseamount">
+              <a-input-number v-model="model.baseamount" placeholder="请输入基本电费" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="电度电费ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="elecfeedegreeid">
+              <a-input-number v-model="model.elecfeedegreeid" placeholder="请输入电度电费ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="电度电费" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="degreeamount">
+              <a-input-number v-model="model.degreeamount" placeholder="请输入电度电费" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="电度电费类型:峰平谷、售电、光伏" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="degreetype">
+              <a-input v-model="model.degreetype" placeholder="请输入电度电费类型:峰平谷、售电、光伏"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="力调系数ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="elecfeeratioid">
+              <a-input-number v-model="model.elecfeeratioid" placeholder="请输入力调系数ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="力调电费" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ratioamount">
+              <a-input-number v-model="model.ratioamount" placeholder="请输入力调电费" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="附加电费ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="elecfeeaddid">
+              <a-input-number v-model="model.elecfeeaddid" placeholder="请输入附加电费ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="附加电费" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="addamount">
+              <a-input-number v-model="model.addamount" placeholder="请输入附加电费" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'DataElectricityForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+           electricityid: [
+              { required: true, message: '请输入电量ID!'},
+           ],
+           tagid: [
+              { required: true, message: '请输入点位ID!'},
+           ],
+           tagname: [
+              { required: true, message: '请输入点位名!'},
+           ],
+        },
+        url: {
+          add: "/dataElectricity/dataElectricity/add",
+          edit: "/dataElectricity/dataElectricity/edit",
+          queryById: "/dataElectricity/dataElectricity/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/vue/modules/DataElectricityModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <data-electricity-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></data-electricity-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import DataElectricityForm from './DataElectricityForm'
+
+  export default {
+    name: 'DataElectricityModal',
+    components: {
+      DataElectricityForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricity/vue/modules/DataElectricityModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <data-electricity-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></data-electricity-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import DataElectricityForm from './DataElectricityForm'
+  export default {
+    name: 'DataElectricityModal',
+    components: {
+      DataElectricityForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 177 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/controller/DataElectricityDayController.java

@@ -0,0 +1,177 @@
+package org.jeecg.modules.dataElectricityDay.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.dataElectricityDay.entity.DataElectricityDay;
+import org.jeecg.modules.dataElectricityDay.service.IDataElectricityDayService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: ems_data_electricity_day
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Api(tags="ems_data_electricity_day")
+@RestController
+@RequestMapping("/dataElectricityDay/dataElectricityDay")
+@Slf4j
+public class DataElectricityDayController extends JeecgController<DataElectricityDay, IDataElectricityDayService> {
+	@Autowired
+	private IDataElectricityDayService dataElectricityDayService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param dataElectricityDay
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "ems_data_electricity_day-分页列表查询")
+	@ApiOperation(value="ems_data_electricity_day-分页列表查询", notes="ems_data_electricity_day-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<DataElectricityDay>> queryPageList(DataElectricityDay dataElectricityDay,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<DataElectricityDay> queryWrapper = QueryGenerator.initQueryWrapper(dataElectricityDay, req.getParameterMap());
+		Page<DataElectricityDay> page = new Page<DataElectricityDay>(pageNo, pageSize);
+		IPage<DataElectricityDay> pageList = dataElectricityDayService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param dataElectricityDay
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_electricity_day-添加")
+	@ApiOperation(value="ems_data_electricity_day-添加", notes="ems_data_electricity_day-添加")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_electricity_day:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody DataElectricityDay dataElectricityDay) {
+		dataElectricityDayService.save(dataElectricityDay);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param dataElectricityDay
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_electricity_day-编辑")
+	@ApiOperation(value="ems_data_electricity_day-编辑", notes="ems_data_electricity_day-编辑")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_electricity_day:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody DataElectricityDay dataElectricityDay) {
+		dataElectricityDayService.updateById(dataElectricityDay);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_electricity_day-通过id删除")
+	@ApiOperation(value="ems_data_electricity_day-通过id删除", notes="ems_data_electricity_day-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_electricity_day:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		dataElectricityDayService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_electricity_day-批量删除")
+	@ApiOperation(value="ems_data_electricity_day-批量删除", notes="ems_data_electricity_day-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_electricity_day:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.dataElectricityDayService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "ems_data_electricity_day-通过id查询")
+	@ApiOperation(value="ems_data_electricity_day-通过id查询", notes="ems_data_electricity_day-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<DataElectricityDay> queryById(@RequestParam(name="id",required=true) String id) {
+		DataElectricityDay dataElectricityDay = dataElectricityDayService.getById(id);
+		if(dataElectricityDay==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(dataElectricityDay);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param dataElectricityDay
+    */
+    //@RequiresPermissions("org.jeecg.modules:ems_data_electricity_day:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, DataElectricityDay dataElectricityDay) {
+        return super.exportXls(request, dataElectricityDay, DataElectricityDay.class, "ems_data_electricity_day");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("ems_data_electricity_day:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, DataElectricityDay.class);
+    }
+
+}

+ 129 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/entity/DataElectricityDay.java

@@ -0,0 +1,129 @@
+package org.jeecg.modules.dataElectricityDay.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: ems_data_electricity_day
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Data
+@TableName("ems_data_electricity_day")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="ems_data_electricity_day对象", description="ems_data_electricity_day")
+public class DataElectricityDay implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**一天电量ID*/
+	@Excel(name = "一天电量ID", width = 15)
+    @ApiModelProperty(value = "一天电量ID")
+    private java.lang.Integer electricitydayid;
+	/**点位ID*/
+	@Excel(name = "点位ID", width = 15)
+    @ApiModelProperty(value = "点位ID")
+    private java.lang.String tagid;
+	/**点位名*/
+	@Excel(name = "点位名", width = 15)
+    @ApiModelProperty(value = "点位名")
+    private java.lang.String tagname;
+	/**设备ID*/
+	@Excel(name = "设备ID", width = 15)
+    @ApiModelProperty(value = "设备ID")
+    private java.lang.String equipmentid;
+	/**设备名称*/
+	@Excel(name = "设备名称", width = 15)
+    @ApiModelProperty(value = "设备名称")
+    private java.lang.String equipmentname;
+	/**计算时间*/
+	@Excel(name = "计算时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "计算时间")
+    private java.util.Date logtime;
+	/**一天电量*/
+	@Excel(name = "一天电量", width = 15)
+    @ApiModelProperty(value = "一天电量")
+    private java.lang.Double electricityvalue;
+	/**所属年*/
+	@Excel(name = "所属年", width = 15)
+    @ApiModelProperty(value = "所属年")
+    private java.lang.Integer year;
+	/**所属月*/
+	@Excel(name = "所属月", width = 15)
+    @ApiModelProperty(value = "所属月")
+    private java.lang.Integer month;
+	/**日期*/
+	@Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private java.lang.String day;
+	/**所属年月*/
+	@Excel(name = "所属年月", width = 15)
+    @ApiModelProperty(value = "所属年月")
+    private java.lang.String yearmonth;
+	/**所属周*/
+	@Excel(name = "所属周", width = 15)
+    @ApiModelProperty(value = "所属周")
+    private java.lang.Integer week;
+	/**周几*/
+	@Excel(name = "周几", width = 15)
+    @ApiModelProperty(value = "周几")
+    private java.lang.Integer dayofweek;
+	/**电费*/
+	@Excel(name = "电费", width = 15)
+    @ApiModelProperty(value = "电费")
+    private java.lang.Double amount;
+	/**基本电费ID*/
+	@Excel(name = "基本电费ID", width = 15)
+    @ApiModelProperty(value = "基本电费ID")
+    private java.lang.Integer elecfeebaseid;
+	/**基本电费*/
+	@Excel(name = "基本电费", width = 15)
+    @ApiModelProperty(value = "基本电费")
+    private java.lang.Double baseamount;
+	/**电度电费ID*/
+	@Excel(name = "电度电费ID", width = 15)
+    @ApiModelProperty(value = "电度电费ID")
+    private java.lang.Integer elecfeedegreeid;
+	/**电度电费*/
+	@Excel(name = "电度电费", width = 15)
+    @ApiModelProperty(value = "电度电费")
+    private java.lang.Double degreeamount;
+	/**电度电费类型:峰平谷、售电、光伏*/
+	@Excel(name = "电度电费类型:峰平谷、售电、光伏", width = 15)
+    @ApiModelProperty(value = "电度电费类型:峰平谷、售电、光伏")
+    private java.lang.String degreetype;
+	/**力调系数ID*/
+	@Excel(name = "力调系数ID", width = 15)
+    @ApiModelProperty(value = "力调系数ID")
+    private java.lang.Integer elecfeeratioid;
+	/**力调电费*/
+	@Excel(name = "力调电费", width = 15)
+    @ApiModelProperty(value = "力调电费")
+    private java.lang.Double ratioamount;
+	/**附加电费ID*/
+	@Excel(name = "附加电费ID", width = 15)
+    @ApiModelProperty(value = "附加电费ID")
+    private java.lang.Integer elecfeeaddid;
+	/**附加电费*/
+	@Excel(name = "附加电费", width = 15)
+    @ApiModelProperty(value = "附加电费")
+    private java.lang.Double addamount;
+}

+ 17 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/mapper/DataElectricityDayMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.dataElectricityDay.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.dataElectricityDay.entity.DataElectricityDay;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: ems_data_electricity_day
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+public interface DataElectricityDayMapper extends BaseMapper<DataElectricityDay> {
+
+}

+ 5 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/mapper/xml/DataElectricityDayMapper.xml

@@ -0,0 +1,5 @@
+<?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="org.jeecg.modules.dataElectricityDay.mapper.DataElectricityDayMapper">
+
+</mapper>

+ 14 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/service/IDataElectricityDayService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.dataElectricityDay.service;
+
+import org.jeecg.modules.dataElectricityDay.entity.DataElectricityDay;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: ems_data_electricity_day
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+public interface IDataElectricityDayService extends IService<DataElectricityDay> {
+
+}

+ 19 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/service/impl/DataElectricityDayServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.dataElectricityDay.service.impl;
+
+import org.jeecg.modules.dataElectricityDay.entity.DataElectricityDay;
+import org.jeecg.modules.dataElectricityDay.mapper.DataElectricityDayMapper;
+import org.jeecg.modules.dataElectricityDay.service.IDataElectricityDayService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: ems_data_electricity_day
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Service
+public class DataElectricityDayServiceImpl extends ServiceImpl<DataElectricityDayMapper, DataElectricityDay> implements IDataElectricityDayService {
+
+}

+ 306 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/vue/DataElectricityDayList.vue

@@ -0,0 +1,306 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('ems_data_electricity_day')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <data-electricity-day-modal ref="modalForm" @ok="modalFormOk"></data-electricity-day-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import DataElectricityDayModal from './modules/DataElectricityDayModal'
+
+  export default {
+    name: 'DataElectricityDayList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      DataElectricityDayModal
+    },
+    data () {
+      return {
+        description: 'ems_data_electricity_day管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'一天电量ID',
+            align:"center",
+            dataIndex: 'electricitydayid'
+          },
+          {
+            title:'点位ID',
+            align:"center",
+            dataIndex: 'tagid'
+          },
+          {
+            title:'点位名',
+            align:"center",
+            dataIndex: 'tagname'
+          },
+          {
+            title:'设备ID',
+            align:"center",
+            dataIndex: 'equipmentid'
+          },
+          {
+            title:'设备名称',
+            align:"center",
+            dataIndex: 'equipmentname'
+          },
+          {
+            title:'计算时间',
+            align:"center",
+            dataIndex: 'logtime',
+            customRender:function (text) {
+              return !text?"":(text.length>10?text.substr(0,10):text)
+            }
+          },
+          {
+            title:'一天电量',
+            align:"center",
+            dataIndex: 'electricityvalue'
+          },
+          {
+            title:'所属年',
+            align:"center",
+            dataIndex: 'year'
+          },
+          {
+            title:'所属月',
+            align:"center",
+            dataIndex: 'month'
+          },
+          {
+            title:'日期',
+            align:"center",
+            dataIndex: 'day'
+          },
+          {
+            title:'所属年月',
+            align:"center",
+            dataIndex: 'yearmonth'
+          },
+          {
+            title:'所属周',
+            align:"center",
+            dataIndex: 'week'
+          },
+          {
+            title:'周几',
+            align:"center",
+            dataIndex: 'dayofweek'
+          },
+          {
+            title:'电费',
+            align:"center",
+            dataIndex: 'amount'
+          },
+          {
+            title:'基本电费ID',
+            align:"center",
+            dataIndex: 'elecfeebaseid'
+          },
+          {
+            title:'基本电费',
+            align:"center",
+            dataIndex: 'baseamount'
+          },
+          {
+            title:'电度电费ID',
+            align:"center",
+            dataIndex: 'elecfeedegreeid'
+          },
+          {
+            title:'电度电费',
+            align:"center",
+            dataIndex: 'degreeamount'
+          },
+          {
+            title:'电度电费类型:峰平谷、售电、光伏',
+            align:"center",
+            dataIndex: 'degreetype'
+          },
+          {
+            title:'力调系数ID',
+            align:"center",
+            dataIndex: 'elecfeeratioid'
+          },
+          {
+            title:'力调电费',
+            align:"center",
+            dataIndex: 'ratioamount'
+          },
+          {
+            title:'附加电费ID',
+            align:"center",
+            dataIndex: 'elecfeeaddid'
+          },
+          {
+            title:'附加电费',
+            align:"center",
+            dataIndex: 'addamount'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/dataElectricityDay/dataElectricityDay/list",
+          delete: "/dataElectricityDay/dataElectricityDay/delete",
+          deleteBatch: "/dataElectricityDay/dataElectricityDay/deleteBatch",
+          exportXlsUrl: "/dataElectricityDay/dataElectricityDay/exportXls",
+          importExcelUrl: "dataElectricityDay/dataElectricityDay/importExcel",
+
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'int',value:'electricitydayid',text:'一天电量ID'})
+        fieldList.push({type:'int',value:'tagid',text:'点位ID'})
+        fieldList.push({type:'string',value:'tagname',text:'点位名'})
+        fieldList.push({type:'int',value:'equipmentid',text:'设备ID'})
+        fieldList.push({type:'string',value:'equipmentname',text:'设备名称'})
+        fieldList.push({type:'date',value:'logtime',text:'计算时间'})
+        fieldList.push({type:'number',value:'electricityvalue',text:'一天电量'})
+        fieldList.push({type:'int',value:'year',text:'所属年'})
+        fieldList.push({type:'int',value:'month',text:'所属月'})
+        fieldList.push({type:'string',value:'day',text:'日期'})
+        fieldList.push({type:'string',value:'yearmonth',text:'所属年月'})
+        fieldList.push({type:'int',value:'week',text:'所属周'})
+        fieldList.push({type:'int',value:'dayofweek',text:'周几'})
+        fieldList.push({type:'number',value:'amount',text:'电费'})
+        fieldList.push({type:'int',value:'elecfeebaseid',text:'基本电费ID'})
+        fieldList.push({type:'number',value:'baseamount',text:'基本电费'})
+        fieldList.push({type:'int',value:'elecfeedegreeid',text:'电度电费ID'})
+        fieldList.push({type:'number',value:'degreeamount',text:'电度电费'})
+        fieldList.push({type:'string',value:'degreetype',text:'电度电费类型:峰平谷、售电、光伏'})
+        fieldList.push({type:'int',value:'elecfeeratioid',text:'力调系数ID'})
+        fieldList.push({type:'number',value:'ratioamount',text:'力调电费'})
+        fieldList.push({type:'int',value:'elecfeeaddid',text:'附加电费ID'})
+        fieldList.push({type:'number',value:'addamount',text:'附加电费'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 26 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/vue/DataElectricityDay_menu_insert.sql

@@ -0,0 +1,26 @@
+-- 注意:该页面对应的前台目录为views/dataElectricityDay文件夹下
+-- 如果你想更改到其他目录,请修改sql中component字段对应的值
+
+
+INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
+VALUES ('2024011903076850370', NULL, 'ems_data_electricity_day', '/dataElectricityDay/dataElectricityDayList', 'dataElectricityDay/DataElectricityDayList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 1, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-01-19 15:07:37', NULL, NULL, 0);
+
+-- 权限控制sql
+-- 新增
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903076850371', '2024011903076850370', '添加ems_data_electricity_day', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_electricity_day:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:37', NULL, NULL, 0, 0, '1', 0);
+-- 编辑
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903076850372', '2024011903076850370', '编辑ems_data_electricity_day', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_electricity_day:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:37', NULL, NULL, 0, 0, '1', 0);
+-- 删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903076850373', '2024011903076850370', '删除ems_data_electricity_day', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_electricity_day:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:37', NULL, NULL, 0, 0, '1', 0);
+-- 批量删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903076850374', '2024011903076850370', '批量删除ems_data_electricity_day', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_electricity_day:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:37', NULL, NULL, 0, 0, '1', 0);
+-- 导出excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903076850375', '2024011903076850370', '导出excel_ems_data_electricity_day', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_electricity_day:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:37', NULL, NULL, 0, 0, '1', 0);
+-- 导入excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903076850376', '2024011903076850370', '导入excel_ems_data_electricity_day', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_electricity_day:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:37', NULL, NULL, 0, 0, '1', 0);

+ 223 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/vue/modules/DataElectricityDayForm.vue

@@ -0,0 +1,223 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="一天电量ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="electricitydayid">
+              <a-input-number v-model="model.electricitydayid" placeholder="请输入一天电量ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagid">
+              <a-input-number v-model="model.tagid" placeholder="请输入点位ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagname">
+              <a-input v-model="model.tagname" placeholder="请输入点位名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
+              <a-input-number v-model="model.equipmentid" placeholder="请输入设备ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentname">
+              <a-input v-model="model.equipmentname" placeholder="请输入设备名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="计算时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logtime">
+              <j-date placeholder="请选择计算时间" v-model="model.logtime"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="一天电量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="electricityvalue">
+              <a-input-number v-model="model.electricityvalue" placeholder="请输入一天电量" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="year">
+              <a-input-number v-model="model.year" placeholder="请输入所属年" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="month">
+              <a-input-number v-model="model.month" placeholder="请输入所属月" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="day">
+              <a-input v-model="model.day" placeholder="请输入日期"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yearmonth">
+              <a-input v-model="model.yearmonth" placeholder="请输入所属年月"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属周" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="week">
+              <a-input-number v-model="model.week" placeholder="请输入所属周" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="周几" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dayofweek">
+              <a-input-number v-model="model.dayofweek" placeholder="请输入周几" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="电费" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="amount">
+              <a-input-number v-model="model.amount" placeholder="请输入电费" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="基本电费ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="elecfeebaseid">
+              <a-input-number v-model="model.elecfeebaseid" placeholder="请输入基本电费ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="基本电费" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="baseamount">
+              <a-input-number v-model="model.baseamount" placeholder="请输入基本电费" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="电度电费ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="elecfeedegreeid">
+              <a-input-number v-model="model.elecfeedegreeid" placeholder="请输入电度电费ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="电度电费" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="degreeamount">
+              <a-input-number v-model="model.degreeamount" placeholder="请输入电度电费" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="电度电费类型:峰平谷、售电、光伏" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="degreetype">
+              <a-input v-model="model.degreetype" placeholder="请输入电度电费类型:峰平谷、售电、光伏"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="力调系数ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="elecfeeratioid">
+              <a-input-number v-model="model.elecfeeratioid" placeholder="请输入力调系数ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="力调电费" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ratioamount">
+              <a-input-number v-model="model.ratioamount" placeholder="请输入力调电费" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="附加电费ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="elecfeeaddid">
+              <a-input-number v-model="model.elecfeeaddid" placeholder="请输入附加电费ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="附加电费" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="addamount">
+              <a-input-number v-model="model.addamount" placeholder="请输入附加电费" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'DataElectricityDayForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+           electricitydayid: [
+              { required: true, message: '请输入一天电量ID!'},
+           ],
+           tagid: [
+              { required: true, message: '请输入点位ID!'},
+           ],
+           tagname: [
+              { required: true, message: '请输入点位名!'},
+           ],
+        },
+        url: {
+          add: "/dataElectricityDay/dataElectricityDay/add",
+          edit: "/dataElectricityDay/dataElectricityDay/edit",
+          queryById: "/dataElectricityDay/dataElectricityDay/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/vue/modules/DataElectricityDayModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <data-electricity-day-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></data-electricity-day-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import DataElectricityDayForm from './DataElectricityDayForm'
+
+  export default {
+    name: 'DataElectricityDayModal',
+    components: {
+      DataElectricityDayForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataElectricityDay/vue/modules/DataElectricityDayModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <data-electricity-day-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></data-electricity-day-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import DataElectricityDayForm from './DataElectricityDayForm'
+  export default {
+    name: 'DataElectricityDayModal',
+    components: {
+      DataElectricityDayForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 177 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/controller/DataPowerController.java

@@ -0,0 +1,177 @@
+package org.jeecg.modules.dataPower.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.dataPower.entity.DataPower;
+import org.jeecg.modules.dataPower.service.IDataPowerService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: ems_data_power
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Api(tags="ems_data_power")
+@RestController
+@RequestMapping("/dataPower/dataPower")
+@Slf4j
+public class DataPowerController extends JeecgController<DataPower, IDataPowerService> {
+	@Autowired
+	private IDataPowerService dataPowerService;
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param dataPower
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "ems_data_power-分页列表查询")
+	@ApiOperation(value="ems_data_power-分页列表查询", notes="ems_data_power-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<DataPower>> queryPageList(DataPower dataPower,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<DataPower> queryWrapper = QueryGenerator.initQueryWrapper(dataPower, req.getParameterMap());
+		Page<DataPower> page = new Page<DataPower>(pageNo, pageSize);
+		IPage<DataPower> pageList = dataPowerService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
+	/**
+	 *   添加
+	 *
+	 * @param dataPower
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_power-添加")
+	@ApiOperation(value="ems_data_power-添加", notes="ems_data_power-添加")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_power:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody DataPower dataPower) {
+		dataPowerService.save(dataPower);
+		return Result.OK("添加成功!");
+	}
+
+	/**
+	 *  编辑
+	 *
+	 * @param dataPower
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_power-编辑")
+	@ApiOperation(value="ems_data_power-编辑", notes="ems_data_power-编辑")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_power:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody DataPower dataPower) {
+		dataPowerService.updateById(dataPower);
+		return Result.OK("编辑成功!");
+	}
+
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_power-通过id删除")
+	@ApiOperation(value="ems_data_power-通过id删除", notes="ems_data_power-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_power:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		dataPowerService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_power-批量删除")
+	@ApiOperation(value="ems_data_power-批量删除", notes="ems_data_power-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_power:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.dataPowerService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "ems_data_power-通过id查询")
+	@ApiOperation(value="ems_data_power-通过id查询", notes="ems_data_power-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<DataPower> queryById(@RequestParam(name="id",required=true) String id) {
+		DataPower dataPower = dataPowerService.getById(id);
+		if(dataPower==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(dataPower);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param dataPower
+    */
+    //@RequiresPermissions("org.jeecg.modules:ems_data_power:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, DataPower dataPower) {
+        return super.exportXls(request, dataPower, DataPower.class, "ems_data_power");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("ems_data_power:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, DataPower.class);
+    }
+
+}

+ 93 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/entity/DataPower.java

@@ -0,0 +1,93 @@
+package org.jeecg.modules.dataPower.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: ems_data_power
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Data
+@TableName("ems_data_power")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="ems_data_power对象", description="ems_data_power")
+public class DataPower implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**设备实时功率ID*/
+	@Excel(name = "设备实时功率ID", width = 15)
+    @ApiModelProperty(value = "设备实时功率ID")
+    private java.lang.Integer powerid;
+	/**点位ID*/
+	@Excel(name = "点位ID", width = 15)
+    @ApiModelProperty(value = "点位ID")
+    private java.lang.String tagid;
+	/**点位名*/
+	@Excel(name = "点位名", width = 15)
+    @ApiModelProperty(value = "点位名")
+    private java.lang.String tagname;
+	/**设备ID*/
+	@Excel(name = "设备ID", width = 15)
+    @ApiModelProperty(value = "设备ID")
+    private java.lang.String equipmentid;
+	/**设备名称*/
+	@Excel(name = "设备名称", width = 15)
+    @ApiModelProperty(value = "设备名称")
+    private java.lang.String equipmentname;
+	/**时间*/
+	@Excel(name = "时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "时间")
+    private java.util.Date logtime;
+	/**点位值(功率)*/
+	@Excel(name = "点位值(功率)", width = 15)
+    @ApiModelProperty(value = "点位值(功率)")
+    private java.lang.Double tagvalue;
+	/**所属年*/
+	@Excel(name = "所属年", width = 15)
+    @ApiModelProperty(value = "所属年")
+    private java.lang.Integer year;
+	/**所属月*/
+	@Excel(name = "所属月", width = 15)
+    @ApiModelProperty(value = "所属月")
+    private java.lang.Integer month;
+	/**日期*/
+	@Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private java.lang.String day;
+	/**时间*/
+	@Excel(name = "时间", width = 15)
+    @ApiModelProperty(value = "时间")
+    private java.lang.String time;
+	/**所属年月*/
+	@Excel(name = "所属年月", width = 15)
+    @ApiModelProperty(value = "所属年月")
+    private java.lang.String yearmonth;
+	/**所属周*/
+	@Excel(name = "所属周", width = 15)
+    @ApiModelProperty(value = "所属周")
+    private java.lang.Integer week;
+	/**周几*/
+	@Excel(name = "周几", width = 15)
+    @ApiModelProperty(value = "周几")
+    private java.lang.Integer dayofweek;
+}

+ 17 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/mapper/DataPowerMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.dataPower.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.dataPower.entity.DataPower;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: ems_data_power
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+public interface DataPowerMapper extends BaseMapper<DataPower> {
+
+}

+ 5 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/mapper/xml/DataPowerMapper.xml

@@ -0,0 +1,5 @@
+<?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="org.jeecg.modules.dataPower.mapper.DataPowerMapper">
+
+</mapper>

+ 14 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/service/IDataPowerService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.dataPower.service;
+
+import org.jeecg.modules.dataPower.entity.DataPower;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: ems_data_power
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+public interface IDataPowerService extends IService<DataPower> {
+
+}

+ 19 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/service/impl/DataPowerServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.dataPower.service.impl;
+
+import org.jeecg.modules.dataPower.entity.DataPower;
+import org.jeecg.modules.dataPower.mapper.DataPowerMapper;
+import org.jeecg.modules.dataPower.service.IDataPowerService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: ems_data_power
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Service
+public class DataPowerServiceImpl extends ServiceImpl<DataPowerMapper, DataPower> implements IDataPowerService {
+
+}

+ 252 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/vue/DataPowerList.vue

@@ -0,0 +1,252 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('ems_data_power')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <data-power-modal ref="modalForm" @ok="modalFormOk"></data-power-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import DataPowerModal from './modules/DataPowerModal'
+
+  export default {
+    name: 'DataPowerList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      DataPowerModal
+    },
+    data () {
+      return {
+        description: 'ems_data_power管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'设备实时功率ID',
+            align:"center",
+            dataIndex: 'powerid'
+          },
+          {
+            title:'点位ID',
+            align:"center",
+            dataIndex: 'tagid'
+          },
+          {
+            title:'点位名',
+            align:"center",
+            dataIndex: 'tagname'
+          },
+          {
+            title:'设备ID',
+            align:"center",
+            dataIndex: 'equipmentid'
+          },
+          {
+            title:'设备名称',
+            align:"center",
+            dataIndex: 'equipmentname'
+          },
+          {
+            title:'时间',
+            align:"center",
+            dataIndex: 'logtime',
+            customRender:function (text) {
+              return !text?"":(text.length>10?text.substr(0,10):text)
+            }
+          },
+          {
+            title:'点位值(功率)',
+            align:"center",
+            dataIndex: 'tagvalue'
+          },
+          {
+            title:'所属年',
+            align:"center",
+            dataIndex: 'year'
+          },
+          {
+            title:'所属月',
+            align:"center",
+            dataIndex: 'month'
+          },
+          {
+            title:'日期',
+            align:"center",
+            dataIndex: 'day'
+          },
+          {
+            title:'时间',
+            align:"center",
+            dataIndex: 'time'
+          },
+          {
+            title:'所属年月',
+            align:"center",
+            dataIndex: 'yearmonth'
+          },
+          {
+            title:'所属周',
+            align:"center",
+            dataIndex: 'week'
+          },
+          {
+            title:'周几',
+            align:"center",
+            dataIndex: 'dayofweek'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/dataPower/dataPower/list",
+          delete: "/dataPower/dataPower/delete",
+          deleteBatch: "/dataPower/dataPower/deleteBatch",
+          exportXlsUrl: "/dataPower/dataPower/exportXls",
+          importExcelUrl: "dataPower/dataPower/importExcel",
+
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'int',value:'powerid',text:'设备实时功率ID'})
+        fieldList.push({type:'int',value:'tagid',text:'点位ID'})
+        fieldList.push({type:'string',value:'tagname',text:'点位名'})
+        fieldList.push({type:'int',value:'equipmentid',text:'设备ID'})
+        fieldList.push({type:'string',value:'equipmentname',text:'设备名称'})
+        fieldList.push({type:'date',value:'logtime',text:'时间'})
+        fieldList.push({type:'number',value:'tagvalue',text:'点位值(功率)'})
+        fieldList.push({type:'int',value:'year',text:'所属年'})
+        fieldList.push({type:'int',value:'month',text:'所属月'})
+        fieldList.push({type:'string',value:'day',text:'日期'})
+        fieldList.push({type:'string',value:'time',text:'时间'})
+        fieldList.push({type:'string',value:'yearmonth',text:'所属年月'})
+        fieldList.push({type:'int',value:'week',text:'所属周'})
+        fieldList.push({type:'int',value:'dayofweek',text:'周几'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 26 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/vue/DataPower_menu_insert.sql

@@ -0,0 +1,26 @@
+-- 注意:该页面对应的前台目录为views/dataPower文件夹下
+-- 如果你想更改到其他目录,请修改sql中component字段对应的值
+
+
+INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
+VALUES ('202401190307730510', NULL, 'ems_data_power', '/dataPower/dataPowerList', 'dataPower/DataPowerList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 1, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-01-19 15:07:51', NULL, NULL, 0);
+
+-- 权限控制sql
+-- 新增
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('202401190307730511', '202401190307730510', '添加ems_data_power', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_power:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:51', NULL, NULL, 0, 0, '1', 0);
+-- 编辑
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('202401190307730512', '202401190307730510', '编辑ems_data_power', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_power:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:51', NULL, NULL, 0, 0, '1', 0);
+-- 删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('202401190307730513', '202401190307730510', '删除ems_data_power', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_power:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:51', NULL, NULL, 0, 0, '1', 0);
+-- 批量删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('202401190307730514', '202401190307730510', '批量删除ems_data_power', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_power:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:51', NULL, NULL, 0, 0, '1', 0);
+-- 导出excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('202401190307730515', '202401190307730510', '导出excel_ems_data_power', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_power:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:51', NULL, NULL, 0, 0, '1', 0);
+-- 导入excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('202401190307730516', '202401190307730510', '导入excel_ems_data_power', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_power:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:07:51', NULL, NULL, 0, 0, '1', 0);

+ 178 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/vue/modules/DataPowerForm.vue

@@ -0,0 +1,178 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="设备实时功率ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="powerid">
+              <a-input-number v-model="model.powerid" placeholder="请输入设备实时功率ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagid">
+              <a-input-number v-model="model.tagid" placeholder="请输入点位ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagname">
+              <a-input v-model="model.tagname" placeholder="请输入点位名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
+              <a-input-number v-model="model.equipmentid" placeholder="请输入设备ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentname">
+              <a-input v-model="model.equipmentname" placeholder="请输入设备名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logtime">
+              <j-date placeholder="请选择时间" v-model="model.logtime"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位值(功率)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagvalue">
+              <a-input-number v-model="model.tagvalue" placeholder="请输入点位值(功率)" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="year">
+              <a-input-number v-model="model.year" placeholder="请输入所属年" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="month">
+              <a-input-number v-model="model.month" placeholder="请输入所属月" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="day">
+              <a-input v-model="model.day" placeholder="请输入日期"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="time">
+              <a-input v-model="model.time" placeholder="请输入时间"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yearmonth">
+              <a-input v-model="model.yearmonth" placeholder="请输入所属年月"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属周" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="week">
+              <a-input-number v-model="model.week" placeholder="请输入所属周" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="周几" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dayofweek">
+              <a-input-number v-model="model.dayofweek" placeholder="请输入周几" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'DataPowerForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+           powerid: [
+              { required: true, message: '请输入设备实时功率ID!'},
+           ],
+           tagid: [
+              { required: true, message: '请输入点位ID!'},
+           ],
+           tagname: [
+              { required: true, message: '请输入点位名!'},
+           ],
+        },
+        url: {
+          add: "/dataPower/dataPower/add",
+          edit: "/dataPower/dataPower/edit",
+          queryById: "/dataPower/dataPower/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/vue/modules/DataPowerModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <data-power-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></data-power-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import DataPowerForm from './DataPowerForm'
+
+  export default {
+    name: 'DataPowerModal',
+    components: {
+      DataPowerForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataPower/vue/modules/DataPowerModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <data-power-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></data-power-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import DataPowerForm from './DataPowerForm'
+  export default {
+    name: 'DataPowerModal',
+    components: {
+      DataPowerForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 177 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/controller/DataVoltageController.java

@@ -0,0 +1,177 @@
+package org.jeecg.modules.dataVoltage.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.dataVoltage.entity.DataVoltage;
+import org.jeecg.modules.dataVoltage.service.IDataVoltageService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: ems_data_voltage
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Api(tags="ems_data_voltage")
+@RestController
+@RequestMapping("/dataVoltage/dataVoltage")
+@Slf4j
+public class DataVoltageController extends JeecgController<DataVoltage, IDataVoltageService> {
+	@Autowired
+	private IDataVoltageService dataVoltageService;
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param dataVoltage
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "ems_data_voltage-分页列表查询")
+	@ApiOperation(value="ems_data_voltage-分页列表查询", notes="ems_data_voltage-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<DataVoltage>> queryPageList(DataVoltage dataVoltage,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<DataVoltage> queryWrapper = QueryGenerator.initQueryWrapper(dataVoltage, req.getParameterMap());
+		Page<DataVoltage> page = new Page<DataVoltage>(pageNo, pageSize);
+		IPage<DataVoltage> pageList = dataVoltageService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+
+	/**
+	 *   添加
+	 *
+	 * @param dataVoltage
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_voltage-添加")
+	@ApiOperation(value="ems_data_voltage-添加", notes="ems_data_voltage-添加")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_voltage:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody DataVoltage dataVoltage) {
+		dataVoltageService.save(dataVoltage);
+		return Result.OK("添加成功!");
+	}
+
+	/**
+	 *  编辑
+	 *
+	 * @param dataVoltage
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_voltage-编辑")
+	@ApiOperation(value="ems_data_voltage-编辑", notes="ems_data_voltage-编辑")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_voltage:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody DataVoltage dataVoltage) {
+		dataVoltageService.updateById(dataVoltage);
+		return Result.OK("编辑成功!");
+	}
+
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_voltage-通过id删除")
+	@ApiOperation(value="ems_data_voltage-通过id删除", notes="ems_data_voltage-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_voltage:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		dataVoltageService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "ems_data_voltage-批量删除")
+	@ApiOperation(value="ems_data_voltage-批量删除", notes="ems_data_voltage-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:ems_data_voltage:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.dataVoltageService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "ems_data_voltage-通过id查询")
+	@ApiOperation(value="ems_data_voltage-通过id查询", notes="ems_data_voltage-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<DataVoltage> queryById(@RequestParam(name="id",required=true) String id) {
+		DataVoltage dataVoltage = dataVoltageService.getById(id);
+		if(dataVoltage==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(dataVoltage);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param dataVoltage
+    */
+    //@RequiresPermissions("org.jeecg.modules:ems_data_voltage:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, DataVoltage dataVoltage) {
+        return super.exportXls(request, dataVoltage, DataVoltage.class, "ems_data_voltage");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("ems_data_voltage:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, DataVoltage.class);
+    }
+
+}

+ 93 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/entity/DataVoltage.java

@@ -0,0 +1,93 @@
+package org.jeecg.modules.dataVoltage.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: ems_data_voltage
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Data
+@TableName("ems_data_voltage")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="ems_data_voltage对象", description="ems_data_voltage")
+public class DataVoltage implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**设备实时电压ID*/
+	@Excel(name = "设备实时电压ID", width = 15)
+    @ApiModelProperty(value = "设备实时电压ID")
+    private java.lang.Integer voltageid;
+	/**点位ID*/
+	@Excel(name = "点位ID", width = 15)
+    @ApiModelProperty(value = "点位ID")
+    private java.lang.String tagid;
+	/**点位名*/
+	@Excel(name = "点位名", width = 15)
+    @ApiModelProperty(value = "点位名")
+    private java.lang.String tagname;
+	/**设备ID*/
+	@Excel(name = "设备ID", width = 15)
+    @ApiModelProperty(value = "设备ID")
+    private java.lang.String equipmentid;
+	/**设备名称*/
+	@Excel(name = "设备名称", width = 15)
+    @ApiModelProperty(value = "设备名称")
+    private java.lang.String equipmentname;
+	/**时间*/
+	@Excel(name = "时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "时间")
+    private java.util.Date logtime;
+	/**点位值(电量)*/
+	@Excel(name = "点位值(电量)", width = 15)
+    @ApiModelProperty(value = "点位值(电量)")
+    private java.lang.Double tagvalue;
+	/**所属年*/
+	@Excel(name = "所属年", width = 15)
+    @ApiModelProperty(value = "所属年")
+    private java.lang.Integer year;
+	/**所属月*/
+	@Excel(name = "所属月", width = 15)
+    @ApiModelProperty(value = "所属月")
+    private java.lang.Integer month;
+	/**日期*/
+	@Excel(name = "日期", width = 15)
+    @ApiModelProperty(value = "日期")
+    private java.lang.String day;
+	/**时间*/
+	@Excel(name = "时间", width = 15)
+    @ApiModelProperty(value = "时间")
+    private java.lang.String time;
+	/**所属年月*/
+	@Excel(name = "所属年月", width = 15)
+    @ApiModelProperty(value = "所属年月")
+    private java.lang.String yearmonth;
+	/**所属周*/
+	@Excel(name = "所属周", width = 15)
+    @ApiModelProperty(value = "所属周")
+    private java.lang.Integer week;
+	/**周几*/
+	@Excel(name = "周几", width = 15)
+    @ApiModelProperty(value = "周几")
+    private java.lang.Integer dayofweek;
+}

+ 17 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/mapper/DataVoltageMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.dataVoltage.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.dataVoltage.entity.DataVoltage;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: ems_data_voltage
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+public interface DataVoltageMapper extends BaseMapper<DataVoltage> {
+
+}

+ 5 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/mapper/xml/DataVoltageMapper.xml

@@ -0,0 +1,5 @@
+<?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="org.jeecg.modules.dataVoltage.mapper.DataVoltageMapper">
+
+</mapper>

+ 14 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/service/IDataVoltageService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.dataVoltage.service;
+
+import org.jeecg.modules.dataVoltage.entity.DataVoltage;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: ems_data_voltage
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+public interface IDataVoltageService extends IService<DataVoltage> {
+
+}

+ 19 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/service/impl/DataVoltageServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.dataVoltage.service.impl;
+
+import org.jeecg.modules.dataVoltage.entity.DataVoltage;
+import org.jeecg.modules.dataVoltage.mapper.DataVoltageMapper;
+import org.jeecg.modules.dataVoltage.service.IDataVoltageService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: ems_data_voltage
+ * @Author: jeecg-boot
+ * @Date:   2024-01-19
+ * @Version: V1.0
+ */
+@Service
+public class DataVoltageServiceImpl extends ServiceImpl<DataVoltageMapper, DataVoltage> implements IDataVoltageService {
+
+}

+ 252 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/vue/DataVoltageList.vue

@@ -0,0 +1,252 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('ems_data_voltage')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <data-voltage-modal ref="modalForm" @ok="modalFormOk"></data-voltage-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import DataVoltageModal from './modules/DataVoltageModal'
+
+  export default {
+    name: 'DataVoltageList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      DataVoltageModal
+    },
+    data () {
+      return {
+        description: 'ems_data_voltage管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'设备实时电压ID',
+            align:"center",
+            dataIndex: 'voltageid'
+          },
+          {
+            title:'点位ID',
+            align:"center",
+            dataIndex: 'tagid'
+          },
+          {
+            title:'点位名',
+            align:"center",
+            dataIndex: 'tagname'
+          },
+          {
+            title:'设备ID',
+            align:"center",
+            dataIndex: 'equipmentid'
+          },
+          {
+            title:'设备名称',
+            align:"center",
+            dataIndex: 'equipmentname'
+          },
+          {
+            title:'时间',
+            align:"center",
+            dataIndex: 'logtime',
+            customRender:function (text) {
+              return !text?"":(text.length>10?text.substr(0,10):text)
+            }
+          },
+          {
+            title:'点位值(电量)',
+            align:"center",
+            dataIndex: 'tagvalue'
+          },
+          {
+            title:'所属年',
+            align:"center",
+            dataIndex: 'year'
+          },
+          {
+            title:'所属月',
+            align:"center",
+            dataIndex: 'month'
+          },
+          {
+            title:'日期',
+            align:"center",
+            dataIndex: 'day'
+          },
+          {
+            title:'时间',
+            align:"center",
+            dataIndex: 'time'
+          },
+          {
+            title:'所属年月',
+            align:"center",
+            dataIndex: 'yearmonth'
+          },
+          {
+            title:'所属周',
+            align:"center",
+            dataIndex: 'week'
+          },
+          {
+            title:'周几',
+            align:"center",
+            dataIndex: 'dayofweek'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/dataVoltage/dataVoltage/list",
+          delete: "/dataVoltage/dataVoltage/delete",
+          deleteBatch: "/dataVoltage/dataVoltage/deleteBatch",
+          exportXlsUrl: "/dataVoltage/dataVoltage/exportXls",
+          importExcelUrl: "dataVoltage/dataVoltage/importExcel",
+
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'int',value:'voltageid',text:'设备实时电压ID'})
+        fieldList.push({type:'int',value:'tagid',text:'点位ID'})
+        fieldList.push({type:'string',value:'tagname',text:'点位名'})
+        fieldList.push({type:'int',value:'equipmentid',text:'设备ID'})
+        fieldList.push({type:'string',value:'equipmentname',text:'设备名称'})
+        fieldList.push({type:'date',value:'logtime',text:'时间'})
+        fieldList.push({type:'number',value:'tagvalue',text:'点位值(电量)'})
+        fieldList.push({type:'int',value:'year',text:'所属年'})
+        fieldList.push({type:'int',value:'month',text:'所属月'})
+        fieldList.push({type:'string',value:'day',text:'日期'})
+        fieldList.push({type:'string',value:'time',text:'时间'})
+        fieldList.push({type:'string',value:'yearmonth',text:'所属年月'})
+        fieldList.push({type:'int',value:'week',text:'所属周'})
+        fieldList.push({type:'int',value:'dayofweek',text:'周几'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 26 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/vue/DataVoltage_menu_insert.sql

@@ -0,0 +1,26 @@
+-- 注意:该页面对应的前台目录为views/dataVoltage文件夹下
+-- 如果你想更改到其他目录,请修改sql中component字段对应的值
+
+
+INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
+VALUES ('2024011903086180030', NULL, 'ems_data_voltage', '/dataVoltage/dataVoltageList', 'dataVoltage/DataVoltageList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 1, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-01-19 15:08:03', NULL, NULL, 0);
+
+-- 权限控制sql
+-- 新增
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903086180031', '2024011903086180030', '添加ems_data_voltage', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_voltage:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:08:03', NULL, NULL, 0, 0, '1', 0);
+-- 编辑
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903086180032', '2024011903086180030', '编辑ems_data_voltage', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_voltage:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:08:03', NULL, NULL, 0, 0, '1', 0);
+-- 删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903086180033', '2024011903086180030', '删除ems_data_voltage', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_voltage:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:08:03', NULL, NULL, 0, 0, '1', 0);
+-- 批量删除
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903086180034', '2024011903086180030', '批量删除ems_data_voltage', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_voltage:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:08:03', NULL, NULL, 0, 0, '1', 0);
+-- 导出excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903086180035', '2024011903086180030', '导出excel_ems_data_voltage', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_voltage:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:08:03', NULL, NULL, 0, 0, '1', 0);
+-- 导入excel
+INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
+VALUES ('2024011903086180036', '2024011903086180030', '导入excel_ems_data_voltage', NULL, NULL, 0, NULL, NULL, 2, 'org.jeecg.modules:ems_data_voltage:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-01-19 15:08:03', NULL, NULL, 0, 0, '1', 0);

+ 178 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/vue/modules/DataVoltageForm.vue

@@ -0,0 +1,178 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label="设备实时电压ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="voltageid">
+              <a-input-number v-model="model.voltageid" placeholder="请输入设备实时电压ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagid">
+              <a-input-number v-model="model.tagid" placeholder="请输入点位ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagname">
+              <a-input v-model="model.tagname" placeholder="请输入点位名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
+              <a-input-number v-model="model.equipmentid" placeholder="请输入设备ID" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentname">
+              <a-input v-model="model.equipmentname" placeholder="请输入设备名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="logtime">
+              <j-date placeholder="请选择时间" v-model="model.logtime"  style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="点位值(电量)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tagvalue">
+              <a-input-number v-model="model.tagvalue" placeholder="请输入点位值(电量)" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="year">
+              <a-input-number v-model="model.year" placeholder="请输入所属年" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="month">
+              <a-input-number v-model="model.month" placeholder="请输入所属月" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="day">
+              <a-input v-model="model.day" placeholder="请输入日期"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="time">
+              <a-input v-model="model.time" placeholder="请输入时间"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属年月" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yearmonth">
+              <a-input v-model="model.yearmonth" placeholder="请输入所属年月"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="所属周" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="week">
+              <a-input-number v-model="model.week" placeholder="请输入所属周" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="周几" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dayofweek">
+              <a-input-number v-model="model.dayofweek" placeholder="请输入周几" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'DataVoltageForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+           voltageid: [
+              { required: true, message: '请输入设备实时电压ID!'},
+           ],
+           tagid: [
+              { required: true, message: '请输入点位ID!'},
+           ],
+           tagname: [
+              { required: true, message: '请输入点位名!'},
+           ],
+        },
+        url: {
+          add: "/dataVoltage/dataVoltage/add",
+          edit: "/dataVoltage/dataVoltage/edit",
+          queryById: "/dataVoltage/dataVoltage/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/vue/modules/DataVoltageModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <data-voltage-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></data-voltage-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import DataVoltageForm from './DataVoltageForm'
+
+  export default {
+    name: 'DataVoltageModal',
+    components: {
+      DataVoltageForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
jeecg_module_ems/src/main/java/org/jeecg/modules/dataVoltage/vue/modules/DataVoltageModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <data-voltage-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></data-voltage-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import DataVoltageForm from './DataVoltageForm'
+  export default {
+    name: 'DataVoltageModal',
+    components: {
+      DataVoltageForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>