|
|
|
@@ -73,16 +73,21 @@ public class DmH5ConfigServiceImpl extends BaseServiceImpl<DmH5ConfigQuery, DmH5 |
|
|
|
temp.setTenantName(items.getTenantName()); |
|
|
|
temp.setManCode(items.getManCode()); |
|
|
|
String streamUrl = items.getStreamUrl(); |
|
|
|
JSONObject jo = JSON.parseObject(item.getProperty()); |
|
|
|
if(jo.containsKey("system")) |
|
|
|
{ |
|
|
|
JSONObject sys = jo.getJSONObject("System"); |
|
|
|
if(sys.containsKey("H5")){ |
|
|
|
JSONObject H5 = sys.getJSONObject("H5"); |
|
|
|
H5.put("streamUrl", streamUrl); |
|
|
|
if(!streamUrl.isEmpty()){ |
|
|
|
JSONObject jo = JSON.parseObject(item.getProperty()); |
|
|
|
if(jo.containsKey("system")) |
|
|
|
{ |
|
|
|
JSONObject sys = jo.getJSONObject("System"); |
|
|
|
if(sys.containsKey("H5")){ |
|
|
|
JSONObject H5 = sys.getJSONObject("H5"); |
|
|
|
H5.put("streamUrl", streamUrl); |
|
|
|
} |
|
|
|
} |
|
|
|
temp.setProperty(jo.toString()); |
|
|
|
} |
|
|
|
else{ |
|
|
|
temp.setProperty(item.getProperty()); |
|
|
|
} |
|
|
|
temp.setProperty(jo.toString()); |
|
|
|
temp.setEnterpriseId(item.getEnterpriseId()); |
|
|
|
temp.setName(item.getName()); |
|
|
|
temp.setId(item.getId()); |
|
|
|
@@ -197,6 +202,34 @@ public class DmH5ConfigServiceImpl extends BaseServiceImpl<DmH5ConfigQuery, DmH5 |
|
|
|
return dto; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public DmH5ConfigDto selectByIdCode(Serializable id, String manCode) { |
|
|
|
DmH5ConfigDto dto = super.selectById(id); |
|
|
|
String result = null; |
|
|
|
try { |
|
|
|
result = nacosConfigManager.getConfigService().getConfig(dto.getName(), NacosConstants.DEFAULT_GROUP, 5000); |
|
|
|
} catch (NacosException ne) { |
|
|
|
log.error("H5配置表nacos-获取配置文件失败:{}", ne.getMessage()); |
|
|
|
} |
|
|
|
DmManDeviceQuery query = new DmManDeviceQuery(); |
|
|
|
query.setManCode(manCode); |
|
|
|
List<DmManDeviceDto> extList = dmManDeviceManager.selectList(query); |
|
|
|
if (extList != null && extList.size() > 0) { |
|
|
|
String streamUrl = extList.get(0).getStreamUrl(); |
|
|
|
JSONObject jo = JSON.parseObject(result); |
|
|
|
if (jo.containsKey("system")) { |
|
|
|
JSONObject sys = jo.getJSONObject("System"); |
|
|
|
if (sys.containsKey("H5")) { |
|
|
|
JSONObject H5 = sys.getJSONObject("H5"); |
|
|
|
H5.put("streamUrl", streamUrl); |
|
|
|
} |
|
|
|
} |
|
|
|
result = jo.toString(); |
|
|
|
dto.setProperty(result); |
|
|
|
} |
|
|
|
return dto; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public String syncH5Config(Long tId, String manCode) { |
|
|
|
log.info("tenant_id:{}",tId); |
|
|
|
|