瀏覽代碼

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	ems-cloud/sql/ems_init_data.sql
hsshuxian 11 月之前
父節點
當前提交
dc4dd8d603
共有 56 個文件被更改,包括 4365 次插入94 次删除
  1. 105 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmEmsElecPgIndexController.java
  2. 105 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmEmsIndexRangeController.java
  3. 7 7
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmOpAlarmPolicyController.java
  4. 106 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmOpInspectionReportController.java
  5. 102 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmOpInspectionTaskController.java
  6. 4 4
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AreaController.java
  7. 4 4
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/ElecAttrController.java
  8. 1 2
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmsSubsystemController.java
  9. 71 4
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/MeterReadingManualController.java
  10. 139 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmEmsElecPgIndex.java
  11. 129 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmEmsIndexRange.java
  12. 125 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmOpInspectionReport.java
  13. 180 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmOpInspectionTask.java
  14. 20 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/MeterDevice.java
  15. 6 5
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/MeterReadingManual.java
  16. 13 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/vo/QueryMeterReading.java
  17. 69 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmEmsElecPgIndexMapper.java
  18. 64 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmEmsIndexRangeMapper.java
  19. 61 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmOpInspectionReportMapper.java
  20. 61 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmOpInspectionTaskMapper.java
  21. 11 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/MeterDeviceMapper.java
  22. 8 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/MeterReadingManualMapper.java
  23. 61 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IAdmEmsElecPgIndexService.java
  24. 61 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IAdmEmsIndexRangeService.java
  25. 61 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IAdmOpInspectionReportService.java
  26. 61 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IAdmOpInspectionTaskService.java
  27. 21 14
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IMeterDeviceService.java
  28. 2 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IMeterReadingManualService.java
  29. 93 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/AdmEmsElecPgIndexServiceImpl.java
  30. 93 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/AdmEmsIndexRangeServiceImpl.java
  31. 93 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/AdmOpInspectionReportServiceImpl.java
  32. 93 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/AdmOpInspectionTaskServiceImpl.java
  33. 116 4
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsFacsServiceImpl.java
  34. 7 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/MeterDeviceServiceImpl.java
  35. 5 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/MeterReadingManualServiceImpl.java
  36. 6 10
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/task/taskiml/FacTask.java
  37. 794 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/util/DateUtils.java
  38. 184 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/util/exception/Assert.java
  39. 59 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/util/exception/BusinessException.java
  40. 74 0
      ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/util/exception/ErrorCode.java
  41. 9 6
      ems-cloud/ems-modules/ems-server/src/main/resources/application-demo.yml
  42. 106 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmEmsElecPgIndexMapper.xml
  43. 99 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmEmsIndexRangeMapper.xml
  44. 78 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmOpInspectionReportMapper.xml
  45. 113 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmOpInspectionTaskMapper.xml
  46. 11 1
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/MeterDeviceMapper.xml
  47. 6 0
      ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/MeterReadingManualMapper.xml
  48. 9 0
      ems-cloud/pom.xml
  49. 6 3
      ems-cloud/ruoyi-common/ruoyi-common-core/pom.xml
  50. 85 0
      ems-cloud/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/FacTypes.java
  51. 39 0
      ems-cloud/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ExpressUtil.java
  52. 260 0
      ems-cloud/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/StreamUtils.java
  53. 72 6
      ems-cloud/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/uuid/Seq.java
  54. 102 0
      ems-cloud/sql/ems_init_data.sql
  55. 2 2
      ems-cloud/sql/ems_server.sql
  56. 93 22
      ems-cloud/sql/ems_sys.sql

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

