fileDigest模块增加区域信息

修改dns域名取值bug
This commit is contained in:
duandongmei
2018-06-08 14:26:40 +08:00
parent 765d9a9ced
commit f8bc158390
8 changed files with 117 additions and 13 deletions

View File

@@ -155,7 +155,7 @@ public class FileTransferCfgController extends BaseController{
@RequestMapping(value = {"saveFileDigestCfg"})
@RequiresPermissions(value={"fileTransfer:fileDigest:config"})
public String saveFileDigestCfg(Model model,HttpServletRequest request,HttpServletResponse response,String ids,
FileDigestCfg entity,MultipartFile file) {
FileDigestCfg entity,MultipartFile file,@ModelAttribute("areaCfgIds")String areaCfgIds) {
try {
Date fileTime=null;
Date date=new Date();
@@ -188,7 +188,7 @@ public class FileTransferCfgController extends BaseController{
result = ConfigServiceUtil.getFileDigest(null, uploadFile, JsonMapper.toJsonString(fileMap));
logger.info("获取文件摘要响应信息:"+result);
}
fileTransferCfgService.saveOrUpdateFileDigestCfg(entity,result);
fileTransferCfgService.saveOrUpdateFileDigestCfg(entity,result,areaCfgIds);
} catch (IOException e) {
e.printStackTrace();
}

View File

@@ -233,9 +233,17 @@
delete from area_ip_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
<update id="updateAreaIpCfgValid" parameterType="com.nis.domain.configuration.BaseCfg">
update area_ip_cfg set is_valid = #{isValid,jdbcType=INTEGER},
update area_ip_cfg
<set>
<if test="isValid != null" >
is_valid = #{isValid,jdbcType=INTEGER},
</if>
<if test="isAudit != null" >
is_audit = #{isAudit,jdbcType=INTEGER},
</if>
editor_id = #{editorId,jdbcType=INTEGER} ,
edit_time = #{editTime,jdbcType=TIMESTAMP}
edit_time = #{editTime,jdbcType=TIMESTAMP},
</set>
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="cfgId !=null ">
AND cfg_id = #{cfgId,jdbcType=BIGINT}

View File

@@ -278,10 +278,10 @@ public abstract class BaseService {
List numRegionList = new ArrayList();
Integer groupId = 0;
for(int i=0;i<srcList.size();i++){
GroupCfg group = new GroupCfg();
BaseIpCfg baseIpCfg = (BaseIpCfg) srcList.get(i);
IpCfg cfg = new IpCfg();
BeanUtils.copyProperties(baseIpCfg, cfg);
GroupCfg group = new GroupCfg();
if(!cfg.getCfgType().equals(regionValue)){
groupId = ConfigServiceUtil.getId(2, 1).get(0);
group.setGroupId(groupId);

View File

@@ -373,6 +373,10 @@ public class AvContentCfgService extends BaseService{
strRegionList=accountMap.get("dstList");
}
if(!StringUtil.isEmpty(areaIpCfgList)){
//TODO DELETE后期删除
for (AreaIpCfg areaIpCfga : areaIpCfgList) {
areaIpCfga.setCfgType("NTC_IP_RANGE");
}
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=areaMap.get("groupList");
areaIpRegionList=areaMap.get("dstList");
@@ -661,8 +665,15 @@ public class AvContentCfgService extends BaseService{
groupRelationList=ipMap.get("groupList");
ipRegionList=ipMap.get("dstList");
}
//TODO DELETE后期删除
for (AreaIpCfg areaIpCfga : areaIpCfgList) {
areaIpCfga.setCfgType("NTC_IP_RANGE");
}
if(!StringUtil.isEmpty(areaIpCfgList)){
//TODO DELETE后期删除
for (AreaIpCfg areaIpCfga : areaIpCfgList) {
areaIpCfga.setCfgType("NTC_IP_RANGE");
}
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=areaMap.get("groupList");
areaIpRegionList=areaMap.get("dstList");
@@ -951,6 +962,10 @@ public class AvContentCfgService extends BaseService{
}
if(!StringUtil.isEmpty(areaIpCfgList)){
//TODO DELETE后期删除
for (AreaIpCfg areaIpCfga : areaIpCfgList) {
areaIpCfga.setCfgType("NTC_IP_RANGE");
}
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=areaMap.get("groupList");
areaIpRegionList=areaMap.get("dstList");
@@ -1204,6 +1219,10 @@ public class AvContentCfgService extends BaseService{
}
if(!StringUtil.isEmpty(areaIpCfgList)){
//TODO DELETE后期删除
for (AreaIpCfg areaIpCfga : areaIpCfgList) {
areaIpCfga.setCfgType("NTC_IP_RANGE");
}
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=areaMap.get("groupList");
areaIpRegionList=areaMap.get("dstList");
@@ -1456,6 +1475,10 @@ public class AvContentCfgService extends BaseService{
}
if(!StringUtil.isEmpty(areaIpCfgList)){
//TODO DELETE后期删除
for (AreaIpCfg areaIpCfga : areaIpCfgList) {
areaIpCfga.setCfgType("NTC_IP_RANGE");
}
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=areaMap.get("groupList");
areaIpRegionList=areaMap.get("dstList");

View File

@@ -318,7 +318,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
return entity;
}
public void saveOrUpdateFileDigestCfg(FileDigestCfg entity,ToMaatResult result){
public void saveOrUpdateFileDigestCfg(FileDigestCfg entity,ToMaatResult result,String areaCfgIds){
//设置区域运营商信息
setAreaEffectiveIds(entity);
@@ -346,7 +346,17 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}
mailCfgDao.saveMailFileDigestCfg(entity);
//保存区域IP信息
if(entity.getAreaCfg()!=null&&entity.getAreaCfg().size()>0){
for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) {
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
}
}
}else{
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
if(result!=null && result.getData()!=null){
@@ -354,6 +364,41 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
entity.setDigest(result.getData().getDigest());
}
fileTransferCfgDao.updateFileDigestCfg(entity);
areaCfgIds=!StringUtil.isEmpty(areaCfgIds)? ","+areaCfgIds:"";
if(!StringUtil.isEmpty(entity.getAreaCfg())){
for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) {
if(!StringUtil.isEmpty(areaIpCfg.getCfgId())){
if(areaCfgIds.contains(","+areaIpCfg.getCfgId()+",")){
areaCfgIds=areaCfgIds.replace(areaIpCfg.getCfgId()+",", "");
}
//修改
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(entity.getEditTime());
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"});
areaIpCfgDao.updateAreaIpCfg(areaIpCfg);
}else{
//新增
entity.setCreatorId(UserUtils.getUser().getId());
entity.setCreateTime(entity.getEditTime());
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType"
});
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
}
}
}
//delete 真是删除areaIpCfg信息
if(!StringUtil.isEmpty(areaCfgIds.replaceAll(",", ""))){
areaCfgIds=areaCfgIds.substring(1,areaCfgIds.length());
for (String cfgId : areaCfgIds.split(",")) {
CfgIndexInfo cfg=new CfgIndexInfo();
AreaIpCfg areaIpCfg=new AreaIpCfg();
areaIpCfg.setCfgId(Long.parseLong(cfgId));
areaIpCfgDao.deleteAreaIpCfgByCfgId(areaIpCfg);
}
}
}
}
@@ -367,6 +412,15 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
entity.setEditTime(new Date());
entity.setFunctionId(functionId);
fileTransferCfgDao.updateFileDigestCfg(entity);
entity = fileTransferCfgDao.getFileDigest(Long.parseLong(id));
AreaIpCfg areaIpCfg=new AreaIpCfg();
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType"
,"cfgId"
});
areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg);
}
}
@@ -381,10 +435,19 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
fileTransferCfgDao.updateFileDigestCfg(entity);
entity = fileTransferCfgDao.getFileDigest(Long.parseLong(id));
List list=new ArrayList();
list.add(entity);
AreaIpCfg areaIpCfg=new AreaIpCfg();
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType"
,"cfgId"
});
areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg);
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
@@ -406,6 +469,16 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
if(map.get("numRegionList")!=null){
numRegionList.addAll(map.get("numRegionList"));
}
if(areaIpCfgList != null && areaIpCfgList.size() >0){
//TODO DELETE后期删除
for (AreaIpCfg areaIpCfga : areaIpCfgList) {
areaIpCfga.setCfgType("NTC_IP_RANGE");
}
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=areaMap.get("groupList");
areaIpRegionList=areaMap.get("dstList");
}
}
//构造提交综合服务参数格式,一条配置提交一次综合服务

View File

@@ -826,7 +826,7 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
cfg.setTableName(DnsDomainCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(strRegionList,entity.getSslList(),2,entity,groupRelationList);
Map<String,List> map = cfgConvert(strRegionList,entity.getDomainList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}

View File

@@ -3,6 +3,7 @@
<h3 class="form-section"><spring:message code="block_config"/></h3>
<div class="row stringInfo">
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="row">
<div class="col-md-6">
<div class="form-group ">

View File

@@ -125,7 +125,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="cfds_level" /></label>
<div class="col-md-6">
<input class="form-control required digits" type="text"
<input class="form-control required digits" type="text" range="[1,10]"
name="cfdsLevel"
value="${_cfg.cfdsLevel}">
</div>
@@ -134,8 +134,7 @@ $(function(){
</div>
</div>
<%-- <%@include file="/WEB-INF/include/form/areaInfo.jsp" %> --%>
<input type="hidden" name="isAreaEffective" value="0">
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
</div>
<div class="form-actions">