APP策略、文件摘要加SubscribeId域.
This commit is contained in:
@@ -378,6 +378,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
|
||||
public FileDigestCfg getFileDigestCfg(Long cfgId){
|
||||
FileDigestCfg entity = fileTransferCfgDao.getFileDigest(cfgId);
|
||||
List<NtcSubscribeIdCfg> subscribeidList = fileTransferCfgDao.getFileDigestSubscribeidList(entity);
|
||||
entity.setNtcSubscribeIdCfgList(subscribeidList);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -402,18 +404,21 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
}
|
||||
entity.setCompileId(compileId);
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
Long rawLen = result.getData().getRawLen();
|
||||
String digest = result.getData().getDigest();
|
||||
if((result!=null && result.getData()!=null) && (rawLen != null && digest!= null)){
|
||||
entity.setRawLen(rawLen);
|
||||
entity.setDigest(digest);
|
||||
entity.setFileUrl(result.getData().getAccessUrl());
|
||||
}else {
|
||||
logger.info("获取文件摘要属性有误");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+null);
|
||||
}
|
||||
entity.setRawLen(result.getData().getRawLen());
|
||||
entity.setDigest(result.getData().getDigest());
|
||||
entity.setFileUrl(result.getData().getAccessUrl());
|
||||
|
||||
mailCfgDao.saveMailFileDigestCfg(entity);
|
||||
|
||||
// 保存SubscribeId域配置信息
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null){
|
||||
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
fileTransferCfgDao.saveP2pSubscribeIdCfg(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null&&entity.getAreaCfg().size()>0){
|
||||
for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) {
|
||||
@@ -427,12 +432,26 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
entity.setEditTime(new Date());
|
||||
if(result!=null && result.getData()!=null){
|
||||
if(result.getData() !=null ) {
|
||||
entity.setRawLen(result.getData().getRawLen());
|
||||
entity.setDigest(result.getData().getDigest());
|
||||
entity.setFileUrl(result.getData().getAccessUrl());
|
||||
}
|
||||
|
||||
fileTransferCfgDao.updateFileDigestCfg(entity);
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
entity.setCreateTime(new Date());
|
||||
|
||||
// SubscribeId域配置 先删后加
|
||||
fileTransferCfgDao.deleteFileDigestSubscribeIdCfg(entity);
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null){
|
||||
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
fileTransferCfgDao.saveP2pSubscribeIdCfg(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
areaCfgIds=!StringUtil.isEmpty(areaCfgIds)? ","+areaCfgIds:"";
|
||||
if(!StringUtil.isEmpty(entity.getAreaCfg())){
|
||||
@@ -592,6 +611,17 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
}
|
||||
}
|
||||
|
||||
public FileDigestCfg getFileDigestSubIdCfg(Long cfgId) {
|
||||
FileDigestCfg entity = fileTransferCfgDao.getFileDigest(cfgId);
|
||||
if(entity.getCompileId()!=null){
|
||||
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
|
||||
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
|
||||
List<NtcSubscribeIdCfg> ntcList = stringCfgDao.findSubscribeIdCfgList(ntcSubscribeIdCfg);
|
||||
entity.setNtcSubscribeIdCfgList(ntcList);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
public Page<CfgIndexInfo> getP2pList(Page<CfgIndexInfo> page, CfgIndexInfo entity){
|
||||
// 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL)
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
|
||||
@@ -943,4 +973,5 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user