Merge branch 'master' of http://47.109.37.87:3000/by2025/SmartParks
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:
commit
291f9e7ffa
@ -21,10 +21,10 @@ public interface RemoteFloorService {
|
||||
List<TreeNode<Long>> queryTreeList();
|
||||
|
||||
/**
|
||||
* 根据单元ID查询楼层
|
||||
* 根据楼层id查询楼层
|
||||
*
|
||||
* @param unitId 单元ID
|
||||
* @param buildingId 单元ID
|
||||
* @return 楼层
|
||||
*/
|
||||
List<RemoteFloorVo> queryByUnitId(Long unitId);
|
||||
List<RemoteFloorVo> queryByBuildingId(Long buildingId);
|
||||
}
|
||||
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.common.core.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author lsm
|
||||
* @apiNote ContentTypeEnum
|
||||
* @since 2025/8/4
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ContentTypeEnum {
|
||||
|
||||
/**
|
||||
* JPEG图片类型
|
||||
*/
|
||||
JPG("jpg", "image/jpeg"),
|
||||
|
||||
/**
|
||||
* JPEG图片类型
|
||||
*/
|
||||
JPEG("jpeg", "image/jpeg"),
|
||||
|
||||
/**
|
||||
* PNG图片类型
|
||||
*/
|
||||
PNG("png", "image/png"),
|
||||
|
||||
/**
|
||||
* GIF图片类型
|
||||
*/
|
||||
GIF("gif", "image/gif");
|
||||
|
||||
private final String extension;
|
||||
private final String contentType;
|
||||
|
||||
/**
|
||||
* 根据文件扩展名获取内容类型
|
||||
*
|
||||
* @param extension 文件扩展名
|
||||
* @return 对应的内容类型,如果未找到则返回null
|
||||
*/
|
||||
public static String getContentType(String extension) {
|
||||
for (ContentTypeEnum type : values()) {
|
||||
if (type.extension.equalsIgnoreCase(extension)) {
|
||||
return type.contentType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件扩展名
|
||||
*
|
||||
* @return 文件扩展名
|
||||
*/
|
||||
public String getExtension() {
|
||||
return extension;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取内容类型
|
||||
*
|
||||
* @return 内容类型
|
||||
*/
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
}
|
@ -105,14 +105,14 @@ public class TbFloorController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单元ID查询楼层
|
||||
* 根据楼层id查询楼层
|
||||
*
|
||||
* @param unitId 单元ID
|
||||
* @param buildingId 单元ID
|
||||
* @return 楼层
|
||||
*/
|
||||
@GetMapping("/queryByUnitId/{unitId}")
|
||||
public R<List<TbFloorVo>> queryByUnitId(@NotNull(message = "单元ID不能为空")
|
||||
@PathVariable("unitId") Long unitId) {
|
||||
return R.ok(tbFloorService.queryByUnitId(unitId));
|
||||
@GetMapping("/queryByBuildingId/{buildingId}")
|
||||
public R<List<TbFloorVo>> queryByBuildingId(@NotNull(message = "楼层ID不能为空")
|
||||
@PathVariable("buildingId") Long buildingId) {
|
||||
return R.ok(tbFloorService.queryByBuildingId(buildingId));
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.dromara.common.core.domain.TreeNode;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.redis.utils.RedisUtils;
|
||||
import org.dromara.property.api.RemoteFloorService;
|
||||
import org.dromara.property.api.domain.vo.RemoteFloorVo;
|
||||
import org.dromara.property.domain.vo.TbBuildingVo;
|
||||
@ -34,7 +35,6 @@ public class RemoteFloorServiceImpl implements RemoteFloorService {
|
||||
private final ITbUnitService unitService;
|
||||
private final ITbFloorService floorService;
|
||||
|
||||
|
||||
@Override
|
||||
public RemoteFloorVo queryByFloorId(Long floorId) {
|
||||
TbFloorVo tbFloorVo = floorService.queryById(floorId);
|
||||
@ -103,14 +103,14 @@ public class RemoteFloorServiceImpl implements RemoteFloorService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单元ID查询楼层
|
||||
* 根据楼层id查询楼层
|
||||
*
|
||||
* @param unitId 单元ID
|
||||
* @param buildingId 单元ID
|
||||
* @return 楼层
|
||||
*/
|
||||
@Override
|
||||
public List<RemoteFloorVo> queryByUnitId(Long unitId){
|
||||
List<TbFloorVo> tbFloorVo = floorService.queryByUnitId(unitId);
|
||||
public List<RemoteFloorVo> queryByBuildingId(Long buildingId){
|
||||
List<TbFloorVo> tbFloorVo = floorService.queryByBuildingId(buildingId);
|
||||
List<RemoteFloorVo> remoteFloorVos = new ArrayList<>();
|
||||
|
||||
tbFloorVo.forEach(item -> {
|
||||
|
@ -76,10 +76,10 @@ public interface ITbFloorService {
|
||||
List<TbFloorVo> queryAll();
|
||||
|
||||
/**
|
||||
* 根据单元ID查询楼层
|
||||
* 根据楼层id查询楼层
|
||||
*
|
||||
* @param unitId 单元ID
|
||||
* @param buildingId 单元ID
|
||||
* @return 楼层
|
||||
*/
|
||||
List<TbFloorVo> queryByUnitId(Long unitId);
|
||||
List<TbFloorVo> queryByBuildingId(Long buildingId);
|
||||
}
|
||||
|
@ -160,15 +160,15 @@ public class TbFloorServiceImpl implements ITbFloorService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单元ID查询楼层
|
||||
* 根据楼层id查询楼层
|
||||
*
|
||||
* @param unitId 单元ID
|
||||
* @param buildingId 单元ID
|
||||
* @return 楼层
|
||||
*/
|
||||
@Override
|
||||
public List<TbFloorVo> queryByUnitId(Long unitId) {
|
||||
public List<TbFloorVo> queryByBuildingId(Long buildingId) {
|
||||
LambdaQueryWrapper<TbFloor> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(TbFloor::getUnitId, unitId)
|
||||
lqw.eq(TbFloor::getBuildingId, buildingId)
|
||||
.orderByAsc(TbFloor::getFloorNumber);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||
* 电梯基本信息业务对象 sis_elevator_info
|
||||
*
|
||||
* @author lxj
|
||||
* @date 2025-07-10
|
||||
* @since 2025-07-10
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
@ -61,7 +61,7 @@ public class HikDeviceApplicationRunner implements ApplicationRunner {
|
||||
SaTokenContextMockUtil.setMockContext(() -> {
|
||||
// 模拟登录
|
||||
StpUtil.login(-8);
|
||||
floorInfoRef.set(remoteFloorService.queryByUnitId(item.getUnitId()));
|
||||
floorInfoRef.set(remoteFloorService.queryByBuildingId(item.getBuildingId()));
|
||||
});
|
||||
|
||||
// 根据单元ID获取楼层信息
|
||||
|
@ -135,7 +135,7 @@ public class SisAuthGroupRefServiceImpl implements ISisAuthGroupRefService {
|
||||
|
||||
log.info("开始写入授权组电梯楼层,floorIds:{}", floorIds);
|
||||
// 获取该电梯所在单元的楼层信息
|
||||
List<RemoteFloorVo> floorVoList = remoteFloorService.queryByUnitId(ele.getUnitId());
|
||||
List<RemoteFloorVo> floorVoList = remoteFloorService.queryByBuildingId(ele.getBuildingId());
|
||||
// 该单元所有楼层id
|
||||
List<Long> allFloors = floorVoList.stream().map(RemoteFloorVo::getId).toList();
|
||||
// 对比找出授权楼层id
|
||||
|
@ -289,7 +289,7 @@ public class SisAuthRecordServiceImpl implements ISisAuthRecordService {
|
||||
// 楼层节点
|
||||
List<TreeNode<Long>> floorTree = new ArrayList<>();
|
||||
// 获取楼层
|
||||
List<RemoteFloorVo> floorInfoList = remoteFloorService.queryByUnitId(item.getUnitId());
|
||||
List<RemoteFloorVo> floorInfoList = remoteFloorService.queryByBuildingId(item.getBuildingId());
|
||||
floorInfoList.forEach(floor -> {
|
||||
TreeNode<Long> floorNode = new TreeNode<>();
|
||||
floorNode.setLevel(3);
|
||||
|
@ -140,7 +140,7 @@ public class ZeroSensationPassageServiceImpl implements IZeroSensationPassageSer
|
||||
// 获取电梯信息
|
||||
SisElevatorInfoVo ele = elevatorInfoService.queryById(deviceId);
|
||||
// 根据单元ID获取楼层信息
|
||||
List<RemoteFloorVo> floorInfo = remoteFloorService.queryByUnitId(deviceId);
|
||||
List<RemoteFloorVo> floorInfo = remoteFloorService.queryByBuildingId(ele.getBuildingId());
|
||||
// 获取电梯⇄楼层关联信息
|
||||
List<SisElevatorFloorRefVo> floorRefList = elevatorFloorRefService.queryByAuthGroupId(groupId);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user