refactor(sis): - 将原有的单一外部通道号拆分为上键通道号和下键通道号

This commit is contained in:
zcxlsm 2025-08-06 20:36:00 +08:00
parent 2b19146c70
commit 2a6f258ae5
14 changed files with 91 additions and 34 deletions

View File

@ -47,8 +47,12 @@ public class CleanLiftAuthRocketConsumer implements RocketMQListener<MessageExt>
List<SisElevatorFloorRefVo> eleRef = groupRef.stream().filter(o -> Objects.equals(o.getElevatorId(), deviceId)).toList();
for (SisElevatorFloorRefVo ref : eleRef){
if (ref.getOutChannel() != null && Objects.equals(ref.getFloorId(), deviceFloorId)){
HikApiService.getInstance().controlGateway(ele.getControlIp(), ref.getOutChannel().intValue(), 3);
if (ref.getUpChannel() != null && Objects.equals(ref.getFloorId(), deviceFloorId)){
HikApiService.getInstance().controlGateway(ele.getControlIp(), ref.getUpChannel().intValue(), 3);
}
if (ref.getDownChannel() != null && Objects.equals(ref.getFloorId(), deviceFloorId)){
HikApiService.getInstance().controlGateway(ele.getControlIp(), ref.getDownChannel().intValue(), 3);
}
if (ref.getInChannel() != null && Objects.equals(ref.getFloorId(), deviceFloorId)){

View File

@ -38,14 +38,19 @@ public class SisElevatorFloorChannelRef extends TenantEntity {
private Long elevatorId;
/**
* 内部通道号
* 楼层通道号
*/
private Long inChannel;
/**
* 外部通道号
* 上键通道号
*/
private Long outChannel;
private Long upChannel;
/**
* 下键通道号
*/
private Long downChannel;
}

View File

@ -43,14 +43,19 @@ public class SisElevatorFloorRef extends TenantEntity {
private Long authGroupId;
/**
* 内部通道号
* 楼层通道号
*/
private Long inChannel;
/**
* 外部通道号
* 上键通道号
*/
private Long outChannel;
private Long upChannel;
/**
* 下键通道号
*/
private Long downChannel;
}

View File

@ -39,14 +39,19 @@ public class SisElevatorFloorChannelRefBo extends BaseEntity {
private Long elevatorId;
/**
* 内部通道号
* 楼层通道号
*/
private Long inChannel;
/**
* 外部通道号
* 上键通道号
*/
private Long outChannel;
private Long upChannel;
/**
* 下键通道号
*/
private Long downChannel;
}

View File

@ -46,7 +46,19 @@ public class SisElevatorFloorRefBo extends BaseEntity {
@NotNull(message = "授权组id不能为空", groups = { AddGroup.class, EditGroup.class })
private Long authGroupId;
/**
* 楼层通道号
*/
private Long inChannel;
/**
* 上键通道号
*/
private Long upChannel;
/**
* 下键通道号
*/
private Long downChannel;
}

View File

@ -163,7 +163,8 @@ public class SisElevatorInfoBo extends BaseEntity {
public static class ChannelInfo {
private Long floorId;
private Long inChannel;
private Long outChannel;
private Long upChannel;
private Long downChannel;
}

View File

@ -47,16 +47,23 @@ public class SisElevatorFloorChannelRefVo implements Serializable {
private Long elevatorId;
/**
* 内部通道号
* 楼层通道号
*/
@ExcelProperty(value = "内部通道号")
@ExcelProperty(value = "楼层通道号")
private Long inChannel;
/**
* 外部通道号
* 上键通道号
*/
@ExcelProperty(value = "外部通道号")
private Long outChannel;
@ExcelProperty(value = "上键通道号")
private Long upChannel;
/**
* 下键通道号
*/
@ExcelProperty(value = "下键通道号")
private Long downChannel;
}

View File

@ -51,13 +51,18 @@ public class SisElevatorFloorRefVo implements Serializable {
private Long authGroupId;
/**
* 内部通道号
* 楼层通道号
*/
private Long inChannel;
/**
* 外部通道号
* 上键通道号
*/
private Long outChannel;
private Long upChannel;
/**
* 下键通道号
*/
private Long downChannel;
}

View File

@ -33,13 +33,17 @@ public class HuaweiBoxRunner implements ApplicationRunner {
private final HuaWeiHttp huaWeiHttp;
@Override
public void run(ApplicationArguments args) throws Exception {
Boolean login = huaWeiHttp.login();
if (login) {
log.info("华为盒子登录成功");
this.keepAlive();
} else {
log.error("华为盒子登录失败");
public void run(ApplicationArguments args) {
try {
Boolean login = huaWeiHttp.login();
if (login) {
log.info("华为盒子登录成功");
this.keepAlive();
} else {
log.warn("华为盒子登录失败");
}
} catch (Exception e) {
log.error("华为盒子登录异常,但继续执行应用启动", e);
}
}

View File

@ -103,6 +103,7 @@ public class HuaWeiBoxApiService implements HuaWeiBoxApi {
return switch (jsonRes.getInt("resultCode")) {
case 912322041 -> new HWResult<>(912322041, "特征值提取失败", 0L);
case 912333003 -> new HWResult<>(912333003, "base64参数非法", 0L);
case 912322040 -> new HWResult<>(912322040, "MCS检索获取特征失败", 0L);
default -> new HWResult<>(jsonRes.getInt("resultCode"), jsonRes.getStr("resultMsg"), 0L);
};
}

View File

@ -78,7 +78,8 @@ public class SisElevatorFloorChannelRefServiceImpl implements ISisElevatorFloorC
lqw.eq(bo.getFloorId() != null, SisElevatorFloorChannelRef::getFloorId, bo.getFloorId());
lqw.eq(bo.getElevatorId() != null, SisElevatorFloorChannelRef::getElevatorId, bo.getElevatorId());
lqw.eq(bo.getInChannel() != null, SisElevatorFloorChannelRef::getInChannel, bo.getInChannel());
lqw.eq(bo.getOutChannel() != null, SisElevatorFloorChannelRef::getOutChannel, bo.getOutChannel());
lqw.eq(bo.getUpChannel() != null, SisElevatorFloorChannelRef::getUpChannel, bo.getUpChannel());
lqw.eq(bo.getDownChannel() != null, SisElevatorFloorChannelRef::getDownChannel, bo.getDownChannel());
return lqw;
}

View File

@ -118,7 +118,8 @@ public class SisElevatorFloorRefServiceImpl implements ISisElevatorFloorRefServi
// 存在通道关系同时写入
SisElevatorFloorChannelRefVo channelRef = channelInfoMap.get(num);
if (channelRef != null) {
add.setOutChannel(channelRef.getOutChannel());
add.setDownChannel(channelRef.getDownChannel());
add.setUpChannel(channelRef.getUpChannel());
add.setInChannel(channelRef.getInChannel());
}
@ -209,7 +210,8 @@ public class SisElevatorFloorRefServiceImpl implements ISisElevatorFloorRefServi
SisElevatorFloorChannelRef floorInfo = floorInfoMap.get(item.getFloorId());
if (floorInfo != null) {
item.setInChannel(floorInfo.getInChannel());
item.setOutChannel(floorInfo.getOutChannel());
item.setUpChannel(floorInfo.getUpChannel());
item.setDownChannel(floorInfo.getDownChannel());
}
}

View File

@ -242,7 +242,8 @@ public class SisElevatorInfoServiceImpl implements ISisElevatorInfoService {
ref.setElevatorId(bo.getElevatorId());
ref.setFloorId(channelInfo.getFloorId());
ref.setInChannel(channelInfo.getInChannel());
ref.setOutChannel(channelInfo.getOutChannel());
ref.setUpChannel(channelInfo.getUpChannel());
ref.setDownChannel(channelInfo.getDownChannel());
channelRefs.add(ref);
}
// 写入电梯楼层通道关联表

View File

@ -54,7 +54,7 @@ public class ZeroSensationPassageServiceImpl implements IZeroSensationPassageSer
// 抓拍小图
String smallImgBase64Str = Base64Encoder.encode(smallImg);
HWResult<Long> result = huaWeiBoxApi.findPerson(smallImgBase64Str);
if (result.getCode() == 0) {
if (result.getCode() != 200) {
log.info("华为盒子比对失败,msg={}", result.getMessage());
// 产生告警数据
alarmEventsService.createAlarmRecord(deviceIp, 1, 1, "人脸比对失败", smallImg, bigImg);
@ -157,8 +157,12 @@ public class ZeroSensationPassageServiceImpl implements IZeroSensationPassageSer
for (SisElevatorFloorRefVo ref : eleRef){
if (controlType == 2){
log.info("开始下发外面版梯控权限....");
if (ref.getOutChannel() != null && Objects.equals(ref.getFloorId(), deviceFloorId)) {
HikApiService.getInstance().controlGateway(ele.getControlIp(), ref.getOutChannel().intValue(), 2);
if (ref.getUpChannel() != null && Objects.equals(ref.getFloorId(), deviceFloorId)) {
HikApiService.getInstance().controlGateway(ele.getControlIp(), ref.getUpChannel().intValue(), 2);
}
if (ref.getDownChannel() != null && Objects.equals(ref.getFloorId(), deviceFloorId)) {
HikApiService.getInstance().controlGateway(ele.getControlIp(), ref.getDownChannel().intValue(), 2);
}
}else {
log.info("开始下发里面版梯控权限....");