Commit 88cf39eb authored by 高建强's avatar 高建强

item:视频监控左侧树与分页接口调整

parent 3e9400bc
...@@ -44,4 +44,7 @@ public class OrgUsrDto extends BaseDto { ...@@ -44,4 +44,7 @@ public class OrgUsrDto extends BaseDto {
@ApiModelProperty(value = "省市区名称,用逗号分隔") @ApiModelProperty(value = "省市区名称,用逗号分隔")
private String pczName; private String pczName;
@ApiModelProperty(value = "建筑ID")
private String buildId;
} }
...@@ -73,5 +73,8 @@ public class BuildingTreeVo { ...@@ -73,5 +73,8 @@ public class BuildingTreeVo {
@ApiModelProperty("建筑地址") @ApiModelProperty("建筑地址")
private String address; private String address;
@ApiModelProperty("机构编码")
private String bizOrgCode;
} }
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import java.util.List; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.entity.vo.BuildingListVO;
import com.yeejoin.equipmanage.common.entity.vo.BuildingVideoListVO;
import com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO;
import com.yeejoin.equipmanage.common.vo.BuildingTreeVo;
import com.yeejoin.equipmanage.service.IBuilldService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -11,15 +18,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -11,15 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import java.util.List;
import com.yeejoin.equipmanage.common.entity.vo.BuildingListVO;
import com.yeejoin.equipmanage.common.entity.vo.BuildingVideoListVO;
import com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO;
import com.yeejoin.equipmanage.common.vo.BuildingTreeVo;
import com.yeejoin.equipmanage.service.IBuilldService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/** /**
* @Description: 消防建筑视屏监控 * @Description: 消防建筑视屏监控
...@@ -32,71 +31,78 @@ import io.swagger.annotations.ApiOperation; ...@@ -32,71 +31,78 @@ import io.swagger.annotations.ApiOperation;
@RequestMapping(value = "/building/video", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "/building/video", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class BuildingVideoController extends AbstractBaseController { public class BuildingVideoController extends AbstractBaseController {
@Autowired @Autowired
IBuilldService buildService; IBuilldService buildService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑视屏监控树")
@GetMapping(value = "/tree")
public List<BuildingTreeVo> getBuildingTree() {
return buildService.getBuildingVideoTree();
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑视屏监控树") @ApiOperation("消防建筑视屏监控树")
@GetMapping(value = "/tree") @GetMapping(value = "/treeByBizOrgTypeCode")
public List<BuildingTreeVo> getBuildingTree() { public List<BuildingTreeVo> getBuildingTreeByBizOrgTypeCode(@RequestParam(required = false) String orgTypes) {
return buildService.getBuildingVideoTree(); ReginParams reginParams = getSelectedOrgInfo();
} ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
String bizOrgCode = personIdentity.getBizOrgCode();
return buildService.getBuildingTreeByBizOrgTypeCode(orgTypes, bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑视屏监控分页列表") @ApiOperation("消防建筑视屏监控分页列表")
@GetMapping(value = "/page") @GetMapping(value = "/page")
public Page<BuildingVideoVO> buildingList(Page page, BuildingVideoListVO dto) { public Page<BuildingVideoVO> buildingList(Page page, BuildingVideoListVO dto) {
if ("0".equals(dto.getBuildingId())) { return buildService.buildingVideoList(page, dto);
dto.setBuildingId(null); }
}
return buildService.buildingVideoList(page, dto);
}
@GetMapping(value = "/fire/equip") @GetMapping(value = "/fire/equip")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "摄像头关联消防设备") @ApiOperation(value = "摄像头关联消防设备")
public List<BuildingListVO> getFireEquip(@RequestParam Long videoId) { public List<BuildingListVO> getFireEquip(@RequestParam Long videoId) {
return buildService.getFireEquipByVideoId(videoId); return buildService.getFireEquipByVideoId(videoId);
} }
@GetMapping(value = "/power/equip") @GetMapping(value = "/power/equip")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "摄像头关联电力设备") @ApiOperation(value = "摄像头关联电力设备")
public List<BuildingListVO> getEquipBySceneId(@RequestParam Long videoId) { public List<BuildingListVO> getEquipBySceneId(@RequestParam Long videoId) {
return buildService.getPowerEquipByVideoId(videoId); return buildService.getPowerEquipByVideoId(videoId);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("安防消防建筑视屏监控树") @ApiOperation("安防消防建筑视屏监控树")
@GetMapping(value = "/cola/tree") @GetMapping(value = "/cola/tree")
public List<BuildingTreeVo> getBuildingColaTree() { public List<BuildingTreeVo> getBuildingColaTree() {
return buildService.getBuildingVideoColaTree(); return buildService.getBuildingVideoColaTree();
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("可乐视屏监控分页列表") @ApiOperation("可乐视屏监控分页列表")
@GetMapping(value = "/cola/page") @GetMapping(value = "/cola/page")
public Page<BuildingVideoVO> buildingColaList(Page page, BuildingVideoListVO dto) { public Page<BuildingVideoVO> buildingColaList(Page page, BuildingVideoListVO dto) {
if ("0".equals(dto.getBuildingId())) { if ("0".equals(dto.getBuildingId())) {
dto.setBuildingId(null); dto.setBuildingId(null);
} }
String orgCode = getOrgCode(); String orgCode = getOrgCode();
dto.setOrgCode(orgCode); dto.setOrgCode(orgCode);
return buildService.buildingColaVideoList(page, dto); return buildService.buildingColaVideoList(page, dto);
} }
@GetMapping(value = "/cola/fire/equip") @GetMapping(value = "/cola/fire/equip")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "摄像头关联消防设备") @ApiOperation(value = "摄像头关联消防设备")
public List<BuildingListVO> getFireEquipment(@RequestParam Long id) { public List<BuildingListVO> getFireEquipment(@RequestParam Long id) {
return buildService.getFireEquipment(id); return buildService.getFireEquipment(id);
} }
@GetMapping(value = "/cola/security/equip") @GetMapping(value = "/cola/security/equip")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "摄像头关联安防设备") @ApiOperation(value = "摄像头关联安防设备")
public List<BuildingListVO> getSecurityEquipment(@RequestParam Long id) { public List<BuildingListVO> getSecurityEquipment(@RequestParam Long id) {
return buildService.getSecurityEquipment(id); return buildService.getSecurityEquipment(id);
} }
} }
...@@ -103,8 +103,9 @@ public interface FormInstanceMapper extends BaseMapper<FormInstance> { ...@@ -103,8 +103,9 @@ public interface FormInstanceMapper extends BaseMapper<FormInstance> {
/** /**
* 消防建筑视屏监控统计树 * 消防建筑视屏监控统计树
* @return * @return
* @param bizOrgCodeList
*/ */
List<Map<String, Object>> getBuildVideoListCount(); List<Map<String, Object>> getBuildVideoListCount(@Param("list") List<String> bizOrgCodeList);
/** /**
* 可乐建筑视屏监控统计树 * 可乐建筑视屏监控统计树
......
...@@ -208,6 +208,14 @@ public interface IBuilldService extends IService<Building> { ...@@ -208,6 +208,14 @@ public interface IBuilldService extends IService<Building> {
List<BuildingTreeVo> getBuildingVideoTree(); List<BuildingTreeVo> getBuildingVideoTree();
/** /**
* 消防建筑视屏监控统计树
* @param orgTypes
* @param bizOrgCode
* @return
*/
List<BuildingTreeVo> getBuildingTreeByBizOrgTypeCode(String orgTypes, String bizOrgCode);
/**
* 消防建筑视屏监控分页列表 * 消防建筑视屏监控分页列表
* @param page * @param page
* @param dto * @param dto
...@@ -299,4 +307,5 @@ public interface IBuilldService extends IService<Building> { ...@@ -299,4 +307,5 @@ public interface IBuilldService extends IService<Building> {
* @return * @return
*/ */
Map<String, String> getBuildingToLongitudeAndLatitude(String instanceId); Map<String, String> getBuildingToLongitudeAndLatitude(String instanceId);
} }
...@@ -136,8 +136,9 @@ public interface IFormInstanceService extends IService<FormInstance> { ...@@ -136,8 +136,9 @@ public interface IFormInstanceService extends IService<FormInstance> {
/** /**
* 消防建筑视屏监控统计树 * 消防建筑视屏监控统计树
* @return * @return
* @param bizOrgCodeList
*/ */
List<Map<String, Object>> getBuildVideoListCount(); List<Map<String, Object>> getBuildVideoListCount(List<String> bizOrgCodeList);
/** /**
* 安防消防建筑视屏监控统计树 * 安防消防建筑视屏监控统计树
......
...@@ -12,6 +12,7 @@ import com.yeejoin.amos.feign.morphic.Morphic; ...@@ -12,6 +12,7 @@ import com.yeejoin.amos.feign.morphic.Morphic;
import com.yeejoin.amos.feign.morphic.model.ResourceDTO; import com.yeejoin.amos.feign.morphic.model.ResourceDTO;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.equipmanage.common.dto.OrgUsrDto;
import com.yeejoin.equipmanage.common.entity.*; import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.dto.BuildIsRiskDTO; import com.yeejoin.equipmanage.common.entity.dto.BuildIsRiskDTO;
import com.yeejoin.equipmanage.common.entity.dto.BuildSearchDTO; import com.yeejoin.equipmanage.common.entity.dto.BuildSearchDTO;
...@@ -35,6 +36,7 @@ import com.yeejoin.equipmanage.operation.factory.PageOperatorFactory; ...@@ -35,6 +36,7 @@ import com.yeejoin.equipmanage.operation.factory.PageOperatorFactory;
import com.yeejoin.equipmanage.remote.RemoteSecurityService; import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
...@@ -115,6 +117,12 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -115,6 +117,12 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Value("${systemctl.sync.switch}") @Value("${systemctl.sync.switch}")
private Boolean syncSwitch; private Boolean syncSwitch;
@Value("${auth-key-fire-video:fire_build_video_info}")
private String authKey;
@Autowired
private JCSRemoteService jcsRemoteService;
@Autowired @Autowired
private SourceSceneMapper sourceSceneMapper; private SourceSceneMapper sourceSceneMapper;
...@@ -130,13 +138,13 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -130,13 +138,13 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Autowired @Autowired
@Lazy @Lazy
private IVideoService videoService; private IVideoService videoService;
@Value("${building.detail}") @Value("${building.detail}")
private String address; private String address;
@Value("${building.floor.detail}") @Value("${building.floor.detail}")
private String apiUrl; private String apiUrl;
@Value("${firefightingsystem.equip.alarms.url}") @Value("${firefightingsystem.equip.alarms.url}")
private String ffsEquipAlarmsUrl; private String ffsEquipAlarmsUrl;
...@@ -298,7 +306,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -298,7 +306,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
this.saveFiles(Long.parseLong(formKeyMap.get("instanceId").toString()), map); this.saveFiles(Long.parseLong(formKeyMap.get("instanceId").toString()), map);
synWarehouse(formKeyMap); synWarehouse(formKeyMap);
// 新增储罐类型,保存不需要风险 // 新增储罐类型,保存不需要风险
if(!"storageTank".equals(groupCode)) { if (!"storageTank".equals(groupCode)) {
// 发布风险区域同步操作事件 // 发布风险区域同步操作事件
map.put("instanceId", formKeyMap.get("instanceId")); map.put("instanceId", formKeyMap.get("instanceId"));
map.put("code", formKeyMap.get("code")); map.put("code", formKeyMap.get("code"));
...@@ -334,7 +342,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -334,7 +342,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
String name = (String) map.get("name"); String name = (String) map.get("name");
String parentId = (String) map.get("parentId"); String parentId = (String) map.get("parentId");
String fullName = name; String fullName = name;
String code = (String) map.get("code"); String code = (String) map.get("code");
String parentName = formInstanceMapper.getStuctureName(parentId); String parentName = formInstanceMapper.getStuctureName(parentId);
if (!"0".equals(parentId)) { if (!"0".equals(parentId)) {
fullName = parentName + '-' + name; fullName = parentName + '-' + name;
...@@ -686,7 +694,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -686,7 +694,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override @Override
public List<BuildingTreeVo> getBuildingVideoTree() { public List<BuildingTreeVo> getBuildingVideoTree() {
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode()); FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getBuildVideoListCount(); List<Map<String, Object>> allList = iFormInstanceService.getBuildVideoListCount(null);
List<BuildingTreeVo> allListVo = buildColaBuildingData(formGroup, allList); List<BuildingTreeVo> allListVo = buildColaBuildingData(formGroup, allList);
// tree 统计处理 // tree 统计处理
return allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> { return allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> {
...@@ -700,6 +708,87 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -700,6 +708,87 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
@Override
public List<BuildingTreeVo> getBuildingTreeByBizOrgTypeCode(String orgTypes, String bizOrgCode) {
List<OrgUsrDto> list = jcsRemoteService.getCompanyDeptListWithAuth(authKey, orgTypes);
List<String> bizOrgCodeList = new ArrayList<>();
if (!CollectionUtils.isEmpty(list)) {
List<BuildingTreeVo> buildingTreeList = list.stream()
.map(key -> {
String buildId = key.getBuildId();
String orgCode = key.getBizOrgCode();
BuildingTreeVo vo = new BuildingTreeVo();
vo.setId(key.getSequenceNbr());
vo.setInstanceId(StringUtils.isNotBlank(buildId) ? Long.parseLong(buildId) : null);
vo.setInstanceName(key.getBizOrgName());
vo.setGroupType(key.getBizOrgType());
vo.setGroupCode(orgCode);
vo.setBizOrgCode(orgCode);
vo.setParentId(key.getParentId());
bizOrgCodeList.add(orgCode);
return vo;
}).collect(Collectors.toList());
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getBuildVideoListCount(bizOrgCodeList);
List<BuildingTreeVo> allListVo = Bean.listMap2ListBean(allList, BuildingTreeVo.class);
for (BuildingTreeVo vo : buildingTreeList) {
String orgCode = vo.getBizOrgCode();
if (StringUtils.isNotBlank(orgCode)) {
List<BuildingTreeVo> collect = allListVo.stream().filter(x -> orgCode.equals(x.getBizOrgCode())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(collect)) {
List<BuildingTreeVo> treeVoList = collect.stream().map(s -> {
BuildingTreeVo t = new BuildingTreeVo();
Bean.copyExistPropertis(s, t);
Map<String, Object> childrenTotal = this.getChildrenTotal(t.getInstanceId(), allListVo);
// t.setChildren((List<BuildingTreeVo>) childrenTotal.get("list"));
t.setTotal((Long) childrenTotal.get("total"));
t.setDetailPaneApi(address);
return t;
}).collect(Collectors.toList());
vo.setChildren(treeVoList);
}
}
}
return listGetStree(buildingTreeList);
}
return Lists.newArrayList();
}
private List<BuildingTreeVo> listGetStree(List<BuildingTreeVo> list) {
List<BuildingTreeVo> treeList = new ArrayList<BuildingTreeVo>();
for (int i = 0; i < list.size(); i++) {
BuildingTreeVo tree = list.get(i);
//找到子
for (BuildingTreeVo treeNode : list) {
if (String.valueOf(tree.getId()).equals(treeNode.getParentId())) {
List<BuildingTreeVo> children = tree.getChildren();
children.add(treeNode);
tree.setChildren(children);
}
}
if (i == 0) {
treeList.add(tree);
}
}
return treeList;
}
private List<BuildingTreeVo> getChildren(BuildingTreeVo root, List<BuildingTreeVo> all) {
String bizOrgCode = root.getBizOrgCode();
return all.stream().filter(d -> StringUtils.isNotBlank(d.getBizOrgCode()) && bizOrgCode.equals(d.getBizOrgCode().substring(0, d.getBizOrgCode().length() - 6)))
.peek(m -> {
List<BuildingTreeVo> children = m.getChildren();
if (CollectionUtils.isEmpty(children)) {
m.setChildren(getChildren(m, all));
} else {
children.addAll(getChildren(m, all));
m.setChildren(children);
}
})
.collect(Collectors.toList());
}
private List<BuildingTreeVo> buildColaBuildingData(FormGroup formGroup, List<Map<String, Object>> allList) { private List<BuildingTreeVo> buildColaBuildingData(FormGroup formGroup, List<Map<String, Object>> allList) {
List<BuildingTreeVo> allListVo = Bean.listMap2ListBean(allList, BuildingTreeVo.class); List<BuildingTreeVo> allListVo = Bean.listMap2ListBean(allList, BuildingTreeVo.class);
BuildingTreeVo treeNode = new BuildingTreeVo(); BuildingTreeVo treeNode = new BuildingTreeVo();
...@@ -753,6 +842,16 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -753,6 +842,16 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override @Override
public Page<BuildingVideoVO> buildingVideoList(Page page, BuildingVideoListVO dto) { public Page<BuildingVideoVO> buildingVideoList(Page page, BuildingVideoListVO dto) {
String buildingId = dto.getBuildingId();
if ("0".equals(buildingId)) {
dto.setBuildingId(null);
List<OrgUsrDto> list = jcsRemoteService.getCompanyDeptListWithAuth(authKey, "DEPARTMENT,COMPANY");
if (!CollectionUtils.isEmpty(list)) {
List<Long> buildIdList = new ArrayList<>();
list.stream().filter(x -> StringUtils.isNotEmpty(x.getBuildId())).forEach(o -> buildIdList.add(Long.parseLong(o.getBuildId())));
dto.setBuildIdList(buildIdList);
}
}
Page<BuildingVideoVO> pages = videoService.pageBuildingVideo(page, dto); Page<BuildingVideoVO> pages = videoService.pageBuildingVideo(page, dto);
if (0 < pages.getRecords().size()) { if (0 < pages.getRecords().size()) {
pages.getRecords().forEach(x -> { pages.getRecords().forEach(x -> {
...@@ -1050,40 +1149,40 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1050,40 +1149,40 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
} }
@Override @Override
public Map<String, String> getStorageTankCodeByBelongUnitId(String belongUnitId,String groupCode) { public Map<String, String> getStorageTankCodeByBelongUnitId(String belongUnitId, String groupCode) {
Map<String,String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("field_name", StroageTankEnum.SSDW.getCode()); map.put("field_name", StroageTankEnum.SSDW.getCode());
map.put("field_value", belongUnitId); map.put("field_value", belongUnitId);
List<Map<String, Object>> list = iFormInstanceService.queryForMapList(groupCode,map); List<Map<String, Object>> list = iFormInstanceService.queryForMapList(groupCode, map);
if(list.size() > 0) { if (list.size() > 0) {
map.clear(); map.clear();
map.put("storageTankCode",stroageTankCode(belongUnitId,list.size()+1)); map.put("storageTankCode", stroageTankCode(belongUnitId, list.size() + 1));
} else { } else {
map.clear(); map.clear();
map.put("storageTankCode",belongUnitId+"0001"); map.put("storageTankCode", belongUnitId + "0001");
} }
return map; return map;
} }
// 生成四位流水号 // 生成四位流水号
private String stroageTankCode(String belongUnitId, int num) { private String stroageTankCode(String belongUnitId, int num) {
if(num < 10) { if (num < 10) {
return belongUnitId + "000" + num; return belongUnitId + "000" + num;
} }
if(num < 100 && num > 9) { if (num < 100 && num > 9) {
return belongUnitId + "00" + num; return belongUnitId + "00" + num;
} }
if(num < 1000 && num > 99) { if (num < 1000 && num > 99) {
return belongUnitId + "0" + num; return belongUnitId + "0" + num;
} }
if(num < 10000 && num > 999) { if (num < 10000 && num > 999) {
return belongUnitId + num; return belongUnitId + num;
} }
throw new BadRequest("无流水号可生成"); throw new BadRequest("无流水号可生成");
} }
// 需求958 导出模板需要列表获取建筑 by kongfm 2021-09-15 // 需求958 导出模板需要列表获取建筑 by kongfm 2021-09-15
@Override @Override
...@@ -1091,9 +1190,9 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1091,9 +1190,9 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
return formInstanceMapper.getAllBuilding(); return formInstanceMapper.getAllBuilding();
} }
@Override @Override
public Map<String, String> getBuildingToLongitudeAndLatitude(String instanceId) { public Map<String, String> getBuildingToLongitudeAndLatitude(String instanceId) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return formInstanceMapper.getBuildingToLongitudeAndLatitude(instanceId); return formInstanceMapper.getBuildingToLongitudeAndLatitude(instanceId);
} }
} }
...@@ -479,8 +479,8 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For ...@@ -479,8 +479,8 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For
} }
@Override @Override
public List<Map<String, Object>> getBuildVideoListCount() { public List<Map<String, Object>> getBuildVideoListCount(List<String> bizOrgCodeList) {
return formInstanceMapper.getBuildVideoListCount(); return formInstanceMapper.getBuildVideoListCount(bizOrgCodeList);
} }
@Override @Override
......
...@@ -36,7 +36,7 @@ dutyMode.fegin.name=AMOS-DUTYMODE ...@@ -36,7 +36,7 @@ dutyMode.fegin.name=AMOS-DUTYMODE
riskSource.feign.name=AMOS-AUTOSYS riskSource.feign.name=AMOS-AUTOSYS
equipManage.name=AMOS-EQUIPMANAGE equipManage.name=AMOS-EQUIPMANAGE
iot.vehicle.track=AMOS-API-IOT iot.vehicle.track=AMOS-API-IOT
jcs.fegin.name=JCS-SHG jcs.fegin.name=JCS
video.fegin.name=VIDEO video.fegin.name=VIDEO
#项目初始化画布id #项目初始化画布id
morphic.projectSeq=1390314016458514433 morphic.projectSeq=1390314016458514433
...@@ -92,4 +92,6 @@ auth-key-fire-system=fire_system_info; ...@@ -92,4 +92,6 @@ auth-key-fire-system=fire_system_info;
# 权限标识-消防装备 # 权限标识-消防装备
auth-key-fire-equip=fire_equip_info; auth-key-fire-equip=fire_equip_info;
# 权限标识-消防视频 # 权限标识-消防视频
auth-key-fire-video=fire_video_info; auth-key-fire-video=fire_video_info;
\ No newline at end of file # 权限标识-消防视频
auth-key-fire-build-video=fire_build_video_info;
\ No newline at end of file
...@@ -259,6 +259,7 @@ ...@@ -259,6 +259,7 @@
</select> </select>
<!-- 消防建筑视屏监控统计树 --> <!-- 消防建筑视屏监控统计树 -->
<select id="getBuildVideoListCount" resultType="hashmap"> <select id="getBuildVideoListCount" resultType="hashmap">
SELECT * FROM(
SELECT SELECT
sa.*, sa.*,
b.total b.total
...@@ -269,7 +270,8 @@ ...@@ -269,7 +270,8 @@
a.group_code AS groupCode, a.group_code AS groupCode,
a.group_type AS groupType, a.group_type AS groupType,
MAX( CASE WHEN a.field_name = 'parentId' THEN a.field_value END ) AS parentId, MAX( CASE WHEN a.field_name = 'parentId' THEN a.field_value END ) AS parentId,
MAX( CASE WHEN a.field_name = 'name' THEN a.field_value END ) AS instanceName MAX( CASE WHEN a.field_name = 'name' THEN a.field_value END ) AS instanceName,
MAX( CASE WHEN a.field_name = 'biz_org_code' THEN a.field_value END ) AS bizOrgCode
FROM FROM
`wl_form_instance` a `wl_form_instance` a
GROUP BY GROUP BY
...@@ -283,9 +285,19 @@ ...@@ -283,9 +285,19 @@
'else' as groupType, 'else' as groupType,
0 as parentId, 0 as parentId,
'其他' as instanceName, '其他' as instanceName,
NULL AS bizOrgCode,
count(1) as total count(1) as total
from from
wl_video where id not in (select video_id from wl_video_source) wl_video where id not in (select video_id from wl_video_source)
) tmp
<where>
<if test="list != null and list.size() >0">
AND tmp.bizOrgCode IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select> </select>
<select id="getColaBuildVideoListCount" resultType="hashmap"> <select id="getColaBuildVideoListCount" resultType="hashmap">
......
...@@ -70,6 +70,12 @@ ...@@ -70,6 +70,12 @@
<if test="dto.buildingId!=null and dto.buildingId!=''"> <if test="dto.buildingId!=null and dto.buildingId!=''">
FIND_IN_SET(vc.source_id, getChildrenIdsByRootId(#{dto.buildingId})) FIND_IN_SET(vc.source_id, getChildrenIdsByRootId(#{dto.buildingId}))
</if> </if>
<if test="dto.buildIdList != null and dto.buildIdList.size > 0">
AND
<foreach collection="dto.buildIdList" item="item" index="index" open="(" close=")" separator=" OR ">
FIND_IN_SET(vc.source_id, getChildrenIdsByRootId(#{item, jdbcType=INTEGER}))
</foreach>
</if>
<if test="dto.equipmentName!=null and dto.equipmentName!=''"> <if test="dto.equipmentName!=null and dto.equipmentName!=''">
and v.name like concat('%',#{dto.equipmentName},'%') and v.name like concat('%',#{dto.equipmentName},'%')
</if> </if>
......
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