增加批量修改通道的业务分组以及行政区划,支持筛选业务分组和行政区划,支持抽稀还原,国标通道编辑增加表单校验
This commit is contained in:
@@ -104,16 +104,26 @@ public class ChannelController {
|
||||
@Parameter(name = "online", description = "是否在线")
|
||||
@Parameter(name = "hasRecordPlan", description = "是否已设置录制计划")
|
||||
@Parameter(name = "channelType", description = "通道类型, 0:国标设备,1:推流设备,2:拉流代理")
|
||||
@Parameter(name = "civilCode", description = "行政区划")
|
||||
@Parameter(name = "parentDeviceId", description = "父节点编码")
|
||||
@GetMapping("/list")
|
||||
public PageInfo<CommonGBChannel> queryList(int page, int count,
|
||||
@RequestParam(required = false) String query,
|
||||
@RequestParam(required = false) Boolean online,
|
||||
@RequestParam(required = false) Boolean hasRecordPlan,
|
||||
@RequestParam(required = false) Integer channelType){
|
||||
@RequestParam(required = false) Integer channelType,
|
||||
@RequestParam(required = false) String civilCode,
|
||||
@RequestParam(required = false) String parentDeviceId){
|
||||
if (ObjectUtils.isEmpty(query)){
|
||||
query = null;
|
||||
}
|
||||
return channelService.queryList(page, count, query, online, hasRecordPlan, channelType);
|
||||
if (ObjectUtils.isEmpty(civilCode)){
|
||||
civilCode = null;
|
||||
}
|
||||
if (ObjectUtils.isEmpty(parentDeviceId)){
|
||||
parentDeviceId = null;
|
||||
}
|
||||
return channelService.queryList(page, count, query, online, hasRecordPlan, channelType, civilCode, parentDeviceId);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取关联行政区划通道列表", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@@ -481,4 +491,13 @@ public class ChannelController {
|
||||
public void saveLevel(@RequestBody List<ChannelForThin> channels){
|
||||
channelService.saveLevel(channels);
|
||||
}
|
||||
|
||||
@Operation(summary = "为地图去除抽稀结果", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@PostMapping("/map/reset-level")
|
||||
public void resetLevel(){
|
||||
channelService.resetLevel();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -474,7 +474,8 @@ public interface CommonGBChannelMapper {
|
||||
|
||||
@SelectProvider(type = ChannelProvider.class, method = "queryList")
|
||||
List<CommonGBChannel> queryList(@Param("query") String query, @Param("online") Boolean online,
|
||||
@Param("hasRecordPlan") Boolean hasRecordPlan, @Param("dataType") Integer dataType);
|
||||
@Param("hasRecordPlan") Boolean hasRecordPlan, @Param("dataType") Integer dataType,
|
||||
@Param("civilCode") String civilCode, @Param("parentDeviceId") String parentDeviceId);
|
||||
|
||||
@Update(value = {" <script>" +
|
||||
" UPDATE wvp_device_channel " +
|
||||
@@ -668,4 +669,8 @@ public interface CommonGBChannelMapper {
|
||||
|
||||
@SelectProvider(type = ChannelProvider.class, method = "queryMeetingChannelList")
|
||||
List<CameraChannel> queryMeetingChannelList(@Param("business") String business);
|
||||
|
||||
@Update("UPDATE wvp_device_channel SET map_level=null")
|
||||
int resetLevel();
|
||||
|
||||
}
|
||||
|
||||
@@ -289,6 +289,12 @@ public class ChannelProvider {
|
||||
if (params.get("dataType") != null) {
|
||||
sqlBuild.append(" AND data_type = #{dataType}");
|
||||
}
|
||||
if (params.get("civilCode") != null) {
|
||||
sqlBuild.append(" AND coalesce(gb_civil_code, civil_code) = #{civilCode}");
|
||||
}
|
||||
if (params.get("parentDeviceId") != null) {
|
||||
sqlBuild.append(" AND coalesce(gb_parent_id, parent_id) = #{parentDeviceId}");
|
||||
}
|
||||
return sqlBuild.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ public interface IGbChannelService {
|
||||
|
||||
List<CommonGBChannel> queryListByStreamPushList(List<StreamPush> streamPushList);
|
||||
|
||||
PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasRecordPlan, Integer channelType);
|
||||
PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasRecordPlan, Integer channelType, String civilCode, String parentDeviceId);
|
||||
|
||||
PageInfo<CommonGBChannel> queryListByCivilCodeForUnusual(int page, int count, String query, Boolean online, Integer channelType);
|
||||
|
||||
@@ -104,4 +104,7 @@ public interface IGbChannelService {
|
||||
void saveLevel(List<ChannelForThin> channels);
|
||||
|
||||
CommonGBChannel queryCommonChannelByDeviceChannel(DeviceChannel channel);
|
||||
|
||||
void resetLevel();
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.genersoft.iot.vmp.gb28181.dao.PlatformChannelMapper;
|
||||
import com.genersoft.iot.vmp.gb28181.dao.RegionMapper;
|
||||
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
||||
import com.genersoft.iot.vmp.gb28181.event.channel.ChannelEvent;
|
||||
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
||||
import com.genersoft.iot.vmp.gb28181.service.IGbChannelService;
|
||||
import com.genersoft.iot.vmp.gb28181.service.IPlatformChannelService;
|
||||
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
||||
@@ -23,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -68,9 +68,12 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "缺少通道数据类型或通道数据关联设备ID");
|
||||
}
|
||||
CommonGBChannel commonGBChannelInDb = commonGBChannelMapper.queryByDataId(commonGBChannel.getDataType(), commonGBChannel.getDataDeviceId());
|
||||
if (commonGBChannelInDb != null) {
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "此推流已经关联通道");
|
||||
}
|
||||
Assert.isNull(commonGBChannelInDb, "此推流已经关联通道");
|
||||
|
||||
// 检验国标编号是否重复
|
||||
List<CommonGBChannel> channelList = commonGBChannelMapper.queryByDeviceId(commonGBChannel.getGbDeviceId());
|
||||
Assert.isTrue(channelList.isEmpty(), "国标编号已经存在");
|
||||
|
||||
commonGBChannel.setCreateTime(DateUtil.getNow());
|
||||
commonGBChannel.setUpdateTime(DateUtil.getNow());
|
||||
int result = commonGBChannelMapper.insert(commonGBChannel);
|
||||
@@ -741,14 +744,15 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasRecordPlan, Integer channelType) {
|
||||
public PageInfo<CommonGBChannel> queryList(int page, int count, String query, Boolean online, Boolean hasRecordPlan,
|
||||
Integer channelType, String civilCode, String parentDeviceId) {
|
||||
PageHelper.startPage(page, count);
|
||||
if (query != null) {
|
||||
query = query.replaceAll("/", "//")
|
||||
.replaceAll("%", "/%")
|
||||
.replaceAll("_", "/_");
|
||||
}
|
||||
List<CommonGBChannel> all = commonGBChannelMapper.queryList(query, online, hasRecordPlan, channelType);
|
||||
List<CommonGBChannel> all = commonGBChannelMapper.queryList(query, online, hasRecordPlan, channelType, civilCode, parentDeviceId);
|
||||
return new PageInfo<>(all);
|
||||
}
|
||||
|
||||
@@ -826,7 +830,7 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
||||
|
||||
@Override
|
||||
public List<CommonGBChannel> queryListForMap(String query, Boolean online, Boolean hasRecordPlan, Integer channelType) {
|
||||
return commonGBChannelMapper.queryList(query, online, hasRecordPlan, channelType);
|
||||
return commonGBChannelMapper.queryList(query, online, hasRecordPlan, channelType, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -850,4 +854,9 @@ public class GbChannelServiceImpl implements IGbChannelService {
|
||||
public CommonGBChannel queryCommonChannelByDeviceChannel(DeviceChannel channel) {
|
||||
return commonGBChannelMapper.queryCommonChannelByDeviceChannel(channel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetLevel() {
|
||||
commonGBChannelMapper.resetLevel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,9 +285,9 @@ public class GroupServiceImpl implements IGroupService, CommandLineRunner {
|
||||
if (group == null) {
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "虚拟组织不存在");
|
||||
}
|
||||
groupList.add(group);
|
||||
List<Group> allParent = getAllParent(group);
|
||||
groupList.addAll(allParent);
|
||||
groupList.add(group);
|
||||
return groupList;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user