修复默认酒店启动覆盖名称问题
This commit is contained in:
@@ -185,7 +185,7 @@ public class PlatformIdentityBootstrapRunner implements ApplicationRunner {
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化默认酒店基础资料,供首个管理员和本地测试环境使用。
|
||||
* 初始化默认酒店基础资料;已有酒店由管理后台维护,启动时不覆盖展示名称、时区和排序。
|
||||
*/
|
||||
private void seedDefaultHotel() {
|
||||
String defaultHotelId = authProperties.getBootstrap().getDefaultHotelId();
|
||||
@@ -195,17 +195,16 @@ public class PlatformIdentityBootstrapRunner implements ApplicationRunner {
|
||||
PlatformHotelEntity hotel = hotelRepository.findHotelByHotelId(defaultHotelId)
|
||||
.orElseGet(PlatformHotelEntity::new);
|
||||
boolean creating = hotel.getId() == null;
|
||||
if (!creating) {
|
||||
return;
|
||||
}
|
||||
hotel.setHotelId(defaultHotelId);
|
||||
hotel.setHotelName(defaultString(authProperties.getBootstrap().getDefaultHotelName(), defaultHotelId));
|
||||
hotel.setHotelStatus(PlatformHotelStatus.ACTIVE.name());
|
||||
hotel.setTimeZone(defaultString(authProperties.getBootstrap().getDefaultHotelTimeZone(), "Asia/Bangkok"));
|
||||
hotel.setSortOrder(10);
|
||||
setAuditTime(hotel, creating);
|
||||
if (creating) {
|
||||
hotelRepository.insertHotel(hotel);
|
||||
} else {
|
||||
hotelRepository.updateHotel(hotel);
|
||||
}
|
||||
hotelRepository.insertHotel(hotel);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user