Commit 5e1ae2c4 authored by chenzhao's avatar chenzhao

修改代码

parent 914f75fe
......@@ -19,7 +19,7 @@ public class VideoOnEquipmentSpecificVo {
/**
* 设备ID
*/
private Long equipmentSpecificId;
private List<Long> equipmentSpecificId;
/**
* 摄像头Id集合
......
......@@ -185,6 +185,13 @@ public class WarehouseStructureController extends AbstractBaseController {
return iWarehouseStructureService.gettree(id,bizOrgCode,buildingId);
}
@RequestMapping(value = "/gettreeNew/{id}", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "树查询", notes = "树查询")
public List<WarehouseStructure> gettreeNew(@PathVariable Long id,String bizOrgCode) {
return iWarehouseStructureService.gettreeToPrent(id,bizOrgCode);
}
/**
* 批量删除
*
......
......@@ -1712,33 +1712,36 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Override
public Boolean videoOnEquipmentSpecific(VideoOnEquipmentSpecificVo videoOnEquipmentSpecificVo) {
Long equipmentSpecificId = videoOnEquipmentSpecificVo.getEquipmentSpecificId();
List<Long> equipmentSpecificIds = videoOnEquipmentSpecificVo.getEquipmentSpecificId();
List<Long> videoIdList = videoOnEquipmentSpecificVo.getVideoIdList();
if (equipmentSpecificId != null) {
EquipmentSpecific equipmentSpecific = this.baseMapper.selectById(equipmentSpecificId);
if (!ObjectUtils.isEmpty(equipmentSpecific)) {
QueryWrapper<VideoEquipmentSpecific> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("equipment_specific_id", equipmentSpecificId);
if (0 == videoIdList.size()) {
videoEquipmentSpecificService.remove(queryWrapper);
return Boolean.TRUE;
}
List<VideoEquipmentSpecific> list = videoEquipmentSpecificService.getBaseMapper().selectList(queryWrapper);
if (0 < list.size()) {
boolean remove = videoEquipmentSpecificService.remove(queryWrapper);
if (remove) {
if (equipmentSpecificIds != null) {
for (Long equipmentSpecificId : equipmentSpecificIds) {
EquipmentSpecific equipmentSpecific = this.baseMapper.selectById(equipmentSpecificId);
if (!ObjectUtils.isEmpty(equipmentSpecific)) {
QueryWrapper<VideoEquipmentSpecific> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("equipment_specific_id", equipmentSpecificId);
if (0 == videoIdList.size()) {
videoEquipmentSpecificService.remove(queryWrapper);
return Boolean.TRUE;
}
List<VideoEquipmentSpecific> list = videoEquipmentSpecificService.getBaseMapper().selectList(queryWrapper);
if (0 < list.size()) {
boolean remove = videoEquipmentSpecificService.remove(queryWrapper);
if (remove) {
this.bingEquipmentRelationshipToVideo(videoIdList, equipmentSpecificId);
}
} else {
this.bingEquipmentRelationshipToVideo(videoIdList, equipmentSpecificId);
}
return Boolean.FALSE;
} else {
this.bingEquipmentRelationshipToVideo(videoIdList, equipmentSpecificId);
throw new RuntimeException("未获取到此设备!");
}
return Boolean.FALSE;
} else {
throw new RuntimeException("未获取到此设备!");
}
} else {
throw new RuntimeException("设备ID为空!");
}
return Boolean.TRUE;
}
@Override
......
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