Merge pull request #38 from lawrencehj/wvp-28181-2.0

修改不能创建多个上级平台的问题等
pull/46/head
648540858 2021-01-15 13:22:07 +08:00 committed by GitHub
commit c8b6ed5823
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 9 deletions

View File

@ -162,10 +162,12 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
private void processMessageCatalogList(RequestEvent evt) {
try {
Element rootElement = getRootElement(evt);
String name = rootElement.getName();
Element deviceIdElement = rootElement.element("DeviceID");
String deviceId = deviceIdElement.getText();
Element deviceListElement = rootElement.element("DeviceList");
if (deviceListElement == null) { // 存在DeviceList则为响应 catalog 不存在DeviceList则为查询请求
// if (deviceListElement == null) { // 存在DeviceList则为响应 catalog 不存在DeviceList则为查询请求
if (name == "Query") { // 区分是Response——查询响应还是Query——查询请求
// TODO 后续将代码拆分
ParentPlatform parentPlatform = storager.queryParentPlatById(deviceId);
if (parentPlatform == null) {

View File

@ -63,6 +63,7 @@ public interface DeviceChannelMapper {
" WHERE 1=1 " +
" <if test=\"hasSubChannel == true\" > AND subCount >0</if>" +
" <if test=\"hasSubChannel == false\" > AND subCount=0</if>" +
" ORDER BY channelId ASC" +
" </script>"})
List<DeviceChannel> queryChannelsByDeviceId(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, Boolean online);
@ -96,6 +97,7 @@ public interface DeviceChannelMapper {
" <if test=\"hasSubChannel!= null and hasSubChannel == false\" > AND subCount=0</if> " +
" <if test=\"platformId != null and inPlatform == true \" > AND platformId='${platformId}'</if> " +
" <if test=\"platformId != null and inPlatform == false \" > AND (platformId != '${platformId}' OR platformId is NULL ) </if> " +
" ORDER BY deviceId, channelId ASC" +
" </script>"})
List<ChannelReduce> queryChannelListInAll(String query, Boolean online, Boolean hasSubChannel, String platformId, Boolean inPlatform);

View File

@ -51,7 +51,7 @@ public interface ParentPlatformMapper {
@Select("SELECT * FROM parent_platform WHERE enable=#{enable}")
List<ParentPlatform> getEnableParentPlatformList(boolean enable);
@Select("SELECT * FROM parent_platform WHERE deviceGBId=#{platformGbId}")
@Select("SELECT * FROM parent_platform WHERE serverGBId=#{platformGbId}")
ParentPlatform getParentPlatById(String platformGbId);
@Update("UPDATE parent_platform SET status=false" )

View File

@ -18,7 +18,7 @@ public interface PatformChannelMapper {
*/
@Select("<script> "+
"SELECT deviceAndChannelId FROM platform_gb_channel WHERE platformId='${platformId}' AND deviceAndChannelId in" +
"<foreach collection='deviceAndChannelIds' open='(' item='id_' separator=',' close=')'> '${id_}'</foreach>" +
"<foreach collection='deviceAndChannelIds' open='(' item='id_' separator=',' close=')'> '${id_}'</foreach> ORDER BY deviceAndChannelId ASC" +
"</script>")
List<String> findChannelRelatedPlatform(String platformId, List<String> deviceAndChannelIds);

View File

@ -231,14 +231,14 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
@Override
public boolean updateParentPlatform(ParentPlatform parentPlatform) {
int result = 0;
ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getDeviceGBId());
if ( platformMapper.getParentPlatById(parentPlatform.getDeviceGBId()) == null) {
ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
if ( platformMapper.getParentPlatById(parentPlatform.getServerGBId()) == null) {
result = platformMapper.addParentPlatform(parentPlatform);
if (parentPlatformCatch == null) {
parentPlatformCatch = new ParentPlatformCatch();
parentPlatformCatch.setParentPlatform(parentPlatform);
parentPlatformCatch.setId(parentPlatform.getDeviceGBId());
parentPlatformCatch.setId(parentPlatform.getServerGBId());
}
}else {
result = platformMapper.updateParentPlatform(parentPlatform);

View File

@ -82,7 +82,8 @@ public class PlatformController {
}
// TODO 检查是否已经存在,且注册成功, 如果注册成功,需要先注销之前再,修改并注册
ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId());
// ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId());
ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getServerGBId());
boolean updateResult = storager.updateParentPlatform(parentPlatform);

Binary file not shown.

View File

@ -72,7 +72,7 @@ export default {
online: "",
choosed: "",
currentPage: 0,
count: 15,
count: 10,
total: 0,
eventEnanle: false

View File

@ -200,6 +200,7 @@ export default {
this.platform = platform;
this.onSubmit_text = "保存";
} else {
this.onSubmit_text = "立即创建";
}
},
onSubmit: function () {