1、数据范围根据用户角色筛选;2、界面功能按钮根据权限是否显示;3、文件上传后,文件访问链接改为服务接口返回的参数内容

This commit is contained in:
zhangwei
2018-05-21 17:21:21 +08:00
parent 46f43c6f5d
commit b46e302824
5 changed files with 93 additions and 26 deletions

View File

@@ -50,12 +50,16 @@ public class AvCfgService extends BaseService{
return avCfgDao.getAvSignSampleById(cfgId);
}
public Page<AvFileSampleCfg> getAvFileSampleList(Page<AvFileSampleCfg> page, AvFileSampleCfg entity){
// 生成数据权限过滤条件dsf为dataScopeFilter的简写在xml中使用 ${sqlMap.dsf}调用权限SQL
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
entity.setPage(page);
List<AvFileSampleCfg> list = avCfgDao.getAvFileSampleList(entity);
page.setList(list);
return page;
}
public Page<AvSignSampleCfg> getAvSignSampleList(Page<AvSignSampleCfg> page, AvSignSampleCfg entity){
// 生成数据权限过滤条件dsf为dataScopeFilter的简写在xml中使用 ${sqlMap.dsf}调用权限SQL
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
entity.setPage(page);
List<AvSignSampleCfg> list = avCfgDao.getAvSignSampleList(entity);
page.setList(list);
@@ -157,6 +161,9 @@ public class AvCfgService extends BaseService{
srcMap.put("checksum", entity.getSrcMd5());
String result1 = ConfigServiceUtil.postFileCfg(null, srcFile, JSONObject.fromObject(srcMap));
logger.info("音视频源文件上传响应信息:"+result1);
//获取文件上传响应信息(文件访问路径)
Map<String, Object> srcRes = gson.fromJson(result1,Map.class);
entity.setSrcUrl(srcRes.get("data").toString());
File smapleFile = new File(entity.getSamplePath());
Map<String,Object> sampleMap = new HashMap();
@@ -167,7 +174,9 @@ public class AvCfgService extends BaseService{
sampleMap.put("checksum", entity.getSampleMd5());
String result2 = ConfigServiceUtil.postFileCfg(null, srcFile, JSONObject.fromObject(sampleMap));
logger.info("音视频样例文件上传响应信息:"+result2);
Map<String, Object> sampleRes = gson.fromJson(result1,Map.class);
//获取文件上传响应信息(文件访问路径)
entity.setSampleUrl(sampleRes.get("data").toString());
} catch (Exception e) {
e.printStackTrace();
logger.info("音视频文件样例配置下发失败");