Kaynağa Gözat

手动抄表联调

lv.wenbin 11 ay önce
ebeveyn
işleme
5eaef1f1b2

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

@@ -120,7 +120,7 @@ public class MeterReadingManualController extends BaseController {
 
         if (null != lastItem) {
             Assert.isTrue(meterRec.getMeterReading() >= lastItem.getMeterReading(), -1, "抄表值不能小于上一条记录");
-            meterRec.setYear(Year.now());
+            meterRec.setYear(DateUtils.dateToString(date, "yyyy"));
             meterRec.setMeterMonth(DateUtils.dateToString(date, "yyyyMM"));
             meterRec.setLastReading(lastItem.getMeterReading());
             meterRec.setLastTime(lastItem.getMeterTime());
@@ -129,7 +129,7 @@ public class MeterReadingManualController extends BaseController {
                 (meterRec.getMeterReading() - lastItem.getMeterReading()) * meterDevice.getMagnification());
         }
         else {
-            meterRec.setYear(Year.now());
+            meterRec.setYear(DateUtils.dateToString(date, "yyyy"));
             meterRec.setMeterMonth(DateUtils.dateToString(date, "yyyyMM"));
             meterRec.setMeterTime(date);
             meterRec.setIncrease(meterRec.getMeterReading() * meterDevice.getMagnification());

+ 7 - 8
ems-cloud/ems-modules/ems-server/src/main/java/com/ruoyi/ems/domain/MeterReadingManual.java

@@ -1,12 +1,12 @@
 package com.ruoyi.ems.domain;
 
-import java.time.Year;
-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
@@ -30,9 +30,8 @@ public class MeterReadingManual extends BaseEntity
     private String areaCode;
 
     /** 年份yyyy */
-    @JsonFormat(pattern = "yyyy")
     @Excel(name = "年份yyyy")
-    private Year year;
+    private String year;
 
     /** 计量月yyyyMM */
     @Excel(name = "计量月yyyyMM")
@@ -87,12 +86,12 @@ public class MeterReadingManual extends BaseEntity
     {
         return areaCode;
     }
-    public void setYear(Year year)
+    public void setYear(String year)
     {
         this.year = year;
     }
 
-    public Year getYear()
+    public String getYear()
     {
         return year;
     }

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

@@ -244,11 +244,11 @@ INSERT INTO adm_co_charging_config (`area_code`, `elec_unit_price`, `elec_gt_com
 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_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', 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-102', '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-102', '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-102', '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-102', '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-102', '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-102', '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-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', 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-102', '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-102', '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-102', '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-102', '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-102', '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-102', '321283124S3001', '2024', '202408', 700, '2024-07-31', 800, '2024-08-31', 100, NULL, NULL);

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

@@ -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 '上次抄表日期',

+ 17 - 15
ems-cloud/sql/ems_sys.sql

@@ -193,9 +193,9 @@ 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', '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 ('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, '用户管理菜单');
@@ -216,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 ('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 ('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 ('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, '系统接口菜单');
 
 -- 三级菜单
 -- 预测菜单