fileDigest模块增加区域信息
修改dns域名取值bug
This commit is contained in:
@@ -155,7 +155,7 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
@RequestMapping(value = {"saveFileDigestCfg"})
|
@RequestMapping(value = {"saveFileDigestCfg"})
|
||||||
@RequiresPermissions(value={"fileTransfer:fileDigest:config"})
|
@RequiresPermissions(value={"fileTransfer:fileDigest:config"})
|
||||||
public String saveFileDigestCfg(Model model,HttpServletRequest request,HttpServletResponse response,String ids,
|
public String saveFileDigestCfg(Model model,HttpServletRequest request,HttpServletResponse response,String ids,
|
||||||
FileDigestCfg entity,MultipartFile file) {
|
FileDigestCfg entity,MultipartFile file,@ModelAttribute("areaCfgIds")String areaCfgIds) {
|
||||||
try {
|
try {
|
||||||
Date fileTime=null;
|
Date fileTime=null;
|
||||||
Date date=new Date();
|
Date date=new Date();
|
||||||
@@ -188,7 +188,7 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
result = ConfigServiceUtil.getFileDigest(null, uploadFile, JsonMapper.toJsonString(fileMap));
|
result = ConfigServiceUtil.getFileDigest(null, uploadFile, JsonMapper.toJsonString(fileMap));
|
||||||
logger.info("获取文件摘要响应信息:"+result);
|
logger.info("获取文件摘要响应信息:"+result);
|
||||||
}
|
}
|
||||||
fileTransferCfgService.saveOrUpdateFileDigestCfg(entity,result);
|
fileTransferCfgService.saveOrUpdateFileDigestCfg(entity,result,areaCfgIds);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -233,9 +233,17 @@
|
|||||||
delete from area_ip_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
delete from area_ip_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
||||||
</delete>
|
</delete>
|
||||||
<update id="updateAreaIpCfgValid" parameterType="com.nis.domain.configuration.BaseCfg">
|
<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} ,
|
editor_id = #{editorId,jdbcType=INTEGER} ,
|
||||||
edit_time = #{editTime,jdbcType=TIMESTAMP}
|
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
||||||
|
</set>
|
||||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||||
<if test="cfgId !=null ">
|
<if test="cfgId !=null ">
|
||||||
AND cfg_id = #{cfgId,jdbcType=BIGINT}
|
AND cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||||
|
|||||||
@@ -278,10 +278,10 @@ public abstract class BaseService {
|
|||||||
List numRegionList = new ArrayList();
|
List numRegionList = new ArrayList();
|
||||||
Integer groupId = 0;
|
Integer groupId = 0;
|
||||||
for(int i=0;i<srcList.size();i++){
|
for(int i=0;i<srcList.size();i++){
|
||||||
GroupCfg group = new GroupCfg();
|
|
||||||
BaseIpCfg baseIpCfg = (BaseIpCfg) srcList.get(i);
|
BaseIpCfg baseIpCfg = (BaseIpCfg) srcList.get(i);
|
||||||
IpCfg cfg = new IpCfg();
|
IpCfg cfg = new IpCfg();
|
||||||
BeanUtils.copyProperties(baseIpCfg, cfg);
|
BeanUtils.copyProperties(baseIpCfg, cfg);
|
||||||
|
GroupCfg group = new GroupCfg();
|
||||||
if(!cfg.getCfgType().equals(regionValue)){
|
if(!cfg.getCfgType().equals(regionValue)){
|
||||||
groupId = ConfigServiceUtil.getId(2, 1).get(0);
|
groupId = ConfigServiceUtil.getId(2, 1).get(0);
|
||||||
group.setGroupId(groupId);
|
group.setGroupId(groupId);
|
||||||
|
|||||||
@@ -373,6 +373,10 @@ public class AvContentCfgService extends BaseService{
|
|||||||
strRegionList=accountMap.get("dstList");
|
strRegionList=accountMap.get("dstList");
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmpty(areaIpCfgList)){
|
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);
|
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
|
||||||
groupRelationList=areaMap.get("groupList");
|
groupRelationList=areaMap.get("groupList");
|
||||||
areaIpRegionList=areaMap.get("dstList");
|
areaIpRegionList=areaMap.get("dstList");
|
||||||
@@ -661,8 +665,15 @@ public class AvContentCfgService extends BaseService{
|
|||||||
groupRelationList=ipMap.get("groupList");
|
groupRelationList=ipMap.get("groupList");
|
||||||
ipRegionList=ipMap.get("dstList");
|
ipRegionList=ipMap.get("dstList");
|
||||||
}
|
}
|
||||||
|
//TODO DELETE后期删除
|
||||||
|
for (AreaIpCfg areaIpCfga : areaIpCfgList) {
|
||||||
|
areaIpCfga.setCfgType("NTC_IP_RANGE");
|
||||||
|
}
|
||||||
if(!StringUtil.isEmpty(areaIpCfgList)){
|
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);
|
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
|
||||||
groupRelationList=areaMap.get("groupList");
|
groupRelationList=areaMap.get("groupList");
|
||||||
areaIpRegionList=areaMap.get("dstList");
|
areaIpRegionList=areaMap.get("dstList");
|
||||||
@@ -951,6 +962,10 @@ public class AvContentCfgService extends BaseService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!StringUtil.isEmpty(areaIpCfgList)){
|
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);
|
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
|
||||||
groupRelationList=areaMap.get("groupList");
|
groupRelationList=areaMap.get("groupList");
|
||||||
areaIpRegionList=areaMap.get("dstList");
|
areaIpRegionList=areaMap.get("dstList");
|
||||||
@@ -1204,6 +1219,10 @@ public class AvContentCfgService extends BaseService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!StringUtil.isEmpty(areaIpCfgList)){
|
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);
|
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
|
||||||
groupRelationList=areaMap.get("groupList");
|
groupRelationList=areaMap.get("groupList");
|
||||||
areaIpRegionList=areaMap.get("dstList");
|
areaIpRegionList=areaMap.get("dstList");
|
||||||
@@ -1456,6 +1475,10 @@ public class AvContentCfgService extends BaseService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!StringUtil.isEmpty(areaIpCfgList)){
|
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);
|
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
|
||||||
groupRelationList=areaMap.get("groupList");
|
groupRelationList=areaMap.get("groupList");
|
||||||
areaIpRegionList=areaMap.get("dstList");
|
areaIpRegionList=areaMap.get("dstList");
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
|||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveOrUpdateFileDigestCfg(FileDigestCfg entity,ToMaatResult result){
|
public void saveOrUpdateFileDigestCfg(FileDigestCfg entity,ToMaatResult result,String areaCfgIds){
|
||||||
//设置区域运营商信息
|
//设置区域运营商信息
|
||||||
setAreaEffectiveIds(entity);
|
setAreaEffectiveIds(entity);
|
||||||
|
|
||||||
@@ -346,7 +346,17 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
|||||||
}
|
}
|
||||||
mailCfgDao.saveMailFileDigestCfg(entity);
|
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{
|
}else{
|
||||||
|
|
||||||
|
|
||||||
entity.setEditorId(entity.getCurrentUser().getId());
|
entity.setEditorId(entity.getCurrentUser().getId());
|
||||||
entity.setEditTime(new Date());
|
entity.setEditTime(new Date());
|
||||||
if(result!=null && result.getData()!=null){
|
if(result!=null && result.getData()!=null){
|
||||||
@@ -354,6 +364,41 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
|||||||
entity.setDigest(result.getData().getDigest());
|
entity.setDigest(result.getData().getDigest());
|
||||||
}
|
}
|
||||||
fileTransferCfgDao.updateFileDigestCfg(entity);
|
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.setEditTime(new Date());
|
||||||
entity.setFunctionId(functionId);
|
entity.setFunctionId(functionId);
|
||||||
fileTransferCfgDao.updateFileDigestCfg(entity);
|
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);
|
fileTransferCfgDao.updateFileDigestCfg(entity);
|
||||||
|
|
||||||
entity = fileTransferCfgDao.getFileDigest(Long.parseLong(id));
|
entity = fileTransferCfgDao.getFileDigest(Long.parseLong(id));
|
||||||
|
|
||||||
List list=new ArrayList();
|
List list=new ArrayList();
|
||||||
list.add(entity);
|
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();
|
ToMaatBean maatBean = new ToMaatBean();
|
||||||
MaatCfg maatCfg = new MaatCfg();
|
MaatCfg maatCfg = new MaatCfg();
|
||||||
List<MaatCfg> configCompileList = new ArrayList();
|
List<MaatCfg> configCompileList = new ArrayList();
|
||||||
@@ -406,6 +469,16 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
|||||||
if(map.get("numRegionList")!=null){
|
if(map.get("numRegionList")!=null){
|
||||||
numRegionList.addAll(map.get("numRegionList"));
|
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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//构造提交综合服务参数格式,一条配置提交一次综合服务
|
//构造提交综合服务参数格式,一条配置提交一次综合服务
|
||||||
|
|||||||
@@ -826,7 +826,7 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
|||||||
cfg.setTableName(DnsDomainCfg.getTablename());
|
cfg.setTableName(DnsDomainCfg.getTablename());
|
||||||
websiteCfgDao.auditCfg(cfg);
|
websiteCfgDao.auditCfg(cfg);
|
||||||
if(isAudit==1){
|
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");
|
groupRelationList=map.get("groupList");
|
||||||
strRegionList=map.get("dstList");
|
strRegionList=map.get("dstList");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<h3 class="form-section"><spring:message code="block_config"/></h3>
|
<h3 class="form-section"><spring:message code="block_config"/></h3>
|
||||||
<div class="row stringInfo">
|
<div class="row stringInfo">
|
||||||
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
|
<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="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group ">
|
<div class="form-group ">
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ $(function(){
|
|||||||
<label class="control-label col-md-3"><font color="red">*</font>
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
<spring:message code="cfds_level" /></label>
|
<spring:message code="cfds_level" /></label>
|
||||||
<div class="col-md-6">
|
<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"
|
name="cfdsLevel"
|
||||||
value="${_cfg.cfdsLevel}">
|
value="${_cfg.cfdsLevel}">
|
||||||
</div>
|
</div>
|
||||||
@@ -134,8 +134,7 @@ $(function(){
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<%-- <%@include file="/WEB-INF/include/form/areaInfo.jsp" %> --%>
|
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
|
||||||
<input type="hidden" name="isAreaEffective" value="0">
|
|
||||||
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
|
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
|
|||||||
Reference in New Issue
Block a user