Merge pull request #38 from lawrencehj/wvp-28181-2.0
修改不能创建多个上级平台的问题等
| | |
| | | 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则为查询请求
|
| | | // TODO 后续将代码拆分
|
| | | // if (deviceListElement == null) { // 存在DeviceList则为响应 catalog, 不存在DeviceList则为查询请求
|
| | | if (name == "Query") { // 区分是Response——查询响应,还是Query——查询请求
|
| | | // TODO 后续将代码拆分
|
| | | ParentPlatform parentPlatform = storager.queryParentPlatById(deviceId);
|
| | | if (parentPlatform == null) {
|
| | | response404Ack(evt);
|
| | |
| | | " 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); |
| | | |
| | |
| | | " <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); |
| | |
| | | @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" ) |
| | |
| | | */ |
| | | @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); |
| | | |
| | |
| | | @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); |
| | |
| | | } |
| | | // TODO 检查是否已经存在,且注册成功, 如果注册成功,需要先注销之前再,修改并注册 |
| | | |
| | | ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId()); |
| | | // ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId()); |
| | | ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getServerGBId()); |
| | | |
| | | boolean updateResult = storager.updateParentPlatform(parentPlatform); |
| | | |
| | |
| | | online: "", |
| | | choosed: "", |
| | | currentPage: 0, |
| | | count: 15, |
| | | count: 10, |
| | | total: 0, |
| | | eventEnanle: false |
| | | |
| | |
| | | this.platform = platform; |
| | | this.onSubmit_text = "保存"; |
| | | } else { |
| | | this.onSubmit_text = "立即创建"; |
| | | } |
| | | }, |
| | | onSubmit: function () { |