Commit 42bec6ea authored by suhuiguang's avatar suhuiguang
parent 2bc23b98
...@@ -15,10 +15,19 @@ public class EquiplistSpecificBySystemVO { ...@@ -15,10 +15,19 @@ public class EquiplistSpecificBySystemVO {
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private Long id; private Long id;
@ApiModelProperty(value = "设备名") @ApiModelProperty(value = "设备名")
private String equipmentName; private String equipmentName;
@ApiModelProperty(value = "设备编码") @ApiModelProperty(value = "设备编码")
private String code; private String code;
@ApiModelProperty(value = "设备分组名称") @ApiModelProperty(value = "设备分组名称")
private String categoryName; private String categoryName;
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "是否绑定")
private Boolean isBound;
} }
...@@ -125,11 +125,11 @@ public class BuildingController extends AbstractBaseController { ...@@ -125,11 +125,11 @@ public class BuildingController extends AbstractBaseController {
return buildService.getScenesList(instanceId, groupType); return buildService.getScenesList(instanceId, groupType);
} }
@GetMapping(value = "/equipInSceneId") @GetMapping(value = "/{floorId}/pointInFloor")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询建筑画布下装备") @ApiOperation(value = "查询指定楼层下装备、摄像头")
public List<EquiplistSpecificBySystemVO> getEquipBySceneId(@RequestParam Long sceneId) { public List<EquiplistSpecificBySystemVO> getPointInFloor(@PathVariable Long floorId) {
return buildService.getEquipBySceneId(sceneId); return buildService.getPointInFloor(floorId);
} }
@PostMapping(value = "/commonSave") @PostMapping(value = "/commonSave")
......
...@@ -55,13 +55,6 @@ public interface BuildingMapper extends BaseMapper<Building> { ...@@ -55,13 +55,6 @@ public interface BuildingMapper extends BaseMapper<Building> {
String getVPointInScene(Long id); String getVPointInScene(Long id);
/** /**
* 获取建筑画布下装备
* @param ids
* @return
*/
List<EquiplistSpecificBySystemVO> getEquipBySceneId( @Param("ids") String[] ids);
List<EquiplistSpecificBySystemVO> getVideoBySceneId( @Param("ids") String[] ids);
/**
* 根据类型获取名下画布集合 * 根据类型获取名下画布集合
* @param id * @param id
* @param groupType * @param groupType
......
...@@ -8,10 +8,7 @@ import com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto; ...@@ -8,10 +8,7 @@ import com.yeejoin.equipmanage.common.dto.EquipmentSpecificDto;
import com.yeejoin.equipmanage.common.dto.UserDto; import com.yeejoin.equipmanage.common.dto.UserDto;
import com.yeejoin.equipmanage.common.entity.*; import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO; import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.entity.vo.PointTreeVo;
import com.yeejoin.equipmanage.common.entity.vo.SourceNameByEquipSpeIdVO;
import com.yeejoin.equipmanage.common.vo.*; import com.yeejoin.equipmanage.common.vo.*;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -207,4 +204,5 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -207,4 +204,5 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
String getEquipmentBySpecificId(@Param("specificId") Long specificId); String getEquipmentBySpecificId(@Param("specificId") Long specificId);
List<EquiplistSpecificBySystemVO> getListByWarehouseStructureId(Long floorId);
} }
...@@ -85,4 +85,6 @@ public interface VideoMapper extends BaseMapper<Video> { ...@@ -85,4 +85,6 @@ public interface VideoMapper extends BaseMapper<Video> {
List<VideoListVo>listByType(@Param("type")String type); List<VideoListVo>listByType(@Param("type")String type);
List<Video>listByCode(@Param("code")String code); List<Video>listByCode(@Param("code")String code);
List<Video> selectListBySourceId(Long floorId);
} }
...@@ -69,14 +69,6 @@ public interface IBuilldService extends IService<Building> { ...@@ -69,14 +69,6 @@ public interface IBuilldService extends IService<Building> {
List<SourceScene> getScenesList(Long id, String groupType); List<SourceScene> getScenesList(Long id, String groupType);
/** /**
* 查询建筑画布下装备
*
* @param id
* @return
*/
List<EquiplistSpecificBySystemVO> getEquipBySceneId(@RequestParam Long id);
/**
* 消防建筑树查询接口 * 消防建筑树查询接口
* *
* @return List<BuildingTreeVo> * @return List<BuildingTreeVo>
...@@ -309,4 +301,11 @@ public interface IBuilldService extends IService<Building> { ...@@ -309,4 +301,11 @@ public interface IBuilldService extends IService<Building> {
List<BuildingTreeVo> getCompanyBuildingTree(String authKey); List<BuildingTreeVo> getCompanyBuildingTree(String authKey);
List<BuildingTreeVo> getBuildingVideoTreeNew(); List<BuildingTreeVo> getBuildingVideoTreeNew();
/**
* 查询指定楼层下装备、摄像头
* @param floorId 楼层id
* @return List<EquiplistSpecificBySystemVO>
*/
List<EquiplistSpecificBySystemVO> getPointInFloor(Long floorId);
} }
...@@ -90,6 +90,9 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -90,6 +90,9 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
IWarehouseStructureService iWarehouseStructureService; IWarehouseStructureService iWarehouseStructureService;
@Autowired @Autowired
EquipmentSpecificMapper equipmentSpecificMapper;
@Autowired
StockDetailMapper stockDetailMapper; StockDetailMapper stockDetailMapper;
@Autowired @Autowired
ISourceSceneService sourceSceneService; ISourceSceneService sourceSceneService;
...@@ -285,23 +288,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -285,23 +288,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
} }
return list; return list;
} }
@Override
public List<EquiplistSpecificBySystemVO> getEquipBySceneId(Long id) {
String pointInScene = this.baseMapper.getPointInScene(id);
String vPointInScene = this.baseMapper.getVPointInScene(id);
if (("".equals(pointInScene) || pointInScene == null) && ("".equals(vPointInScene) || vPointInScene == null)) {
return new ArrayList<>();
}
String[] ids = pointInScene.split(",");
String[] vids = vPointInScene.split(",");
List<EquiplistSpecificBySystemVO> list = new ArrayList<>();
list.addAll(this.baseMapper.getEquipBySceneId(ids));
list.addAll(this.baseMapper.getVideoBySceneId(vids));
return list;
}
@Override @Override
public Object saveForm(String groupCode, String companyCode, Map<String, Object> map) { public Object saveForm(String groupCode, String companyCode, Map<String, Object> map) {
final String instanceId = "instanceId"; final String instanceId = "instanceId";
...@@ -1137,7 +1124,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1137,7 +1124,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
vo.setName(orgUsrDto.getBizOrgName()); vo.setName(orgUsrDto.getBizOrgName());
vo.setId(orgUsrDto.getSequenceNbr()); vo.setId(orgUsrDto.getSequenceNbr());
vo.setBizOrgName(orgUsrDto.getBizOrgName()); vo.setBizOrgName(orgUsrDto.getBizOrgName());
vo.setTotal(allListVo.stream().filter(b-> b.getBizOrgCode() != null && b.getBizOrgCode().contains(vo.getBizOrgCode()) && "building".equals(b.getGroupType())).count()); vo.setTotal(allListVo.stream().filter(b -> b.getBizOrgCode() != null && b.getBizOrgCode().contains(vo.getBizOrgCode()) && "building".equals(b.getGroupType())).count());
if ("".equals(orgUsrDto.getParentId()) || "-1".equals(orgUsrDto.getParentId()) || null == orgUsrDto.getParentId()) { if ("".equals(orgUsrDto.getParentId()) || "-1".equals(orgUsrDto.getParentId()) || null == orgUsrDto.getParentId()) {
flag.set(true); flag.set(true);
} }
...@@ -1192,6 +1179,38 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1192,6 +1179,38 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
@Override
public List<EquiplistSpecificBySystemVO> getPointInFloor(Long floorId) {
//0.查询画布信息,todo 建筑可标记点类型为装备、摄像头
List<SourceScene> sourceScenes = sourceSceneService.findBySourceId(floorId);
SourceScene sourceScene = sourceScenes.size() > 0 ? sourceScenes.get(0) : new SourceScene();
//0.1已标记装备点
String equipPointInScene = sourceScene.getPointInScene() != null ? sourceScene.getPointInScene() : "";
//0.2已标记视频点
String videoPointInScene = sourceScene.getVideoInScene() != null ? sourceScene.getVideoInScene() : "";
//1.查询楼层下的所有装备list
List<EquiplistSpecificBySystemVO> equipmentSpecifics = equipmentSpecificMapper.getListByWarehouseStructureId(floorId);
equipmentSpecifics.forEach(e->{
e.setIsBound(equipPointInScene.contains(e.getId().toString()));
e.setType("装备点");
});
List<EquiplistSpecificBySystemVO> bySystemVOS = new ArrayList<>(equipmentSpecifics);
//2.查询楼层下的所有视频list
List<Video> videos = videoMapper.selectListBySourceId(floorId);
//3.数据加工
videos.forEach(v->{
EquiplistSpecificBySystemVO vo = new EquiplistSpecificBySystemVO();
vo.setId(v.getId());
vo.setCode(v.getCode());
vo.setCategoryName(v.getType());
vo.setEquipmentName(v.getName());
vo.setType("视频点");
vo.setIsBound(videoPointInScene.contains(v.getId().toString()));
bySystemVOS.add(vo);
});
return bySystemVOS;
}
// @Override // @Override
// public List<BuildingTreeVo> getBuildingVideoTreeNew() { // public List<BuildingTreeVo> getBuildingVideoTreeNew() {
// List<BuildingTreeVo> list = getCompanyBuildingTree(buildVideoAuthKey); // List<BuildingTreeVo> list = getCompanyBuildingTree(buildVideoAuthKey);
......
...@@ -134,38 +134,6 @@ ...@@ -134,38 +134,6 @@
<select id="getVPointInScene" resultType="string"> <select id="getVPointInScene" resultType="string">
select video_in_scene from wl_source_scene where scene_id =#{id} select video_in_scene from wl_source_scene where scene_id =#{id}
</select> </select>
<select id="getEquipBySceneId" resultMap="EquiplistBySystemId">
SELECT
spe.id,
det.name equipment_name,
spe.code,
wlec.name AS category_name
FROM
wl_equipment_specific AS spe
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
LEFT JOIN wl_equipment_category AS wlec ON wlec.id = wle.category_id
WHERE
spe.id in
<foreach item="item" collection="ids" separator="," open="(" close=")" index="">
#{item}
</foreach>
</select>
<select id="getVideoBySceneId" resultMap="EquiplistBySystemId">
SELECT
id,
name equipment_name,
code,
name AS category_name
FROM
wl_video
WHERE
id in
<foreach item="item" collection="ids" separator="," open="(" close=")" index="">
#{item}
</foreach>
</select>
<select id="getScenesList" resultType="com.yeejoin.equipmanage.common.entity.SourceScene"> <select id="getScenesList" resultType="com.yeejoin.equipmanage.common.entity.SourceScene">
select select
ins.instance_id as id, ins.instance_id as id,
......
...@@ -1465,4 +1465,18 @@ ...@@ -1465,4 +1465,18 @@
where where
wes.id = #{specificId} wes.id = #{specificId}
</select> </select>
<select id="getListByWarehouseStructureId"
resultType="com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO">
SELECT
spe.id,
spe.name equipment_name,
spe.code,
wlec.name AS category_name
FROM
wl_equipment_specific AS spe
LEFT JOIN wl_equipment AS wle ON spe.equipment_code = wle.code
LEFT JOIN wl_equipment_category AS wlec ON wlec.id = wle.category_id
WHERE
spe.warehouse_structure_id =#{floorId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -365,6 +365,16 @@ ...@@ -365,6 +365,16 @@
wl_video as wlv wl_video as wlv
where wlv.code = #{code} where wlv.code = #{code}
</select> </select>
<select id="selectListBySourceId" resultType="com.yeejoin.equipmanage.common.entity.Video">
select
v.id,
v.code,
v.name,
v.type
from
wl_video v,
wl_video_source vs
where vs.source_id = #{floorId}
and vs.video_id = v.id
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment