refactor(property): 将 RemoteUnitService 调整为 RemoteBuildingService
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
@@ -13,8 +13,8 @@ import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.property.api.RemoteUnitService;
|
||||
import org.dromara.property.api.domain.vo.RemoteUnitVo;
|
||||
import org.dromara.property.api.RemoteBuildingService;
|
||||
import org.dromara.property.api.domain.vo.RemoteBuildingVo;
|
||||
import org.dromara.sis.domain.SisDeviceBindRef;
|
||||
import org.dromara.sis.domain.SisElevatorInfo;
|
||||
import org.dromara.sis.domain.bo.SisElevatorInfoBo;
|
||||
@@ -45,7 +45,7 @@ public class SisElevatorInfoServiceImpl implements ISisElevatorInfoService {
|
||||
private final ISisDeviceBindRefService deviceBindRefService;
|
||||
|
||||
@DubboReference
|
||||
private RemoteUnitService remoteUnitService;
|
||||
private RemoteBuildingService remoteBuildingService;
|
||||
|
||||
/**
|
||||
* 查询电梯基本信息
|
||||
@@ -137,17 +137,23 @@ public class SisElevatorInfoServiceImpl implements ISisElevatorInfoService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertByBo(SisElevatorInfoBo bo) {
|
||||
// 验证单元是否存在
|
||||
RemoteUnitVo remoteUnitVo = remoteUnitService.queryUnitById(bo.getUnitId());
|
||||
Assert.notNull(remoteUnitVo, "社区单元信息不存在。");
|
||||
// 验证建筑是否存在
|
||||
RemoteBuildingVo remoteBuildingVo = remoteBuildingService.queryBuildingById(bo.getBuildingId());
|
||||
Assert.notNull(remoteBuildingVo, "建筑信息不存在。");
|
||||
|
||||
// 数据转换
|
||||
SisElevatorInfo add = MapstructUtils.convert(bo, SisElevatorInfo.class);
|
||||
Assert.notNull(add, "电梯信息处理失败。");
|
||||
add.setCommunityId(remoteUnitVo.getCommunityId());
|
||||
add.setBuildingId(remoteUnitVo.getBuildingId());
|
||||
|
||||
assert add != null;
|
||||
add.setCommunityId(remoteBuildingVo.getCommunityId());
|
||||
add.setBuildingId(remoteBuildingVo.getId());
|
||||
// 生成电梯编码
|
||||
String code = ELEVATOR_CONTROL_CODE_PREFIX + IdUtil.getSnowflakeNextIdStr();
|
||||
add.setElevatorCode(code);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
Assert.isTrue(flag, "新增电梯信息失败。");
|
||||
|
||||
if (flag) {
|
||||
bo.setElevatorId(add.getElevatorId());
|
||||
List<SisDeviceBindRef> ls = new ArrayList<>();
|
||||
|
Reference in New Issue
Block a user