1.ftp增加doLog2.增加subscribeId3.增加compileId查询

This commit is contained in:
zhanghongqing
2018-08-22 22:42:12 +08:00
parent 5932b68c84
commit 8884972507
9 changed files with 285 additions and 32 deletions

View File

@@ -43,6 +43,7 @@ import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.AreaIpCfgDao;
import com.nis.web.dao.configuration.FileTransferCfgDao;
import com.nis.web.dao.configuration.MailCfgDao;
import com.nis.web.dao.configuration.StringCfgDao;
import com.nis.web.security.UserUtils;
import com.nis.web.service.CrudService;
@@ -59,6 +60,9 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
protected AreaIpCfgDao areaIpCfgDao;
@Autowired
protected MailCfgDao mailCfgDao;
@Autowired
protected StringCfgDao stringCfgDao;
public Page<CfgIndexInfo> getFtpList(Page<CfgIndexInfo> page, CfgIndexInfo entity){
// 生成数据权限过滤条件dsf为dataScopeFilter的简写在xml中使用 ${sqlMap.dsf}调用权限SQL
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
@@ -71,6 +75,13 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
CfgIndexInfo entity = fileTransferCfgDao.getCfgIndexInfo(cfgId);
List<IpPortCfg> ipPortList = fileTransferCfgDao.getIpPortList(entity);
List<BaseStringCfg> keywordList = fileTransferCfgDao.getFtpKeywordList(entity);
//设置关键字
if(entity.getCompileId()!=null){
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
List<NtcSubscribeIdCfg> ntcList = stringCfgDao.findSubscribeIdCfgList(ntcSubscribeIdCfg);
entity.setNtcSubscribeIdCfgList(ntcList);
}
entity.setIpPortList(ipPortList);
entity.setStringList(keywordList);
return entity;
@@ -83,6 +94,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
public void saveFtpCfg(CfgIndexInfo entity){
//设置区域运营商信息
setAreaEffectiveIds(entity);
entity.setIsValid(0);
entity.setIsAudit(0);
if(entity.getCfgId()==null){
Integer compileId = 0;
try {
@@ -108,6 +121,15 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
// entity.setNtcSubscribeIdCfg(cfg);
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
stringCfgDao.saveSubscribeIdCfg(cfg);
}
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
@@ -123,11 +145,19 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}
}else{
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
fileTransferCfgDao.updateCfgIndex(entity);
//无效子配置后,再新增子配置
fileTransferCfgDao.deleteFtpIpCfg(entity);
fileTransferCfgDao.deleteFtpKeywordCfg(entity);
fileTransferCfgDao.deleteFileDigestCfg(entity);
//删除关键字配置后再新增
if(entity!=null&&entity.getCompileId()!=null){
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
stringCfgDao.deleteSubscribeIdCfg(ntcSubscribeIdCfg);
}
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
@@ -148,6 +178,14 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}
}
}
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
stringCfgDao.saveSubscribeIdCfg(cfg);
}
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
@@ -184,6 +222,14 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
cfg.setTableName(FtpKeywordCfg.getTablename());
fileTransferCfgDao.updateCfgValid(cfg);
}
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0)
{
NtcSubscribeIdCfg ntc = new NtcSubscribeIdCfg();
BeanUtils.copyProperties(entity, ntc, new String[]{"cfgId"});
ntc.setTableName(ntc.getTablename());
stringCfgDao.updateSubscribeIdCfg(ntc);
}
//保存区域IP信息
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
AreaIpCfg cfg = new AreaIpCfg();
@@ -237,6 +283,18 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
strRegionList=map.get("dstList");
}
}
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0)
{
NtcSubscribeIdCfg ntc = new NtcSubscribeIdCfg();
BeanUtils.copyProperties(entity, ntc, new String[]{"cfgId"});
ntc.setTableName(ntc.getTablename());
stringCfgDao.updateSubscribeIdCfg(ntc);
if(isAudit==1){
Map<String,List> ntcMap = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
groupRelationList=ntcMap.get("groupList");
strRegionList=ntcMap.get("dstList");
}
}
if(entity.getDigestList()!=null && entity.getDigestList().size()>0){
FileDigestCfg cfg = new FileDigestCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});