临时提交
parent
ff4d251eac
commit
8cde446049
|
@ -23,6 +23,9 @@ public class PlatformCatalog {
|
|||
@Schema(description = "行政区划")
|
||||
private String civilCode;
|
||||
|
||||
@Schema(description = "为所关联的通道缓存的行政区划")
|
||||
private String civilCodeForChannel;
|
||||
|
||||
@Schema(description = "目录分组")
|
||||
private String businessGroupId;
|
||||
|
||||
|
@ -102,6 +105,15 @@ public class PlatformCatalog {
|
|||
return civilCode;
|
||||
}
|
||||
|
||||
|
||||
public String getCivilCodeForChannel() {
|
||||
return civilCodeForChannel;
|
||||
}
|
||||
|
||||
public void setCivilCodeForChannel(String civilCodeForChannel) {
|
||||
this.civilCodeForChannel = civilCodeForChannel;
|
||||
}
|
||||
|
||||
public void setCivilCode(String civilCode) {
|
||||
this.civilCode = civilCode;
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ public class GbStreamServiceImpl implements IGbStreamService {
|
|||
|
||||
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platform.getServerGBId(), catalogId);
|
||||
if (catalog != null) {
|
||||
deviceChannel.setCivilCode(catalog.getCivilCode());
|
||||
deviceChannel.setCivilCode(catalog.getCivilCodeForChannel());
|
||||
deviceChannel.setParentId(catalog.getParentId());
|
||||
deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId());
|
||||
}else {
|
||||
|
@ -219,7 +219,7 @@ public class GbStreamServiceImpl implements IGbStreamService {
|
|||
deviceChannel.setRegisterWay(1);
|
||||
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platform.getServerGBId(), catalogId);
|
||||
if (catalog != null) {
|
||||
deviceChannel.setCivilCode(catalog.getCivilCode());
|
||||
deviceChannel.setCivilCode(catalog.getCivilCodeForChannel());
|
||||
deviceChannel.setParentId(catalog.getParentId());
|
||||
deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId());
|
||||
}else {
|
||||
|
|
|
@ -126,7 +126,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
|
|||
|
||||
private List<DeviceChannel> getDeviceChannelListByChannelReduceList(List<ChannelReduce> channelReduces, String catalogId, ParentPlatform platform) {
|
||||
List<DeviceChannel> deviceChannelList = new ArrayList<>();
|
||||
if (channelReduces.size() > 0){
|
||||
if (!channelReduces.isEmpty()){
|
||||
PlatformCatalog catalog = catalogManager.selectByPlatFormAndCatalogId(platform.getServerGBId(),catalogId);
|
||||
if (catalog == null && catalogId.equals(platform.getDeviceGBId())) {
|
||||
for (ChannelReduce channelReduce : channelReduces) {
|
||||
|
@ -143,7 +143,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
|
|||
for (ChannelReduce channelReduce : channelReduces) {
|
||||
DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(channelReduce.getDeviceId(), channelReduce.getChannelId());
|
||||
deviceChannel.setParental(0);
|
||||
deviceChannel.setCivilCode(catalog.getCivilCode());
|
||||
deviceChannel.setCivilCode(catalog.getCivilCodeForChannel());
|
||||
deviceChannel.setParentId(catalog.getParentId());
|
||||
deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId());
|
||||
deviceChannelList.add(deviceChannel);
|
||||
|
|
|
@ -486,10 +486,10 @@ public interface DeviceChannelMapper {
|
|||
@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);
|
||||
|
||||
@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.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) AS 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 " +
|
||||
" from wvp_device_channel dc" +
|
||||
" LEFT JOIN wvp_platform_gb_channel pgc on dc.id = pgc.device_channel_id" +
|
||||
" LEFT JOIN wvp_platform_catalog pc on pgc.catalog_id = pc.id and pgc.platform_id = pc.platform_id" +
|
||||
|
|
|
@ -78,7 +78,7 @@ public interface GbStreamMapper {
|
|||
|
||||
@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," +
|
||||
" '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 " +
|
||||
" left join (" +
|
||||
" select " +
|
||||
|
|
|
@ -13,8 +13,8 @@ import java.util.List;
|
|||
@Repository
|
||||
public interface PlatformCatalogMapper {
|
||||
|
||||
@Insert("INSERT INTO wvp_platform_catalog (id, name, platform_id, parent_id, civil_code, business_group_id) VALUES" +
|
||||
"(#{id}, #{name}, #{platformId}, #{parentId}, #{civilCode}, #{businessGroupId})")
|
||||
@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}, #{civilCodeForChannel}, #{businessGroupId})")
|
||||
int add(PlatformCatalog platformCatalog);
|
||||
|
||||
@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}")
|
||||
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 " +
|
||||
"WHERE pc.parent_id=#{parentId} AND pc.platform_id=#{platformId} " +
|
||||
"group by pc.id, pc.name, pc.platform_id, pc.business_group_id, pc.civil_code, pc.parent_id")
|
||||
"WHERE pc.platform_id=#{platformId} " +
|
||||
"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);
|
||||
|
||||
@Update(value = {" <script>" +
|
||||
|
|
|
@ -814,8 +814,14 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||
if (platform == null) {
|
||||
return 0;
|
||||
}
|
||||
if (platformCatalog.getParentId().equals(platform.getDeviceGBId())) {
|
||||
platformCatalog.setParentId(null);
|
||||
}
|
||||
if (platformCatalog.getId().length() <= 8) {
|
||||
platformCatalog.setCivilCode(platformCatalog.getParentId());
|
||||
if (platformCatalog.getParentId() != null) {
|
||||
platformCatalog.setCivilCode(platformCatalog.getParentId());
|
||||
}
|
||||
platformCatalog.setCivilCodeForChannel(platformCatalog.getId());
|
||||
}else {
|
||||
if (platformCatalog.getId().length() != 20) {
|
||||
return 0;
|
||||
|
@ -826,9 +832,15 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||
case 215:
|
||||
if (platformCatalog.getParentId().length() <= 8) {
|
||||
platformCatalog.setCivilCode(platformCatalog.getParentId());
|
||||
platformCatalog.setCivilCodeForChannel(platformCatalog.getParentId());
|
||||
}else {
|
||||
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platformCatalog.getPlatformId(), platformCatalog.getParentId());
|
||||
if (catalog != null) {
|
||||
if (catalog.getId().length() <= 8) {
|
||||
platformCatalog.setCivilCodeForChannel(platformCatalog.getParentId());
|
||||
}else {
|
||||
platformCatalog.setCivilCodeForChannel(platformCatalog.getCivilCode());
|
||||
}
|
||||
platformCatalog.setCivilCode(catalog.getCivilCode());
|
||||
}
|
||||
}
|
||||
|
@ -836,12 +848,14 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||
case 216:
|
||||
if (platformCatalog.getParentId().length() <= 8) {
|
||||
platformCatalog.setCivilCode(platformCatalog.getParentId());
|
||||
platformCatalog.setCivilCodeForChannel(platformCatalog.getParentId());
|
||||
}else {
|
||||
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platformCatalog.getPlatformId(),platformCatalog.getParentId());
|
||||
if (catalog == null) {
|
||||
logger.warn("[添加目录] 无法获取目录{}的CivilCode和BusinessGroupId", platformCatalog.getPlatformId());
|
||||
break;
|
||||
}
|
||||
platformCatalog.setCivilCodeForChannel(catalog.getCivilCode());
|
||||
platformCatalog.setCivilCode(catalog.getCivilCode());
|
||||
if (Integer.parseInt(platformCatalog.getParentId().substring(10, 13)) == 215) {
|
||||
platformCatalog.setBusinessGroupId(platformCatalog.getParentId());
|
||||
|
|
|
@ -208,6 +208,7 @@ create table wvp_platform_catalog (
|
|||
name character varying(255),
|
||||
parent_id character varying(50),
|
||||
civil_code character varying(50),
|
||||
civil_code_for_channel character varying(50),
|
||||
business_group_id character varying(50),
|
||||
constraint uk_platform_catalog_id_platform_id unique (id, platform_id)
|
||||
);
|
||||
|
|
|
@ -208,6 +208,7 @@ create table wvp_platform_catalog (
|
|||
name character varying(255),
|
||||
parent_id character varying(50),
|
||||
civil_code character varying(50),
|
||||
civil_code_for_channel character varying(50),,
|
||||
business_group_id character varying(50),
|
||||
constraint uk_platform_catalog_id_platform_id unique (id, platform_id)
|
||||
);
|
||||
|
|
|
@ -1,2 +1,5 @@
|
|||
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
|
||||
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