mirror of
https://gitee.com/san-bing/JChargePointProtocol
synced 2026-05-13 06:19:56 +08:00
bugfix
This commit is contained in:
@@ -197,7 +197,6 @@ public class InstallInitializingBean implements InitializingBean {
|
|||||||
User adminUser = User.builder()
|
User adminUser = User.builder()
|
||||||
.id(adminUserId)
|
.id(adminUserId)
|
||||||
.createdTime(LocalDateTime.now())
|
.createdTime(LocalDateTime.now())
|
||||||
.updatedTime(LocalDateTime.now())
|
|
||||||
.additionalInfo(additionalInfo)
|
.additionalInfo(additionalInfo)
|
||||||
.status(UserStatusEnum.ENABLE)
|
.status(UserStatusEnum.ENABLE)
|
||||||
.userName("sanbing")
|
.userName("sanbing")
|
||||||
@@ -249,7 +248,6 @@ public class InstallInitializingBean implements InitializingBean {
|
|||||||
Station station = Station.builder()
|
Station station = Station.builder()
|
||||||
.id(stationId)
|
.id(stationId)
|
||||||
.createdTime(LocalDateTime.now())
|
.createdTime(LocalDateTime.now())
|
||||||
.updatedTime(LocalDateTime.now())
|
|
||||||
.additionalInfo(additionalInfo)
|
.additionalInfo(additionalInfo)
|
||||||
.stationName(data[1])
|
.stationName(data[1])
|
||||||
.stationCode(data[2])
|
.stationCode(data[2])
|
||||||
@@ -322,7 +320,6 @@ public class InstallInitializingBean implements InitializingBean {
|
|||||||
Pile pile = Pile.builder()
|
Pile pile = Pile.builder()
|
||||||
.id(pileId)
|
.id(pileId)
|
||||||
.createdTime(LocalDateTime.now())
|
.createdTime(LocalDateTime.now())
|
||||||
.updatedTime(LocalDateTime.now())
|
|
||||||
.additionalInfo(additionalInfo)
|
.additionalInfo(additionalInfo)
|
||||||
.pileName(String.format("%s-%d号充电桩", station.getStationName(), pileIndex))
|
.pileName(String.format("%s-%d号充电桩", station.getStationName(), pileIndex))
|
||||||
.pileCode(pileCode)
|
.pileCode(pileCode)
|
||||||
@@ -363,7 +360,6 @@ public class InstallInitializingBean implements InitializingBean {
|
|||||||
Gun gun = Gun.builder()
|
Gun gun = Gun.builder()
|
||||||
.id(gunId)
|
.id(gunId)
|
||||||
.createdTime(LocalDateTime.now())
|
.createdTime(LocalDateTime.now())
|
||||||
.updatedTime(LocalDateTime.now())
|
|
||||||
.additionalInfo(additionalInfo)
|
.additionalInfo(additionalInfo)
|
||||||
.gunNo(String.format("%02d", gunIndex))
|
.gunNo(String.format("%02d", gunIndex))
|
||||||
.gunName(String.format("%s-%d号枪", pile.getPileName(), gunIndex))
|
.gunName(String.format("%s-%d号枪", pile.getPileName(), gunIndex))
|
||||||
@@ -398,23 +394,23 @@ public class InstallInitializingBean implements InitializingBean {
|
|||||||
currentTime
|
currentTime
|
||||||
);
|
);
|
||||||
attributeService.save(pileId, statusAttr);
|
attributeService.save(pileId, statusAttr);
|
||||||
|
|
||||||
if (isOnline) {
|
if (isOnline) {
|
||||||
// 在线桩设置连接时间
|
// 在线桩设置连接时间
|
||||||
AttributeKvEntry connectedAtAttr = new BaseAttributeKvEntry(
|
AttributeKvEntry connectedAtAttr = new BaseAttributeKvEntry(
|
||||||
new LongDataEntry(AttrKeyEnum.CONNECTED_AT.getCode(), currentTime - (3600000L * (pileIndex % 12))),
|
new LongDataEntry(AttrKeyEnum.CONNECTED_AT.getCode(), currentTime - (3600000L * (pileIndex % 12))),
|
||||||
currentTime
|
currentTime
|
||||||
);
|
);
|
||||||
attributeService.save(pileId, connectedAtAttr);
|
attributeService.save(pileId, connectedAtAttr);
|
||||||
} else {
|
} else {
|
||||||
// 离线桩设置断开时间
|
// 离线桩设置断开时间
|
||||||
AttributeKvEntry disconnectedAtAttr = new BaseAttributeKvEntry(
|
AttributeKvEntry disconnectedAtAttr = new BaseAttributeKvEntry(
|
||||||
new LongDataEntry(AttrKeyEnum.DISCONNECTED_AT.getCode(), currentTime - (1800000L * (pileIndex % 6))),
|
new LongDataEntry(AttrKeyEnum.DISCONNECTED_AT.getCode(), currentTime - (1800000L * (pileIndex % 6))),
|
||||||
currentTime
|
currentTime
|
||||||
);
|
);
|
||||||
attributeService.save(pileId, disconnectedAtAttr);
|
attributeService.save(pileId, disconnectedAtAttr);
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("为充电桩 {} 设置演示状态属性: {}", pileId, status);
|
log.info("为充电桩 {} 设置演示状态属性: {}", pileId, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,9 +32,6 @@ CREATE TABLE IF NOT EXISTS t_user
|
|||||||
CREATE UNIQUE INDEX IF NOT EXISTS uni_user_name
|
CREATE UNIQUE INDEX IF NOT EXISTS uni_user_name
|
||||||
on t_user (user_name);
|
on t_user (user_name);
|
||||||
|
|
||||||
-- 为t_user表的字段添加注释
|
|
||||||
COMMENT ON COLUMN t_user.authority IS '用户权限: SYS_ADMIN, TENANT_ADMIN, CUSTOMER_USER, REFRESH_TOKEN, PRE_VERIFICATION_TOKEN';
|
|
||||||
|
|
||||||
-- 为authority字段创建索引,便于按权限查询用户
|
-- 为authority字段创建索引,便于按权限查询用户
|
||||||
CREATE INDEX IF NOT EXISTS idx_user_authority
|
CREATE INDEX IF NOT EXISTS idx_user_authority
|
||||||
on t_user (authority);
|
on t_user (authority);
|
||||||
@@ -89,7 +86,7 @@ CREATE TABLE IF NOT EXISTS t_gun
|
|||||||
id uuid not null
|
id uuid not null
|
||||||
primary key,
|
primary key,
|
||||||
created_time timestamp default CURRENT_TIMESTAMP not null,
|
created_time timestamp default CURRENT_TIMESTAMP not null,
|
||||||
updated_time timestamp default CURRENT_TIMESTAMP not null,
|
updated_time timestamp,
|
||||||
additional_info varchar(255),
|
additional_info varchar(255),
|
||||||
gun_no varchar(255) not null,
|
gun_no varchar(255) not null,
|
||||||
gun_name varchar(255) not null,
|
gun_name varchar(255) not null,
|
||||||
|
|||||||
Reference in New Issue
Block a user