@@ -0,0 +1,105 @@
+package com.ruoyi.ems.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.ems.domain.AdmEmsElecPgIndex;
+import com.ruoyi.ems.service.IAdmEmsElecPgIndexService;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+
+/**
+ * 电网设施指标Controller
+ * 
+ * @author ruoyi
+ * @date 2024-08-30
+ */
+@RestController
+@RequestMapping("/elecPgIndex")
+public class AdmEmsElecPgIndexController extends BaseController
+{
+    @Autowired
+    private IAdmEmsElecPgIndexService admEmsElecPgIndexService;
+
+    /**
+     * 查询电网设施指标列表
+     */
+    @RequiresPermissions("ems:elecPgIndex:list")
+    @GetMapping("/list")
+    public TableDataInfo list(AdmEmsElecPgIndex admEmsElecPgIndex)
+    {
+        startPage();
+        List<AdmEmsElecPgIndex> list = admEmsElecPgIndexService.selectAdmEmsElecPgIndexList(admEmsElecPgIndex);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出电网设施指标列表
+     */
+    @RequiresPermissions("ems:elecPgIndex:export")
+    @Log(title = "电网设施指标", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, AdmEmsElecPgIndex admEmsElecPgIndex)
+    {
+        List<AdmEmsElecPgIndex> list = admEmsElecPgIndexService.selectAdmEmsElecPgIndexList(admEmsElecPgIndex);
+        ExcelUtil<AdmEmsElecPgIndex> util = new ExcelUtil<AdmEmsElecPgIndex>(AdmEmsElecPgIndex.class);
+        util.exportExcel(response, list, "电网设施指标数据");
+    }
+
+    /**
+     * 获取电网设施指标详细信息
+     */
+    @RequiresPermissions("ems:elecPgIndex:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(admEmsElecPgIndexService.selectAdmEmsElecPgIndexById(id));
+    }
+
+    /**
+     * 新增电网设施指标
+     */
+    @RequiresPermissions("ems:elecPgIndex:add")
+    @Log(title = "电网设施指标", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdmEmsElecPgIndex admEmsElecPgIndex)
+    {
+        return toAjax(admEmsElecPgIndexService.insertAdmEmsElecPgIndex(admEmsElecPgIndex));
+    }
+
+    /**
+     * 修改电网设施指标
+     */
+    @RequiresPermissions("ems:elecPgIndex:edit")
+    @Log(title = "电网设施指标", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdmEmsElecPgIndex admEmsElecPgIndex)
+    {
+        return toAjax(admEmsElecPgIndexService.updateAdmEmsElecPgIndex(admEmsElecPgIndex));
+    }
+
+    /**
+     * 删除电网设施指标
+     */
+    @RequiresPermissions("ems:elecPgIndex:remove")
+    @Log(title = "电网设施指标", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(admEmsElecPgIndexService.deleteAdmEmsElecPgIndexByIds(ids));
+    }
+}

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

@@ -0,0 +1,105 @@
+package com.ruoyi.ems.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.ems.domain.AdmEmsIndexRange;
+import com.ruoyi.ems.service.IAdmEmsIndexRangeService;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+
+/**
+ * 能源指标范围Controller
+ * 
+ * @author ruoyi
+ * @date 2024-08-30
+ */
+@RestController
+@RequestMapping("/indexRange")
+public class AdmEmsIndexRangeController extends BaseController
+{
+    @Autowired
+    private IAdmEmsIndexRangeService admEmsIndexRangeService;
+
+    /**
+     * 查询能源指标范围列表
+     */
+    @RequiresPermissions("ems:indexRange:list")
+    @GetMapping("/list")
+    public TableDataInfo list(AdmEmsIndexRange admEmsIndexRange)
+    {
+        startPage();
+        List<AdmEmsIndexRange> list = admEmsIndexRangeService.selectAdmEmsIndexRangeList(admEmsIndexRange);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出能源指标范围列表
+     */
+    @RequiresPermissions("ems:indexRange:export")
+    @Log(title = "能源指标范围", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, AdmEmsIndexRange admEmsIndexRange)
+    {
+        List<AdmEmsIndexRange> list = admEmsIndexRangeService.selectAdmEmsIndexRangeList(admEmsIndexRange);
+        ExcelUtil<AdmEmsIndexRange> util = new ExcelUtil<AdmEmsIndexRange>(AdmEmsIndexRange.class);
+        util.exportExcel(response, list, "能源指标范围数据");
+    }
+
+    /**
+     * 获取能源指标范围详细信息
+     */
+    @RequiresPermissions("ems:indexRange:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(admEmsIndexRangeService.selectAdmEmsIndexRangeById(id));
+    }
+
+    /**
+     * 新增能源指标范围
+     */
+    @RequiresPermissions("ems:indexRange:add")
+    @Log(title = "能源指标范围", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdmEmsIndexRange admEmsIndexRange)
+    {
+        return toAjax(admEmsIndexRangeService.insertAdmEmsIndexRange(admEmsIndexRange));
+    }
+
+    /**
+     * 修改能源指标范围
+     */
+    @RequiresPermissions("ems:indexRange:edit")
+    @Log(title = "能源指标范围", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdmEmsIndexRange admEmsIndexRange)
+    {
+        return toAjax(admEmsIndexRangeService.updateAdmEmsIndexRange(admEmsIndexRange));
+    }
+
+    /**
+     * 删除能源指标范围
+     */
+    @RequiresPermissions("ems:indexRange:remove")
+    @Log(title = "能源指标范围", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(admEmsIndexRangeService.deleteAdmEmsIndexRangeByIds(ids));
+    }
+}

+ 7 - 7
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmOpAlarmPolicyController.java

@@ -24,7 +24,7 @@ import com.ruoyi.common.core.web.page.TableDataInfo;
 
 /**
  * 能源设施告警策略Controller
- * 
+ *
  * @author ruoyi
  * @date 2024-08-26
  */
@@ -38,7 +38,7 @@ public class AdmOpAlarmPolicyController extends BaseController
     /**
      * 查询能源设施告警策略列表
      */
-    @RequiresPermissions("ems:alarm:list")
+    @RequiresPermissions("ems:alarm-strategy:list")
     @GetMapping("/list")
     public TableDataInfo list(AdmOpAlarmPolicy admOpAlarmPolicy)
     {
@@ -50,7 +50,7 @@ public class AdmOpAlarmPolicyController extends BaseController
     /**
      * 导出能源设施告警策略列表
      */
-    @RequiresPermissions("ems:alarm:export")
+    @RequiresPermissions("ems:alarm-strategy:export")
     @Log(title = "能源设施告警策略", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, AdmOpAlarmPolicy admOpAlarmPolicy)
@@ -63,7 +63,7 @@ public class AdmOpAlarmPolicyController extends BaseController
     /**
      * 获取能源设施告警策略详细信息
      */
-    @RequiresPermissions("ems:alarm:query")
+    @RequiresPermissions("ems:alarm-strategy:query")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -73,7 +73,7 @@ public class AdmOpAlarmPolicyController extends BaseController
     /**
      * 新增能源设施告警策略
      */
-    @RequiresPermissions("ems:alarm:add")
+    @RequiresPermissions("ems:alarm-strategy:add")
     @Log(title = "能源设施告警策略", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody AdmOpAlarmPolicy admOpAlarmPolicy)
@@ -84,7 +84,7 @@ public class AdmOpAlarmPolicyController extends BaseController
     /**
      * 修改能源设施告警策略
      */
-    @RequiresPermissions("ems:alarm:edit")
+    @RequiresPermissions("ems:alarm-strategy:edit")
     @Log(title = "能源设施告警策略", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody AdmOpAlarmPolicy admOpAlarmPolicy)
@@ -95,7 +95,7 @@ public class AdmOpAlarmPolicyController extends BaseController
     /**
      * 删除能源设施告警策略
      */
-    @RequiresPermissions("ems:alarm:remove")
+    @RequiresPermissions("ems:alarm-strategy:remove")
     @Log(title = "能源设施告警策略", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

+ 106 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmOpInspectionReportController.java

@@ -0,0 +1,106 @@
+package com.ruoyi.ems.controller;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.ems.domain.AdmOpInspectionReport;
+import com.ruoyi.ems.service.IAdmOpInspectionReportService;
+
+/**
+ * 巡检报告Controller
+ *
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+@RestController
+@RequestMapping("/inspectionReport")
+public class AdmOpInspectionReportController extends BaseController {
+    @Autowired
+    private IAdmOpInspectionReportService admOpInspectionReportService;
+
+    /**
+     * 查询巡检报告列表
+     */
+    @RequiresPermissions("ems:inspection-report:list")
+    @GetMapping("/list")
+    public TableDataInfo list(AdmOpInspectionReport admOpInspectionReport) {
+        startPage();
+        List<AdmOpInspectionReport> list = admOpInspectionReportService.selectAdmOpInspectionReportList(admOpInspectionReport);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出巡检报告列表
+     */
+    @RequiresPermissions("ems:inspection-report:export")
+    @Log(title = "巡检报告", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, AdmOpInspectionReport admOpInspectionReport) {
+        List<AdmOpInspectionReport> list = admOpInspectionReportService.selectAdmOpInspectionReportList(admOpInspectionReport);
+        ExcelUtil<AdmOpInspectionReport> util = new ExcelUtil<AdmOpInspectionReport>(AdmOpInspectionReport.class);
+        util.exportExcel(response, list, "巡检报告数据");
+    }
+
+    /**
+     * 获取巡检报告详细信息
+     */
+    @RequiresPermissions("ems:inspection-report:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(admOpInspectionReportService.selectAdmOpInspectionReportById(id));
+    }
+
+    /**
+     * 新增巡检报告
+     */
+    @RequiresPermissions("ems:inspection-report:add")
+    @Log(title = "巡检报告", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdmOpInspectionReport admOpInspectionReport) {
+        admOpInspectionReport.setSubTime(DateUtils.getNowDate());
+        admOpInspectionReport.setSubmitter(SecurityUtils.getUsername());
+        return toAjax(admOpInspectionReportService.insertAdmOpInspectionReport(admOpInspectionReport));
+    }
+
+    /**
+     * 修改巡检报告
+     */
+    @RequiresPermissions("ems:inspection-report:edit")
+    @Log(title = "巡检报告", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdmOpInspectionReport admOpInspectionReport) {
+        admOpInspectionReport.setSubTime(DateUtils.getNowDate());
+        admOpInspectionReport.setSubmitter(SecurityUtils.getUsername());
+        return toAjax(admOpInspectionReportService.updateAdmOpInspectionReport(admOpInspectionReport));
+    }
+
+    /**
+     * 删除巡检报告
+     */
+    @RequiresPermissions("ems:inspection-report:remove")
+    @Log(title = "巡检报告", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(admOpInspectionReportService.deleteAdmOpInspectionReportByIds(ids));
+    }
+}

+ 102 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AdmOpInspectionTaskController.java

@@ -0,0 +1,102 @@
+package com.ruoyi.ems.controller;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.utils.uuid.Seq;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.ems.domain.AdmOpInspectionTask;
+import com.ruoyi.ems.service.IAdmOpInspectionTaskService;
+
+/**
+ * 巡检任务Controller
+ *
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+@RestController
+@RequestMapping("/inspectionTask")
+public class AdmOpInspectionTaskController extends BaseController {
+    @Autowired
+    private IAdmOpInspectionTaskService admOpInspectionTaskService;
+
+    /**
+     * 查询巡检任务列表
+     */
+    @RequiresPermissions("ems:inspection-task:list")
+    @GetMapping("/list")
+    public TableDataInfo list(AdmOpInspectionTask admOpInspectionTask) {
+        startPage();
+        List<AdmOpInspectionTask> list = admOpInspectionTaskService.selectAdmOpInspectionTaskList(admOpInspectionTask);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出巡检任务列表
+     */
+    @RequiresPermissions("ems:inspection-task:export")
+    @Log(title = "巡检任务", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, AdmOpInspectionTask admOpInspectionTask) {
+        List<AdmOpInspectionTask> list = admOpInspectionTaskService.selectAdmOpInspectionTaskList(admOpInspectionTask);
+        ExcelUtil<AdmOpInspectionTask> util = new ExcelUtil<AdmOpInspectionTask>(AdmOpInspectionTask.class);
+        util.exportExcel(response, list, "巡检任务数据");
+    }
+
+    /**
+     * 获取巡检任务详细信息
+     */
+    @RequiresPermissions("ems:inspection-task:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(admOpInspectionTaskService.selectAdmOpInspectionTaskById(id));
+    }
+
+    /**
+     * 新增巡检任务
+     */
+    @RequiresPermissions("ems:inspection-task:add")
+    @Log(title = "巡检任务", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody AdmOpInspectionTask admOpInspectionTask) {
+        admOpInspectionTask.setTaskCode(Seq.getId());
+        return toAjax(admOpInspectionTaskService.insertAdmOpInspectionTask(admOpInspectionTask));
+    }
+
+    /**
+     * 修改巡检任务
+     */
+    @RequiresPermissions("ems:inspection-task:edit")
+    @Log(title = "巡检任务", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody AdmOpInspectionTask admOpInspectionTask) {
+        return toAjax(admOpInspectionTaskService.updateAdmOpInspectionTask(admOpInspectionTask));
+    }
+
+    /**
+     * 删除巡检任务
+     */
+    @RequiresPermissions("ems:inspection-task:remove")
+    @Log(title = "巡检任务", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(admOpInspectionTaskService.deleteAdmOpInspectionTaskByIds(ids));
+    }
+}

+ 4 - 4
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/AreaController.java

@@ -65,7 +65,7 @@ public class AreaController extends BaseController {
      * 导出服务区列表
      */
     @RequiresPermissions("basecfg:area:export")
-    @Log(title = "服务区", businessType = BusinessType.EXPORT)
+    @Log(title = "区块划分", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, Area area) {
         List<Area> list = areaService.selectAreaList(area);
@@ -110,7 +110,7 @@ public class AreaController extends BaseController {
      * 新增服务区
      */
     @RequiresPermissions("basecfg:area:add")
-    @Log(title = "服务区", businessType = BusinessType.INSERT)
+    @Log(title = "区块划分", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody Area area) {
         return toAjax(areaService.insertArea(area));
@@ -120,7 +120,7 @@ public class AreaController extends BaseController {
      * 修改服务区
      */
     @RequiresPermissions("basecfg:area:edit")
-    @Log(title = "服务区", businessType = BusinessType.UPDATE)
+    @Log(title = "区块划分", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody Area area) {
         return toAjax(areaService.updateArea(area));
@@ -130,7 +130,7 @@ public class AreaController extends BaseController {
      * 删除服务区
      */
     @RequiresPermissions("basecfg:area:remove")
-    @Log(title = "服务区", businessType = BusinessType.DELETE)
+    @Log(title = "区块划分", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(areaService.deleteAreaByIds(ids));

+ 4 - 4
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/ElecAttrController.java

@@ -54,7 +54,7 @@ public class ElecAttrController extends BaseController {
      * 导出服务区用电属性列表
      */
     @RequiresPermissions("basecfg:price:export")
-    @Log(title = "导出服务区用电属性", businessType = BusinessType.EXPORT)
+    @Log(title = "服务区用电属性", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, ElecAttr areaElectricityAttr) {
         List<ElecAttr> list = attrService.selectElecAttrList(areaElectricityAttr);
@@ -75,7 +75,7 @@ public class ElecAttrController extends BaseController {
      * 新增服务区用电属性
      */
     @RequiresPermissions("basecfg:price:add")
-    @Log(title = "新增服务区用电属性", businessType = BusinessType.INSERT)
+    @Log(title = "服务区用电属性", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody ElecAttr areaElectricityAttr) {
         return toAjax(attrService.insertElecAttr(areaElectricityAttr));
@@ -85,7 +85,7 @@ public class ElecAttrController extends BaseController {
      * 修改服务区用电属性
      */
     @RequiresPermissions("basecfg:price:edit")
-    @Log(title = "更新服务区用电属性", businessType = BusinessType.UPDATE)
+    @Log(title = "服务区用电属性", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody ElecAttr areaElectricityAttr) {
         return toAjax(attrService.updateElecAttr(areaElectricityAttr));
@@ -95,7 +95,7 @@ public class ElecAttrController extends BaseController {
      * 删除服务区用电属性
      */
     @RequiresPermissions("basecfg:price:remove")
-    @Log(title = "删除服务区用电属性", businessType = BusinessType.DELETE)
+    @Log(title = "服务区用电属性", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(attrService.deleteElecAttrByIds(ids));

+ 1 - 2
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/EmsSubsystemController.java

@@ -25,7 +25,7 @@ import java.util.List;
 
 /**
  * 能源子系统Controller
- * 
+ *
  * @author ruoyi
  * @date 2024-08-16
  */
@@ -40,7 +40,6 @@ public class EmsSubsystemController extends BaseController
     /**
      * 查询能源子系统列表
      */
-    @RequiresPermissions("adapter:subsystem:list")
     @GetMapping("/list")
     public TableDataInfo list(EmsSubsystem emsSubsystem)
     {

+ 71 - 4
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/controller/MeterReadingManualController.java

@@ -5,11 +5,19 @@ import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.ems.domain.MeterDevice;
 import com.ruoyi.ems.domain.MeterReadingManual;
 import com.ruoyi.ems.domain.vo.QueryMeterReading;
+import com.ruoyi.ems.service.IMeterDeviceService;
 import com.ruoyi.ems.service.IMeterReadingManualService;
+import com.ruoyi.ems.util.DateUtils;
+import com.ruoyi.ems.util.exception.Assert;
+import com.ruoyi.ems.util.exception.BusinessException;
+import io.swagger.annotations.Api;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -17,6 +25,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.time.Year;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -27,10 +37,14 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/meterReading")
+@Api(value = "MeterReadingManualController", description = "手动抄表管理")
 public class MeterReadingManualController extends BaseController {
     @Autowired
     private IMeterReadingManualService meterReadingManualService;
 
+    @Autowired
+    private IMeterDeviceService meterDeviceService;
+
     /**
      * 查询手动抄记录列表
      */
@@ -55,8 +69,15 @@ public class MeterReadingManualController extends BaseController {
     @RequiresPermissions("ems:meterReading:add")
     @Log(title = "手动抄记录", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody MeterReadingManual meterReadingManual) {
-        return toAjax(meterReadingManualService.insert(meterReadingManual));
+    public AjaxResult add(@RequestBody MeterReadingManual meterRec) {
+        try {
+            fillData(meterRec);
+            int count = meterReadingManualService.insert(meterRec);
+            return toAjax(count);
+        }
+        catch (BusinessException e) {
+            return error(e.getMessage());
+        }
     }
 
     /**
@@ -65,7 +86,53 @@ public class MeterReadingManualController extends BaseController {
     @RequiresPermissions("ems:meterReading:edit")
     @Log(title = "手动抄记录", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody MeterReadingManual meterReadingManual) {
-        return toAjax(meterReadingManualService.update(meterReadingManual));
+    public AjaxResult edit(@RequestBody MeterReadingManual meterRec) {
+        try {
+            MeterReadingManual dbItem = meterReadingManualService.selectById(meterRec.getId());
+            Assert.notNull(dbItem, -1, "该记录不存在");
+            meterReadingManualService.deleteById(meterRec.getId());
+            dbItem.setMeterReading(meterRec.getMeterReading());
+            fillData(meterRec);
+            int count = meterReadingManualService.insert(meterRec);
+            return toAjax(count);
+        }
+        catch (BusinessException e) {
+            return error(e.getMessage());
+        }
+    }
+
+    /**
+     * 删除动力箱柜
+     */
+    @RequiresPermissions("ems:meterReading:remove")
+    @Log(title = "手动抄记录", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{id}")
+    public AjaxResult remove(@PathVariable Long id) {
+        return toAjax(meterReadingManualService.deleteById(id));
+    }
+
+    private void fillData(MeterReadingManual meterRec) {
+        MeterReadingManual lastItem = meterReadingManualService.selectLastItem(meterRec.getAreaCode(),
+            meterRec.getDeviceCode());
+        MeterDevice meterDevice = meterDeviceService.selectMeterDeviceByCode(meterRec.getAreaCode(),
+            meterRec.getDeviceCode());
+        Date date = new Date();
+
+        if (null != lastItem) {
+            Assert.isTrue(meterRec.getMeterReading() >= lastItem.getMeterReading(), -1, "抄表值不能小于上一条记录");
+            meterRec.setYear(DateUtils.dateToString(date, "yyyy"));
+            meterRec.setMeterMonth(DateUtils.dateToString(date, "yyyyMM"));
+            meterRec.setLastReading(lastItem.getMeterReading());
+            meterRec.setLastTime(lastItem.getMeterTime());
+            meterRec.setMeterTime(date);
+            meterRec.setIncrease(
+                (meterRec.getMeterReading() - lastItem.getMeterReading()) * meterDevice.getMagnification());
+        }
+        else {
+            meterRec.setYear(DateUtils.dateToString(date, "yyyy"));
+            meterRec.setMeterMonth(DateUtils.dateToString(date, "yyyyMM"));
+            meterRec.setMeterTime(date);
+            meterRec.setIncrease(meterRec.getMeterReading() * meterDevice.getMagnification());
+        }
     }
 }

+ 139 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmEmsElecPgIndex.java

@@ -0,0 +1,139 @@
+package com.ruoyi.ems.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 电网设施指标对象 adm_ems_elec_pg_index
+ * 
+ * @author ruoyi
+ * @date 2024-08-30
+ */
+public class AdmEmsElecPgIndex extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 园区代码 */
+    @Excel(name = "园区代码")
+    private String areaCode;
+
+    /** 设施代码 */
+    @Excel(name = "设施代码")
+    private String facsCode;
+
+    /** 日期 yyyy-MM-dd */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "日期 yyyy-MM-dd", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date date;
+
+    /** 时间 yyyy-MM-dd HH:mm:ss */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "时间 yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date time;
+
+    /** 电压 单位:kV(千伏) */
+    @Excel(name = "电压 单位:kV", readConverterExp = "千=伏")
+    private Double voltage;
+
+    /** 电流 单位:A(安培) */
+    @Excel(name = "电流 单位:A", readConverterExp = "安=培")
+    private Double electricity;
+
+    /** 功率 单位:kW(千瓦) */
+    @Excel(name = "功率 单位:kW", readConverterExp = "千=瓦")
+    private Double power;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setAreaCode(String areaCode) 
+    {
+        this.areaCode = areaCode;
+    }
+
+    public String getAreaCode() 
+    {
+        return areaCode;
+    }
+    public void setFacsCode(String facsCode) 
+    {
+        this.facsCode = facsCode;
+    }
+
+    public String getFacsCode() 
+    {
+        return facsCode;
+    }
+    public void setDate(Date date) 
+    {
+        this.date = date;
+    }
+
+    public Date getDate() 
+    {
+        return date;
+    }
+    public void setTime(Date time) 
+    {
+        this.time = time;
+    }
+
+    public Date getTime() 
+    {
+        return time;
+    }
+    public void setVoltage(Double voltage) 
+    {
+        this.voltage = voltage;
+    }
+
+    public Double getVoltage() 
+    {
+        return voltage;
+    }
+    public void setElectricity(Double electricity) 
+    {
+        this.electricity = electricity;
+    }
+
+    public Double getElectricity() 
+    {
+        return electricity;
+    }
+    public void setPower(Double power) 
+    {
+        this.power = power;
+    }
+
+    public Double getPower() 
+    {
+        return power;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("areaCode", getAreaCode())
+            .append("facsCode", getFacsCode())
+            .append("date", getDate())
+            .append("time", getTime())
+            .append("voltage", getVoltage())
+            .append("electricity", getElectricity())
+            .append("power", getPower())
+            .toString();
+    }
+}

+ 129 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmEmsIndexRange.java

@@ -0,0 +1,129 @@
+package com.ruoyi.ems.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 能源指标范围对象 adm_ems_index_range
+ *
+ * @author ruoyi
+ * @date 2024-08-30
+ */
+public class AdmEmsIndexRange extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 序号
+     */
+    private Long id;
+
+    /**
+     * 对象代码
+     */
+    @Excel(name = "对象代码")
+    private String objCode;
+
+    /**
+     * 对象类型
+     */
+    @Excel(name = "对象类型")
+    private Integer objType;
+
+    /**
+     * 指标名称
+     */
+    @Excel(name = "指标名称")
+    private String indexName;
+
+    /**
+     * 指标描述
+     */
+    @Excel(name = "指标描述")
+    private String indexDesc;
+
+    /**
+     * 指标上限
+     */
+    @Excel(name = "指标上限")
+    private Double indexUpperLimit;
+
+    /**
+     * 指标下限
+     */
+    @Excel(name = "指标下限")
+    private Double indexLowerLimit;
+
+    private String facsType;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setObjCode(String objCode) {
+        this.objCode = objCode;
+    }
+
+    public String getObjCode() {
+        return objCode;
+    }
+
+    public void setObjType(Integer objType) {
+        this.objType = objType;
+    }
+
+    public Integer getObjType() {
+        return objType;
+    }
+
+    public void setIndexName(String indexName) {
+        this.indexName = indexName;
+    }
+
+    public String getIndexName() {
+        return indexName;
+    }
+
+    public void setIndexDesc(String indexDesc) {
+        this.indexDesc = indexDesc;
+    }
+
+    public String getIndexDesc() {
+        return indexDesc;
+    }
+
+    public void setIndexUpperLimit(Double indexUpperLimit) {
+        this.indexUpperLimit = indexUpperLimit;
+    }
+
+    public Double getIndexUpperLimit() {
+        return indexUpperLimit;
+    }
+
+    public void setIndexLowerLimit(Double indexLowerLimit) {
+        this.indexLowerLimit = indexLowerLimit;
+    }
+
+    public Double getIndexLowerLimit() {
+        return indexLowerLimit;
+    }
+
+    public String getFacsType() {
+        return facsType;
+    }
+
+    public void setFacsType(String facsType) {
+        this.facsType = facsType;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId()).append("objCode", getObjCode()).append("objType", getObjType()).append("indexName", getIndexName()).append("indexDesc", getIndexDesc()).append("indexUpperLimit", getIndexUpperLimit()).append("indexLowerLimit", getIndexLowerLimit()).toString();
+    }
+}

+ 125 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmOpInspectionReport.java

@@ -0,0 +1,125 @@
+package com.ruoyi.ems.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 巡检报告对象 adm_op_inspection_report
+ * 
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+public class AdmOpInspectionReport extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 任务代码 */
+    @Excel(name = "任务代码")
+    private String taskCode;
+
+    /** 结果状态 */
+    @Excel(name = "结果状态")
+    private Integer resultStatus;
+
+    /** 结果描述 */
+    @Excel(name = "结果描述")
+    private String resultMsg;
+
+    /** 完成时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date finishTime;
+
+    /** 提交时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "提交时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date subTime;
+
+    /** 提交人 */
+    @Excel(name = "提交人")
+    private String submitter;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setTaskCode(String taskCode) 
+    {
+        this.taskCode = taskCode;
+    }
+
+    public String getTaskCode() 
+    {
+        return taskCode;
+    }
+    public void setResultStatus(Integer resultStatus) 
+    {
+        this.resultStatus = resultStatus;
+    }
+
+    public Integer getResultStatus() 
+    {
+        return resultStatus;
+    }
+    public void setResultMsg(String resultMsg) 
+    {
+        this.resultMsg = resultMsg;
+    }
+
+    public String getResultMsg() 
+    {
+        return resultMsg;
+    }
+    public void setFinishTime(Date finishTime) 
+    {
+        this.finishTime = finishTime;
+    }
+
+    public Date getFinishTime() 
+    {
+        return finishTime;
+    }
+    public void setSubTime(Date subTime) 
+    {
+        this.subTime = subTime;
+    }
+
+    public Date getSubTime() 
+    {
+        return subTime;
+    }
+    public void setSubmitter(String submitter) 
+    {
+        this.submitter = submitter;
+    }
+
+    public String getSubmitter() 
+    {
+        return submitter;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("taskCode", getTaskCode())
+            .append("resultStatus", getResultStatus())
+            .append("resultMsg", getResultMsg())
+            .append("finishTime", getFinishTime())
+            .append("subTime", getSubTime())
+            .append("submitter", getSubmitter())
+            .toString();
+    }
+}

+ 180 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/AdmOpInspectionTask.java

@@ -0,0 +1,180 @@
+package com.ruoyi.ems.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 巡检任务对象 adm_op_inspection_task
+ *
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+public class AdmOpInspectionTask extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 序号 */
+    private Long id;
+
+    /** 任务代码 */
+    @Excel(name = "任务代码")
+    private String taskCode;
+
+    /** 任务名称 */
+    @Excel(name = "任务名称")
+    private String taskName;
+
+    /** 任务类型 */
+    @Excel(name = "任务类型")
+    private Integer taskType;
+
+    /** 任务状态 */
+    @Excel(name = "任务状态")
+    private Integer taskStatus;
+
+    /** 开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startTime;
+
+    /** 结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date endTime;
+
+    /** 执行人 */
+    @Excel(name = "执行人")
+    private String executor;
+
+    /** 巡检对象 */
+    @Excel(name = "巡检对象")
+    private Integer objType;
+
+    /** 选择巡检对象 */
+    private String objCode;
+
+    /** 对象名称 */
+    @Excel(name = "对象名称")
+    private String objName;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setTaskCode(String taskCode)
+    {
+        this.taskCode = taskCode;
+    }
+
+    public String getTaskCode()
+    {
+        return taskCode;
+    }
+    public void setTaskName(String taskName)
+    {
+        this.taskName = taskName;
+    }
+
+    public String getTaskName()
+    {
+        return taskName;
+    }
+    public void setTaskType(Integer taskType)
+    {
+        this.taskType = taskType;
+    }
+
+    public Integer getTaskType()
+    {
+        return taskType;
+    }
+    public void setTaskStatus(Integer taskStatus)
+    {
+        this.taskStatus = taskStatus;
+    }
+
+    public Integer getTaskStatus()
+    {
+        return taskStatus;
+    }
+    public void setStartTime(Date startTime)
+    {
+        this.startTime = startTime;
+    }
+
+    public Date getStartTime()
+    {
+        return startTime;
+    }
+    public void setEndTime(Date endTime)
+    {
+        this.endTime = endTime;
+    }
+
+    public Date getEndTime()
+    {
+        return endTime;
+    }
+    public void setExecutor(String executor)
+    {
+        this.executor = executor;
+    }
+
+    public String getExecutor()
+    {
+        return executor;
+    }
+    public void setObjType(Integer objType)
+    {
+        this.objType = objType;
+    }
+
+    public Integer getObjType()
+    {
+        return objType;
+    }
+    public void setObjCode(String objCode)
+    {
+        this.objCode = objCode;
+    }
+
+    public String getObjCode()
+    {
+        return objCode;
+    }
+    public void setObjName(String objName)
+    {
+        this.objName = objName;
+    }
+
+    public String getObjName()
+    {
+        return objName;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("taskCode", getTaskCode())
+            .append("taskName", getTaskName())
+            .append("taskType", getTaskType())
+            .append("taskStatus", getTaskStatus())
+            .append("startTime", getStartTime())
+            .append("endTime", getEndTime())
+            .append("executor", getExecutor())
+            .append("objType", getObjType())
+            .append("objCode", getObjCode())
+            .append("objName", getObjName())
+            .toString();
+    }
+}

+ 20 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/MeterDevice.java

@@ -39,8 +39,12 @@ public class MeterDevice extends BaseEntity
     /** 计量对象编码 */
     private String objCode;
 
+    /** 计量对象名称 */
     private String objName;
 
+    /** 计量对象标记 */
+    private Integer objTag;
+
     /** 采集周期 */
     private Long colCycle;
 
@@ -117,6 +121,14 @@ public class MeterDevice extends BaseEntity
         this.objName = objName;
     }
 
+    public Integer getObjTag() {
+        return objTag;
+    }
+
+    public void setObjTag(Integer objTag) {
+        this.objTag = objTag;
+    }
+
     public Long getColCycle() {
         return colCycle;
     }
@@ -148,4 +160,12 @@ public class MeterDevice extends BaseEntity
     public void setSpecDesc(String specDesc) {
         this.specDesc = specDesc;
     }
+
+    @Override
+    public String toString() {
+        return "MeterDevice{" + "id=" + id + ", deviceCode='" + deviceCode + '\'' + ", areaCode='" + areaCode + '\''
+            + ", meterCls=" + meterCls + ", objType=" + objType + ", objSubType=" + objSubType + ", objCode='" + objCode
+            + '\'' + ", objName='" + objName + '\'' + ", objTag='" + objTag + '\'' + ", colCycle=" + colCycle
+            + ", colMode=" + colMode + ", magnification=" + magnification + ", specDesc='" + specDesc + '\'' + '}';
+    }
 }

+ 6 - 5
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/MeterReadingManual.java

@@ -1,11 +1,12 @@
 package com.ruoyi.ems.domain;
 
-import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.core.annotation.Excel;
 import com.ruoyi.common.core.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
 
 /**
  * 手动抄记录对象 adm_meter_reading_manual
@@ -85,12 +86,12 @@ public class MeterReadingManual extends BaseEntity
     {
         return areaCode;
     }
-    public void setYear(String year) 
+    public void setYear(String year)
     {
         this.year = year;
     }
 
-    public String getYear() 
+    public String getYear()
     {
         return year;
     }

+ 13 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/vo/QueryMeterReading.java

@@ -35,6 +35,11 @@ public class QueryMeterReading {
     /** 结束月份 */
     private String endMonth;
 
+    /**
+     * 排序方式
+     */
+    private String orderFlag = "ASC";
+
     public String getAreaCode() {
         return areaCode;
     }
@@ -74,4 +79,12 @@ public class QueryMeterReading {
     public void setEndMonth(String endMonth) {
         this.endMonth = endMonth;
     }
+
+    public String getOrderFlag() {
+        return orderFlag;
+    }
+
+    public void setOrderFlag(String orderFlag) {
+        this.orderFlag = orderFlag;
+    }
 }

+ 69 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmEmsElecPgIndexMapper.java

@@ -0,0 +1,69 @@
+package com.ruoyi.ems.mapper;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ibatis.annotations.MapKey;
+import org.apache.ibatis.annotations.Param;
+
+import com.ruoyi.ems.domain.AdmEmsElecPgIndex;
+
+/**
+ * 电网设施指标Mapper接口
+ *
+ * @author ruoyi
+ * @date 2024-08-30
+ */
+public interface AdmEmsElecPgIndexMapper {
+    /**
+     * 查询电网设施指标
+     *
+     * @param id 电网设施指标主键
+     * @return 电网设施指标
+     */
+    public AdmEmsElecPgIndex selectAdmEmsElecPgIndexById(Long id);
+
+    /**
+     * 查询电网设施指标列表
+     *
+     * @param admEmsElecPgIndex 电网设施指标
+     * @return 电网设施指标集合
+     */
+    public List<AdmEmsElecPgIndex> selectAdmEmsElecPgIndexList(AdmEmsElecPgIndex admEmsElecPgIndex);
+
+    /**
+     * 新增电网设施指标
+     *
+     * @param admEmsElecPgIndex 电网设施指标
+     * @return 结果
+     */
+    public int insertAdmEmsElecPgIndex(AdmEmsElecPgIndex admEmsElecPgIndex);
+
+    /**
+     * 修改电网设施指标
+     *
+     * @param admEmsElecPgIndex 电网设施指标
+     * @return 结果
+     */
+    public int updateAdmEmsElecPgIndex(AdmEmsElecPgIndex admEmsElecPgIndex);
+
+    /**
+     * 删除电网设施指标
+     *
+     * @param id 电网设施指标主键
+     * @return 结果
+     */
+    public int deleteAdmEmsElecPgIndexById(Long id);
+
+    /**
+     * 批量删除电网设施指标
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAdmEmsElecPgIndexByIds(Long[] ids);
+
+
+    @MapKey("facsCode")
+    Map<String, Map<String, Object>> qryLatestObjIndex(@Param("set") List<String> set);
+}

+ 64 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmEmsIndexRangeMapper.java

@@ -0,0 +1,64 @@
+package com.ruoyi.ems.mapper;
+
+import java.util.List;
+import java.util.Map;
+
+import com.ruoyi.ems.domain.AdmEmsIndexRange;
+
+/**
+ * 能源指标范围Mapper接口
+ *
+ * @author ruoyi
+ * @date 2024-08-30
+ */
+public interface AdmEmsIndexRangeMapper {
+    /**
+     * 查询能源指标范围
+     *
+     * @param id 能源指标范围主键
+     * @return 能源指标范围
+     */
+    public AdmEmsIndexRange selectAdmEmsIndexRangeById(Long id);
+
+    /**
+     * 查询能源指标范围列表
+     *
+     * @param admEmsIndexRange 能源指标范围
+     * @return 能源指标范围集合
+     */
+    public List<AdmEmsIndexRange> selectAdmEmsIndexRangeList(AdmEmsIndexRange admEmsIndexRange);
+
+    /**
+     * 新增能源指标范围
+     *
+     * @param admEmsIndexRange 能源指标范围
+     * @return 结果
+     */
+    public int insertAdmEmsIndexRange(AdmEmsIndexRange admEmsIndexRange);
+
+    /**
+     * 修改能源指标范围
+     *
+     * @param admEmsIndexRange 能源指标范围
+     * @return 结果
+     */
+    public int updateAdmEmsIndexRange(AdmEmsIndexRange admEmsIndexRange);
+
+    /**
+     * 删除能源指标范围
+     *
+     * @param id 能源指标范围主键
+     * @return 结果
+     */
+    public int deleteAdmEmsIndexRangeById(Long id);
+
+    /**
+     * 批量删除能源指标范围
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAdmEmsIndexRangeByIds(Long[] ids);
+
+    public List<Map<String, Object>> selectAdmEmsIndexRange();
+}

+ 61 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmOpInspectionReportMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.ems.mapper;
+
+import java.util.List;
+import com.ruoyi.ems.domain.AdmOpInspectionReport;
+
+/**
+ * 巡检报告Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+public interface AdmOpInspectionReportMapper 
+{
+    /**
+     * 查询巡检报告
+     * 
+     * @param id 巡检报告主键
+     * @return 巡检报告
+     */
+    public AdmOpInspectionReport selectAdmOpInspectionReportById(Long id);
+
+    /**
+     * 查询巡检报告列表
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 巡检报告集合
+     */
+    public List<AdmOpInspectionReport> selectAdmOpInspectionReportList(AdmOpInspectionReport admOpInspectionReport);
+
+    /**
+     * 新增巡检报告
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 结果
+     */
+    public int insertAdmOpInspectionReport(AdmOpInspectionReport admOpInspectionReport);
+
+    /**
+     * 修改巡检报告
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 结果
+     */
+    public int updateAdmOpInspectionReport(AdmOpInspectionReport admOpInspectionReport);
+
+    /**
+     * 删除巡检报告
+     * 
+     * @param id 巡检报告主键
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionReportById(Long id);
+
+    /**
+     * 批量删除巡检报告
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionReportByIds(Long[] ids);
+}

+ 61 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/AdmOpInspectionTaskMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.ems.mapper;
+
+import java.util.List;
+import com.ruoyi.ems.domain.AdmOpInspectionTask;
+
+/**
+ * 巡检任务Mapper接口
+ *
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+public interface AdmOpInspectionTaskMapper
+{
+    /**
+     * 查询巡检任务
+     *
+     * @param id 巡检任务主键
+     * @return 巡检任务
+     */
+    public AdmOpInspectionTask selectAdmOpInspectionTaskById(Long id);
+
+    /**
+     * 查询巡检任务列表
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 巡检任务集合
+     */
+    public List<AdmOpInspectionTask> selectAdmOpInspectionTaskList(AdmOpInspectionTask admOpInspectionTask);
+
+    /**
+     * 新增巡检任务
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 结果
+     */
+    public int insertAdmOpInspectionTask(AdmOpInspectionTask admOpInspectionTask);
+
+    /**
+     * 修改巡检任务
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 结果
+     */
+    public int updateAdmOpInspectionTask(AdmOpInspectionTask admOpInspectionTask);
+
+    /**
+     * 删除巡检任务
+     *
+     * @param id 巡检任务主键
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionTaskById(Long id);
+
+    /**
+     * 批量删除巡检任务
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionTaskByIds(Long[] ids);
+}

+ 11 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/MeterDeviceMapper.java

@@ -1,7 +1,9 @@
 package com.ruoyi.ems.mapper;
 
 import java.util.List;
+
 import com.ruoyi.ems.domain.MeterDevice;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 计量设备Mapper接口
@@ -19,6 +21,15 @@ public interface MeterDeviceMapper {
     MeterDevice selectMeterDeviceById(Long id);
 
     /**
+     * 查询计量设备
+     *
+     * @param areaCode   区域code
+     * @param deviceCode 设备code
+     * @return 计量设备
+     */
+    MeterDevice selectMeterDeviceByCode(@Param("areaCode") String areaCode, @Param("deviceCode") String deviceCode);
+
+    /**
      * 查询计量设备列表
      *
      * @param meterDevice 计量设备

+ 8 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/mapper/MeterReadingManualMapper.java

@@ -16,6 +16,14 @@ public interface MeterReadingManualMapper {
     /**
      * 查询手动抄记录列表
      *
+     * @param id   区域编码
+     * @return 手动抄记录集合
+     */
+    MeterReadingManual selectById(@Param("id") Long id);
+
+    /**
+     * 查询手动抄记录列表
+     *
      * @param areaCode   区域编码
      * @param deviceCode 设备编码
      * @return 手动抄记录集合

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

@@ -0,0 +1,61 @@
+package com.ruoyi.ems.service;
+
+import java.util.List;
+import com.ruoyi.ems.domain.AdmEmsElecPgIndex;
+
+/**
+ * 电网设施指标Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-08-30
+ */
+public interface IAdmEmsElecPgIndexService 
+{
+    /**
+     * 查询电网设施指标
+     * 
+     * @param id 电网设施指标主键
+     * @return 电网设施指标
+     */
+    public AdmEmsElecPgIndex selectAdmEmsElecPgIndexById(Long id);
+
+    /**
+     * 查询电网设施指标列表
+     * 
+     * @param admEmsElecPgIndex 电网设施指标
+     * @return 电网设施指标集合
+     */
+    public List<AdmEmsElecPgIndex> selectAdmEmsElecPgIndexList(AdmEmsElecPgIndex admEmsElecPgIndex);
+
+    /**
+     * 新增电网设施指标
+     * 
+     * @param admEmsElecPgIndex 电网设施指标
+     * @return 结果
+     */
+    public int insertAdmEmsElecPgIndex(AdmEmsElecPgIndex admEmsElecPgIndex);
+
+    /**
+     * 修改电网设施指标
+     * 
+     * @param admEmsElecPgIndex 电网设施指标
+     * @return 结果
+     */
+    public int updateAdmEmsElecPgIndex(AdmEmsElecPgIndex admEmsElecPgIndex);
+
+    /**
+     * 批量删除电网设施指标
+     * 
+     * @param ids 需要删除的电网设施指标主键集合
+     * @return 结果
+     */
+    public int deleteAdmEmsElecPgIndexByIds(Long[] ids);
+
+    /**
+     * 删除电网设施指标信息
+     * 
+     * @param id 电网设施指标主键
+     * @return 结果
+     */
+    public int deleteAdmEmsElecPgIndexById(Long id);
+}

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

@@ -0,0 +1,61 @@
+package com.ruoyi.ems.service;
+
+import java.util.List;
+import com.ruoyi.ems.domain.AdmEmsIndexRange;
+
+/**
+ * 能源指标范围Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-08-30
+ */
+public interface IAdmEmsIndexRangeService 
+{
+    /**
+     * 查询能源指标范围
+     * 
+     * @param id 能源指标范围主键
+     * @return 能源指标范围
+     */
+    public AdmEmsIndexRange selectAdmEmsIndexRangeById(Long id);
+
+    /**
+     * 查询能源指标范围列表
+     * 
+     * @param admEmsIndexRange 能源指标范围
+     * @return 能源指标范围集合
+     */
+    public List<AdmEmsIndexRange> selectAdmEmsIndexRangeList(AdmEmsIndexRange admEmsIndexRange);
+
+    /**
+     * 新增能源指标范围
+     * 
+     * @param admEmsIndexRange 能源指标范围
+     * @return 结果
+     */
+    public int insertAdmEmsIndexRange(AdmEmsIndexRange admEmsIndexRange);
+
+    /**
+     * 修改能源指标范围
+     * 
+     * @param admEmsIndexRange 能源指标范围
+     * @return 结果
+     */
+    public int updateAdmEmsIndexRange(AdmEmsIndexRange admEmsIndexRange);
+
+    /**
+     * 批量删除能源指标范围
+     * 
+     * @param ids 需要删除的能源指标范围主键集合
+     * @return 结果
+     */
+    public int deleteAdmEmsIndexRangeByIds(Long[] ids);
+
+    /**
+     * 删除能源指标范围信息
+     * 
+     * @param id 能源指标范围主键
+     * @return 结果
+     */
+    public int deleteAdmEmsIndexRangeById(Long id);
+}

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

@@ -0,0 +1,61 @@
+package com.ruoyi.ems.service;
+
+import java.util.List;
+import com.ruoyi.ems.domain.AdmOpInspectionReport;
+
+/**
+ * 巡检报告Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+public interface IAdmOpInspectionReportService 
+{
+    /**
+     * 查询巡检报告
+     * 
+     * @param id 巡检报告主键
+     * @return 巡检报告
+     */
+    public AdmOpInspectionReport selectAdmOpInspectionReportById(Long id);
+
+    /**
+     * 查询巡检报告列表
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 巡检报告集合
+     */
+    public List<AdmOpInspectionReport> selectAdmOpInspectionReportList(AdmOpInspectionReport admOpInspectionReport);
+
+    /**
+     * 新增巡检报告
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 结果
+     */
+    public int insertAdmOpInspectionReport(AdmOpInspectionReport admOpInspectionReport);
+
+    /**
+     * 修改巡检报告
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 结果
+     */
+    public int updateAdmOpInspectionReport(AdmOpInspectionReport admOpInspectionReport);
+
+    /**
+     * 批量删除巡检报告
+     * 
+     * @param ids 需要删除的巡检报告主键集合
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionReportByIds(Long[] ids);
+
+    /**
+     * 删除巡检报告信息
+     * 
+     * @param id 巡检报告主键
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionReportById(Long id);
+}

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

@@ -0,0 +1,61 @@
+package com.ruoyi.ems.service;
+
+import java.util.List;
+import com.ruoyi.ems.domain.AdmOpInspectionTask;
+
+/**
+ * 巡检任务Service接口
+ *
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+public interface IAdmOpInspectionTaskService
+{
+    /**
+     * 查询巡检任务
+     *
+     * @param id 巡检任务主键
+     * @return 巡检任务
+     */
+    public AdmOpInspectionTask selectAdmOpInspectionTaskById(Long id);
+
+    /**
+     * 查询巡检任务列表
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 巡检任务集合
+     */
+    public List<AdmOpInspectionTask> selectAdmOpInspectionTaskList(AdmOpInspectionTask admOpInspectionTask);
+
+    /**
+     * 新增巡检任务
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 结果
+     */
+    public int insertAdmOpInspectionTask(AdmOpInspectionTask admOpInspectionTask);
+
+    /**
+     * 修改巡检任务
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 结果
+     */
+    public int updateAdmOpInspectionTask(AdmOpInspectionTask admOpInspectionTask);
+
+    /**
+     * 批量删除巡检任务
+     *
+     * @param ids 需要删除的巡检任务主键集合
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionTaskByIds(Long[] ids);
+
+    /**
+     * 删除巡检任务信息
+     *
+     * @param id 巡检任务主键
+     * @return 结果
+     */
+    public int deleteAdmOpInspectionTaskById(Long id);
+}

+ 21 - 14
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IMeterDeviceService.java

@@ -6,57 +6,64 @@ import java.util.List;
 
 /**
  * 计量设备Service接口
- * 
+ *
  * @author ruoyi
  * @date 2024-08-08
  */
-public interface IMeterDeviceService
-{
+public interface IMeterDeviceService {
     /**
      * 查询计量设备
-     * 
+     *
      * @param id 计量设备主键
      * @return 计量设备
      */
     MeterDevice selectMeterDeviceById(Long id);
 
     /**
+     * 查询计量设备
+     * @param areaCode 区域code
+     * @param deviceCode 设备code
+     * @return 计量设备
+     */
+    MeterDevice selectMeterDeviceByCode(String areaCode, String deviceCode);
+
+    /**
      * 查询计量设备列表
-     * 
+     *
      * @param meterDevice 计量设备
      * @return 计量设备集合
      */
-     List<MeterDevice> selectMeterDeviceList(MeterDevice meterDevice);
+    List<MeterDevice> selectMeterDeviceList(MeterDevice meterDevice);
 
     /**
      * 新增计量设备
-     * 
+     *
      * @param meterDevice 计量设备
      * @return 结果
      */
-     int insertMeterDevice(MeterDevice meterDevice);
+    int insertMeterDevice(MeterDevice meterDevice);
 
     /**
      * 修改计量设备
-     * 
+     *
      * @param meterDevice 计量设备
      * @return 结果
      */
-     int updateMeterDevice(MeterDevice meterDevice);
+    int updateMeterDevice(MeterDevice meterDevice);
 
     /**
      * 批量删除计量设备
-     * 
+     *
      * @param ids 需要删除的计量设备主键集合
      * @return 结果
      */
-     int deleteMeterDeviceByIds(Long[] ids);
+    int deleteMeterDeviceByIds(Long[] ids);
 
     /**
      * 删除计量设备信息
-     * 
+     *
      * @param id 计量设备主键
      * @return 结果
      */
-     int deleteMeterDeviceById(Long id);
+    int deleteMeterDeviceById(Long id);
 }

+ 2 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/IMeterReadingManualService.java

@@ -13,6 +13,8 @@ import java.util.List;
  */
 public interface IMeterReadingManualService
 {
+    MeterReadingManual selectById(Long id);
+
     /**
      * 查询手动抄记录列表
      *

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

@@ -0,0 +1,93 @@
+package com.ruoyi.ems.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.ems.mapper.AdmEmsElecPgIndexMapper;
+import com.ruoyi.ems.domain.AdmEmsElecPgIndex;
+import com.ruoyi.ems.service.IAdmEmsElecPgIndexService;
+
+/**
+ * 电网设施指标Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-08-30
+ */
+@Service
+public class AdmEmsElecPgIndexServiceImpl implements IAdmEmsElecPgIndexService 
+{
+    @Autowired
+    private AdmEmsElecPgIndexMapper admEmsElecPgIndexMapper;
+
+    /**
+     * 查询电网设施指标
+     * 
+     * @param id 电网设施指标主键
+     * @return 电网设施指标
+     */
+    @Override
+    public AdmEmsElecPgIndex selectAdmEmsElecPgIndexById(Long id)
+    {
+        return admEmsElecPgIndexMapper.selectAdmEmsElecPgIndexById(id);
+    }
+
+    /**
+     * 查询电网设施指标列表
+     * 
+     * @param admEmsElecPgIndex 电网设施指标
+     * @return 电网设施指标
+     */
+    @Override
+    public List<AdmEmsElecPgIndex> selectAdmEmsElecPgIndexList(AdmEmsElecPgIndex admEmsElecPgIndex)
+    {
+        return admEmsElecPgIndexMapper.selectAdmEmsElecPgIndexList(admEmsElecPgIndex);
+    }
+
+    /**
+     * 新增电网设施指标
+     * 
+     * @param admEmsElecPgIndex 电网设施指标
+     * @return 结果
+     */
+    @Override
+    public int insertAdmEmsElecPgIndex(AdmEmsElecPgIndex admEmsElecPgIndex)
+    {
+        return admEmsElecPgIndexMapper.insertAdmEmsElecPgIndex(admEmsElecPgIndex);
+    }
+
+    /**
+     * 修改电网设施指标
+     * 
+     * @param admEmsElecPgIndex 电网设施指标
+     * @return 结果
+     */
+    @Override
+    public int updateAdmEmsElecPgIndex(AdmEmsElecPgIndex admEmsElecPgIndex)
+    {
+        return admEmsElecPgIndexMapper.updateAdmEmsElecPgIndex(admEmsElecPgIndex);
+    }
+
+    /**
+     * 批量删除电网设施指标
+     * 
+     * @param ids 需要删除的电网设施指标主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmEmsElecPgIndexByIds(Long[] ids)
+    {
+        return admEmsElecPgIndexMapper.deleteAdmEmsElecPgIndexByIds(ids);
+    }
+
+    /**
+     * 删除电网设施指标信息
+     * 
+     * @param id 电网设施指标主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmEmsElecPgIndexById(Long id)
+    {
+        return admEmsElecPgIndexMapper.deleteAdmEmsElecPgIndexById(id);
+    }
+}

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

@@ -0,0 +1,93 @@
+package com.ruoyi.ems.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.ems.mapper.AdmEmsIndexRangeMapper;
+import com.ruoyi.ems.domain.AdmEmsIndexRange;
+import com.ruoyi.ems.service.IAdmEmsIndexRangeService;
+
+/**
+ * 能源指标范围Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-08-30
+ */
+@Service
+public class AdmEmsIndexRangeServiceImpl implements IAdmEmsIndexRangeService 
+{
+    @Autowired
+    private AdmEmsIndexRangeMapper admEmsIndexRangeMapper;
+
+    /**
+     * 查询能源指标范围
+     * 
+     * @param id 能源指标范围主键
+     * @return 能源指标范围
+     */
+    @Override
+    public AdmEmsIndexRange selectAdmEmsIndexRangeById(Long id)
+    {
+        return admEmsIndexRangeMapper.selectAdmEmsIndexRangeById(id);
+    }
+
+    /**
+     * 查询能源指标范围列表
+     * 
+     * @param admEmsIndexRange 能源指标范围
+     * @return 能源指标范围
+     */
+    @Override
+    public List<AdmEmsIndexRange> selectAdmEmsIndexRangeList(AdmEmsIndexRange admEmsIndexRange)
+    {
+        return admEmsIndexRangeMapper.selectAdmEmsIndexRangeList(admEmsIndexRange);
+    }
+
+    /**
+     * 新增能源指标范围
+     * 
+     * @param admEmsIndexRange 能源指标范围
+     * @return 结果
+     */
+    @Override
+    public int insertAdmEmsIndexRange(AdmEmsIndexRange admEmsIndexRange)
+    {
+        return admEmsIndexRangeMapper.insertAdmEmsIndexRange(admEmsIndexRange);
+    }
+
+    /**
+     * 修改能源指标范围
+     * 
+     * @param admEmsIndexRange 能源指标范围
+     * @return 结果
+     */
+    @Override
+    public int updateAdmEmsIndexRange(AdmEmsIndexRange admEmsIndexRange)
+    {
+        return admEmsIndexRangeMapper.updateAdmEmsIndexRange(admEmsIndexRange);
+    }
+
+    /**
+     * 批量删除能源指标范围
+     * 
+     * @param ids 需要删除的能源指标范围主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmEmsIndexRangeByIds(Long[] ids)
+    {
+        return admEmsIndexRangeMapper.deleteAdmEmsIndexRangeByIds(ids);
+    }
+
+    /**
+     * 删除能源指标范围信息
+     * 
+     * @param id 能源指标范围主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmEmsIndexRangeById(Long id)
+    {
+        return admEmsIndexRangeMapper.deleteAdmEmsIndexRangeById(id);
+    }
+}

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

@@ -0,0 +1,93 @@
+package com.ruoyi.ems.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.ems.mapper.AdmOpInspectionReportMapper;
+import com.ruoyi.ems.domain.AdmOpInspectionReport;
+import com.ruoyi.ems.service.IAdmOpInspectionReportService;
+
+/**
+ * 巡检报告Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+@Service
+public class AdmOpInspectionReportServiceImpl implements IAdmOpInspectionReportService 
+{
+    @Autowired
+    private AdmOpInspectionReportMapper admOpInspectionReportMapper;
+
+    /**
+     * 查询巡检报告
+     * 
+     * @param id 巡检报告主键
+     * @return 巡检报告
+     */
+    @Override
+    public AdmOpInspectionReport selectAdmOpInspectionReportById(Long id)
+    {
+        return admOpInspectionReportMapper.selectAdmOpInspectionReportById(id);
+    }
+
+    /**
+     * 查询巡检报告列表
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 巡检报告
+     */
+    @Override
+    public List<AdmOpInspectionReport> selectAdmOpInspectionReportList(AdmOpInspectionReport admOpInspectionReport)
+    {
+        return admOpInspectionReportMapper.selectAdmOpInspectionReportList(admOpInspectionReport);
+    }
+
+    /**
+     * 新增巡检报告
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 结果
+     */
+    @Override
+    public int insertAdmOpInspectionReport(AdmOpInspectionReport admOpInspectionReport)
+    {
+        return admOpInspectionReportMapper.insertAdmOpInspectionReport(admOpInspectionReport);
+    }
+
+    /**
+     * 修改巡检报告
+     * 
+     * @param admOpInspectionReport 巡检报告
+     * @return 结果
+     */
+    @Override
+    public int updateAdmOpInspectionReport(AdmOpInspectionReport admOpInspectionReport)
+    {
+        return admOpInspectionReportMapper.updateAdmOpInspectionReport(admOpInspectionReport);
+    }
+
+    /**
+     * 批量删除巡检报告
+     * 
+     * @param ids 需要删除的巡检报告主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmOpInspectionReportByIds(Long[] ids)
+    {
+        return admOpInspectionReportMapper.deleteAdmOpInspectionReportByIds(ids);
+    }
+
+    /**
+     * 删除巡检报告信息
+     * 
+     * @param id 巡检报告主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmOpInspectionReportById(Long id)
+    {
+        return admOpInspectionReportMapper.deleteAdmOpInspectionReportById(id);
+    }
+}

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

@@ -0,0 +1,93 @@
+package com.ruoyi.ems.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.ems.mapper.AdmOpInspectionTaskMapper;
+import com.ruoyi.ems.domain.AdmOpInspectionTask;
+import com.ruoyi.ems.service.IAdmOpInspectionTaskService;
+
+/**
+ * 巡检任务Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-08-29
+ */
+@Service
+public class AdmOpInspectionTaskServiceImpl implements IAdmOpInspectionTaskService
+{
+    @Autowired
+    private AdmOpInspectionTaskMapper admOpInspectionTaskMapper;
+
+    /**
+     * 查询巡检任务
+     *
+     * @param id 巡检任务主键
+     * @return 巡检任务
+     */
+    @Override
+    public AdmOpInspectionTask selectAdmOpInspectionTaskById(Long id)
+    {
+        return admOpInspectionTaskMapper.selectAdmOpInspectionTaskById(id);
+    }
+
+    /**
+     * 查询巡检任务列表
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 巡检任务
+     */
+    @Override
+    public List<AdmOpInspectionTask> selectAdmOpInspectionTaskList(AdmOpInspectionTask admOpInspectionTask)
+    {
+        return admOpInspectionTaskMapper.selectAdmOpInspectionTaskList(admOpInspectionTask);
+    }
+
+    /**
+     * 新增巡检任务
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 结果
+     */
+    @Override
+    public int insertAdmOpInspectionTask(AdmOpInspectionTask admOpInspectionTask)
+    {
+        return admOpInspectionTaskMapper.insertAdmOpInspectionTask(admOpInspectionTask);
+    }
+
+    /**
+     * 修改巡检任务
+     *
+     * @param admOpInspectionTask 巡检任务
+     * @return 结果
+     */
+    @Override
+    public int updateAdmOpInspectionTask(AdmOpInspectionTask admOpInspectionTask)
+    {
+        return admOpInspectionTaskMapper.updateAdmOpInspectionTask(admOpInspectionTask);
+    }
+
+    /**
+     * 批量删除巡检任务
+     *
+     * @param ids 需要删除的巡检任务主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmOpInspectionTaskByIds(Long[] ids)
+    {
+        return admOpInspectionTaskMapper.deleteAdmOpInspectionTaskByIds(ids);
+    }
+
+    /**
+     * 删除巡检任务信息
+     *
+     * @param id 巡检任务主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAdmOpInspectionTaskById(Long id)
+    {
+        return admOpInspectionTaskMapper.deleteAdmOpInspectionTaskById(id);
+    }
+}

+ 116 - 4
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/service/impl/EmsFacsServiceImpl.java

@@ -1,20 +1,41 @@
 package com.ruoyi.ems.service.impl;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.BiFunction;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ruoyi.common.core.enums.FacTypes;
 import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.core.utils.ExpressUtil;
+import com.ruoyi.common.core.utils.StreamUtils;
+import com.ruoyi.ems.domain.AdmEmsElecPgIndex;
+import com.ruoyi.ems.domain.AdmEmsIndexRange;
 import com.ruoyi.ems.domain.EmsFacs;
 import com.ruoyi.ems.domain.EmsFacsAbility;
 import com.ruoyi.ems.domain.EmsFacsAttr;
 import com.ruoyi.ems.domain.EmsFacsEvent;
+import com.ruoyi.ems.mapper.AdmEmsElecPgIndexMapper;
+import com.ruoyi.ems.mapper.AdmEmsIndexRangeMapper;
 import com.ruoyi.ems.mapper.EmsFacsMapper;
+import com.ruoyi.ems.service.IAdmEmsIndexRangeService;
 import com.ruoyi.ems.service.IEmsFacsAbilityService;
 import com.ruoyi.ems.service.IEmsFacsAttrService;
 import com.ruoyi.ems.service.IEmsFacsEventService;
 import com.ruoyi.ems.service.IEmsFacsService;
-import org.apache.commons.collections4.CollectionUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
 
-import java.util.List;
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.date.DateUnit;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.map.MapUtil;
 
 /**
  * 能源设施/系统Service业务层处理
@@ -28,6 +49,12 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
     private EmsFacsMapper emsFacsMapper;
 
     @Autowired
+    private AdmEmsIndexRangeMapper admEmsIndexRangeMapper;
+
+    @Autowired
+    private AdmEmsElecPgIndexMapper admEmsElecPgIndexMapper;
+
+    @Autowired
     private IEmsFacsAttrService facsAttrService;
 
     @Autowired
@@ -36,6 +63,9 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
     @Autowired
     private IEmsFacsEventService facsEventService;
 
+    @Autowired
+    private IAdmEmsIndexRangeService admEmsIndexRangeService;
+
     /**
      * 查询能源设施
      *
@@ -181,6 +211,88 @@ public class EmsFacsServiceImpl implements IEmsFacsService {
         return emsFacsMapper.deleteEmsFacsById(id);
     }
 
+    public List<String> inspectFacIndex() {
+        List<Map<String, Object>> admEmsIndexRanges = admEmsIndexRangeMapper.selectAdmEmsIndexRange();
+        Map<String, List<Map<String, Object>>> facTypeRangeMap = StreamUtils.groupByKey(admEmsIndexRanges,
+            stringObjectMap -> MapUtil.getStr(stringObjectMap, "facsType"));
+        List<String> errorReport = Collections.synchronizedList(new ArrayList<String>());
+        Map<String, BiFunction<List<String>, Map.Entry<String, List<Map<String, Object>>>, Void>> handlers = new HashMap<String, BiFunction<List<String>, Map.Entry<String, List<Map<String, Object>>>, Void>>() {
+            {
+                put(FacTypes.PRODUCT.getCode(), (strings, stringListEntry) -> {
+                    pgIndexInspection(errorReport, stringListEntry);
+                    return null;
+                });
+            }
+        };
+        for (Map.Entry<String, List<Map<String, Object>>> facTypeRange : facTypeRangeMap.entrySet()) {
+            String key = facTypeRange.getKey();
+            if (!handlers.containsKey(key)) {
+                continue;
+            }
+            handlers.get(key).apply(errorReport, facTypeRange);
+        }
+        return errorReport;
+    }
+
+    private void pgIndexInspection(List<String> errorReport,
+        Map.Entry<String, List<Map<String, Object>>> facTypeRange) {
+        Map<String, List<Map<String, Object>>> objCodeRangeMap = StreamUtils.groupByKey(facTypeRange.getValue(),
+            stringObjectMap -> MapUtil.getStr(stringObjectMap, "objCode"));
+        Set<String> objCodes = objCodeRangeMap.keySet();
+        List<List<String>> splitObjCodes = StreamUtils.splitSet(objCodes, 100);
+        for (List<String> splitObjCode : splitObjCodes) {
+            Map<String, Map<String, Object>> objCodePgIndexes = admEmsElecPgIndexMapper.qryLatestObjIndex(splitObjCode);
+            for (Map.Entry<String, Map<String, Object>> objCodePgIndex : objCodePgIndexes.entrySet()) {
+                if (!objCodeRangeMap.containsKey(objCodePgIndex.getKey())) {
+                    continue;
+                }
+                Date time = MapUtil.getDate(objCodePgIndex.getValue(), "time");
+                long between = DateUtil.between(time, new Date(), DateUnit.DAY);
+                List<Map<String, Object>> ranges = objCodeRangeMap.get(objCodePgIndex.getKey());
+                String objTypeName = MapUtil.getStr(ranges.get(0), "facsName");
+                if (between > 1) {
+                    errorReport.add(String.format("%s(%s)已经离线", objCodePgIndex.getKey(), objTypeName));
+                    continue;
+                }
+                List<Map<String, Object>> errors = ExpressUtil.hitExpress(objCodePgIndex.getValue(),
+                    objCodeRangeMap.get(objCodePgIndex.getKey()));
+                if (CollectionUtils.isEmpty(errors)) {
+                    continue;
+                }
+                for (Map<String, Object> error : errors) {
+                    errorReport.add(String.format("%s(%s)超出%s", objCodePgIndex.getKey(), objTypeName,
+                        MapUtil.getStr(error, "indexDesc")));
+                }
+            }
+        }
+    }
+
+    public static void main(String[] args) {
+        List<Map<String, Object>> admEmsIndexRanges = new ArrayList<>();
+        admEmsIndexRanges.add(BeanUtil.beanToMap(new AdmEmsIndexRange() {
+            {
+                setFacsType(FacTypes.PRODUCT.getCode());
+                setIndexName("voltage");
+                setIndexUpperLimit(225.0D);
+                setIndexLowerLimit(220.1D);
+            }
+        }, "facsType", "indexName", "indexUpperLimit", "indexLowerLimit"));
+        admEmsIndexRanges.add(BeanUtil.beanToMap(new AdmEmsIndexRange() {
+            {
+                setFacsType(FacTypes.PRODUCT.getCode());
+                setIndexName("electricity");
+                setIndexUpperLimit(225.0D);
+                setIndexLowerLimit(220.1D);
+            }
+        }, "facsType", "indexName", "indexUpperLimit", "indexLowerLimit"));
+        System.out.println(ExpressUtil.hitExpress(new AdmEmsElecPgIndex() {
+            {
+                setVoltage(220.1D);
+                setElectricity(1.1D);
+            }
+        }, admEmsIndexRanges));
+    }
+
     private List<EmsFacsAttr> getFacsAttrs(EmsFacs emsFacs) {
         EmsFacsAttr param = new EmsFacsAttr(emsFacs.getFacsCode());
         return facsAttrService.selectEmsFacsAttrList(param);

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

@@ -61,6 +61,13 @@ public class MeterDeviceServiceImpl implements IMeterDeviceService {
         return meterDevice;
     }
 
+    @Override
+    public MeterDevice selectMeterDeviceByCode(String areaCode, String deviceCode) {
+        MeterDevice meterDevice = meterDeviceMapper.selectMeterDeviceByCode(areaCode, deviceCode);
+        fillObjName(meterDevice);
+        return meterDevice;
+    }
+
     /**
      * 查询计量设备列表
      *

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

@@ -21,6 +21,11 @@ public class MeterReadingManualServiceImpl implements IMeterReadingManualService
     private MeterReadingManualMapper meterReadingManualMapper;
 
     @Override
+    public MeterReadingManual selectById(Long id) {
+        return meterReadingManualMapper.selectById(id);
+    }
+
+    @Override
     public MeterReadingManual selectLastItem(String areaCode, String deviceCode) {
         return meterReadingManualMapper.selectLastItem(areaCode, deviceCode);
     }

+ 6 - 10
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/task/taskiml/FacTask.java

@@ -1,15 +1,12 @@
 package com.ruoyi.ems.task.taskiml;
 
-import com.alibaba.fastjson2.JSON;
-import com.ruoyi.common.log.aspect.LogAspect;
-import com.ruoyi.ems.mapper.AreaMapper;
-import com.ruoyi.ems.task.BaseTask;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.List;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.ems.service.impl.EmsFacsServiceImpl;
+import com.ruoyi.ems.task.BaseTask;
 
 /**
  * 定时任务调度测试
@@ -20,10 +17,9 @@ import com.ruoyi.common.core.utils.StringUtils;
 public class FacTask extends BaseTask {
 
     @Autowired
-    private AreaMapper areaMapper;
-
+    private EmsFacsServiceImpl emsFacsService;
     @Override
     public void run() {
-       log.info(JSON.toJSONString(areaMapper.selectAreaById(1L)));
+        List<String> errorReport = emsFacsService.inspectFacIndex();
     }
 }

+ 794 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/util/DateUtils.java

@@ -0,0 +1,794 @@
+/*
+ * 文 件 名:  DateUtils.java
+ * 版    权:  浩鲸云计算科技有限公司
+ * 描    述:  日期工具类
+ * 修 改 人:  lvwenbin
+ * 修改时间:  2018年9月20日
+ * 修改内容:  <修改内容>
+ */
+package com.ruoyi.ems.util;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
+
+/**
+ * 日期工具类 <功能详细描述>
+ * 
+ * @author lvwenbin
+ * @version [版本号, 2018年9月20日]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+public abstract class DateUtils {
+    public static final String DEFAULT_TIME_FORMAT = "yyyyMMddHHmmss";
+
+    /**
+     * 通用时间展示格式
+     */
+    public static final String COMMON_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
+
+    private static final Logger log = LoggerFactory.getLogger(DateUtils.class);
+
+    /**
+     * $ 时间年偏移 <功能详细描述>
+     * 
+     * @param date 日期
+     * @param offset 偏移量
+     * @return date 日期
+     * @see [类、类#方法、类#成员]
+     */
+    public static Date adjustYear(Date date, int offset) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.YEAR, offset);
+        Date newDate = calendar.getTime();
+        return newDate;
+    }
+
+    /**
+     * $时间年偏移 <功能详细描述>
+     * 
+     * @param time yyyyMMddHHmmss
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String adjustYear(String time, int offset) {
+        return adjustYear(time, offset, DEFAULT_TIME_FORMAT);
+    }
+
+    /**
+     * $时间年偏移 <功能详细描述>
+     * 
+     * @param time yyyyMMddHHmmss
+     * @param offset 偏移量
+     * @param format 格式化
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String adjustYear(String time, int offset, String format) {
+        SimpleDateFormat formatter = new SimpleDateFormat(format);
+        String retTime = null;
+
+        try {
+            Date date = formatter.parse(time);
+            Date newDate = adjustYear(date, offset);
+            retTime = formatter.format(newDate);
+        }
+        catch (ParseException e) {
+            log.error("adjustYear fail!" + ExceptionUtils.getStackTrace(e));
+        }
+
+        return retTime;
+    }
+
+    /**
+     * 时间月偏移
+     * @param date 日期
+     * @param offset 偏移量
+     * @return date 日期
+     */
+    public static Date adjustMonth(Date date, int offset) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.MONTH, offset);
+        Date newDate = calendar.getTime();
+        return newDate;
+    }
+
+    /**
+     * $时间月偏移 <功能详细描述>
+     * 
+     * @param time yyyyMMddHHmmss
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String adjustMonth(String time, int offset) {
+        return adjustMonth(time, offset, DEFAULT_TIME_FORMAT);
+    }
+
+    /**
+     * $时间月偏移 <功能详细描述>
+     * 
+     * @param time yyyyMMddHHmmss
+     * @param offset 偏移量
+     * @param format 格式化时间
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String adjustMonth(String time, int offset, String format) {
+        SimpleDateFormat formatter = new SimpleDateFormat(format);
+        String retTime = null;
+
+        try {
+            Date date = formatter.parse(time);
+            Date newDate = adjustMonth(date, offset);
+            retTime = formatter.format(newDate);
+        }
+        catch (ParseException e) {
+            log.error("adjustMonth fail!" + ExceptionUtils.getStackTrace(e));
+        }
+
+        return retTime;
+    }
+
+    /**
+     * $时间周偏移 <功能详细描述>
+     * 
+     * @param date 日期
+     * @param offset 偏移量
+     * @return date
+     * @see [类、类#方法、类#成员]
+     */
+    public static Date adjustWeek(Date date, int offset) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.DATE, 7 * offset);
+        Date newDate = calendar.getTime();
+        return newDate;
+    }
+
+    /**
+     * $时间周偏移 <功能详细描述>
+     * 
+     * @param time yyyyMMddHHmmss
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String adjustWeek(String time, int offset) {
+        return adjustWeek(time, offset, DEFAULT_TIME_FORMAT);
+    }
+
+    /**
+     * $时间周偏移 <功能详细描述>
+     * 
+     * @param time 字符串日期
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String adjustWeek(String time, int offset, String format) {
+        SimpleDateFormat formatter = new SimpleDateFormat(format);
+        String retTime = null;
+
+        try {
+            Date date = formatter.parse(time);
+            Date newDate = adjustWeek(date, offset);
+            retTime = formatter.format(newDate);
+        }
+        catch (ParseException e) {
+            log.error("adjustWeek fail!" + ExceptionUtils.getStackTrace(e));
+        }
+
+        return retTime;
+    }
+
+    /**
+     * $时间日偏移 <功能详细描述>
+     * 
+     * @param date 日期
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static Date adjustDay(Date date, int offset) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.DATE, offset);
+        Date newDate = calendar.getTime();
+        return newDate;
+    }
+
+    /**
+     * $时间日偏移 <功能详细描述>
+     * 
+     * @param time yyyyMMddHHmmss
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String adjustDay(String time, int offset) {
+        return adjustDay(time, offset, DEFAULT_TIME_FORMAT);
+    }
+
+    /**
+     * $时间日偏移 <功能详细描述>
+     * 
+     * @param time 字符串日期
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String adjustDay(String time, int offset, String format) {
+        SimpleDateFormat formatter = new SimpleDateFormat(format);
+        String retTime = null;
+
+        try {
+            Date date = formatter.parse(time);
+            Date newDate = adjustDay(date, offset);
+            retTime = formatter.format(newDate);
+        }
+        catch (ParseException e) {
+            log.error("adjustDay fail!" + ExceptionUtils.getStackTrace(e));
+        }
+
+        return retTime;
+    }
+
+    /**
+     * $时间小时偏移 <功能详细描述>
+     * 
+     * @param date 日期
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static Date adjustHour(Date date, int offset) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.HOUR_OF_DAY, offset);
+        Date newDate = calendar.getTime();
+
+        return newDate;
+    }
+
+    /**
+     * $时间小时偏移 <功能详细描述>
+     * 
+     * @param time yyyyMMddHHmmss
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String adjustHour(String time, int offset) {
+        return adjustHour(time, offset, DEFAULT_TIME_FORMAT);
+    }
+
+    /**
+     * $时间小时偏移 <功能详细描述>
+     * 
+     * @param time yyyyMMddHHmmss
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String adjustHour(String time, int offset, String format) {
+        SimpleDateFormat formatter = new SimpleDateFormat(format);
+        String retTime = null;
+
+        try {
+            Date date = formatter.parse(time);
+            Date newDate = adjustHour(date, offset);
+            retTime = formatter.format(newDate);
+        }
+        catch (ParseException e) {
+            log.error("adjustHour fail!" + ExceptionUtils.getStackTrace(e));
+        }
+
+        return retTime;
+    }
+
+    /**
+     * $时间分钟偏移 <功能详细描述>
+     * 
+     * @param date 日期
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static Date adjustMinute(Date date, int offset) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.MINUTE, offset);
+        Date newDate = calendar.getTime();
+        return newDate;
+    }
+
+    /**
+     * $时间分钟偏移 <功能详细描述>
+     * 
+     * @param time yyyyMMddHHmmss
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String adjustMinute(String time, int offset) {
+        return adjustMinute(time, offset, DEFAULT_TIME_FORMAT);
+    }
+
+    /**
+     * $时间分钟偏移 <功能详细描述>
+     * 
+     * @param time 字符串日期
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String adjustMinute(String time, int offset, String format) {
+        SimpleDateFormat formatter = new SimpleDateFormat(format);
+        String retTime = null;
+
+        try {
+            Date date = formatter.parse(time);
+            Date newDate = adjustMinute(date, offset);
+            retTime = formatter.format(newDate);
+        }
+        catch (ParseException e) {
+            log.error("adjustMinute fail!" + ExceptionUtils.getStackTrace(e));
+        }
+
+        return retTime;
+    }
+
+    /**
+     * $时间秒偏移 <功能详细描述>
+     * 
+     * @param date 字符串日期
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static Date adjustSecond(Date date, int offset) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.SECOND, offset);
+        Date newDate = calendar.getTime();
+        return newDate;
+    }
+
+    /**
+     * $时间秒偏移 <功能详细描述>
+     * 
+     * @param time yyyyMMddHHmmss
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String adjustSecond(String time, int offset) {
+        return adjustSecond(time, offset, DEFAULT_TIME_FORMAT);
+    }
+
+    /**
+     * $时间秒偏移 <功能详细描述>
+     * 
+     * @param time yyyyMMddHHmmss
+     * @param offset 偏移量
+     * @return yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String adjustSecond(String time, int offset, String format) {
+        SimpleDateFormat formatter = new SimpleDateFormat(format);
+        String retTime = null;
+
+        try {
+            Date date = formatter.parse(time);
+            Date newDate = adjustSecond(date, offset);
+            retTime = formatter.format(newDate);
+        }
+        catch (ParseException e) {
+            log.error("adjustSecond fail!" + ExceptionUtils.getStackTrace(e));
+        }
+
+        return retTime;
+    }
+
+    /**
+     * $获取两个间隔日期间的天数 <功能详细描述>
+     * 
+     * @param timeBefore yyyyMMdd格式
+     * @param timeAfter yyyyMMdd格式
+     * @return 天数
+     * @see [类、类#方法、类#成员]
+     */
+    public static int getDayBetween(String timeBefore, String timeAfter) {
+        SimpleDateFormat sd = new SimpleDateFormat("yyyyMMdd");
+        long num = 0;
+
+        try {
+            long diff = sd.parse(timeAfter).getTime() - sd.parse(timeBefore).getTime();
+            num = diff / (1000 * 24 * 60 * 60);
+        }
+        catch (ParseException e) {
+            log.error("getDayBetween fail!", e);
+        }
+
+        return (int) num;
+    }
+
+    /**
+     * $获取一个月最后一天
+     * 
+     * @param time yyyyMMdd格式
+     * @return 日期
+     * @see [类、类#方法、类#成员]
+     */
+    public static String getMaxDateOfMonth(String time, String format) {
+        SimpleDateFormat sd = new SimpleDateFormat(format);
+        Calendar cDay = Calendar.getInstance();
+
+        try {
+            Date date = sd.parse(time);
+            cDay.setTime(date);
+        }
+        catch (ParseException e) {
+            log.error("getMaxDateOfMonth fail!", e);
+        }
+
+        return String.valueOf(cDay.getActualMaximum(Calendar.DAY_OF_MONTH));
+    }
+
+    /**
+     * Date转String <br>
+     * 根据format格式转换时间为字符串
+     * 
+     * @param date 时刻
+     * @param format 转换模板
+     * @return 字符串日期
+     * @see [类、类#方法、类#成员]
+     */
+    public static String dateToString(Date date, String format) {
+        if (date == null) {
+            date = new Date();
+        }
+
+        SimpleDateFormat formatter = new SimpleDateFormat(format);
+        String retTime = formatter.format(date);
+
+        return retTime;
+    }
+
+    /**
+     * $格式化取时间
+     * 
+     * @param dateString yyyyMMddHHmmss时刻
+     * @param format 转换模板
+     * @return 字符串日期
+     * @see [类、类#方法、类#成员]
+     */
+    public static String formater(String dateString, String format) {
+        Date date = stringToDate(dateString);
+        SimpleDateFormat formatter = new SimpleDateFormat(format);
+        String retTime = formatter.format(date);
+
+        return retTime;
+    }
+
+    /**
+     * 格式化取时间
+     * @param dateString 字符串日期
+     * @param from 源格式
+     * @param to 目标格式
+     * @return String
+     */
+    public static String formater(String dateString, String from, String to) {
+        Date date = stringToDate(dateString, from);
+        SimpleDateFormat formatter = new SimpleDateFormat(to);
+        String retTime = formatter.format(date);
+
+        return retTime;
+    }
+
+    /**
+     * $时间转换 <功能详细描述>
+     * 
+     * @param dateKey 天
+     * @param timeKey  时间
+     * @param format 格式
+     * @return String
+     * @see [类、类#方法、类#成员]
+     */
+    public static String formater(int dateKey, int timeKey, String format) {
+        int year = dateKey / 10000;
+        int month = (dateKey / 100) % 100;
+        int day = dateKey % 100;
+        int hour = timeKey / 10000;
+        int min = (timeKey / 100) % 100;
+        int second = timeKey % 100;
+
+        GregorianCalendar calender = new GregorianCalendar(year, month - 1, day, hour, min, second);
+        return dateToString(calender.getTime(), format);
+    }
+
+    /**
+     * Date转String <br>
+     * 根据format格式转换时间为字符串
+     * 
+     * @param date 时刻
+     * @return 字符串日期
+     * @see [类、类#方法、类#成员]
+     */
+    public static String dateToString(Date date) {
+        return dateToString(date, COMMON_TIME_FORMAT);
+    }
+
+    /**
+     * String转Date <br>
+     * 根据format格式转换时间为字符串
+     * 
+     * @param dateString 时刻
+     * @return date
+     * @see [类、类#方法、类#成员]
+     */
+    public static Date stringToDate(String dateString) {
+        return stringToDate(dateString, DEFAULT_TIME_FORMAT);
+    }
+
+    /**
+     * String转Date
+     * @param dateString 字符串日期
+     * @param format 格式
+     * @return date
+     */
+    public static Date stringToDate(String dateString, String format) {
+        SimpleDateFormat sd = new SimpleDateFormat(format);
+        Date date = null;
+
+        try {
+            date = sd.parse(dateString);
+        }
+        catch (ParseException e) {
+            log.error("stringToDate fail!", e);
+        }
+
+        return date;
+    }
+
+    /**
+     * String转Calendar <br>
+     * 根据format格式转换时间为字符串
+     * 
+     * @param dateString 时刻
+     * @return Calendar
+     * @see [类、类#方法、类#成员]
+     */
+    public static Calendar stringToCalendar(String dateString) {
+        if ((dateString == null) || (dateString.length() < 14)) {
+            throw new IllegalArgumentException(dateString);
+        }
+
+        Date date = stringToDate(dateString);
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+
+        return calendar;
+    }
+
+    /**
+     * String转Calendar <br>
+     * 根据format格式转换时间为字符串
+     * 
+     * @param dateString 时间字符串
+     * @param format 格式
+     * @return Calendar
+     * @see [类、类#方法、类#成员]
+     */
+    public static Calendar stringToCalendar(String dateString, String format) {
+        Date date = stringToDate(dateString, format);
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        return calendar;
+    }
+
+    /**
+     * $获取当前时间 <功能详细描述>
+     * 
+     * @return String yyyyMMddHHmmss
+     * @see [类、类#方法、类#成员]
+     */
+    public static String getCurrentTime() {
+        return dateToString(new Date(), DEFAULT_TIME_FORMAT);
+    }
+
+    /**
+     * $获取两个时间之间的间隔(毫秒) <功能详细描述>
+     * 
+     * @param d1 日期1
+     * @param d2 日期2
+     * @return
+     * @see [类、类#方法、类#成员]
+     */
+    public static long getTimeBetween(Date d1, Date d2) {
+        return Math.abs(d2.getTime() - d1.getTime());
+    }
+
+    /**
+     * $获取星期几
+     * 
+     * @param date 输入日期
+     * @return 星期几
+     */
+    public static int getWeekOfDate(Date date) {
+        Calendar cd = Calendar.getInstance();
+        cd.setTime(date);
+        int wd = cd.get(Calendar.DAY_OF_WEEK);
+
+        if (wd == 1) {
+            return 7;
+        }
+        else {
+            return wd - 1;
+        }
+    }
+
+    /**
+     * $早高峰区间
+     */
+    private static final String[] MORING_PEAK_INTERVAL = new String[] {
+        "070000", "090000"
+    };
+
+    /**
+     * $晚高峰区间
+     */
+    private static final String[] EVENING_PEAK_INTERVAL = new String[] {
+        "170000", "190000"
+    };
+
+    /**
+     * $平峰区间
+     */
+    private static final String[] FLAT_PEAK_INTERVAL = new String[] {
+        "090000", "170000"
+    };
+
+    /**
+     * $判断是否早高峰 <07:00~09:00>
+     * 
+     * @param date 输入日期
+     * @return boolean
+     */
+    public static boolean checkMoringPeak(Date date) {
+        String time = StringUtils.substring(dateToString(date, DEFAULT_TIME_FORMAT), 8, 14);
+        return StringUtils.compare(time, MORING_PEAK_INTERVAL[0]) >= 0
+            && StringUtils.compare(time, MORING_PEAK_INTERVAL[1]) <= 0;
+    }
+
+    /**
+     * $判断是否晚高峰 <07:00~09:00>
+     * 
+     * @param date 输入日期
+     * @return boolean
+     */
+    public static boolean checkEveningPeak(Date date) {
+        String time = StringUtils.substring(dateToString(date, DEFAULT_TIME_FORMAT), 8, 14);
+        return StringUtils.compare(time, EVENING_PEAK_INTERVAL[0]) >= 0
+            && StringUtils.compare(time, EVENING_PEAK_INTERVAL[1]) <= 0;
+    }
+
+    /**
+     * $判断是否平峰 <09:00~17:00>
+     * 
+     * @param date 输入日期
+     * @return boolean
+     */
+    public static boolean checkFlatPeak(Date date) {
+        String time = StringUtils.substring(dateToString(date, DEFAULT_TIME_FORMAT), 8, 14);
+        return StringUtils.compare(time, FLAT_PEAK_INTERVAL[0]) >= 0
+            && StringUtils.compare(time, FLAT_PEAK_INTERVAL[1]) <= 0;
+    }
+
+    /**
+     * $判断是否工作日 <功能详细描述>
+     * 
+     * @param date 日期
+     * @return
+     * @see [类、类#方法、类#成员]
+     */
+    public static boolean checkWorkDay(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int wd = calendar.get(Calendar.DAY_OF_WEEK) - 1;
+        return wd >= 1 && wd <= 5;
+    }
+
+    /**
+     * $判断是否非工作日 <功能详细描述>
+     * 
+     * @param date 日期
+     * @return
+     * @see [类、类#方法、类#成员]
+     */
+    public static boolean checkNoWorkDay(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int wd = calendar.get(Calendar.DAY_OF_WEEK) - 1;
+        return wd == 6 || wd == 0;
+    }
+
+    public static Integer dateToStepIndex(String YmDHms, String tp) {
+        LocalDateTime localDateTime = LocalDateTime.parse(YmDHms, DateTimeFormatter.ofPattern(COMMON_TIME_FORMAT));
+        int hour = localDateTime.getHour();
+        int minute = localDateTime.getMinute();
+        int stepIndex = 0;
+
+        if (tp.endsWith("mi")) {
+            int interval = Integer.parseInt(tp.split("mi")[0]);
+            Double floor = Math.floor((hour * 60 + minute) / (double) interval);
+            stepIndex = floor.intValue();
+        }
+        else if (tp.endsWith("h")) {
+            stepIndex = hour;
+        }
+        return stepIndex;
+    }
+
+    /**
+     * 计算时间序列 - 当前时刻是当天第N个时间片
+     * @param period 时间片间隔
+     * @param timeStr 当前时间yyyy-MM-dd HH:mm:ss
+     * @return 时间序列
+     */
+    public static int buildColTimeIndex(long period, String timeStr) {
+        long dataTp = period / 60;
+        return dateToStepIndex(timeStr, dataTp + "mi");
+    }
+
+    public static String dateToUtcString(Date date){
+        SimpleDateFormat sdfutc = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'");
+        sdfutc.setTimeZone(TimeZone.getTimeZone("UTC"));
+        String format = sdfutc.format(date);
+        return format;
+    }
+
+    public static Date stringUtcToDate(String date) {
+        SimpleDateFormat sdfutc = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
+        sdfutc.setTimeZone(TimeZone.getTimeZone("UTC"));
+        Date parse = null;
+        try {
+            parse = sdfutc.parse(date);
+        } catch (ParseException e) {
+            log.error("mongoDbUtcToBjDate fail!" + ExceptionUtils.getStackTrace(e));
+        }
+
+        return parse;
+    }
+
+    public static Date currentDateZeroHours(Date date){
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date parse = null;
+        try {
+            parse = simpleDateFormat.parse(simpleDateFormat.format(date));
+        } catch (ParseException e) {
+            log.error("currentDateZeroHours fail!" + ExceptionUtils.getStackTrace(e));
+        }
+        return parse;
+    }
+
+    public static Integer secondDifferenceCount(Date start,Date end,Integer frequency){
+        Long count = (end.getTime()-start.getTime())/frequency;
+        return count.intValue();
+    }
+}

+ 184 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/util/exception/Assert.java

@@ -0,0 +1,184 @@
+/*
+ * 文 件 名:  Assert
+ * 版    权:  浩鲸云计算科技股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lv.wenbin@iwhalecloud.com
+ * 修改时间:  2019/4/21
+ */
+package com.ruoyi.ems.util.exception;
+
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * 断言 <功能详细描述>
+ *
+ * @author lv.wenbin@iwhalecloud.com
+ * @version [版本号, 2019/4/21]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+public abstract class Assert {
+    /**
+     * 真假断言 <功能详细描述>
+     *
+     * @param expression 真假
+     * @param errorCode  错误码
+     * @param message    错误消息
+     * @throws BusinessException 异常
+     * @see [类、类#方法、类#成员]
+     */
+    public static void isTrue(boolean expression, int errorCode, String message) throws BusinessException {
+        if (!expression) {
+            throw new BusinessException(errorCode, message);
+        }
+    }
+
+    /**
+     * 真假断言 <功能详细描述>
+     *
+     * @param expression 真假
+     * @param errorCode  错误码
+     * @throws BusinessException 异常
+     * @see [类、类#方法、类#成员]
+     */
+    public static void isTrue(boolean expression, ErrorCode errorCode) throws BusinessException {
+        if (!expression) {
+            throw new BusinessException(errorCode.getCode(), errorCode.getMessage());
+        }
+    }
+
+    /**
+     * 真假断言 <功能详细描述>
+     *
+     * @param expression 真假
+     * @param errorCode  错误码
+     * @param message    错误消息
+     * @param ext        扩展属性
+     * @throws BusinessException 异常
+     * @see [类、类#方法、类#成员]
+     */
+    public static void isTrue(boolean expression, int errorCode, String message, Object ext) throws BusinessException {
+        if (!expression) {
+            throw new BusinessException(errorCode, message, ext);
+        }
+    }
+
+    /**
+     * 空判断 <功能详细描述>
+     *
+     * @param object    对象
+     * @param errorCode 错误码
+     * @param message   错误消息
+     * @throws BusinessException 异常
+     * @see [类、类#方法、类#成员]
+     */
+    public static void isNull(Object object, int errorCode, String message) throws BusinessException {
+        if (object != null) {
+            throw new BusinessException(errorCode, message);
+        }
+    }
+
+    /**
+     * 空判断 <功能详细描述>
+     *
+     * @param object    对象
+     * @param errorCode 错误
+     * @throws BusinessException 异常
+     * @see [类、类#方法、类#成员]
+     */
+    public static void isNull(Object object, ErrorCode errorCode) throws BusinessException {
+        if (object != null) {
+            throw new BusinessException(errorCode.getCode(), errorCode.getMessage());
+        }
+    }
+
+    /**
+     * 非空判断 <功能详细描述>
+     *
+     * @param object    对象
+     * @param errorCode 错误码
+     * @param message   错误消息
+     * @throws BusinessException 异常
+     * @see [类、类#方法、类#成员]
+     */
+    public static void notNull(Object object, int errorCode, String message) throws BusinessException {
+        if (object == null) {
+            throw new BusinessException(errorCode, message);
+        }
+    }
+
+    /**
+     * 非空判断 <功能详细描述>
+     *
+     * @param object    对象
+     * @param errorCode 错误
+     * @throws BusinessException 异常
+     * @see [类、类#方法、类#成员]
+     */
+    public static void notNull(Object object, ErrorCode errorCode) throws BusinessException {
+        if (object == null) {
+            throw new BusinessException(errorCode.getCode(), errorCode.getMessage());
+        }
+    }
+
+    /**
+     * 数组非空判断 <功能详细描述>
+     *
+     * @param array     数组
+     * @param errorCode 错误码
+     * @param message   错误消息
+     * @throws BusinessException 异常
+     * @see [类、类#方法、类#成员]
+     */
+    public static void notEmpty(Object[] array, int errorCode, String message) throws BusinessException {
+        if (array == null || array.length == 0) {
+            throw new BusinessException(errorCode, message);
+        }
+    }
+
+    /**
+     * 集合非空判断 <功能详细描述>
+     *
+     * @param collection 集合列表
+     * @param errorCode  错误码
+     * @param message    错误信息
+     * @throws BusinessException 异常
+     * @see [类、类#方法、类#成员]
+     */
+    public static <T> void notEmpty(Collection<T> collection, int errorCode, String message) throws BusinessException {
+        if (collection == null || collection.isEmpty()) {
+            throw new BusinessException(errorCode, message);
+        }
+    }
+
+    /**
+     * Map非空判断
+     *
+     * @param map       Map Map集合
+     * @param errorCode 错误码
+     * @param message   错误信息
+     * @throws BusinessException 异常
+     * @see [类、类#方法、类#成员]
+     */
+    public static <K, V> void notEmpty(Map<K, V> map, int errorCode, String message) throws BusinessException {
+        if (map == null || map.isEmpty()) {
+            throw new BusinessException(errorCode, message);
+        }
+    }
+
+    /**
+     * 字符串空判断 <功能详细描述>
+     *
+     * @param str       字符串
+     * @param errorCode 错误码
+     * @param message   错误信息
+     * @throws BusinessException 异常
+     * @see [类、类#方法、类#成员]
+     */
+    public static void notEmpty(String str, int errorCode, String message) throws BusinessException {
+        if (str == null || str.length() == 0) {
+            throw new BusinessException(errorCode, message);
+        }
+    }
+}

+ 59 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/util/exception/BusinessException.java

@@ -0,0 +1,59 @@
+package com.ruoyi.ems.util.exception;
+
+/**
+ * 业务异常
+ *
+ * @author ruoyi
+ */
+public class BusinessException extends RuntimeException {
+    /**
+     * 错误码
+     */
+    protected int code;
+
+    protected final String message;
+
+    /**
+     * 扩展属性
+     */
+    private Object ext;
+
+    public BusinessException(String message) {
+        this.message = message;
+    }
+
+    public BusinessException(int code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+
+    public BusinessException(String message, Throwable e) {
+        super(message, e);
+        this.message = message;
+    }
+
+    public BusinessException(int code, String message, Throwable e) {
+        super(message, e);
+        this.code = code;
+        this.message = message;
+    }
+
+    public BusinessException(int code, String message, Object ext) {
+        this.code = code;
+        this.message = message;
+        this.ext = ext;
+    }
+
+    @Override
+    public String getMessage() {
+        return message;
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public Object getExt() {
+        return ext;
+    }
+}

+ 74 - 0
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/util/exception/ErrorCode.java

@@ -0,0 +1,74 @@
+/*
+ * 文 件 名:  BusinessError
+ * 版    权:  浩鲸云科技股份有限公司
+ * 描    述:  <描述>
+ * 修 改 人:  lv.wenbin@iwhalecloud.com
+ * 修改时间:  2018/12/10
+ */
+package com.ruoyi.ems.util.exception;
+
+/**
+ * 异常枚举 <功能详细描述>
+ *
+ * @author lv.wenbin@iwhalecloud.com
+ * @version [版本号, 2018/12/10]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
+public enum ErrorCode {
+    /**
+     * 成功
+     */
+    SUCCESS(0, "成功."),
+
+    /**
+     * 未知错误
+     */
+    UNKNOWN_ERROR(-1, "未知错误."),
+
+    /**
+     * 参数错误
+     */
+    PARAM_ERROR(1001, "参数错误."),
+
+    /**
+     * 参数错误
+     */
+    DB_ERROR(3001, "数据库异常."),
+
+    /**
+     * 服务不可用
+     */
+    SERVICE_UNAVAILABLE(9001, "服务不可用.");
+
+    /**
+     * 错误码分段: <br/>
+     * 0000 :业务正常 <br/>
+     * -001 :未知异常 <br/>
+     * 1xxx : 参数异常 <br/>
+     * 2xxx : 框架异常 <br/>
+     * 3xxx : DB异常 <br/>
+     * 4xxx : MQ异常 <br/>
+     * 5xxx : xx <br/>
+     * 6xxx : xx <br/>
+     * 7xxx : xx <br/>
+     * 8xxx : xx <br/>
+     * 9xxxxx : 业务异常
+     */
+    private int code;
+
+    private String message;
+
+    private ErrorCode(int code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+}

+ 9 - 6
ems-cloud/ems-modules/ems-server/src/main/resources/application-demo.yml

@@ -1,5 +1,8 @@
 # spring配置
 spring:
+  mvc:
+    pathmatch:
+      matching-strategy: ant_path_matcher
   redis:
     host: 172.10.0.18
     port: 6379
@@ -43,12 +46,12 @@ spring:
 # mybatis配置
 mybatis:
   # 搜索指定包别名
-  typeAliasesPackage: com.ruoyi.system
+  typeAliasesPackage: com.ruoyi.ems.**.domain;com.ruoyi.quartz.**.domain
   # 配置mapper的扫描,找到所有的mapper.xml映射文件
-  mapperLocations: classpath:mapper/**/*.xml
-
+  mapperLocations: classpath*:mapper/**/*.xml
+  configuration:
+    map-underscore-to-camel-case: true
 # swagger配置
 swagger:
-  title: 系统模块接口文档
-  license: Powered By ruoyi
-  licenseUrl: https://ruoyi.vip
+  title: 能源模块接口文档
+  enabled: true

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

@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.ems.mapper.AdmEmsElecPgIndexMapper">
+
+    <resultMap type="com.ruoyi.ems.domain.AdmEmsElecPgIndex" id="AdmEmsElecPgIndexResult">
+        <result property="id" column="id"/>
+        <result property="areaCode" column="area_code"/>
+        <result property="facsCode" column="facs_code"/>
+        <result property="date" column="date"/>
+        <result property="time" column="time"/>
+        <result property="voltage" column="voltage"/>
+        <result property="electricity" column="electricity"/>
+        <result property="power" column="power"/>
+    </resultMap>
+
+    <sql id="selectAdmEmsElecPgIndexVo">
+        select id, area_code, facs_code, date, time, voltage, electricity, power
+        from adm_ems_elec_pg_index
+    </sql>
+
+    <select id="selectAdmEmsElecPgIndexList" parameterType="com.ruoyi.ems.domain.AdmEmsElecPgIndex"
+            resultMap="AdmEmsElecPgIndexResult">
+        <include refid="selectAdmEmsElecPgIndexVo"/>
+        <where>
+            <if test="areaCode != null  and areaCode != ''">and area_code = #{areaCode}</if>
+            <if test="facsCode != null  and facsCode != ''">and facs_code = #{facsCode}</if>
+            <if test="date != null ">and date = #{date}</if>
+            <if test="time != null ">and time = #{time}</if>
+            <if test="voltage != null ">and voltage = #{voltage}</if>
+            <if test="electricity != null ">and electricity = #{electricity}</if>
+            <if test="power != null ">and power = #{power}</if>
+        </where>
+    </select>
+
+    <select id="selectAdmEmsElecPgIndexById" parameterType="Long" resultMap="AdmEmsElecPgIndexResult">
+        <include refid="selectAdmEmsElecPgIndexVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertAdmEmsElecPgIndex" parameterType="com.ruoyi.ems.domain.AdmEmsElecPgIndex" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into adm_ems_elec_pg_index
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="areaCode != null and areaCode != ''">area_code,</if>
+            <if test="facsCode != null and facsCode != ''">facs_code,</if>
+            <if test="date != null">date,</if>
+            <if test="time != null">time,</if>
+            <if test="voltage != null">voltage,</if>
+            <if test="electricity != null">electricity,</if>
+            <if test="power != null">power,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="areaCode != null and areaCode != ''">#{areaCode},</if>
+            <if test="facsCode != null and facsCode != ''">#{facsCode},</if>
+            <if test="date != null">#{date},</if>
+            <if test="time != null">#{time},</if>
+            <if test="voltage != null">#{voltage},</if>
+            <if test="electricity != null">#{electricity},</if>
+            <if test="power != null">#{power},</if>
+        </trim>
+    </insert>
+
+    <update id="updateAdmEmsElecPgIndex" parameterType="com.ruoyi.ems.domain.AdmEmsElecPgIndex">
+        update adm_ems_elec_pg_index
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if>
+            <if test="facsCode != null and facsCode != ''">facs_code = #{facsCode},</if>
+            <if test="date != null">date = #{date},</if>
+            <if test="time != null">time = #{time},</if>
+            <if test="voltage != null">voltage = #{voltage},</if>
+            <if test="electricity != null">electricity = #{electricity},</if>
+            <if test="power != null">power = #{power},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAdmEmsElecPgIndexById" parameterType="Long">
+        delete
+        from adm_ems_elec_pg_index
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteAdmEmsElecPgIndexByIds" parameterType="String">
+        delete from adm_ems_elec_pg_index where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="qryLatestObjIndex" resultType="Map">
+        SELECT
+        id, area_code as areaCode, facs_code as facsCode, date, time, voltage, electricity, power
+        FROM
+        ( SELECT *, RANK() OVER ( PARTITION BY facs_code ORDER BY time DESC ) AS num FROM adm_ems_elec_pg_index pgInde
+        where facs_code
+        <foreach item="item" index="index" collection="set" open="in (" separator=", " close=")">
+            ${item}
+        </foreach>
+        ) f
+        WHERE
+        f.num =1
+    </select>
+
+</mapper>

+ 99 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmEmsIndexRangeMapper.xml

@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.ems.mapper.AdmEmsIndexRangeMapper">
+
+    <resultMap type="com.ruoyi.ems.domain.AdmEmsIndexRange" id="AdmEmsIndexRangeResult">
+        <result property="id" column="id"/>
+        <result property="objCode" column="obj_code"/>
+        <result property="objType" column="obj_type"/>
+        <result property="indexName" column="index_name"/>
+        <result property="indexDesc" column="index_desc"/>
+        <result property="indexUpperLimit" column="index_upper_limit"/>
+        <result property="indexLowerLimit" column="index_lower_limit"/>
+    </resultMap>
+
+    <sql id="selectAdmEmsIndexRangeVo">
+        select id, obj_code, obj_type, index_name, index_desc, index_upper_limit, index_lower_limit
+        from adm_ems_index_range
+    </sql>
+
+    <select id="selectAdmEmsIndexRangeList" parameterType="com.ruoyi.ems.domain.AdmEmsIndexRange"
+            resultMap="AdmEmsIndexRangeResult">
+        <include refid="selectAdmEmsIndexRangeVo"/>
+        <where>
+            <if test="objType != null ">and obj_type = #{objType}</if>
+            <if test="indexName != null  and indexName != ''">and index_name like concat('%', #{indexName}, '%')</if>
+            <if test="indexDesc != null  and indexDesc != ''">and index_desc = #{indexDesc}</if>
+        </where>
+    </select>
+
+    <select id="selectAdmEmsIndexRangeById" parameterType="Long" resultMap="AdmEmsIndexRangeResult">
+        <include refid="selectAdmEmsIndexRangeVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertAdmEmsIndexRange" parameterType="com.ruoyi.ems.domain.AdmEmsIndexRange" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into adm_ems_index_range
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="objCode != null and objCode != ''">obj_code,</if>
+            <if test="objType != null">obj_type,</if>
+            <if test="indexName != null and indexName != ''">index_name,</if>
+            <if test="indexDesc != null">index_desc,</if>
+            <if test="indexUpperLimit != null">index_upper_limit,</if>
+            <if test="indexLowerLimit != null">index_lower_limit,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="objCode != null and objCode != ''">#{objCode},</if>
+            <if test="objType != null">#{objType},</if>
+            <if test="indexName != null and indexName != ''">#{indexName},</if>
+            <if test="indexDesc != null">#{indexDesc},</if>
+            <if test="indexUpperLimit != null">#{indexUpperLimit},</if>
+            <if test="indexLowerLimit != null">#{indexLowerLimit},</if>
+        </trim>
+    </insert>
+
+    <update id="updateAdmEmsIndexRange" parameterType="com.ruoyi.ems.domain.AdmEmsIndexRange">
+        update adm_ems_index_range
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="objCode != null and objCode != ''">obj_code = #{objCode},</if>
+            <if test="objType != null">obj_type = #{objType},</if>
+            <if test="indexName != null and indexName != ''">index_name = #{indexName},</if>
+            <if test="indexDesc != null">index_desc = #{indexDesc},</if>
+            <if test="indexUpperLimit != null">index_upper_limit = #{indexUpperLimit},</if>
+            <if test="indexLowerLimit != null">index_lower_limit = #{indexLowerLimit},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAdmEmsIndexRangeById" parameterType="Long">
+        delete
+        from adm_ems_index_range
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteAdmEmsIndexRangeByIds" parameterType="String">
+        delete from adm_ems_index_range where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="selectAdmEmsIndexRange" resultType="Map">
+        select id,
+               obj_code objCode,
+               obj_type objType,
+               index_name indexName,
+               index_desc indexDesc,
+               index_upper_limit indexUpperLimit,
+               index_lower_limit indexLowerLimit,
+               facs.facs_type facsType,
+               facs.facs_name facsName
+        FROM adm_ems_index_range indexRange
+                 LEFT JOIN adm_ems_facs facs ON indexRange.obj_code = facs.facs_code
+            AND indexRange.obj_type = 1
+    </select>
+
+</mapper>

+ 78 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmOpInspectionReportMapper.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.ems.mapper.AdmOpInspectionReportMapper">
+
+    <resultMap type="com.ruoyi.ems.domain.AdmOpInspectionReport" id="AdmOpInspectionReportResult">
+        <result property="id"    column="id"    />
+        <result property="taskCode"    column="task_code"    />
+        <result property="resultStatus"    column="result_status"    />
+        <result property="resultMsg"    column="result_msg"    />
+        <result property="finishTime"    column="finish_time"    />
+        <result property="subTime"    column="sub_time"    />
+        <result property="submitter"    column="submitter"    />
+    </resultMap>
+
+    <sql id="selectAdmOpInspectionReportVo">
+        select id, task_code, result_status, result_msg, finish_time, sub_time, submitter from adm_op_inspection_report
+    </sql>
+
+    <select id="selectAdmOpInspectionReportList" parameterType="com.ruoyi.ems.domain.AdmOpInspectionReport" resultMap="AdmOpInspectionReportResult">
+        <include refid="selectAdmOpInspectionReportVo"/>
+        <where>
+            <if test="taskCode != null  and taskCode != ''"> and task_code = #{taskCode}</if>
+            <if test="resultStatus != null "> and result_status = #{resultStatus}</if>
+            <if test="submitter != null  and submitter != ''"> and submitter like concat('%', #{submitter}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectAdmOpInspectionReportById" parameterType="Long" resultMap="AdmOpInspectionReportResult">
+        <include refid="selectAdmOpInspectionReportVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertAdmOpInspectionReport" parameterType="com.ruoyi.ems.domain.AdmOpInspectionReport" useGeneratedKeys="true" keyProperty="id">
+        insert into adm_op_inspection_report
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="taskCode != null and taskCode != ''">task_code,</if>
+            <if test="resultStatus != null">result_status,</if>
+            <if test="resultMsg != null">result_msg,</if>
+            <if test="finishTime != null">finish_time,</if>
+            <if test="subTime != null">sub_time,</if>
+            <if test="submitter != null">submitter,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="taskCode != null and taskCode != ''">#{taskCode},</if>
+            <if test="resultStatus != null">#{resultStatus},</if>
+            <if test="resultMsg != null">#{resultMsg},</if>
+            <if test="finishTime != null">#{finishTime},</if>
+            <if test="subTime != null">#{subTime},</if>
+            <if test="submitter != null">#{submitter},</if>
+         </trim>
+    </insert>
+
+    <update id="updateAdmOpInspectionReport" parameterType="com.ruoyi.ems.domain.AdmOpInspectionReport">
+        update adm_op_inspection_report
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="taskCode != null and taskCode != ''">task_code = #{taskCode},</if>
+            <if test="resultStatus != null">result_status = #{resultStatus},</if>
+            <if test="resultMsg != null">result_msg = #{resultMsg},</if>
+            <if test="finishTime != null">finish_time = #{finishTime},</if>
+            <if test="subTime != null">sub_time = #{subTime},</if>
+            <if test="submitter != null">submitter = #{submitter},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAdmOpInspectionReportById" parameterType="Long">
+        delete from adm_op_inspection_report where id = #{id}
+    </delete>
+
+    <delete id="deleteAdmOpInspectionReportByIds" parameterType="String">
+        delete from adm_op_inspection_report where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 113 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/AdmOpInspectionTaskMapper.xml

@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.ems.mapper.AdmOpInspectionTaskMapper">
+
+    <resultMap type="com.ruoyi.ems.domain.AdmOpInspectionTask" id="AdmOpInspectionTaskResult">
+        <result property="id" column="id"/>
+        <result property="taskCode" column="task_code"/>
+        <result property="taskName" column="task_name"/>
+        <result property="taskType" column="task_type"/>
+        <result property="taskStatus" column="task_status"/>
+        <result property="startTime" column="start_time"/>
+        <result property="endTime" column="end_time"/>
+        <result property="executor" column="executor"/>
+        <result property="objType" column="obj_type"/>
+        <result property="objCode" column="obj_code"/>
+        <result property="objName" column="obj_name"/>
+    </resultMap>
+
+    <sql id="selectAdmOpInspectionTaskVo">
+        select id,
+               task_code,
+               task_name,
+               task_type,
+               task_status,
+               start_time,
+               end_time,
+               executor,
+               obj_type,
+               obj_code,
+               obj_name
+        from adm_op_inspection_task
+    </sql>
+
+    <select id="selectAdmOpInspectionTaskList" parameterType="com.ruoyi.ems.domain.AdmOpInspectionTask"
+            resultMap="AdmOpInspectionTaskResult">
+        <include refid="selectAdmOpInspectionTaskVo"/>
+        <where>
+            <if test="taskCode != null  and taskCode != ''">and task_code = #{taskCode}</if>
+            <if test="taskName != null  and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if>
+            <if test="taskType != null ">and task_type = #{taskType}</if>
+            <if test="taskStatus != null ">and task_status = #{taskStatus}</if>
+            <if test="executor != null  and executor != ''">and executor = #{executor}</if>
+            <if test="objType != null ">and obj_type = #{objType}</if>
+            <if test="objName != null  and objName != ''">and obj_name like concat('%', #{objName}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectAdmOpInspectionTaskById" parameterType="Long" resultMap="AdmOpInspectionTaskResult">
+        <include refid="selectAdmOpInspectionTaskVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertAdmOpInspectionTask" parameterType="com.ruoyi.ems.domain.AdmOpInspectionTask"
+            useGeneratedKeys="true" keyProperty="id">
+        insert into adm_op_inspection_task
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="taskCode != null and taskCode != ''">task_code,</if>
+            <if test="taskName != null and taskName != ''">task_name,</if>
+            <if test="taskType != null">task_type,</if>
+            <if test="taskStatus != null">task_status,</if>
+            <if test="startTime != null">start_time,</if>
+            <if test="endTime != null">end_time,</if>
+            <if test="executor != null">executor,</if>
+            <if test="objType != null">obj_type,</if>
+            <if test="objCode != null and objCode != ''">obj_code,</if>
+            <if test="objName != null">obj_name,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="taskCode != null and taskCode != ''">#{taskCode},</if>
+            <if test="taskName != null and taskName != ''">#{taskName},</if>
+            <if test="taskType != null">#{taskType},</if>
+            <if test="taskStatus != null">#{taskStatus},</if>
+            <if test="startTime != null">#{startTime},</if>
+            <if test="endTime != null">#{endTime},</if>
+            <if test="executor != null">#{executor},</if>
+            <if test="objType != null">#{objType},</if>
+            <if test="objCode != null and objCode != ''">#{objCode},</if>
+            <if test="objName != null">#{objName},</if>
+        </trim>
+    </insert>
+
+    <update id="updateAdmOpInspectionTask" parameterType="com.ruoyi.ems.domain.AdmOpInspectionTask">
+        update adm_op_inspection_task
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="taskCode != null and taskCode != ''">task_code = #{taskCode},</if>
+            <if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
+            <if test="taskType != null">task_type = #{taskType},</if>
+            <if test="taskStatus != null">task_status = #{taskStatus},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="executor != null">executor = #{executor},</if>
+            <if test="objType != null">obj_type = #{objType},</if>
+            <if test="objCode != null and objCode != ''">obj_code = #{objCode},</if>
+            <if test="objName != null">obj_name = #{objName},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAdmOpInspectionTaskById" parameterType="Long">
+        delete
+        from adm_op_inspection_task
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteAdmOpInspectionTaskByIds" parameterType="String">
+        delete from adm_op_inspection_task where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 11 - 1
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/MeterDeviceMapper.xml

@@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="objSubType"  column="obj_sub_type"    />
         <result property="objCode"     column="obj_code"    />
         <result property="objName"     column="obj_name"    />
+        <result property="objTag"      column="obj_tag"    />
         <result property="colCycle"    column="col_cycle"    />
         <result property="colMode"     column="col_mode"    />
         <result property="magnification" column="magnification" />
@@ -20,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectMeterDeviceVo">
-        select id, device_code, area_code, meter_cls, obj_type, obj_sub_type, obj_code, col_cycle, col_mode, magnification, spec_desc from adm_meter_device
+        select id, device_code, area_code, meter_cls, obj_type, obj_sub_type, obj_code, obj_tag, col_cycle, col_mode, magnification, spec_desc from adm_meter_device
     </sql>
 
     <select id="selectMeterDeviceList" parameterType="com.ruoyi.ems.domain.MeterDevice" resultMap="meterDeviceResult">
@@ -32,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="objType != null "> and obj_type = #{objType}</if>
             <if test="objSubType != null "> and obj_sub_type = #{objSubType}</if>
             <if test="objCode != null  and objCode != ''"> and obj_code = #{objCode}</if>
+            <if test="objTag != null  and objTag != ''"> and obj_tag = #{objTag}</if>
             <if test="colCycle != null "> and col_cycle = #{colCycle}</if>
             <if test="colMode != null "> and col_mode = #{colMode}</if>
         </where>
@@ -42,6 +44,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectMeterDeviceVo"/>
         where id = #{id}
     </select>
+
+    <select id="selectMeterDeviceByCode"  resultMap="meterDeviceResult">
+        <include refid="selectMeterDeviceVo"/>
+        where area_code = #{areaCode} and device_code = #{deviceCode}
+    </select>
         
     <insert id="insertMeterDevice" parameterType="com.ruoyi.ems.domain.MeterDevice" useGeneratedKeys="true" keyProperty="id">
         insert into adm_meter_device
@@ -52,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="objType != null">obj_type,</if>
             <if test="objSubType != null ">obj_sub_type,</if>
             <if test="objCode != null and objCode != ''">obj_code,</if>
+            <if test="objTag != null and objTag != ''">obj_tag,</if>
             <if test="colCycle != null">col_cycle,</if>
             <if test="colMode != null">col_mode,</if>
             <if test="magnification != null">magnification,</if>
@@ -64,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="objType != null">#{objType},</if>
             <if test="objSubType != null">#{objSubType},</if>
             <if test="objCode != null and objCode != ''">#{objCode},</if>
+            <if test="objTag != null and objTag != ''">#{objTag}</if>
             <if test="colCycle != null">#{colCycle},</if>
             <if test="colMode != null">#{colMode},</if>
             <if test="magnification != null">#{magnification},</if>
@@ -80,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="objType != null">obj_type = #{objType},</if>
             <if test="objSubType != null">obj_sub_type = #{objSubType},</if>
             <if test="objCode != null and objCode != ''">obj_code = #{objCode},</if>
+            <if test="objTag != null and objTag != ''">obj_tag = #{objTag},</if>
             <if test="colCycle != null">col_cycle = #{colCycle},</if>
             <if test="colMode != null">col_mode = #{colMode},</if>
             <if test="magnification != null">magnification = #{magnification},</if>

+ 6 - 0
ems-cloud/ems-modules/ems-server/src/main/resources/mapper/ems/MeterReadingManualMapper.xml

@@ -24,6 +24,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select id, device_code, area_code, `year`, meter_month, last_reading, last_time, meter_reading, meter_time, increase, create_time, update_time from adm_meter_reading_manual
     </sql>
 
+    <select id="selectById"  parameterType="Long" resultMap="MeterReadingManualResult">
+        <include refid="selectMeterReadingManualVo"/>
+        where id = #{id}
+    </select>
+
     <select id="selectLastItem"  resultMap="MeterReadingManualResult">
         <include refid="selectMeterReadingManualVo"/>
         where area_code = #{areaCode} and device_code = #{deviceCode}
@@ -40,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="startMonth != null  and startMonth != ''"> and meter_month &gt;= #{startMonth}</if>
             <if test="endMonth != null  and endMonth != ''"> and meter_month &lt;= #{endMonth}</if>
         </where>
+        ORDER BY meter_month ${orderFlag}
     </select>
 
     <insert id="insert" parameterType="com.ruoyi.ems.domain.MeterReadingManual" useGeneratedKeys="true" keyProperty="id">

+ 9 - 0
ems-cloud/pom.xml

@@ -34,6 +34,7 @@
         <jjwt.version>0.9.1</jjwt.version>
         <minio.version>8.2.2</minio.version>
         <poi.version>4.1.2</poi.version>
+        <hutool.version>5.8.26</hutool.version>
         <transmittable-thread-local.version>2.14.4</transmittable-thread-local.version>
     </properties>
 
@@ -227,6 +228,14 @@
                 <artifactId>ruoyi-common-quartz</artifactId>
                 <version>${ruoyi.version}</version>
             </dependency>
+            <dependency>
+                <groupId>cn.hutool</groupId>
+                <artifactId>hutool-bom</artifactId>
+                <version>${hutool.version}</version>
+                <type>pom</type>
+                <!-- 注意这里是import -->
+                <scope>import</scope>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 

+ 6 - 3
ems-cloud/ruoyi-common/ruoyi-common-core/pom.xml

@@ -10,7 +10,7 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>ruoyi-common-core</artifactId>
-    
+
     <description>
         ruoyi-common-core核心模块
     </description>
@@ -22,7 +22,7 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-openfeign</artifactId>
         </dependency>
-        
+
         <!-- SpringCloud Loadbalancer -->
         <dependency>
             <groupId>org.springframework.cloud</groupId>
@@ -112,7 +112,10 @@
             <groupId>io.swagger</groupId>
             <artifactId>swagger-annotations</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-core</artifactId>
+        </dependency>
     </dependencies>
 
 </project>

+ 85 - 0
ems-cloud/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/enums/FacTypes.java

@@ -0,0 +1,85 @@
+package com.ruoyi.common.core.enums;
+
+/**
+ * 设备类型
+ *
+ * @author ruoyi
+ */
+public enum FacTypes {
+    /**
+     * Product fac types.
+     *
+     * @author chen.cheng
+     */
+    PRODUCT("E", "能源生产系统"),
+    /**
+     * Transfer fac types.
+     *
+     * @author chen.cheng
+     */
+    TRANSFER("T", "中转系统"),
+    /**
+     * Transmit fac types.
+     *
+     * @author chen.cheng
+     */
+    TRANSMIT("W", "传输系统"),
+    /**
+     * Storage fac types.
+     *
+     * @author chen.cheng
+     */
+    STORAGE("C", "存储系统"),
+    /**
+     * Energy fac types.
+     *
+     * @author chen.cheng
+     */
+    ENERGY("Z", "用能系统");
+
+    /**
+     * The Code.
+     *
+     * @author chen.cheng
+     */
+    private final String code;
+
+    /**
+     * The Info.
+     *
+     * @author chen.cheng
+     */
+    private final String info;
+
+    /**
+     * Instantiates a new Fac types.
+     *
+     * @param code the code
+     * @param info the info
+     * @author chen.cheng
+     */
+    FacTypes(String code, String info) {
+        this.code = code;
+        this.info = info;
+    }
+
+    /**
+     * Gets code.
+     *
+     * @return the code
+     * @author chen.cheng
+     */
+    public String getCode() {
+        return code;
+    }
+
+    /**
+     * Gets info.
+     *
+     * @return the info
+     * @author chen.cheng
+     */
+    public String getInfo() {
+        return info;
+    }
+}

+ 39 - 0
ems-cloud/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ExpressUtil.java

@@ -0,0 +1,39 @@
+package com.ruoyi.common.core.utils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.expression.Expression;
+import org.springframework.expression.spel.standard.SpelExpressionParser;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.map.MapUtil;
+
+public final class ExpressUtil {
+    public static <T> List<Map<String, Object>> hitExpress(T obj, List<Map<String, Object>> indexRangeList) {
+        if (CollectionUtils.isEmpty(indexRangeList)) {
+            return null;
+        }
+        SpelExpressionParser spelExpressionParser = new SpelExpressionParser();
+        List<Map<String, Object>> result = new ArrayList<>();
+        Map<String, Object> map = new HashMap<>();
+        BeanUtil.beanToMap(obj, map, false, false);
+        String express;
+        String indexName;
+        Expression expression;
+        Boolean eval;
+        for (Map<String, Object> stringObjectMap : indexRangeList) {
+            indexName = MapUtil.getStr(stringObjectMap, "indexName");
+            express = String.format("%s < ['indexUpperLimit'] && %s >= ['indexLowerLimit']", map.get(indexName), map.get(indexName));
+            expression = spelExpressionParser.parseExpression(express);
+            eval = expression.getValue(stringObjectMap, Boolean.class);
+            if (Boolean.FALSE.equals(eval)) {
+                result.add(stringObjectMap);
+            }
+        }
+        return result;
+    }
+}

+ 260 - 0
ems-cloud/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/StreamUtils.java

@@ -0,0 +1,260 @@
+package com.ruoyi.common.core.utils;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import org.apache.commons.collections4.MapUtils;
+import org.springframework.util.CollectionUtils;
+
+/**
+ * stream 流工具类
+ */
+
+public class StreamUtils {
+
+    /**
+     * 将collection过滤
+     *
+     * @param collection 需要转化的集合
+     * @param function 过滤方法
+     * @return 过滤后的list
+     */
+    public static <E> List<E> filter(Collection<E> collection, Predicate<E> function) {
+        if (CollectionUtils.isEmpty(collection)) {
+            return new ArrayList<>();
+        }
+        return collection.stream().filter(function).collect(Collectors.toList());
+    }
+
+    /**
+     * 将collection拼接
+     *
+     * @param collection 需要转化的集合
+     * @param function 拼接方法
+     * @return 拼接后的list
+     */
+    public static <E> String join(Collection<E> collection, Function<E, String> function) {
+        return join(collection, function, StringUtils.SPACE);
+    }
+
+    /**
+     * 将collection拼接
+     *
+     * @param collection 需要转化的集合
+     * @param function 拼接方法
+     * @param delimiter 拼接符
+     * @return 拼接后的list
+     */
+    public static <E> String join(Collection<E> collection, Function<E, String> function, CharSequence delimiter) {
+        if (CollectionUtils.isEmpty(collection)) {
+            return StringUtils.EMPTY;
+        }
+        return collection.stream().map(function).filter(Objects::nonNull).collect(Collectors.joining(delimiter));
+    }
+
+    /**
+     * 将collection排序
+     *
+     * @param collection 需要转化的集合
+     * @param comparing 排序方法
+     * @return 排序后的list
+     */
+    public static <E> List<E> sorted(Collection<E> collection, Comparator<E> comparing) {
+        if (CollectionUtils.isEmpty(collection)) {
+            return new ArrayList<>();
+        }
+        return collection.stream().sorted(comparing).collect(Collectors.toList());
+    }
+
+    /**
+     * 将collection转化为类型不变的map<br>
+     * <B>{@code Collection<V>  ---->  Map<K,V>}</B>
+     *
+     * @param collection 需要转化的集合
+     * @param key V类型转化为K类型的lambda方法
+     * @param <V> collection中的泛型
+     * @param <K> map中的key类型
+     * @return 转化后的map
+     */
+    public static <V, K> Map<K, V> toIdentityMap(Collection<V> collection, Function<V, K> key) {
+        if (CollectionUtils.isEmpty(collection)) {
+            return new HashMap<>();
+        }
+        return collection.stream().collect(Collectors.toMap(key, Function.identity(), (l, r) -> l));
+    }
+
+    /**
+     * 将Collection转化为map(value类型与collection的泛型不同)<br>
+     * <B>{@code Collection<E> -----> Map<K,V>  }</B>
+     *
+     * @param collection 需要转化的集合
+     * @param key E类型转化为K类型的lambda方法
+     * @param value E类型转化为V类型的lambda方法
+     * @param <E> collection中的泛型
+     * @param <K> map中的key类型
+     * @param <V> map中的value类型
+     * @return 转化后的map
+     */
+    public static <E, K, V> Map<K, V> toMap(Collection<E> collection, Function<E, K> key, Function<E, V> value) {
+        if (CollectionUtils.isEmpty(collection)) {
+            return new HashMap<>();
+        }
+        return collection.stream().collect(Collectors.toMap(key, value, (l, r) -> l));
+    }
+
+    /**
+     * 将collection按照规则(比如有相同的班级id)分类成map<br>
+     * <B>{@code Collection<E> -------> Map<K,List<E>> } </B>
+     *
+     * @param collection 需要分类的集合
+     * @param key 分类的规则
+     * @param <E> collection中的泛型
+     * @param <K> map中的key类型
+     * @return 分类后的map
+     */
+    public static <E, K> Map<K, List<E>> groupByKey(Collection<E> collection, Function<E, K> key) {
+        if (CollectionUtils.isEmpty(collection)) {
+            return new HashMap<>();
+        }
+        return collection.stream().collect(Collectors.groupingBy(key, LinkedHashMap::new, Collectors.toList()));
+    }
+
+    /**
+     * 将collection按照两个规则(比如有相同的年级id,班级id)分类成双层map<br>
+     * <B>{@code Collection<E>  --->  Map<T,Map<U,List<E>>> } </B>
+     *
+     * @param collection 需要分类的集合
+     * @param key1 第一个分类的规则
+     * @param key2 第二个分类的规则
+     * @param <E> 集合元素类型
+     * @param <K> 第一个map中的key类型
+     * @param <U> 第二个map中的key类型
+     * @return 分类后的map
+     */
+    public static <E, K, U> Map<K, Map<U, List<E>>> groupBy2Key(Collection<E> collection, Function<E, K> key1,
+        Function<E, U> key2) {
+        if (CollectionUtils.isEmpty(collection)) {
+            return new HashMap<>();
+        }
+        return collection.stream().collect(Collectors.groupingBy(key1, LinkedHashMap::new,
+            Collectors.groupingBy(key2, LinkedHashMap::new, Collectors.toList())));
+    }
+
+    /**
+     * 将collection按照两个规则(比如有相同的年级id,班级id)分类成双层map<br>
+     * <B>{@code Collection<E>  --->  Map<T,Map<U,E>> } </B>
+     *
+     * @param collection 需要分类的集合
+     * @param key1 第一个分类的规则
+     * @param key2 第二个分类的规则
+     * @param <T> 第一个map中的key类型
+     * @param <U> 第二个map中的key类型
+     * @param <E> collection中的泛型
+     * @return 分类后的map
+     */
+    public static <E, T, U> Map<T, Map<U, E>> group2Map(Collection<E> collection, Function<E, T> key1,
+        Function<E, U> key2) {
+        if (CollectionUtils.isEmpty(collection) || key1 == null || key2 == null) {
+            return new HashMap<>();
+        }
+        return collection.stream().collect(
+            Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.toMap(key2, Function.identity(), (l, r) -> l)));
+    }
+
+    /**
+     * 将collection转化为List集合,但是两者的泛型不同<br>
+     * <B>{@code Collection<E>  ------>  List<T> } </B>
+     *
+     * @param collection 需要转化的集合
+     * @param function collection中的泛型转化为list泛型的lambda表达式
+     * @param <E> collection中的泛型
+     * @param <T> List中的泛型
+     * @return 转化后的list
+     */
+    public static <E, T> List<T> toList(Collection<E> collection, Function<E, T> function) {
+        if (CollectionUtils.isEmpty(collection)) {
+            return new ArrayList<>();
+        }
+        return collection.stream().map(function).filter(Objects::nonNull).collect(Collectors.toList());
+    }
+
+    /**
+     * 将collection转化为Set集合,但是两者的泛型不同<br>
+     * <B>{@code Collection<E>  ------>  Set<T> } </B>
+     *
+     * @param collection 需要转化的集合
+     * @param function collection中的泛型转化为set泛型的lambda表达式
+     * @param <E> collection中的泛型
+     * @param <T> Set中的泛型
+     * @return 转化后的Set
+     */
+    public static <E, T> Set<T> toSet(Collection<E> collection, Function<E, T> function) {
+        if (CollectionUtils.isEmpty(collection) || function == null) {
+            return new HashSet<>();
+        }
+        return collection.stream().map(function).filter(Objects::nonNull).collect(Collectors.toSet());
+    }
+
+    /**
+     * 合并两个相同key类型的map
+     *
+     * @param map1 第一个需要合并的 map
+     * @param map2 第二个需要合并的 map
+     * @param merge 合并的lambda,将key value1 value2合并成最终的类型,注意value可能为空的情况
+     * @param <K> map中的key类型
+     * @param <X> 第一个 map的value类型
+     * @param <Y> 第二个 map的value类型
+     * @param <V> 最终map的value类型
+     * @return 合并后的map
+     */
+    public static <K, X, Y, V> Map<K, V> merge(Map<K, X> map1, Map<K, Y> map2, BiFunction<X, Y, V> merge) {
+        if (MapUtils.isEmpty(map1) && MapUtils.isEmpty(map2)) {
+            return new HashMap<>();
+        }
+        else if (MapUtils.isEmpty(map1)) {
+            map1 = new HashMap<>();
+        }
+        else if (MapUtils.isEmpty(map2)) {
+            map2 = new HashMap<>();
+        }
+        Set<K> key = new HashSet<>();
+        key.addAll(map1.keySet());
+        key.addAll(map2.keySet());
+        Map<K, V> map = new HashMap<>();
+        for (K t : key) {
+            X x = map1.get(t);
+            Y y = map2.get(t);
+            V z = merge.apply(x, y);
+            if (z != null) {
+                map.put(t, z);
+            }
+        }
+        return map;
+    }
+    /**
+     * 将 Set 切分成多个子集
+     * @param originalSet 原始 Set
+     * @param chunkSize 每个子集的大小
+     * @return 切分后的子集列表
+     */
+    public static List<List<String>> splitSet(Set<String> originalSet, int chunkSize) {
+        List<String> list = new ArrayList<>(originalSet);
+        return IntStream.range(0, (int) Math.ceil((double) list.size() / chunkSize))
+                .mapToObj(i -> list.subList(i * chunkSize, Math.min((i + 1) * chunkSize, list.size())))
+                .collect(Collectors.toList());
+    }
+}

+ 72 - 6
ems-cloud/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/uuid/Seq.java

@@ -1,6 +1,7 @@
 package com.ruoyi.common.core.utils.uuid;
 
 import java.util.concurrent.atomic.AtomicInteger;
+
 import com.ruoyi.common.core.utils.DateUtils;
 import com.ruoyi.common.core.utils.StringUtils;
 
@@ -26,17 +27,21 @@ public class Seq
 
     /**
      * 获取通用序列号
-     * 
+     *
      * @return 序列值
      */
     public static String getId()
     {
         return getId(commSeqType);
     }
-    
+
+    public static String getIdWidthPrefix(String prefix) {
+        return prefix + getId(commSeqType);
+    }
+
     /**
      * 默认16位序列号 yyMMddHHmmss + 一位机器标识 + 3长度循环递增字符串
-     * 
+     *
      * @return 序列值
      */
     public static String getId(String type)
@@ -51,14 +56,14 @@ public class Seq
 
     /**
      * 通用接口序列号 yyMMddHHmmss + 一位机器标识 + length长度循环递增字符串
-     * 
+     *
      * @param atomicInt 序列数
      * @param length 数值长度
      * @return 序列值
      */
     public static String getId(AtomicInteger atomicInt, int length)
     {
-        String result = DateUtils.dateTimeNow();
+        String result = DateUtils.dateTimeNow("yyMMddHHmmss");
         result += machineCode;
         result += getSeq(atomicInt, length);
         return result;
@@ -66,7 +71,7 @@ public class Seq
 
     /**
      * 序列循环递增字符串[1, 10 的 (length)幂次方), 用0左补齐length位数
-     * 
+     *
      * @return 序列值
      */
     private synchronized static String getSeq(AtomicInteger atomicInt, int length)
@@ -83,4 +88,65 @@ public class Seq
         // 转字符串,用0左补齐
         return StringUtils.padl(value, length);
     }
+
+    public static void main(String[] args) {
+        // 线程数=count*count
+        int count = 10;
+        final long[][] times = new long[count][100];
+
+        Thread[] threads = new Thread[count];
+        for (int i = 0; i < threads.length; i++) {
+            final int ip = i;
+            threads[i] = new Thread() {
+                @Override
+                public void run() {
+                    for (int j = 0; j < 10; j++) {
+                        long t1 = System.nanoTime();// 该函数是返回纳秒的。1毫秒=1纳秒*1000000
+
+                        System.out.println(Seq.getId());// 测试
+
+                        long t = System.nanoTime() - t1;
+
+                        times[ip][j] = t;// 求平均
+                    }
+                }
+
+            };
+        }
+
+        long lastMilis = System.currentTimeMillis();
+        // 逐个启动线程
+        for (int i = 0; i < threads.length; i++) {
+            threads[i].start();
+        }
+
+        for (int i = 0; i < threads.length; i++) {
+            try {
+                threads[i].join();
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+        }
+        /**
+         * 1、QPS:系统每秒处理的请求数(query per second) 2、RT:系统的响应时间,一个请求的响应时间,也可以是一段时间的平均值 3、最佳线程数量:刚好消耗完服务器瓶颈资源的临界线程数
+         * 对于单线程:QPS=1000/RT 对于多线程:QPS=1000*线程数量/RT
+         */
+        long time = System.currentTimeMillis() - lastMilis;
+        System.out.println("QPS: " + (1000 * count / time));
+
+        long sum = 0;
+        long max = 0;
+        for (int i = 0; i < times.length; i++) {
+            for (int j = 0; j < times[i].length; j++) {
+                sum += times[i][j];
+
+                if (times[i][j] > max) {
+                    max = times[i][j];
+                }
+            }
+        }
+        System.out.println("Sum(ms)" + time);
+        System.out.println("AVG(ms): " + sum / 1000000 / (count * 100));
+        System.out.println("MAX(ms): " + max / 1000000);
+    }
 }

+ 102 - 0
ems-cloud/sql/ems_init_data.sql

@@ -392,3 +392,105 @@ INSERT INTO adm_elecprice_strategy_hour (`strategy_code`, `start_time`, `end_tim
 INSERT INTO adm_co_charging_config (`area_code`, `elec_unit_price`, `elec_gt_compute_type`, `elec_compute_desc`, `water_unit_price`, `water_gt_compute_type`, `water_compute_desc`) VALUES ('321283124S3001', 0.6068, 1, '1.按户数均摊\n公摊电费每户收费 = 公摊电费 / 户数\n2、按面积分摊\n单户公摊电费 = 公摊电费 * (单户面积 / 总面积)', 3.04, 0, NULL);
 INSERT INTO adm_co_charging_config (`area_code`, `elec_unit_price`, `elec_gt_compute_type`, `elec_compute_desc`, `water_unit_price`, `water_gt_compute_type`, `water_compute_desc`) VALUES ('321283124S3002', 0.6068, 1, '1.按户数均摊\n公摊电费每户收费 = 公摊电费 / 户数\n2、按面积分摊\n单户公摊电费 = 公摊电费 * (单户面积 / 总面积)', 3.04, 0, NULL);
 
+-- 能源计量设备DEMO数据
+-- 电表
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-102', '321283124S3001', 45, 1, 3, 'B-102', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-103', '321283124S3001', 45, 1, 3, 'B-103', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-104', '321283124S3001', 45, 1, 3, 'B-104', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-105', '321283124S3001', 45, 1, 3, 'B-105', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-106', '321283124S3001', 45, 1, 3, 'B-106', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-107', '321283124S3001', 45, 1, 3, 'B-107', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-108', '321283124S3001', 45, 1, 3, 'B-108', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-109', '321283124S3001', 45, 1, 3, 'B-109', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-110', '321283124S3001', 45, 1, 3, 'B-110', 1, 4, 1, 1, '直采表');
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-Z120', '321283124S3001', 45, 2, 1, 'Z120', 0, 4, 1, 20, '互感器表');
+
+-- 水表
+INSERT INTO `adm_meter_device` (`device_code`, `area_code`, `meter_cls`, `obj_type`, `obj_sub_type`, `obj_code`, `obj_tag`, `col_cycle`, `col_mode`, `magnification`, `spec_desc`) VALUES ('J-D-B-01', '321283124S3001', 70, 1, 2, '321283124S300101', 0, 4, 1, 1, '直采表');
+
+
+-- 抄表demo数据
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202402', 100, '2024-02-29', 238, '2024-02-28', 138, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202403', 238, '2024-02-29', 365, '2024-03-31', 127, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202404', 365, '2024-03-31', 537, '2024-04-30', 172, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202405', 537, '2024-04-30', 686, '2024-05-31', 149, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202406', 686, '2024-05-31', 921, '2024-06-30', 235, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202407', 921, '2024-06-30', 1189, '2024-07-31', 268, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-102', '321283124S3001', '2024', '202408', 1189, '2024-07-31', 1464, '2024-08-31', 275, NULL, NULL);
+
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202402', 100, '2024-02-29', 250, '2024-02-28', 150, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202403', 250, '2024-02-29', 360, '2024-03-31', 160, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202404', 360, '2024-03-31', 500, '2024-04-30', 140, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202405', 500, '2024-04-30', 600, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202406', 600, '2024-05-31', 720, '2024-06-30', 120, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202407', 720, '2024-06-30', 800, '2024-07-31', 80, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-103', '321283124S3001', '2024', '202408', 800, '2024-07-31', 860, '2024-08-31', 160, NULL, NULL);
+
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202402', 100, '2024-02-29', 200, '2024-02-28', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202403', 200, '2024-02-29', 300, '2024-03-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202404', 300, '2024-03-31', 400, '2024-04-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202405', 400, '2024-04-30', 500, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202406', 500, '2024-05-31', 600, '2024-06-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202407', 600, '2024-06-30', 700, '2024-07-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-104', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);
+
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202402', 100, '2024-02-29', 200, '2024-02-28', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202403', 200, '2024-02-29', 300, '2024-03-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202404', 300, '2024-03-31', 400, '2024-04-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202405', 400, '2024-04-30', 500, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202406', 500, '2024-05-31', 600, '2024-06-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202407', 600, '2024-06-30', 700, '2024-07-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-105', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);
+
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202402', 100, '2024-02-29', 200, '2024-02-28', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202403', 200, '2024-02-29', 300, '2024-03-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202404', 300, '2024-03-31', 400, '2024-04-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202405', 400, '2024-04-30', 500, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202406', 500, '2024-05-31', 600, '2024-06-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202407', 600, '2024-06-30', 700, '2024-07-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-106', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);
+
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202402', 100, '2024-02-29', 200, '2024-02-28', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202403', 200, '2024-02-29', 300, '2024-03-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202404', 300, '2024-03-31', 400, '2024-04-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202405', 400, '2024-04-30', 500, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202406', 500, '2024-05-31', 600, '2024-06-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202407', 600, '2024-06-30', 700, '2024-07-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-107', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);
+
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202402', 100, '2024-02-29', 200, '2024-02-28', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202403', 200, '2024-02-29', 300, '2024-03-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202404', 300, '2024-03-31', 400, '2024-04-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202405', 400, '2024-04-30', 500, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202406', 500, '2024-05-31', 600, '2024-06-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202407', 600, '2024-06-30', 700, '2024-07-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-108', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);
+
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202402', 100, '2024-02-29', 200, '2024-02-28', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202403', 200, '2024-02-29', 300, '2024-03-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202404', 300, '2024-03-31', 400, '2024-04-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202405', 400, '2024-04-30', 500, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202406', 500, '2024-05-31', 600, '2024-06-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202407', 600, '2024-06-30', 700, '2024-07-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-109', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);
+
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202401', 0, '2024-02-29', 100, '2024-01-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202402', 100, '2024-02-29', 200, '2024-02-28', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202403', 200, '2024-02-29', 300, '2024-03-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202404', 300, '2024-03-31', 400, '2024-04-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202405', 400, '2024-04-30', 500, '2024-05-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202406', 500, '2024-05-31', 600, '2024-06-30', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202407', 600, '2024-06-30', 700, '2024-07-31', 100, NULL, NULL);
+INSERT INTO adm_meter_reading_manual (`device_code`, `area_code`, `year`, `meter_month`, `last_reading`, `last_time`, `meter_reading`, `meter_time`, `increase`, `create_time`, `update_time`) VALUES ('J-D-B-110', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);
+
+
+
+

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

@@ -259,7 +259,6 @@ create table dim_ems_tag (
 INSERT INTO `dim_ems_tag` (`tag_model`, `tag_code`, `tag_name`) VALUES ('Area', 'Area_00', '公共区域');
 INSERT INTO `dim_ems_tag` (`tag_model`, `tag_code`, `tag_name`) VALUES ('Area', 'Area_01', '商户区域');
 
-
 -- ----------------------------
 -- 设备类型
 -- ----------------------------
@@ -577,6 +576,7 @@ create table adm_meter_device  (
   `obj_type`        int             not null                     comment '计量对象类型 1-区域 2-设备',
   `obj_sub_type`    int             not null                     comment '计量对象子类型',
   `obj_code`        varchar(32)     not null                     comment '计量对象编码',
+  `obj_tag`         int             default null                 comment '对象标记',
   `col_cycle`       int             default null                 comment '采集周期',
   `col_mode`        int             default null                 comment '采集方式',
   `magnification`   int             default 1                    comment '倍率',
@@ -827,7 +827,7 @@ create table adm_meter_reading_manual (
   `id`               bigint(20)      not null auto_increment      comment '序号',
   `device_code`      varchar(16)     not null                     comment '计量设备code',
   `area_code`        varchar(16)     not null                     comment '服务区代码',
-  `year`             year            not null                     comment '年份yyyy',
+  `year`             varchar(4)      not null                     comment '年份yyyy',
   `meter_month`      varchar(6)      not null                     comment '计量月yyyyMM',
   `last_reading`     int             default null                 comment '上次示数',
   `last_time`        date            default null                 comment '上次抄表日期',

+ 93 - 22
ems-cloud/sql/ems_sys.sql

@@ -193,14 +193,15 @@ insert into sys_menu values ('142',  '设备台账',       '5',    '2',  'device
 insert into sys_menu values ('143',  '设备告警',       '5',    '3',  'analysis-warn',       'analysis/device/warn',   '', 1, 0, 'C', '0', '0',   'analysis:device',        'deviceanalyze',  'admin', sysdate(), '', null, '设备分析');
 insert into sys_menu values ('144',  '手动抄表',       '5',    '4',  'meterRead-manual',    'devmgr/meterRead',       '', 1, 0, 'C', '0', '0',   'ems:meterReading:list',  'meterReading',   'admin', sysdate(), '', null, '手动抄表');
 
-insert into sys_menu values ('151',  '告警策略',       '6',    '1',  'warn-strategy',      'warn/strategy',          '', 1, 0, 'C', '0', '0',   'warn:strategy',          'warnstrategy',   'admin', sysdate(), '', null, '告警策略');
-insert into sys_menu values ('152',  '告警列表',       '6',    '2',  'warn-list',          'warn/list',              '', 1, 0, 'C', '0', '0',   'warn:list',              'warnmsg',        'admin', sysdate(), '', null, '告警策略');
-INSERT INTO sys_menu VALUES (153, '巡检任务', 6, 3, 'oper-task', 'oper-mgr/task', '', 1, 0, 'C', '0', '0', 'oper-mgr:task', 'task', 'admin', '2024-08-29 10:34:48', '', NULL, '巡检任务');
-insert into sys_menu values ('154',  '巡检报告',       '6',    '4',  'oper-report',        'oper-mgr/report',        '', 1, 0, 'C', '0', '0',   'oper-mgr:report',        'note',           'admin', sysdate(), '', null, '巡检报告');
+INSERT INTO sys_menu VALUES ('151',  '告警策略',       '6',    '1',  'warn-strategy',       'alarm/index',            '', 1, 0, 'C', '0', '0',    'warn:strategy', 'warnstrategy', 'admin', '2024-08-29 15:40:27', 'admin', '2024-08-29 16:01:10', '告警策略');
+INSERT INTO sys_menu VALUES ('152',  '告警列表',       '6',    '2',  'warn-list',           'alarm/alarm-info/index', '', 1, 0, 'C', '0', '0',    'warn:list', 'warnmsg', 'admin', '2024-08-29 15:40:27', 'admin', '2024-08-29 16:01:36', '告警策略');
+INSERT INTO sys_menu VALUES ('153',  '巡检任务',       '6',    '3',  'oper-task',           'task/index',             '', 1, 0, 'C', '0', '0',    'oper-mgr:task', 'task', 'admin', '2024-08-29 15:40:27', 'admin', '2024-08-29 16:02:38', '巡检任务');
+insert into sys_menu values ('154',  '巡检报告',       '6',    '4',  'oper-report',        'task/report/index',        '', 1, 0, 'C', '0', '0',   'oper-mgr:report',        'note',           'admin', sysdate(), '', null, '巡检报告');
 
 insert into sys_menu values ('161',  '建筑区块',       '7',    '1',  'buildingcfg',        '',                       '', 1, 0, 'M', '0', '0',   'basecfg:building',       'building',       'admin', sysdate(), '', null, '用户管理菜单');
 insert into sys_menu values ('162',  '设备设施',       '7',    '2',  'devicecfg',          '',                       '', 1, 0, 'M', '0', '0',   'basecfg:device',         'devicemgr',      'admin', sysdate(), '', null, '用户管理菜单');
 insert into sys_menu values ('163',  '能源计量',       '7',    '3',  'energycfg',          '',                       '', 1, 0, 'M', '0', '0',   'basecfg:energy',         'energy',         'admin', sysdate(), '', null, '用户管理菜单');
+insert into sys_menu values ('164',  '标签管理',       '7',    '4',  'emstag',             'basecfg/tag',            '', 1, 0, 'C', '0', '0',   'basecfg:tag:list',       'tree',           'admin', sysdate(), '', null, '标签菜单');
 
 insert into sys_menu values ('170',  '用户管理',       '8',   '1',  'user',               'system/user/index',      '', 1, 0, 'C', '0', '0',   'system:user:list',       'user',           'admin', sysdate(), '', null, '用户管理菜单');
 insert into sys_menu values ('171',  '角色管理',       '8',   '2',  'role',               'system/role/index',      '', 1, 0, 'C', '0', '0',   'system:role:list',       'peoples',        'admin', sysdate(), '', null, '角色管理菜单');
@@ -215,18 +216,20 @@ insert into sys_menu values ('179',  '在线用户',       '8',   '10', 'online'
 INSERT INTO sys_menu VALUES ('180',  '任务调度',       '8',   '10', 'task/job',           'monitor/job/index',      '', 1, 0, 'C', '0', '0',   'monitor:job',            'date-range',     'admin', sysdate(), '', NULL, '任务调度');
 
 
-insert into sys_menu values ('190',  '光伏',          '9',   '1',  'adapter-pv',         'adapter/pv/index',      '', 1, 0, 'C', '0', '0',   'adapter:user:list',       'photovoltaic',        'admin', sysdate(), '', null, '光伏');
-insert into sys_menu values ('191',  '光储直柔',       '9',   '2',  'adapter-gczr',       'adapter/gczr/index',    '', 1, 0, 'C', '0', '0',   'adapter:role:list',       'deviceaccess',      'admin', sysdate(), '', null, '光储直柔');
-insert into sys_menu values ('192',  '光储充',         '9',   '3',  'adapter-gcc',        'adapter/gcc/index',     '', 1, 0, 'C', '0', '0',   'adapter:menu:list',       'energyconsume',       'admin', sysdate(), '', null, '光储充');
-insert into sys_menu values ('193',  '充电桩',         '9',   '4',  'adapter-cdz',        'adapter/cdz/index',     '', 1, 0, 'C', '0', '0',   'adapter:dept:list',       'powerstore',       'admin', sysdate(), '', null, '充电桩');
-insert into sys_menu values ('194',  '智慧照明',       '9',   '5',  'adapter-zm',         'adapter/zm/index',      '', 1, 0, 'C', '0', '0',   'adapter:post:list',       'system',        'admin', sysdate(), '', null, '智慧照明');
-insert into sys_menu values ('195',  '智慧海绵',       '9',   '6',  'adapter-hm',         'adapter/hm/index',      '', 1, 0, 'C', '0', '0',   'adapter:dict:list',       'system',        'admin', sysdate(), '', null, '智慧海绵');
-insert into sys_menu values ('196',  '垃圾厨余',       '9',   '7',  'adapter-ljcy',       'adapter/ljcy/index',    '', 1, 0, 'C', '0', '0',   'adapter:config:list',     'system',      'admin', sysdate(), '', null, '垃圾厨余');
-insert into sys_menu values ('197',  '能耗监测',       '9',   '8',  'adapter-nhjc',       'adapter/nhjc/index',    '', 1, 0, 'C', '0', '0',   'adapter:notice:list',     'system',      'admin', sysdate(), '', null, '能耗监测');
-insert into sys_menu values ('198',  '设备管理',       '9',   '9',  'adapter-devc',       'adapter/devc/index',    '', 1, 0, 'M', '0', '0',   'adapter:devc:list',       'system',      'admin', sysdate(), '', null, '设备管理');
+insert into sys_menu values ('190',  '系统信息',       '9',   '1',  'adapter-subsystem',  'adapter/subsystem/index',  '', 1, 0, 'C', '0', '0',   'adapter:subsystem:list',  'note',           'admin', sysdate(), '', null, '光伏');
+insert into sys_menu values ('191',  '光伏',          '9',   '2',  'adapter-pv',         'adapter/pv/index',      '', 1, 0, 'C', '0', '0',   'adapter:user:list',       'photovoltaic',        'admin', sysdate(), '', null, '光伏');
+insert into sys_menu values ('192',  '光储直柔',       '9',   '3',  'adapter-gczr',       'adapter/gczr/index',    '', 1, 0, 'C', '0', '0',   'adapter:role:list',       'deviceaccess',      'admin', sysdate(), '', null, '光储直柔');
+insert into sys_menu values ('193',  '光储充',         '9',   '4',  'adapter-gcc',        'adapter/gcc/index',     '', 1, 0, 'C', '0', '0',   'adapter:menu:list',       'energyconsume',       'admin', sysdate(), '', null, '光储充');
+insert into sys_menu values ('194',  '充电桩',         '9',   '5',  'adapter-cdz',        'adapter/cdz/index',     '', 1, 0, 'C', '0', '0',   'adapter:dept:list',       'powerstore',       'admin', sysdate(), '', null, '充电桩');
+insert into sys_menu values ('195',  '智慧照明',       '9',   '6',  'adapter-zm',         'adapter/zm/index',      '', 1, 0, 'C', '0', '0',   'adapter:post:list',       'system',        'admin', sysdate(), '', null, '智慧照明');
+insert into sys_menu values ('196',  '智慧海绵',       '9',   '7',  'adapter-hm',         'adapter/hm/index',      '', 1, 0, 'C', '0', '0',   'adapter:dict:list',       'system',        'admin', sysdate(), '', null, '智慧海绵');
+insert into sys_menu values ('197',  '垃圾厨余',       '9',   '8',  'adapter-ljcy',       'adapter/ljcy/index',    '', 1, 0, 'C', '0', '0',   'adapter:config:list',     'system',      'admin', sysdate(), '', null, '垃圾厨余');
+insert into sys_menu values ('198',  '能耗监测',       '9',   '9',  'adapter-nhjc',       'adapter/nhjc/index',    '', 1, 0, 'C', '0', '0',   'adapter:notice:list',     'system',      'admin', sysdate(), '', null, '能耗监测');
+insert into sys_menu values ('199',  '设备管理',       '9',   '10',  'adapter-devc',       'adapter/devc/index',    '', 1, 0, 'M', '0', '0',   'adapter:devc:list',       'system',      'admin', sysdate(), '', null, '设备管理');
 
-insert into sys_menu values ('998',  '表单构建',       '99',   '1',  'build',              'tool/build/index',       '', 1, 0, 'C', '0', '0',   'tool:build:list',        'build',          'admin', sysdate(), '', null, '表单构建菜单');
-insert into sys_menu values ('999',  '代码生成',       '99',   '2',  'gen',                'tool/gen/index',         '', 1, 0, 'C', '0', '0',   'tool:gen:list',          'code',           'admin', sysdate(), '', null, '代码生成菜单');
+insert into sys_menu values ('997',  '表单构建',       '99',   '1',  'build',              'tool/build/index',       '', 1, 0, 'C', '0', '0',   'tool:build:list',        'build',          'admin', sysdate(), '', null, '表单构建菜单');
+insert into sys_menu values ('998',  '代码生成',       '99',   '2',  'gen',                'tool/gen/index',         '', 1, 0, 'C', '0', '0',   'tool:gen:list',          'code',           'admin', sysdate(), '', null, '代码生成菜单');
+insert into sys_menu values ('999',  '系统接口',       '99',   '3',  'http://localhost:9100/swagger-ui/index.html',   '', '', 0, 0, 'C', '0', '0', 'tool:swagger:list',   'swagger',        'admin', sysdate(), '', null, '系统接口菜单');
 
 -- 三级菜单
 -- 预测菜单
@@ -245,7 +248,8 @@ insert into sys_menu values ('1612',  '功能分区',   '161', '3',  'basecfg-zo
 insert into sys_menu values ('1620',  '设施分类',   '162', '1',  'basecfg-facstype',       'basecfg/facstype/index',     '', 1, 0, 'C', '0', '0',   'basecfg:facstype:list',        'cfgwrite',   'admin', sysdate(), '', null, '设施配置');
 insert into sys_menu values ('1621',  '能源设施',   '162', '2',  'basecfg-facscfg',        'basecfg/emsfacs/index',      '', 1, 0, 'C', '0', '0',   'basecfg:emsfacs:list',         'cfgwrite',   'admin', sysdate(), '', null, '设施配置');
 insert into sys_menu values ('1622',  '能流关系',   '162', '3',  'basecfg-flowrel',        'basecfg/flowrel/index',      '', 1, 0, 'C', '0', '0',   'basecfg:flowrel:list',         'cfgwrite',   'admin', sysdate(), '', null, '设备配置');
-insert into sys_menu values ('1623',  '用能设备',   '162', '4',  'basecfg-devccfg',        'basecfg/device/index',       '', 1, 0, 'C', '0', '0',   'basecfg:device:list',          'cfgwrite',   'admin', sysdate(), '', null, '设备配置');
+insert into sys_menu values ('1623',  '能源设备',   '162', '4',  'basecfg-devccfg',        'basecfg/device/index',       '', 1, 0, 'C', '0', '0',   'basecfg:device:list',          'cfgwrite',   'admin', sysdate(), '', null, '设备配置');
+insert into sys_menu values ('1624',  '配电设施',   '162', '5',  'basecfg-powerbox',       'basecfg/powerbox/index',     '', 1, 0, 'C', '0', '0',   'ems:powerbox:list',            'cfgwrite',   'admin', sysdate(), '', null, '配电设施');
 insert into sys_menu values ('1630',  '价格策略',   '163', '1',  'basecfg-electricity',    'basecfg/price/index',        '', 1, 0, 'C', '0', '0',   'basecfg:price:list',           'cfgwrite',   'admin', sysdate(), '', null, '价格策略');
 insert into sys_menu values ('1631',  '计量设备',   '163', '2',  'basecfg-meterdevc',      'basecfg/meterdevc/index',     '', 1, 0, 'C', '0', '0',  'ems:meterdevc:list',           'cfgwrite',   'admin', sysdate(), '', null, '计量设备');
 insert into sys_menu values ('1632',  '碳核算',     '163', '3',  'basecfg-cacfg',          'basecfg/cacfg/index',        '', 1, 0, 'C', '0', '0',   'basecfg:cacfg:list',           'cfgwrite',   'admin', sysdate(), '', null, '碳排因子');
@@ -371,11 +375,11 @@ INSERT INTO `sys_menu` VALUES (1134,'edit',113, 1, '', NULL, NULL, 1, 0, 'F', '0
 INSERT INTO `sys_menu` VALUES (1135,'remove',113, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'power-mgr:gs:remove', '#', 'admin', sysdate(), '', NULL, '');
 
 -- 告警策略
-INSERT INTO sys_menu VALUES(1510, 'list', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
-INSERT INTO sys_menu VALUES(1511, 'export', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:export', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
-INSERT INTO sys_menu VALUES(1512, 'query', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
-INSERT INTO sys_menu VALUES(1513, 'add', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:add', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
-INSERT INTO sys_menu VALUES(1514, 'edit', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:edit', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1510, 'list', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1511, 'export', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:export', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1512, 'query', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1513, 'add', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:add', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1514, 'edit', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:edit', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
 INSERT INTO sys_menu VALUES (1515, 'remove', 151, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:alarm-strategy:remove', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
 
 -- 告警列表
@@ -427,7 +431,6 @@ INSERT INTO `sys_menu` VALUES (1324,'edit',132, 1, '', NULL, NULL, 1, 0, 'F', '0
 INSERT INTO `sys_menu` VALUES (1325,'remove',132, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ca-analysis:sink:remove', '#', 'admin', sysdate(), '', NULL, '');
 
 
-
 -- 巡检任务
 INSERT INTO sys_menu VALUES (1531, 'list', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-task:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
 INSERT INTO sys_menu VALUES (1532, 'export', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-task:export', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
@@ -435,6 +438,16 @@ INSERT INTO sys_menu VALUES (1534, 'query', 153, 1, '', NULL, NULL, 1, 0, 'F', '
 INSERT INTO sys_menu VALUES (1535, 'add', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-task:add', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
 INSERT INTO sys_menu VALUES (1536, 'edit', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-task:edit', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
 INSERT INTO sys_menu VALUES (1537, 'remove', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-task:remove', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1538, '执行一次', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:auto-task:exc', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1539, '任务查询权限', 153, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:auto-task:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+
+-- 巡检报告
+INSERT INTO sys_menu VALUES (1541, '查询', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1542, '导出', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:export', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1543, '查询权限', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:query', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1544, '新增', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:add', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1545, '修改', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:edit', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
+INSERT INTO sys_menu VALUES (1546, '删除', 154, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'ems:inspection-report:remove', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
 
 -- 任务调度
 INSERT INTO sys_menu VALUES (1800, '任务列表', 180, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'monitor:job:list', '#', 'admin', '2024-08-26 11:08:42', '', NULL, '');
@@ -792,6 +805,20 @@ insert into sys_dict_type values(7,  '通知类型', 'sys_notice_type',     '0',
 insert into sys_dict_type values(8,  '通知状态', 'sys_notice_status',   '0', 'admin', sysdate(), '', null, '通知状态列表');
 insert into sys_dict_type values(9,  '操作类型', 'sys_oper_type',       '0', 'admin', sysdate(), '', null, '操作类型列表');
 insert into sys_dict_type values(10, '系统状态', 'sys_common_status',   '0', 'admin', sysdate(), '', null, '登录状态列表');
+INSERT INTO `sys_dict_type` VALUES (100, '设备状态', 'sys_device_stat', '0', 'admin', '2024-08-07 10:21:42', '', NULL, NULL);
+INSERT INTO `sys_dict_type` VALUES (101, '策略类型', 'strategy_type', '0', 'admin', '2024-08-08 14:45:51', 'admin', '2024-08-08 14:46:11', '1:源网协调,2:源荷互动');
+INSERT INTO `sys_dict_type` VALUES (102, '执行模式', 'exec_mode', '0', 'admin', '2024-08-08 14:48:15', '', NULL, '0:固定策略 1:规则引擎 2:定时执行(cron)99:手动执行');
+INSERT INTO `sys_dict_type` VALUES (103, '是否允许修改标记', 'allow_modify', '0', 'admin', '2024-08-08 17:00:42', '', NULL, NULL);
+INSERT INTO `sys_dict_type` VALUES (104, '计量类型', 'meter_type', '0', 'admin', '2024-08-09 10:23:03', 'admin', '2024-08-09 10:23:30', '计量类型 0:不区分 1:峰电计量  2:谷电计量');
+INSERT INTO `sys_dict_type` VALUES (105, '设施对象类型', 'obj_type', '0', 'admin', '2024-08-12 14:22:40', 'admin', '2024-08-28 15:33:20', '对象类型 0:园区,1:区块,2:设施,3:设备');
+INSERT INTO `sys_dict_type` VALUES (106, '标签', 'basecfg_lable', '0', 'admin', '2024-08-19 10:44:49', '', NULL, NULL);
+INSERT INTO `sys_dict_type` VALUES (107, '告警规则', 'alarm_thre_type', '0', 'admin', '2024-08-26 10:26:49', '', NULL, '1大于;2小于');
+INSERT INTO `sys_dict_type` VALUES (108, '告警类型', 'alarm_type', '0', 'admin', '2024-08-26 10:28:04', '', NULL, '1:一般告警 2:重要告警 3:紧急告警 4:恢复告警 5:诊断告警 6:其他告警');
+INSERT INTO `sys_dict_type` VALUES (109, '告警状态', 'alarm_state', '0', 'admin', '2024-08-26 11:39:44', 'admin', '2024-08-26 11:40:27', '0-新增,1-处置中,2-已处置,3-消散');
+INSERT INTO `sys_dict_type` VALUES (110, '设备台账对象类型', 'device_type', '0', 'admin', '2024-08-27 15:00:16', '', NULL, '设备台账对象类型');
+INSERT INTO `sys_dict_type` VALUES (111, '巡检类型', 'task_type', '0', 'admin', '2024-08-29 14:28:37', '', NULL, '1自动;2手动');
+INSERT INTO `sys_dict_type` VALUES (112, '巡检状态', 'task_status', '0', 'admin', '2024-08-29 14:30:35', 'admin', '2024-08-29 16:18:01', '0未完成,1进行中,2已完成,3已超期');
+INSERT INTO `sys_dict_type` VALUES (113, '巡检结果', 'inspection_result', '0', 'admin', '2024-08-29 16:49:17', '', NULL, '结果状态 0:正常  1:异常');
 
 
 -- ----------------------------
@@ -846,6 +873,50 @@ insert into sys_dict_data values(26, 8,  '生成代码', '8',       'sys_oper_ty
 insert into sys_dict_data values(27, 9,  '清空数据', '9',       'sys_oper_type',       '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '清空操作');
 insert into sys_dict_data values(28, 1,  '成功',     '0',       'sys_common_status',   '',   'primary', 'N', '0', 'admin', sysdate(), '', null, '正常状态');
 insert into sys_dict_data values(29, 2,  '失败',     '1',       'sys_common_status',   '',   'danger',  'N', '0', 'admin', sysdate(), '', null, '停用状态');
+INSERT INTO `sys_dict_data` VALUES (100, 0, '运行', '0', 'sys_device_stat', NULL, 'default', 'N', '0', 'admin', '2024-08-07 10:22:55', 'admin', '2024-08-07 11:12:50', NULL);
+INSERT INTO `sys_dict_data` VALUES (101, 0, '故障', '1', 'sys_device_stat', NULL, 'default', 'N', '0', 'admin', '2024-08-07 10:23:36', 'admin', '2024-08-07 11:12:56', NULL);
+INSERT INTO `sys_dict_data` VALUES (102, 0, '未运行', '2', 'sys_device_stat', NULL, 'default', 'N', '0', 'admin', '2024-08-07 10:23:48', 'admin', '2024-08-07 11:13:00', NULL);
+INSERT INTO `sys_dict_data` VALUES (103, 0, '源网协调', '1', 'strategy_type', NULL, 'default', 'N', '0', 'admin', '2024-08-08 14:46:37', '', NULL, NULL);
+INSERT INTO `sys_dict_data` VALUES (104, 0, '源荷互动', '2', 'strategy_type', NULL, 'default', 'N', '0', 'admin', '2024-08-08 14:46:55', '', NULL, NULL);
+INSERT INTO `sys_dict_data` VALUES (105, 0, '固定策略', '0', 'exec_mode', NULL, 'default', 'N', '0', 'admin', '2024-08-08 14:48:38', '', NULL, NULL);
+INSERT INTO `sys_dict_data` VALUES (106, 0, '规则引擎', '1', 'exec_mode', NULL, 'default', 'N', '0', 'admin', '2024-08-08 14:48:51', '', NULL, NULL);
+INSERT INTO `sys_dict_data` VALUES (107, 0, '定时执行(cron)', '2', 'exec_mode', NULL, 'default', 'N', '0', 'admin', '2024-08-08 14:49:06', '', NULL, NULL);
+INSERT INTO `sys_dict_data` VALUES (108, 0, '手动执行', '99', 'exec_mode', NULL, 'default', 'N', '0', 'admin', '2024-08-08 14:49:34', '', NULL, '手动执行');
+INSERT INTO `sys_dict_data` VALUES (109, 0, '是', '0', 'allow_modify', NULL, 'default', 'N', '0', 'admin', '2024-08-08 17:01:57', 'admin', '2024-08-08 17:03:14', NULL);
+INSERT INTO `sys_dict_data` VALUES (110, 0, '否', '1', 'allow_modify', NULL, 'default', 'N', '0', 'admin', '2024-08-08 17:03:04', '', NULL, NULL);
+INSERT INTO `sys_dict_data` VALUES (111, 0, '不区分', '0', 'meter_type', NULL, 'default', 'N', '0', 'admin', '2024-08-09 10:23:59', '', NULL, '0:不区分 ');
+INSERT INTO `sys_dict_data` VALUES (112, 0, '峰电计量', '1', 'meter_type', NULL, 'default', 'N', '0', 'admin', '2024-08-09 10:24:14', '', NULL, '1:峰电计量  ');
+INSERT INTO `sys_dict_data` VALUES (113, 0, '谷电计量', '2', 'meter_type', NULL, 'default', 'N', '0', 'admin', '2024-08-09 10:24:24', '', NULL, '2:谷电计量');
+INSERT INTO `sys_dict_data` VALUES (114, 0, '区块', '1', 'obj_type', NULL, 'default', 'N', '0', 'admin', '2024-08-12 14:23:19', 'admin', '2024-08-28 15:33:44', '');
+INSERT INTO `sys_dict_data` VALUES (115, 0, '设施 ', '2', 'obj_type', NULL, 'default', 'N', '0', 'admin', '2024-08-12 14:23:30', '', NULL, ' 2-设施 ');
+INSERT INTO `sys_dict_data` VALUES (116, 0, '设备', '3', 'obj_type', NULL, 'default', 'N', '0', 'admin', '2024-08-12 14:23:40', 'admin', '2024-08-12 14:23:47', '3-设备');
+INSERT INTO `sys_dict_data` VALUES (117, 1, ' photovoltaic', '100', 'basecfg_lable', NULL, 'default', 'N', '0', 'admin', '2024-08-19 10:50:16', 'admin', '2024-08-19 14:33:00', '光伏');
+INSERT INTO `sys_dict_data` VALUES (118, 2, 'energy', '200', 'basecfg_lable', NULL, 'default', 'N', '0', 'admin', '2024-08-19 10:50:59', '', NULL, '能源');
+INSERT INTO `sys_dict_data` VALUES (119, 3, 'Energy storage', '300', 'basecfg_lable', NULL, 'default', 'N', '0', 'admin', '2024-08-19 10:51:30', '', NULL, '储能');
+INSERT INTO `sys_dict_data` VALUES (120, 0, '大于', '1', 'alarm_thre_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:27:12', '', NULL, NULL);
+INSERT INTO `sys_dict_data` VALUES (121, 0, '小于', '2', 'alarm_thre_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:27:26', '', NULL, NULL);
+INSERT INTO `sys_dict_data` VALUES (122, 0, '一般告警', '1', 'alarm_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:28:19', 'admin', '2024-08-27 14:41:59', '1:一般告警 2:重要告警 3:紧急告警 4:恢复告警 5:诊断告警 6:其他告警');
+INSERT INTO `sys_dict_data` VALUES (123, 0, '重要告警', '2', 'alarm_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:28:27', 'admin', '2024-08-26 10:28:40', '1:一般告警 2:重要告警 3:紧急告警 4:恢复告警 5:诊断告警 6:其他告警');
+INSERT INTO `sys_dict_data` VALUES (124, 0, '紧急告警', '3', 'alarm_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:28:53', '', NULL, '3:紧急告警 4:恢复告警 5:诊断告警 6:其他告警');
+INSERT INTO `sys_dict_data` VALUES (125, 0, '恢复告警', '4', 'alarm_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:29:17', '', NULL, '4:恢复告警 ');
+INSERT INTO `sys_dict_data` VALUES (126, 0, '诊断告警', '5', 'alarm_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:29:30', '', NULL, '5:诊断告警 ');
+INSERT INTO `sys_dict_data` VALUES (127, 0, '其他告警', '6', 'alarm_type', NULL, 'default', 'N', '0', 'admin', '2024-08-26 10:29:38', '', NULL, '6:其他告警');
+INSERT INTO `sys_dict_data` VALUES (128, 0, '新增', '0', 'alarm_state', NULL, 'default', 'N', '0', 'admin', '2024-08-26 11:40:51', '', NULL, '0-新增,');
+INSERT INTO `sys_dict_data` VALUES (129, 0, '处置中', '1', 'alarm_state', NULL, 'default', 'N', '0', 'admin', '2024-08-26 11:41:06', '', NULL, '1-处置中,');
+INSERT INTO `sys_dict_data` VALUES (130, 0, '已处置', '2', 'alarm_state', NULL, 'default', 'N', '0', 'admin', '2024-08-26 11:41:19', '', NULL, '2-已处置,');
+INSERT INTO `sys_dict_data` VALUES (131, 0, '消散', '3', 'alarm_state', NULL, 'default', 'N', '0', 'admin', '2024-08-26 11:41:30', '', NULL, '3-消散');
+INSERT INTO `sys_dict_data` VALUES (132, 1, '设备', '0', 'device_type', NULL, 'default', 'N', '0', 'admin', '2024-08-27 15:02:01', '', NULL, NULL);
+INSERT INTO `sys_dict_data` VALUES (133, 2, '设施', '1', 'device_type', NULL, 'default', 'N', '0', 'admin', '2024-08-27 15:02:15', '', NULL, NULL);
+INSERT INTO `sys_dict_data` VALUES (134, 0, '园区', '0', 'obj_type', NULL, 'default', 'N', '0', 'admin', '2024-08-28 15:34:10', '', NULL, '对象类型 0:园区,1:区块,2:设施,3:设备');
+INSERT INTO `sys_dict_data` VALUES (135, 0, '自动', '1', 'task_type', NULL, 'default', 'N', '0', 'admin', '2024-08-29 14:28:57', '', NULL, '1自动;2手动');
+INSERT INTO `sys_dict_data` VALUES (136, 0, '手动', '2', 'task_type', NULL, 'default', 'N', '0', 'admin', '2024-08-29 14:29:12', '', NULL, '手动');
+INSERT INTO `sys_dict_data` VALUES (137, 0, '自动巡检', 'EMS_AUTO_TASK', 'sys_job_group', NULL, 'default', 'N', '0', 'admin', '2024-08-29 16:11:54', 'admin', '2024-08-29 16:12:21', NULL);
+INSERT INTO `sys_dict_data` VALUES (138, 0, '未完成', '0', 'task_status', NULL, 'default', 'N', '0', 'admin', '2024-08-29 16:18:23', '', NULL, '0未完成,');
+INSERT INTO `sys_dict_data` VALUES (139, 0, '进行中', '1', 'task_status', NULL, 'default', 'N', '0', 'admin', '2024-08-29 16:18:39', '', NULL, '1进行中,');
+INSERT INTO `sys_dict_data` VALUES (140, 0, '已完成', '2', 'task_status', NULL, 'default', 'N', '0', 'admin', '2024-08-29 16:18:55', '', NULL, '2已完成,');
+INSERT INTO `sys_dict_data` VALUES (141, 0, '已超期', '3', 'task_status', NULL, 'default', 'N', '0', 'admin', '2024-08-29 16:19:05', '', NULL, '3已超期');
+INSERT INTO `sys_dict_data` VALUES (142, 0, '正常', '0', 'inspection_result', NULL, 'default', 'N', '0', 'admin', '2024-08-29 16:49:39', '', NULL, '结果状态 0:正常  1:异常');
+INSERT INTO `sys_dict_data` VALUES (143, 0, '异常', '1', 'inspection_result', NULL, 'default', 'N', '0', 'admin', '2024-08-29 16:49:55', '', NULL, NULL);
 
 
 -- ----------------------------