dns mail http ssl增加subscribeId业务
This commit is contained in:
@@ -22,6 +22,7 @@ import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.FileDigestCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.MailKeywordCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
@@ -37,6 +38,7 @@ import com.nis.util.FileUtils;
|
||||
import com.nis.util.JsonMapper;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
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;
|
||||
|
||||
@@ -51,6 +53,10 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
|
||||
protected MailCfgDao mailCfgDao;
|
||||
@Autowired
|
||||
protected AreaIpCfgDao areaIpCfgDao;
|
||||
@Autowired
|
||||
protected StringCfgDao stringCfgDao;
|
||||
|
||||
|
||||
public Page<CfgIndexInfo> getMailList(Page<CfgIndexInfo> page, CfgIndexInfo entity){
|
||||
// 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL)
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
|
||||
@@ -65,9 +71,11 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
|
||||
List<ComplexkeywordCfg> keywordList = mailCfgDao.getMailKeywordList(entity);
|
||||
List<FileDigestCfg> digestList = mailCfgDao.getMailFileDigestList(entity);
|
||||
List<AreaIpCfg> areaCfg = areaIpCfgDao.getByCompileId(entity.getCompileId());
|
||||
List<NtcSubscribeIdCfg> ntcSubscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
|
||||
entity.setIpPortList(ipPortList);
|
||||
entity.setComplexList(keywordList);
|
||||
entity.setDigestList(digestList);
|
||||
entity.setNtcSubscribeIdCfgList(ntcSubscribeIdList);
|
||||
entity.setAreaCfg(areaCfg);
|
||||
return entity;
|
||||
}
|
||||
@@ -79,6 +87,10 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
|
||||
public void saveMailCfg(CfgIndexInfo entity,ToMaatResult result){
|
||||
//设置区域运营商信息
|
||||
setAreaEffectiveIds(entity);
|
||||
|
||||
entity.setIsValid(0);
|
||||
entity.setIsAudit(0);
|
||||
|
||||
if(entity.getCfgId()==null){
|
||||
Integer compileId = 0;
|
||||
try {
|
||||
@@ -86,58 +98,67 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
|
||||
if(idList!=null && idList.size()>0){
|
||||
compileId = idList.get(0);
|
||||
}
|
||||
entity.setCompileId(compileId);
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
mailCfgDao.saveCfgIndex(entity);
|
||||
if(entity.getIpPortList()!=null){
|
||||
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
mailCfgDao.saveIpPortCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(entity.getComplexList()!=null){
|
||||
for(ComplexkeywordCfg cfg:entity.getComplexList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
|
||||
cfg.setDistrict(cfg.getDistrictShowName());
|
||||
}
|
||||
mailCfgDao.saveMailKeywordCfg(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(entity.getDigestList()!=null){
|
||||
for(FileDigestCfg cfg:entity.getDigestList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
if(result!=null && result.getData()!=null){
|
||||
cfg.setRawLen(result.getData().getRawLen());
|
||||
cfg.setDigest(result.getData().getDigest());
|
||||
cfg.setFileUrl(result.getData().getAccessUrl());
|
||||
}
|
||||
mailCfgDao.saveMailFileDigestCfg(cfg);
|
||||
}
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null){
|
||||
for(AreaIpCfg cfg:entity.getAreaCfg()){
|
||||
cfg.initDefaultValue();
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
areaIpCfgDao.saveAreaIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} catch (MaatConvertException e) {
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
entity.setCompileId(compileId);
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
mailCfgDao.saveCfgIndex(entity);
|
||||
if(entity.getIpPortList()!=null){
|
||||
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
mailCfgDao.saveIpPortCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(entity.getComplexList()!=null){
|
||||
for(ComplexkeywordCfg cfg:entity.getComplexList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
|
||||
cfg.setDistrict(cfg.getDistrictShowName());
|
||||
}
|
||||
mailCfgDao.saveMailKeywordCfg(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(entity.getDigestList()!=null){
|
||||
for(FileDigestCfg cfg:entity.getDigestList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
if(result!=null && result.getData()!=null){
|
||||
cfg.setRawLen(result.getData().getRawLen());
|
||||
cfg.setDigest(result.getData().getDigest());
|
||||
cfg.setFileUrl(result.getData().getAccessUrl());
|
||||
}
|
||||
mailCfgDao.saveMailFileDigestCfg(cfg);
|
||||
}
|
||||
}
|
||||
|
||||
if(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()){
|
||||
cfg.initDefaultValue();
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
areaIpCfgDao.saveAreaIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
mailCfgDao.updateCfgIndex(entity);
|
||||
//无效子配置后,再新增子配置
|
||||
mailCfgDao.deleteMailIpCfg(entity);
|
||||
mailCfgDao.deleteMailKeywordCfg(entity);
|
||||
mailCfgDao.deleteMailFileDigestCfg(entity);
|
||||
stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity);
|
||||
AreaIpCfg area = new AreaIpCfg();
|
||||
area.setCompileId(entity.getCompileId());
|
||||
area.setFunctionId(entity.getFunctionId());
|
||||
@@ -172,6 +193,14 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
|
||||
mailCfgDao.saveMailFileDigestCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(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()){
|
||||
@@ -208,6 +237,13 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
|
||||
cfg.setTableName(MailKeywordCfg.getTablename());
|
||||
mailCfgDao.updateCfgValid(cfg);
|
||||
}
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0)
|
||||
{
|
||||
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
|
||||
mailCfgDao.updateCfgValid(cfg);
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
|
||||
AreaIpCfg cfg = new AreaIpCfg();
|
||||
@@ -272,6 +308,19 @@ public class MailCfgService extends CrudService<MailCfgDao,CfgIndexInfo> {
|
||||
digestRegionList=map.get("dstList");
|
||||
}
|
||||
}
|
||||
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
|
||||
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
|
||||
mailCfgDao.auditCfg(cfg);
|
||||
if(isAudit==1){
|
||||
Map<String,List> map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
}
|
||||
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
|
||||
AreaIpCfg cfg = new AreaIpCfg();
|
||||
|
||||
Reference in New Issue
Block a user