mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 08:20:31 +08:00
fix(v0.11): 兼容优先的走查整改——SnowFlake/BeanCopy 卫生与电梯编码批量查询
- 不改 AES 模式、不重命名 KafkaProducter,避免影响旧客户端与二进制兼容。
- SnowFlakeSerialCode:中断等待改恢复中断标志 + Slf4j 替代 printStackTrace。
- BeanCopyUtils:实例化仅捕获 ReflectiveOperationException,copyProperties 异常仍按运行时上抛,对外行为与旧版一致。
- 电梯 39202:新增 MyBatis listByZoneIds 与 AcsElevatorCodeService.mapByZoneIds(增量 API),树接口仍逐条组装 DTO,仅将循环内多次 get 合并为一次 IN 查询,HTTP 契约不变。
验证:maven-cloudwalk-legacy-public 全量 compile;cw-elevator-application-data 单模块 compile 通过。
Made-with: Cursor
Former-commit-id: 57270a7ac5
This commit is contained in:
+6
-7
@@ -34,12 +34,11 @@ public static <T> T copyProperties(Object source, Class<T> targetClazz) {
|
||||
/* 34 */ T target = null;
|
||||
try {
|
||||
/* 36 */ target = targetClazz.getDeclaredConstructor().newInstance();
|
||||
/* 37 */ BeanUtils.copyProperties(source, target);
|
||||
/* 38 */ } catch (Exception e) {
|
||||
/* 39 */ throw new RuntimeException(e);
|
||||
/* 37 */ } catch (ReflectiveOperationException e) {
|
||||
/* 38 */ throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
/* 42 */ return target;
|
||||
/* 40 */ BeanUtils.copyProperties(source, target);
|
||||
/* 41 */ return target;
|
||||
}
|
||||
|
||||
|
||||
@@ -102,10 +101,10 @@ for (V source : list) {
|
||||
E target = null;
|
||||
try {
|
||||
target = clazz.getDeclaredConstructor().newInstance();
|
||||
BeanUtils.copyProperties(source, target);
|
||||
} catch (Exception e) {
|
||||
} catch (ReflectiveOperationException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
BeanUtils.copyProperties(source, target);
|
||||
|
||||
result.add(target);
|
||||
}
|
||||
|
||||
+5
-1
@@ -13,6 +13,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
|
||||
|
||||
@@ -39,6 +41,7 @@ import org.springframework.data.redis.core.RedisTemplate;
|
||||
public class SnowFlakeSerialCode
|
||||
implements UUIDSerial
|
||||
{
|
||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||
private static final int LOCK_TRY_MAX_TIME = 5;
|
||||
private static final int THREAD_SLEEP_TIME = 5;
|
||||
/* 44 */ private static final Integer MAX_NODE_ID = Integer.valueOf(31);
|
||||
@@ -218,7 +221,8 @@ return true;
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(5L);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
Thread.currentThread().interrupt();
|
||||
this.log.warn("获取雪花 Redis 锁等待被中断", e);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user