临时提交
parent
ff4d251eac
commit
8cde446049
|
@ -23,6 +23,9 @@ public class PlatformCatalog {
|
||||||
@Schema(description = "行政区划")
|
@Schema(description = "行政区划")
|
||||||
private String civilCode;
|
private String civilCode;
|
||||||
|
|
||||||
|
@Schema(description = "为所关联的通道缓存的行政区划")
|
||||||
|
private String civilCodeForChannel;
|
||||||
|
|
||||||
@Schema(description = "目录分组")
|
@Schema(description = "目录分组")
|
||||||
private String businessGroupId;
|
private String businessGroupId;
|
||||||
|
|
||||||
|
@ -102,6 +105,15 @@ public class PlatformCatalog {
|
||||||
return civilCode;
|
return civilCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getCivilCodeForChannel() {
|
||||||
|
return civilCodeForChannel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCivilCodeForChannel(String civilCodeForChannel) {
|
||||||
|
this.civilCodeForChannel = civilCodeForChannel;
|
||||||
|
}
|
||||||
|
|
||||||
public void setCivilCode(String civilCode) {
|
public void setCivilCode(String civilCode) {
|
||||||
this.civilCode = civilCode;
|
this.civilCode = civilCode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ public class GbStreamServiceImpl implements IGbStreamService {
|
||||||
|
|
||||||
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platform.getServerGBId(), catalogId);
|
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platform.getServerGBId(), catalogId);
|
||||||
if (catalog != null) {
|
if (catalog != null) {
|
||||||
deviceChannel.setCivilCode(catalog.getCivilCode());
|
deviceChannel.setCivilCode(catalog.getCivilCodeForChannel());
|
||||||
deviceChannel.setParentId(catalog.getParentId());
|
deviceChannel.setParentId(catalog.getParentId());
|
||||||
deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId());
|
deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId());
|
||||||
}else {
|
}else {
|
||||||
|
@ -219,7 +219,7 @@ public class GbStreamServiceImpl implements IGbStreamService {
|
||||||
deviceChannel.setRegisterWay(1);
|
deviceChannel.setRegisterWay(1);
|
||||||
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platform.getServerGBId(), catalogId);
|
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platform.getServerGBId(), catalogId);
|
||||||
if (catalog != null) {
|
if (catalog != null) {
|
||||||
deviceChannel.setCivilCode(catalog.getCivilCode());
|
deviceChannel.setCivilCode(catalog.getCivilCodeForChannel());
|
||||||
deviceChannel.setParentId(catalog.getParentId());
|
deviceChannel.setParentId(catalog.getParentId());
|
||||||
deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId());
|
deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId());
|
||||||
}else {
|
}else {
|
||||||
|
|
|
@ -126,7 +126,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
|
||||||
|
|
||||||
private List<DeviceChannel> getDeviceChannelListByChannelReduceList(List<ChannelReduce> channelReduces, String catalogId, ParentPlatform platform) {
|
private List<DeviceChannel> getDeviceChannelListByChannelReduceList(List<ChannelReduce> channelReduces, String catalogId, ParentPlatform platform) {
|
||||||
List<DeviceChannel> deviceChannelList = new ArrayList<>();
|
List<DeviceChannel> deviceChannelList = new ArrayList<>();
|
||||||
if (channelReduces.size() > 0){
|
if (!channelReduces.isEmpty()){
|
||||||
PlatformCatalog catalog = catalogManager.selectByPlatFormAndCatalogId(platform.getServerGBId(),catalogId);
|
PlatformCatalog catalog = catalogManager.selectByPlatFormAndCatalogId(platform.getServerGBId(),catalogId);
|
||||||
if (catalog == null && catalogId.equals(platform.getDeviceGBId())) {
|
if (catalog == null && catalogId.equals(platform.getDeviceGBId())) {
|
||||||
for (ChannelReduce channelReduce : channelReduces) {
|
for (ChannelReduce channelReduce : channelReduces) {
|
||||||
|
@ -143,7 +143,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
|
||||||
for (ChannelReduce channelReduce : channelReduces) {
|
for (ChannelReduce channelReduce : channelReduces) {
|
||||||
DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(channelReduce.getDeviceId(), channelReduce.getChannelId());
|
DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(channelReduce.getDeviceId(), channelReduce.getChannelId());
|
||||||
deviceChannel.setParental(0);
|
deviceChannel.setParental(0);
|
||||||
deviceChannel.setCivilCode(catalog.getCivilCode());
|
deviceChannel.setCivilCode(catalog.getCivilCodeForChannel());
|
||||||
deviceChannel.setParentId(catalog.getParentId());
|
deviceChannel.setParentId(catalog.getParentId());
|
||||||
deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId());
|
deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId());
|
||||||
deviceChannelList.add(deviceChannel);
|
deviceChannelList.add(deviceChannel);
|
||||||
|
|
|
@ -486,7 +486,7 @@ public interface DeviceChannelMapper {
|
||||||
@Select("select * from wvp_device_channel where device_id=#{deviceId} and SUBSTRING(channel_id, 11, 3)=#{typeCode}")
|
@Select("select * from wvp_device_channel where device_id=#{deviceId} and SUBSTRING(channel_id, 11, 3)=#{typeCode}")
|
||||||
List<DeviceChannel> getBusinessGroups(@Param("deviceId") String deviceId, @Param("typeCode") String typeCode);
|
List<DeviceChannel> getBusinessGroups(@Param("deviceId") String deviceId, @Param("typeCode") String typeCode);
|
||||||
|
|
||||||
@Select("select dc.id, dc.channel_id, dc.device_id, COALESCE(dc.custom_name, dc.name) AS name, dc.manufacture,dc.model,dc.owner, pc.civil_code,dc.block, " +
|
@Select("select dc.id, dc.channel_id, dc.device_id, COALESCE(dc.custom_name, dc.name) AS name, dc.manufacture,dc.model,dc.owner, pc.civil_code_for_channel as civil_code,dc.block, " +
|
||||||
" dc.address, '0' as parental,'0' as channel_type, pc.id as parent_id, dc.safety_way, dc.register_way,dc.cert_num, dc.certifiable, " +
|
" dc.address, '0' as parental,'0' as channel_type, pc.id as parent_id, dc.safety_way, dc.register_way,dc.cert_num, dc.certifiable, " +
|
||||||
" dc.err_code,dc.end_time, dc.secrecy, dc.ip_address, dc.port, COALESCE(dc.custom_ptz_type, dc.ptz_type) AS ptz_type, dc.password, dc.status, " +
|
" dc.err_code,dc.end_time, dc.secrecy, dc.ip_address, dc.port, COALESCE(dc.custom_ptz_type, dc.ptz_type) AS ptz_type, dc.password, dc.status, " +
|
||||||
" COALESCE(dc.custom_longitude, dc.longitude) A S longitude, COALESCE(dc.custom_latitude, dc.latitude) AS latitude, pc.business_group_id " +
|
" COALESCE(dc.custom_longitude, dc.longitude) A S longitude, COALESCE(dc.custom_latitude, dc.latitude) AS latitude, pc.business_group_id " +
|
||||||
|
|
|
@ -78,7 +78,7 @@ public interface GbStreamMapper {
|
||||||
|
|
||||||
@Select("<script> "+
|
@Select("<script> "+
|
||||||
"select gt.gb_id as channel_id, gt.name, 'wvp-pro' as manufacture, st.status, gt.longitude, gt.latitude, pc.id as parent_id," +
|
"select gt.gb_id as channel_id, gt.name, 'wvp-pro' as manufacture, st.status, gt.longitude, gt.latitude, pc.id as parent_id," +
|
||||||
" '1' as register_way, pc.civil_code, 'live' as model, 'wvp-pro' as owner, '0' as parental,'0' as secrecy" +
|
" '1' as register_way, pc.civil_code_for_channel as civil_code, 'live' as model, 'wvp-pro' as owner, '0' as parental,'0' as secrecy" +
|
||||||
" from wvp_gb_stream gt " +
|
" from wvp_gb_stream gt " +
|
||||||
" left join (" +
|
" left join (" +
|
||||||
" select " +
|
" select " +
|
||||||
|
|
|
@ -13,8 +13,8 @@ import java.util.List;
|
||||||
@Repository
|
@Repository
|
||||||
public interface PlatformCatalogMapper {
|
public interface PlatformCatalogMapper {
|
||||||
|
|
||||||
@Insert("INSERT INTO wvp_platform_catalog (id, name, platform_id, parent_id, civil_code, business_group_id) VALUES" +
|
@Insert("INSERT INTO wvp_platform_catalog (id, name, platform_id, parent_id, civil_code, civil_code_for_channel, business_group_id) VALUES" +
|
||||||
"(#{id}, #{name}, #{platformId}, #{parentId}, #{civilCode}, #{businessGroupId})")
|
"(#{id}, #{name}, #{platformId}, #{parentId}, #{civilCode}, #{civilCodeForChannel}, #{businessGroupId})")
|
||||||
int add(PlatformCatalog platformCatalog);
|
int add(PlatformCatalog platformCatalog);
|
||||||
|
|
||||||
@Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId} and id=#{id}")
|
@Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId} and id=#{id}")
|
||||||
|
@ -23,10 +23,13 @@ public interface PlatformCatalogMapper {
|
||||||
@Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId}")
|
@Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId}")
|
||||||
int delByPlatformId(@Param("platformId") String platformId);
|
int delByPlatformId(@Param("platformId") String platformId);
|
||||||
|
|
||||||
@Select("SELECT pc.*, count(pc2.id) as children_count from wvp_platform_catalog pc " +
|
@Select(
|
||||||
|
value = {" <script>" +
|
||||||
|
"SELECT pc.*, count(pc2.id) as children_count from wvp_platform_catalog pc " +
|
||||||
"left join wvp_platform_catalog pc2 on pc.id = pc2.parent_id " +
|
"left join wvp_platform_catalog pc2 on pc.id = pc2.parent_id " +
|
||||||
"WHERE pc.parent_id=#{parentId} AND pc.platform_id=#{platformId} " +
|
"WHERE pc.platform_id=#{platformId} " +
|
||||||
"group by pc.id, pc.name, pc.platform_id, pc.business_group_id, pc.civil_code, pc.parent_id")
|
"group by pc.id, pc.name, pc.platform_id, pc.business_group_id, pc.civil_code, pc.parent_id, pc.civil_code_for_channel"
|
||||||
|
"</script>"})
|
||||||
List<PlatformCatalog> selectByParentId(@Param("platformId") String platformId, @Param("parentId") String parentId);
|
List<PlatformCatalog> selectByParentId(@Param("platformId") String platformId, @Param("parentId") String parentId);
|
||||||
|
|
||||||
@Update(value = {" <script>" +
|
@Update(value = {" <script>" +
|
||||||
|
|
|
@ -814,8 +814,14 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
if (platform == null) {
|
if (platform == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (platformCatalog.getParentId().equals(platform.getDeviceGBId())) {
|
||||||
|
platformCatalog.setParentId(null);
|
||||||
|
}
|
||||||
if (platformCatalog.getId().length() <= 8) {
|
if (platformCatalog.getId().length() <= 8) {
|
||||||
|
if (platformCatalog.getParentId() != null) {
|
||||||
platformCatalog.setCivilCode(platformCatalog.getParentId());
|
platformCatalog.setCivilCode(platformCatalog.getParentId());
|
||||||
|
}
|
||||||
|
platformCatalog.setCivilCodeForChannel(platformCatalog.getId());
|
||||||
}else {
|
}else {
|
||||||
if (platformCatalog.getId().length() != 20) {
|
if (platformCatalog.getId().length() != 20) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -826,9 +832,15 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
case 215:
|
case 215:
|
||||||
if (platformCatalog.getParentId().length() <= 8) {
|
if (platformCatalog.getParentId().length() <= 8) {
|
||||||
platformCatalog.setCivilCode(platformCatalog.getParentId());
|
platformCatalog.setCivilCode(platformCatalog.getParentId());
|
||||||
|
platformCatalog.setCivilCodeForChannel(platformCatalog.getParentId());
|
||||||
}else {
|
}else {
|
||||||
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platformCatalog.getPlatformId(), platformCatalog.getParentId());
|
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platformCatalog.getPlatformId(), platformCatalog.getParentId());
|
||||||
if (catalog != null) {
|
if (catalog != null) {
|
||||||
|
if (catalog.getId().length() <= 8) {
|
||||||
|
platformCatalog.setCivilCodeForChannel(platformCatalog.getParentId());
|
||||||
|
}else {
|
||||||
|
platformCatalog.setCivilCodeForChannel(platformCatalog.getCivilCode());
|
||||||
|
}
|
||||||
platformCatalog.setCivilCode(catalog.getCivilCode());
|
platformCatalog.setCivilCode(catalog.getCivilCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -836,12 +848,14 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
case 216:
|
case 216:
|
||||||
if (platformCatalog.getParentId().length() <= 8) {
|
if (platformCatalog.getParentId().length() <= 8) {
|
||||||
platformCatalog.setCivilCode(platformCatalog.getParentId());
|
platformCatalog.setCivilCode(platformCatalog.getParentId());
|
||||||
|
platformCatalog.setCivilCodeForChannel(platformCatalog.getParentId());
|
||||||
}else {
|
}else {
|
||||||
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platformCatalog.getPlatformId(),platformCatalog.getParentId());
|
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platformCatalog.getPlatformId(),platformCatalog.getParentId());
|
||||||
if (catalog == null) {
|
if (catalog == null) {
|
||||||
logger.warn("[添加目录] 无法获取目录{}的CivilCode和BusinessGroupId", platformCatalog.getPlatformId());
|
logger.warn("[添加目录] 无法获取目录{}的CivilCode和BusinessGroupId", platformCatalog.getPlatformId());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
platformCatalog.setCivilCodeForChannel(catalog.getCivilCode());
|
||||||
platformCatalog.setCivilCode(catalog.getCivilCode());
|
platformCatalog.setCivilCode(catalog.getCivilCode());
|
||||||
if (Integer.parseInt(platformCatalog.getParentId().substring(10, 13)) == 215) {
|
if (Integer.parseInt(platformCatalog.getParentId().substring(10, 13)) == 215) {
|
||||||
platformCatalog.setBusinessGroupId(platformCatalog.getParentId());
|
platformCatalog.setBusinessGroupId(platformCatalog.getParentId());
|
||||||
|
|
|
@ -208,6 +208,7 @@ create table wvp_platform_catalog (
|
||||||
name character varying(255),
|
name character varying(255),
|
||||||
parent_id character varying(50),
|
parent_id character varying(50),
|
||||||
civil_code character varying(50),
|
civil_code character varying(50),
|
||||||
|
civil_code_for_channel character varying(50),
|
||||||
business_group_id character varying(50),
|
business_group_id character varying(50),
|
||||||
constraint uk_platform_catalog_id_platform_id unique (id, platform_id)
|
constraint uk_platform_catalog_id_platform_id unique (id, platform_id)
|
||||||
);
|
);
|
||||||
|
|
|
@ -208,6 +208,7 @@ create table wvp_platform_catalog (
|
||||||
name character varying(255),
|
name character varying(255),
|
||||||
parent_id character varying(50),
|
parent_id character varying(50),
|
||||||
civil_code character varying(50),
|
civil_code character varying(50),
|
||||||
|
civil_code_for_channel character varying(50),,
|
||||||
business_group_id character varying(50),
|
business_group_id character varying(50),
|
||||||
constraint uk_platform_catalog_id_platform_id unique (id, platform_id)
|
constraint uk_platform_catalog_id_platform_id unique (id, platform_id)
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
alter table wvp_media_server
|
alter table wvp_media_server
|
||||||
add transcode_suffix character varying(255);
|
add transcode_suffix character varying(255);
|
||||||
|
|
||||||
|
alter table wvp_platform_catalog
|
||||||
|
add civil_code_for_channel character varying(50);
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
alter table wvp_media_server
|
alter table wvp_media_server
|
||||||
add transcode_suffix character varying(255);
|
add transcode_suffix character varying(255);
|
||||||
|
|
||||||
|
alter table wvp_platform_catalog
|
||||||
|
add civil_code_for_channel character varying(50);
|
Loading…
Reference in New Issue