feat(device): 增加设备绑定楼层信息
This commit is contained in:
parent
1288d27125
commit
a12ee50d08
@ -45,5 +45,9 @@ public class SisDeviceBindRef extends TenantEntity {
|
||||
*/
|
||||
private Integer controlType;
|
||||
|
||||
/**
|
||||
* 楼层id
|
||||
*/
|
||||
private Long deviceFloorId;
|
||||
|
||||
}
|
||||
|
@ -80,4 +80,9 @@ public class SisDeviceManage extends BaseEntity {
|
||||
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 楼层id
|
||||
*/
|
||||
private Long floorId;
|
||||
|
||||
}
|
||||
|
@ -62,6 +62,12 @@ public class SisDeviceManageBo extends BaseEntity {
|
||||
@NotBlank(message = "设备密码不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String devicePwd;
|
||||
|
||||
/**
|
||||
* 楼层id
|
||||
*/
|
||||
@NotNull(message = "楼层id不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long floorId;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
|
@ -77,6 +77,11 @@ public class SisDeviceManageVo implements Serializable {
|
||||
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "deviceType", other = "sis_ipc_device_type")
|
||||
private Integer deviceTypeName;
|
||||
|
||||
/**
|
||||
* 楼层id
|
||||
*/
|
||||
private Long floorId;
|
||||
|
||||
/**
|
||||
* 设备厂商编号
|
||||
*/
|
||||
@ -90,5 +95,4 @@ public class SisDeviceManageVo implements Serializable {
|
||||
private Long groupId;
|
||||
|
||||
private String groupName;
|
||||
|
||||
}
|
||||
|
@ -141,6 +141,7 @@ public class SisAccessControlServiceImpl implements ISisAccessControlService {
|
||||
SisDeviceBindRef sisDeviceBindRef = new SisDeviceBindRef();
|
||||
sisDeviceBindRef.setDeviceId(sisDeviceManageVo.getId());
|
||||
sisDeviceBindRef.setDeviceIp(sisDeviceManageVo.getDeviceIp());
|
||||
sisDeviceBindRef.setDeviceFloorId(sisDeviceManageVo.getFloorId());
|
||||
sisDeviceBindRef.setBindId(bo.getId());
|
||||
sisDeviceBindRef.setControlType(ControlTypeEnum.ACCESS_CONTROL.getCode());
|
||||
Boolean insert = sisDeviceBindRefService.insert(sisDeviceBindRef);
|
||||
|
@ -50,7 +50,11 @@ public class SisDeviceManageServiceImpl implements ISisDeviceManageService {
|
||||
*/
|
||||
@Override
|
||||
public SisDeviceManageVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
SisDeviceManageVo deviceManageVo = baseMapper.selectVoById(id);
|
||||
|
||||
log.info("查询设备管理:{}", deviceManageVo);
|
||||
|
||||
return deviceManageVo;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -20,12 +20,10 @@ import org.dromara.sis.domain.SisElevatorFloorChannelRef;
|
||||
import org.dromara.sis.domain.SisElevatorInfo;
|
||||
import org.dromara.sis.domain.bo.SisElevatorInfoBo;
|
||||
import org.dromara.sis.domain.enums.ControlTypeEnum;
|
||||
import org.dromara.sis.domain.vo.SisDeviceManageVo;
|
||||
import org.dromara.sis.domain.vo.SisElevatorInfoVo;
|
||||
import org.dromara.sis.mapper.SisElevatorInfoMapper;
|
||||
import org.dromara.sis.service.ISisDeviceBindRefService;
|
||||
import org.dromara.sis.service.ISisElevatorFloorChannelRefService;
|
||||
import org.dromara.sis.service.ISisElevatorFloorRefService;
|
||||
import org.dromara.sis.service.ISisElevatorInfoService;
|
||||
import org.dromara.sis.service.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -45,6 +43,7 @@ import static org.dromara.common.core.constant.CodePrefixConstants.ELEVATOR_CONT
|
||||
public class SisElevatorInfoServiceImpl implements ISisElevatorInfoService {
|
||||
|
||||
private final SisElevatorInfoMapper baseMapper;
|
||||
private final ISisDeviceManageService deviceManageService;
|
||||
private final ISisDeviceBindRefService deviceBindRefService;
|
||||
private final ISisElevatorFloorRefService elevatorFloorRefService;
|
||||
private final ISisElevatorFloorChannelRefService elevatorFloorChannelRefService;
|
||||
@ -201,20 +200,26 @@ public class SisElevatorInfoServiceImpl implements ISisElevatorInfoService {
|
||||
List<SisDeviceBindRef> ls = new ArrayList<>();
|
||||
// 梯控
|
||||
if (bo.getElevatorControlDeviceId() != null) {
|
||||
SisDeviceManageVo vo = deviceManageService.queryById(bo.getElevatorControlDeviceId().getDeviceId());
|
||||
|
||||
SisDeviceBindRef ref = new SisDeviceBindRef();
|
||||
ref.setDeviceId(bo.getElevatorControlDeviceId().getDeviceId());
|
||||
ref.setDeviceIp(bo.getElevatorControlDeviceId().getDeviceIp());
|
||||
ref.setBindId(bo.getElevatorId());
|
||||
ref.setDeviceFloorId(vo.getFloorId());
|
||||
ref.setControlType(ControlTypeEnum.ELEVATOR_CONTROL.getCode());
|
||||
ls.add(ref);
|
||||
}
|
||||
// 远程呼叫
|
||||
if (bo.getRemoteCallElevatorDeviceId() != null && !bo.getRemoteCallElevatorDeviceId().isEmpty()) {
|
||||
for (SisElevatorInfoBo.DeviceInfo deviceInfo : bo.getRemoteCallElevatorDeviceId()) {
|
||||
SisDeviceManageVo vo = deviceManageService.queryById(deviceInfo.getDeviceId());
|
||||
|
||||
SisDeviceBindRef ref = new SisDeviceBindRef();
|
||||
ref.setDeviceId(deviceInfo.getDeviceId());
|
||||
ref.setDeviceIp(deviceInfo.getDeviceIp());
|
||||
ref.setBindId(bo.getElevatorId());
|
||||
ref.setDeviceFloorId(vo.getFloorId());
|
||||
ref.setControlType(ControlTypeEnum.REMOTE_CALL_ELEVATOR.getCode());
|
||||
ls.add(ref);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user