refactor(energy): 简化事件驱动系统(7个→3个)

- 删除旧事件:BillApprovedEvent, BillCreatedEvent, DeductionCompletedEvent, DetailAuditedEvent, DetailCreatedEvent, RecordMatchedEvent
- 新增事件:BillAuditPassedEvent, DetailAuditPassedEvent
- 保留事件:RecordImportedEvent
- 更新监听器:AccountEventListener, BillEventListener, DetailEventListener
- 清理代码中的旧事件引用和注释

优化原则:前端简单,后端健壮
事件流程:导入→匹配→生成明细→审核→扣款→生成账单→结算
This commit is contained in:
kkfluous
2026-03-16 12:53:14 +08:00
parent f5062cec22
commit 2f38a703f9
167 changed files with 9876 additions and 824 deletions

View File

@@ -0,0 +1,62 @@
-- ==========================================
-- 2026-03-16 Energy 模块优化
-- 新增加氢站基础信息表asset 模块)
-- 去掉 energy_station_config 表
-- ==========================================
-- ----------------------------
-- 1. 在 asset 模块创建加氢站表
-- ----------------------------
DROP TABLE IF EXISTS `asset_hydrogen_station`;
CREATE TABLE `asset_hydrogen_station` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(100) NOT NULL COMMENT '站点名称',
`short_name` varchar(50) DEFAULT NULL COMMENT '简称',
`station_no` varchar(50) DEFAULT NULL COMMENT '站点编码',
`city` varchar(50) DEFAULT NULL COMMENT '所属城市',
`address` varchar(255) DEFAULT NULL COMMENT '站点地址',
`longitude` varchar(50) DEFAULT NULL COMMENT '经度',
`latitude` varchar(50) DEFAULT NULL COMMENT '纬度',
`contact` varchar(50) DEFAULT NULL COMMENT '联系人',
`phone` varchar(20) DEFAULT NULL COMMENT '联系电话',
`station_type` tinyint DEFAULT NULL COMMENT '站点类型(字典)',
`cooperation_type` tinyint NOT NULL DEFAULT 0 COMMENT '合作类型0=合作 1=非合作)',
`auto_deduct` tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否自动扣款1=是 0=否)',
`booking_required` tinyint(1) DEFAULT 0 COMMENT '是否需要预约1=是 0=否)',
`station_status` tinyint NOT NULL DEFAULT 1 COMMENT '站点状态0=停用 1=启用)',
`start_business` time DEFAULT NULL COMMENT '开始营业时间',
`end_business` time DEFAULT NULL COMMENT '结束营业时间',
`billing_method` tinyint DEFAULT NULL COMMENT '结算方式(字典)',
`cooperation_term` date DEFAULT NULL COMMENT '合作期限',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`creator` varchar(64) DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) DEFAULT '' COMMENT '更新者',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_station_no` (`station_no`),
KEY `idx_name` (`name`),
KEY `idx_city` (`city`),
KEY `idx_station_status` (`station_status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='加氢站基础信息';
-- ----------------------------
-- 2. 删除 energy_station_config 表
-- ----------------------------
DROP TABLE IF EXISTS `energy_station_config`;
-- ----------------------------
-- 3. 插入测试数据
-- ----------------------------
INSERT INTO `asset_hydrogen_station`
(`id`, `name`, `short_name`, `station_no`, `city`, `address`, `contact`, `phone`,
`cooperation_type`, `auto_deduct`, `station_status`, `start_business`, `end_business`, `remark`)
VALUES
(1, '嘉兴嘉燃经开站', '经开站', 'JX001', '嘉兴', '浙江省嘉兴市经济开发区岗山路', '张三', '13800138000',
0, 1, 1, '08:00:00', '18:00:00', '合作站点,自动扣款'),
(2, '上海临港加氢站', '临港站', 'SH001', '上海', '上海市浦东新区临港新城', '李四', '13900139000',
0, 1, 1, '07:00:00', '19:00:00', '合作站点,自动扣款'),
(3, '杭州萧山加氢站', '萧山站', 'HZ001', '杭州', '浙江省杭州市萧山区', '王五', '13700137000',
1, 0, 1, '08:30:00', '17:30:00', '非合作站点,审核后扣款');