Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
fangshunjian
2018-08-24 13:54:33 +08:00
57 changed files with 5148 additions and 1182 deletions

View File

@@ -69,17 +69,17 @@ public class AppPolicyCfg extends BaseCfg<AppPolicyCfg> {
@Expose
@ExcelField(title="expression_type")
@SerializedName("exprType")
private Integer exprType ;
protected Integer exprType ;
@Expose
@ExcelField(title="match_method")
@SerializedName("matchMethod")
private Integer matchMethod ;
protected Integer matchMethod ;
@Expose
@ExcelField(title="whether_hexbinary")
@SerializedName("isHexbin")
private Integer isHexbin;
protected Integer isHexbin;
private List<IpPortCfg> ipPortList;
private IpPortCfg ipPort;

View File

@@ -0,0 +1,176 @@
/**
*@Title: BaseStringConfig.java
*@Package com.nis.domain.restful
*@Description TODO
*@author dell
*@date 2018年2月5日 下午5:26:02
*@version 版本号
*/
package com.nis.domain.configuration;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.nis.util.excel.ExcelField;
/**
* APP TCP会话字节数特征
* @author dell
*
*/
public class AppTcpCfg extends BaseCfg<AppTcpCfg> {
/**
*
*/
private static final long serialVersionUID = -4366457794248757698L;
private static final String tableName="app_session_cfg";
@Expose
private Integer compileId;
@Expose
private Integer ratelimit;
private Integer appCode;//specific_service_cfg表一级节点的spec_service_code
private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code
private Integer specServiceId;
private String district;
private String cfgKeywords;
private String appName;
/**
* 数值下界
*/
protected Integer lowBoundary;
/**
* 数值上界
*/
protected Integer upBoundary;
@Expose
@ExcelField(title="expression_type")
@SerializedName("exprType")
protected Integer exprType ;
@Expose
@ExcelField(title="match_method")
@SerializedName("matchMethod")
protected Integer matchMethod ;
@Expose
@ExcelField(title="whether_hexbinary")
@SerializedName("isHexbin")
protected Integer isHexbin;
public Integer getLowBoundary() {
return lowBoundary;
}
public void setLowBoundary(Integer lowBoundary) {
this.lowBoundary = lowBoundary;
}
public Integer getUpBoundary() {
return upBoundary;
}
public void setUpBoundary(Integer upBoundary) {
this.upBoundary = upBoundary;
}
public Integer getExprType() {
return exprType;
}
public void setExprType(Integer exprType) {
this.exprType = exprType;
}
public Integer getMatchMethod() {
return matchMethod;
}
public void setMatchMethod(Integer matchMethod) {
this.matchMethod = matchMethod;
}
public Integer getIsHexbin() {
return isHexbin;
}
public void setIsHexbin(Integer isHexbin) {
this.isHexbin = isHexbin;
}
@Override
public void initDefaultValue() {
// TODO Auto-generated method stub
super.initDefaultValue();
this.isHexbin = 0;
}
public Integer getCompileId() {
return compileId;
}
public void setCompileId(Integer compileId) {
this.compileId = compileId;
}
public static String getTablename() {
return tableName;
}
public Integer getRatelimit() {
return ratelimit;
}
public void setRatelimit(Integer ratelimit) {
this.ratelimit = ratelimit;
}
public Integer getAppCode() {
return appCode;
}
public void setAppCode(Integer appCode) {
this.appCode = appCode;
}
public Integer getSpecServiceId() {
return specServiceId;
}
public void setSpecServiceId(Integer specServiceId) {
this.specServiceId = specServiceId;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public String getCfgKeywords() {
return cfgKeywords;
}
public void setCfgKeywords(String cfgKeywords) {
this.cfgKeywords = cfgKeywords;
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public Integer getBehavCode() {
return behavCode;
}
public void setBehavCode(Integer behavCode) {
this.behavCode = behavCode;
}
}

View File

@@ -0,0 +1,153 @@
/**
*@Title: BaseStringConfig.java
*@Package com.nis.domain.restful
*@Description TODO
*@author dell
*@date 2018年2月5日 下午5:26:02
*@version 版本号
*/
package com.nis.domain.configuration;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.nis.util.excel.ExcelField;
/**
* @Description: 主题网站配置
* @author (dell)
* @date 2018年2月5日 下午5:26:02
* @version V1.0
*/
public class AppTopicDomainCfg extends BaseCfg<AppTopicDomainCfg> {
private static final long serialVersionUID = -442502179959427340L;
private static final String tableName="app_topic_domain_cfg";
@Expose
private Integer compileId;
@Expose
private Integer ratelimit;
// private Integer appCode;//specific_service_cfg表一级节点的spec_service_code
private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code
private Integer specServiceId;
private String domain;
private String cfgKeywords;
private String appName;
private String topic;
@Expose
@ExcelField(title="expression_type")
@SerializedName("exprType")
protected Integer exprType ;
@Expose
@ExcelField(title="match_method")
@SerializedName("matchMethod")
protected Integer matchMethod ;
@Expose
@ExcelField(title="whether_hexbinary")
@SerializedName("isHexbin")
protected Integer isHexbin;
public String getTopic() {
return topic;
}
public void setTopic(String topic) {
this.topic = topic;
}
public Integer getExprType() {
return exprType;
}
public void setExprType(Integer exprType) {
this.exprType = exprType;
}
public Integer getMatchMethod() {
return matchMethod;
}
public void setMatchMethod(Integer matchMethod) {
this.matchMethod = matchMethod;
}
public Integer getIsHexbin() {
return isHexbin;
}
public void setIsHexbin(Integer isHexbin) {
this.isHexbin = isHexbin;
}
@Override
public void initDefaultValue() {
super.initDefaultValue();
this.isHexbin = 0;
this.doLog = 0;//app特征域不记录日志
}
public Integer getCompileId() {
return compileId;
}
public void setCompileId(Integer compileId) {
this.compileId = compileId;
}
public static String getTablename() {
return tableName;
}
public Integer getRatelimit() {
return ratelimit;
}
public void setRatelimit(Integer ratelimit) {
this.ratelimit = ratelimit;
}
// public Integer getAppCode() {
// return appCode;
// }
// public void setAppCode(Integer appCode) {
// this.appCode = appCode;
// }
public Integer getSpecServiceId() {
return specServiceId;
}
public void setSpecServiceId(Integer specServiceId) {
this.specServiceId = specServiceId;
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public String getCfgKeywords() {
return cfgKeywords;
}
public void setCfgKeywords(String cfgKeywords) {
this.cfgKeywords = cfgKeywords;
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public Integer getBehavCode() {
return behavCode;
}
public void setBehavCode(Integer behavCode) {
this.behavCode = behavCode;
}
}

View File

@@ -30,7 +30,10 @@ public class FileDigestCfg extends BaseCfg<FileDigestCfg> {
private String digest;
private Integer cfdsLevel;
private String fileUrl;
private NtcSubscribeIdCfg ntcSubscribeIdCfg;
private List<NtcSubscribeIdCfg> ntcSubscribeIdCfgList;
public static String getTablename() {
return tableName;
}
@@ -61,5 +64,17 @@ public class FileDigestCfg extends BaseCfg<FileDigestCfg> {
public void setFileUrl(String fileUrl) {
this.fileUrl = fileUrl;
}
public NtcSubscribeIdCfg getNtcSubscribeIdCfg() {
return ntcSubscribeIdCfg;
}
public void setNtcSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg) {
this.ntcSubscribeIdCfg = ntcSubscribeIdCfg;
}
public List<NtcSubscribeIdCfg> getNtcSubscribeIdCfgList() {
return ntcSubscribeIdCfgList;
}
public void setNtcSubscribeIdCfgList(List<NtcSubscribeIdCfg> ntcSubscribeIdCfgList) {
this.ntcSubscribeIdCfgList = ntcSubscribeIdCfgList;
}
}

View File

@@ -31,7 +31,14 @@ public class SpecificServiceCfg extends BaseEntity<SpecificServiceCfg>{
private Date endDate; // 结束日期
private String showSequence; //显示序号
private String businessType;
private Integer addFlag;//app界面添加标记
public Integer getAddFlag() {
return addFlag;
}
public void setAddFlag(Integer addFlag) {
this.addFlag = addFlag;
}
public String getBusinessType() {
return businessType;
}

View File

@@ -7,6 +7,8 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.nis.web.security.UserUtils;
@Controller
@RequestMapping("${adminPath}/tag")
@@ -26,7 +28,9 @@ public class TagController extends BaseController {
model.addAttribute("selectIds", request.getParameter("selectIds")); // 指定默认选中的ID
model.addAttribute("isAll", request.getParameter("isAll")); // 是否读取全部数据,不进行权限过滤
model.addAttribute("module", request.getParameter("module")); // 过滤栏目模型仅针对CMS的Category树
model.addAttribute("title", request.getParameter("title"));
model.addAttribute("title", request.getParameter("title"));//根节点替换文本
model.addAttribute("enableAddBtn", request.getParameter("enableAddBtn"));//节点是否可编辑
model.addAttribute("userId", UserUtils.getUser().getId());//如果启用了addBtn,则使用userId判断是否是用户自己创建的用户自己创建的节点可删除
return "/sys/tagTreeselect";
}

View File

@@ -24,13 +24,18 @@ import com.nis.domain.configuration.AppHttpCfg;
import com.nis.domain.configuration.AppIpCfg;
import com.nis.domain.configuration.AppPolicyCfg;
import com.nis.domain.configuration.AppSslCertCfg;
import com.nis.domain.configuration.AppTcpCfg;
import com.nis.domain.configuration.AppTopicDomainCfg;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.exceptions.CallExternalProceduresException;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.CodeDicUtils;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.web.controller.BaseController;
import com.nis.web.dao.dashboard.codedic.CodeResult;
import com.nis.web.security.UserUtils;
/**
@@ -755,6 +760,126 @@ public class AppCfgController extends BaseController {
appCfgService.updateAppSslCfgValid(isValid,ids,functionId);
return "redirect:" + adminPath +"/app/sslCfgList?functionId="+functionId;
}
/**
* APP TCP会话字节数特征 列表
* @param model
* @param cfg
* @param request
* @param response
* @return
*/
@RequestMapping(value = {"tcpCfgList"})
public String tcpCfgList(Model model,@ModelAttribute("cfg")AppTcpCfg cfg,HttpServletRequest request,HttpServletResponse response) {
Page<AppTcpCfg> searchPage=new Page<AppTcpCfg>(request,response,"r");
Page<AppTcpCfg> page = appCfgService.findAppTcpList(searchPage, cfg);
for(AppTcpCfg entity:page.getList()){
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
entity.setAppName(app.getSpecServiceName());
}
model.addAttribute("page", page);
initPageCondition(model,cfg);
return "/cfg/app/appTcpCfgList";
}
/**
* APP TCP会话字节数特征表单新增/修改)
* @param model
* @param ids
* @param entity
* @return
*/
@RequestMapping(value = {"tcpCfgForm"})
@RequiresPermissions(value={"app:tcp:config"})
public String tcpCfgForm(Model model,String ids,AppTcpCfg entity) {
if(StringUtils.isNotBlank(ids)){
entity = appCfgService.getAppTcpCfg(Long.parseLong(ids));
initUpdateFormCondition(model,entity);
}else{
initFormCondition(model,entity);
}
model.addAttribute("_cfg", entity);
return "/cfg/app/appTcpCfgForm";
}
/**
* APP TCP会话字节数特征配置新增/修改)提交
* @param model
* @param request
* @param response
* @param entity
* @param redirectAttributes
* @return
*/
@RequestMapping(value = {"saveAppTcpCfg"})
@RequiresPermissions(value={"app:tcp:config"})
public String saveAppTcpCfg(Model model,HttpServletRequest request,HttpServletResponse response,
AppTcpCfg entity,RedirectAttributes redirectAttributes) {
try {
SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
if(specificService!=null){
entity.setAppCode(specificService.getSpecServiceCode());
}
appCfgService.saveOrUpdateAppTcpeCfg(entity);
} catch (Exception e) {
e.printStackTrace();
addMessage(redirectAttributes, e.getMessage());
}
return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+entity.getFunctionId();
}
/**
* APP TCP会话字节数特征配置删除
* @param isValid
* @param ids
* @param functionId
* @return
*/
@RequestMapping(value = {"updateAppTcpCfgValid"})
@RequiresPermissions(value={"app:tcp:config"})
public String updateAppTcpCfgValid(Integer isValid,String ids,Integer functionId) {
appCfgService.updateAppTcpCfgValid(isValid,ids,functionId);
return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+functionId;
}
/**
* APP TCP会话字节数特征配置 审核
* @param isAudit
* @param isValid
* @param ids
* @param functionId
* @param redirectAttributes
* @return
*/
@RequestMapping(value = {"auditAppTcpCfg"})
@RequiresPermissions(value={"app:tcp:confirm"})
public String auditAppTcpCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
AppTcpCfg entity = new AppTcpCfg();
String[] idArray = ids.split(",");
for(String id :idArray){
entity = appCfgService.getAppTcpCfg(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
try {
appCfgService.auditAppTcpCfg(entity,isAudit);
} catch (MaatConvertException e) {
e.printStackTrace();
logger.info("app SSL配置下发失败"+e.getMessage());
addMessage(redirectAttributes, e.getMessage());
}
}
return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+functionId;
}
/**
* APP header特征配置 列表
* @param model
@@ -864,4 +989,150 @@ public class AppCfgController extends BaseController {
appCfgService.updateAppHeaderCfgValid(isValid,ids,functionId);
return "redirect:" + adminPath +"/app/headerCfgList?functionId="+functionId;
}
/**
* 主题网站配置列表
* @param model
* @param cfg
* @param request
* @param response
* @return
*/
@RequestMapping(value = {"topicDomainCfgList"})
public String TopicDomainCfgList(Model model,@ModelAttribute("cfg")AppTopicDomainCfg cfg,HttpServletRequest request,HttpServletResponse response) {
Page<AppTopicDomainCfg> searchPage=new Page<AppTopicDomainCfg>(request,response,"r");
Page<AppTopicDomainCfg> page = appCfgService.findAppTopicDomainList(searchPage, cfg);
// for(AppTopicDomainCfg entity:page.getList()){
// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
// entity.setAppName(app.getSpecServiceName());
// }
//设置topic主题
for (AppTopicDomainCfg entity:page.getList()) {
List<CodeResult> codeList = CodeDicUtils.getCodeList("serviceCode");
for (CodeResult codeResult : codeList) {
if(null!=entity.getTopic()&&codeResult.getCode().equals(entity.getTopic())){
entity.setAppName(codeResult.getItem());
}
}
}
model.addAttribute("page", page);
initPageCondition(model,cfg);
return "/cfg/app/appTopicDomainCfgList";
}
/**
* app主题网站配置表单
* @param model
* @param ids
* @param entity
* @return
*/
@RequestMapping(value = {"topicDomainCfgForm"})
@RequiresPermissions(value={"app:topic:config"})
public String topicDomainCfgForm(Model model,String ids,@ModelAttribute("_cfg")AppTopicDomainCfg entity) {
if(StringUtils.isNotBlank(ids)){
entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(ids));
initUpdateFormCondition(model,entity);
}else{
initFormCondition(model,entity);
}
model.addAttribute("_cfg", entity);
return "/cfg/app/appTopicDomainCfgForm";
}
/**
* app主题网站配置新增修改
* @param model
* @param request
* @param response
* @param entity
* @param redirectAttributes
* @return
*/
@RequestMapping(value = {"saveAppTopicDomainCfg"})
@RequiresPermissions(value={"app:topic:config"})
public String saveAppTopicDomainCfg(Model model,HttpServletRequest request,HttpServletResponse response,
AppTopicDomainCfg entity,RedirectAttributes redirectAttributes) {
try {
// SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
// if(specificService!=null){
// entity.setAppCode(specificService.getSpecServiceCode());
// }
appCfgService.saveOrUpdateAppTopicDomainCfg(entity);
addMessage(redirectAttributes,"save_success");
} catch (Exception e) {
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.info("app主题网站配置下发失败"+e.getMessage());;
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("app主题网站配置下发失败",e);
addMessage(redirectAttributes,"save_failed");
}
}
return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+entity.getFunctionId();
}
/**
* domain配置审核
* @param isAudit
* @param isValid
* @param ids
* @param functionId
* @param redirectAttributes
* @return
*/
@RequestMapping(value = {"auditAppTopicDomainCfg"})
// @RequiresPermissions(value={"app:domain:confirm"})
public String auditAppTopicDomainCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
AppTopicDomainCfg entity = new AppTopicDomainCfg();
String[] idArray = ids.split(",");
for(String id :idArray){
entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
try {
appCfgService.auditAppTopicDomainCfg(entity,isAudit);
addMessage(redirectAttributes,"audit_success");
} catch (MaatConvertException e) {
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.info("app主题网站配置下发失败"+e.getMessage());;
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("app主题网站配置下发失败",e);
addMessage(redirectAttributes,"audit_failed");
}
}
}
return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+functionId;
}
/**
* 网站主题配置删除
* @param isValid
* @param ids
* @param functionId
* @return
*/
@RequestMapping(value = {"updateAppTopicDomainCfgValid"})
@RequiresPermissions(value={"app:topic:config"})
public String updateAppTopicDomainCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
try {
appCfgService.updateAppTopicDomainCfgValid(isValid,ids,functionId);
addMessage(redirectAttributes,"delete_success");
} catch (Exception e) {
logger.error("app主题网站删除失败",e);
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
e.printStackTrace();
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
addMessage(redirectAttributes,"delete_failed");
}
}
return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+functionId;
}
}

View File

@@ -225,7 +225,7 @@ public class FileTransferCfgController extends BaseController{
entity.setCreateTime(date);
fileTime=entity.getCreateTime();
}
ToMaatResult result = null;
ToMaatResult result = new ToMaatResult();
if(file!=null && file.getSize()>0 && entity!=null){
String sep = System.getProperty("file.separator");
String digestFilePath = request.getRealPath("/")+"digestFile";
@@ -245,6 +245,10 @@ public class FileTransferCfgController extends BaseController{
String md5 = DigestUtils.md5Hex(file.getBytes());
fileMap.put("checksum", md5);
result = ConfigServiceUtil.getFileDigest(null, uploadFile, JsonMapper.toJsonString(fileMap));
if((result.getData().getRawLen() == null) || (result.getData().getDigest() == null)) {
logger.info("文件摘要信息获取有误!");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+null);
}
logger.info("获取文件摘要响应信息:"+result);
}
fileTransferCfgService.saveOrUpdateFileDigestCfg(entity,result,areaCfgIds);
@@ -282,6 +286,25 @@ public class FileTransferCfgController extends BaseController{
}
return "redirect:" + adminPath +"/ntc/fileTransfer/fileDigestList?functionId="+functionId;
}
@RequestMapping(value = {"ajaxFileDigestSubIdList"})
public String ajaxFileDigestSubIdList(Model model,Long cfgId,Integer index) {
FileDigestCfg cfg = fileTransferCfgService.getFileDigestSubIdCfg(cfgId);
List<String[]> tabList = new ArrayList();
//查询SubscribeId域配置
if(cfg.getNtcSubscribeIdCfgList()!=null){
String cfgType = null;
for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){
if(!ntc.getCfgType().equals(cfgType)){
tabList.add(new String[]{"2",ntc.getCfgType()});
cfgType = ntc.getCfgType();
}
}
}
model.addAttribute("_cfg", cfg);
model.addAttribute("index", index);
model.addAttribute("tabList", tabList);
return "/cfg/fileTransfer/fileDigestSubList";
}
@RequestMapping(value = {"p2pList"})
public String p2pList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {

View File

@@ -27,6 +27,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.Page;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.exceptions.MaatConvertException;
import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils;
@@ -104,6 +105,15 @@ public class XmppController extends BaseController {
}
}
}
if(cfg.getNtcSubscribeIdCfgList()!=null){
String cfgType = null;
for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){
if(!keyword.getCfgType().equals(cfgType)){
tabList.add(new String[]{"2",keyword.getCfgType()});
cfgType = keyword.getCfgType();
}
}
}
model.addAttribute("_cfg", cfg);
model.addAttribute("index", index);
model.addAttribute("tabList", tabList);

View File

@@ -1,6 +1,5 @@
package com.nis.web.controller.specific;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -13,6 +12,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@@ -22,6 +22,8 @@ import com.google.common.collect.Maps;
import com.nis.domain.Page;
import com.nis.domain.SysDataDictionaryItem;
import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.StringUtils;
import com.nis.web.controller.BaseController;
@@ -201,8 +203,9 @@ public class SpecificServiceCfgController extends BaseController {
Map<String, Object> map2 = Maps.newHashMap();
map2.put("id", 0);
map2.put("pId", 0);
map2.put("type",0);
map2.put("serviceType",0);
map2.put("business",-2);
map2.put("groupId",0);
map2.put("name","root_node");
//map2.put("placeholder","0");
mapList.add(map2);
@@ -222,6 +225,7 @@ public class SpecificServiceCfgController extends BaseController {
map.put("name",props.getProperty(dict.getItemValue(), dict.getItemValue()));
map.put("serviceType",cfgType);
map.put("businessType","-1");
map.put("groupId",0);
businessList.add(map);
}
mapList.addAll(businessList);
@@ -242,7 +246,12 @@ public class SpecificServiceCfgController extends BaseController {
map.put("pId", "businessType"+business.getItemCode());
map.put("name",specificServiceCfg.getSpecServiceName());
map.put("serviceType",specificServiceCfg.getCfgType());
map.put("serviceCode",specificServiceCfg.getSpecServiceCode());
map.put("businessType",specificServiceCfg.getBusinessType());
map.put("groupId",specificServiceCfg.getGroupId());
if(specificServiceCfg.getAddFlag()!=null) {
map.put("user",specificServiceCfg.getAddFlag());
}
mapList.add(map);
break;
}
@@ -253,6 +262,7 @@ public class SpecificServiceCfgController extends BaseController {
map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
map.put("name",specificServiceCfg.getSpecServiceName());
map.put("serviceType",specificServiceCfg.getCfgType());
map.put("groupId",specificServiceCfg.getGroupId());
mapList.add(map);
}
}
@@ -272,6 +282,10 @@ public class SpecificServiceCfgController extends BaseController {
map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
map.put("name",specificServiceCfg.getSpecServiceName());
map.put("type",specificServiceCfg.getCfgType());
map.put("groupId",specificServiceCfg.getGroupId());
if(specificServiceCfg.getAddFlag()!=null) {
map.put("user",specificServiceCfg.getAddFlag());
}
mapList.add(map);
}
}
@@ -380,5 +394,70 @@ public class SpecificServiceCfgController extends BaseController {
}
return false;
}
@ResponseBody
@RequestMapping(value = "ajaxSaveOrUpdateApp",method=RequestMethod.POST )
public Map<String,Object> ajaxSaveOrUpdateApp(@RequestParam(required=true,value="specServiceId")String specServiceId,@RequestParam(required=false,value="specServiceCode")String specServiceCode,@RequestParam(required=true,value="specServiceName") String specServiceName,
@RequestParam(required=true,value="cfgType") String cfgType, @RequestParam(required=true,value="businessType")String businessType,@RequestParam(required=false,value="addFlag")String addFlag,
@RequestParam(required=false,value="groupId")String groupId){
Map<String, Object> map = Maps.newHashMap();
//校验是真ID还是假ID假的Id以manual开头无法转换成数字
boolean isTrueId=false;
try {
Long.parseLong(specServiceId);
isTrueId=true;
}catch (Exception e) {
// TODO: handle exception
}
try{
SpecificServiceCfg cfg=new SpecificServiceCfg();
if(isTrueId) {
cfg.setSpecServiceId(Integer.parseInt(specServiceId));
}
if(StringUtils.isNotBlank(specServiceCode)) {
cfg.setSpecServiceCode(Integer.parseInt(specServiceCode));
}
cfg.setAddFlag(Integer.parseInt(addFlag));
cfg.setSpecServiceName(specServiceName);
cfg.setBusinessType(businessType);
cfg.setCfgType(Integer.parseInt(cfgType));
cfg.setIsValid(Constants.VALID_YES);
if(StringUtils.isNotBlank(groupId)) {
cfg.setGroupId(Integer.parseInt(groupId));
}
SpecificServiceCfg parent=new SpecificServiceCfg();
parent.setSpecServiceId(0);
cfg.setParent(parent);
specificServiceCfgService.saveOrUpdate(cfg);
cfg=specificServiceCfgService.getBySpecServiceId(cfg.getSpecServiceId());
map.put("id", cfg.getSpecServiceId());
map.put("pId", "businessType"+cfg.getBusinessType());
map.put("name",cfg.getSpecServiceName());
map.put("serviceType",cfg.getCfgType());
map.put("businessType",cfg.getBusinessType());
map.put("groupId",cfg.getGroupId());
return map;
}catch (Exception e) {
e.printStackTrace();
if(e instanceof MaatConvertException) {
map.put("errTip", "request_service_failed");
}else {
map.put("errTip", "save_failed");
}
}
return map;
}
@ResponseBody
@RequestMapping(value = "ajaxRemoveApp",method=RequestMethod.POST )
public boolean ajaxRemoveApp(@RequestParam(required=true,value="specServiceId")Integer specServiceId){
try{
specificServiceCfgService.delete(String.valueOf(specServiceId));
return true;
}catch (Exception e) {
e.printStackTrace();
}
return false;
}
}

View File

@@ -17,6 +17,8 @@ import com.nis.domain.configuration.AppIpCfg;
import com.nis.domain.configuration.AppPolicyCfg;
import com.nis.domain.configuration.AppSslCertCfg;
import com.nis.domain.configuration.AppStringCfg;
import com.nis.domain.configuration.AppTcpCfg;
import com.nis.domain.configuration.AppTopicDomainCfg;
import com.nis.domain.configuration.BaseCfg;
import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.ComplexkeywordCfg;
@@ -57,6 +59,11 @@ public interface AppCfgDao {
public AppDomainCfg getAppDomainCfg(Long cfgId) ;
public int insertAppDomainCfg(AppDomainCfg entity);
public int updateAppDomainCfg(AppDomainCfg entity);
//app 主题网站配置增删改查
public List<AppTopicDomainCfg> findAppTopicDomainList(AppTopicDomainCfg entity) ;
public AppTopicDomainCfg getAppTopicDomainCfg(Long cfgId) ;
public int insertAppTopicDomainCfg(AppTopicDomainCfg entity);
public int updateAppTopicDomainCfg(AppTopicDomainCfg entity);
//app 字节特征增删改查
public List<AppByteCfg> findAppByteList(AppByteCfg entity) ;
public AppByteCfg getAppByteCfg(Long cfgId) ;
@@ -77,7 +84,11 @@ public interface AppCfgDao {
public AppHeaderCfg getAppHeaderCfg(Long cfgId);
public int insertAppHeaderCfg(AppHeaderCfg entity);
public int updateAppHeaderCfg(AppHeaderCfg entity);
//APP TCP会话字节数特征
public List<AppTcpCfg> findAppTcpList(AppTcpCfg entity);
public AppTcpCfg getAppTcpCfg(Long cfgId);
public int insertAppTcpCfg(AppTcpCfg entity);
public int updateAppTcpCfg(AppTcpCfg entity);
//审核配置
public void auditCfg(BaseCfg entity);
//修改配置状态

View File

@@ -137,6 +137,37 @@
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap>
<resultMap id="AppTopicDomainCfgMap" type="com.nis.domain.configuration.AppTopicDomainCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="topic" property="topic" jdbcType="VARCHAR" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="domain" property="domain" jdbcType="VARCHAR" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
<result column="request_id" property="requestId" jdbcType="INTEGER" />
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
<result column="classify" property="classify" jdbcType="VARCHAR" />
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="expr_type" property="exprType" jdbcType="INTEGER" />
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap>
<resultMap id="AppByteCfgMap" type="com.nis.domain.configuration.AppByteCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
@@ -297,6 +328,47 @@
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap>
<resultMap id="AppTcpCfgMap" type="com.nis.domain.configuration.AppTcpCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="low_boundary" property="lowBoundary" jdbcType="BIGINT" />
<result column="up_boundary" property="upBoundary" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
<result column="request_id" property="requestId" jdbcType="INTEGER" />
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
<result column="classify" property="classify" jdbcType="VARCHAR" />
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="expr_type" property="exprType" jdbcType="INTEGER" />
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap>
<sql id="AppTcpCfg_Column" >
r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
r.low_boundary,r.up_boundary as upBoundary,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.do_log
</sql>
<sql id="AppPolicyCfg_Column" >
r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
@@ -332,6 +404,14 @@
r.DOMAIN,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.DO_LOG
</sql>
<sql id="AppTopicDomainCfg_Column" >
r.CFG_ID, r.TOPIC,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
r.DOMAIN,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.DO_LOG
</sql>
<sql id="AppByteCfg_Column" >
r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
@@ -358,6 +438,17 @@
#{areaEffectiveIds,jdbcType=VARCHAR},#{ratelimit,jdbcType=INTEGER},#{functionId,jdbcType=INTEGER},
#{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER}
</sql>
<sql id="AppTopicCommonCfg_Value_List" >
#{topic,jdbcType=VARCHAR},#{behavCode,jdbcType=INTEGER},#{specServiceId,jdbcType=INTEGER},
#{cfgDesc,jdbcType=VARCHAR},#{action,jdbcType=INTEGER},
#{isValid,jdbcType=INTEGER},#{isAudit,jdbcType=INTEGER},#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},#{editorId,jdbcType=INTEGER},#{editTime,jdbcType=TIMESTAMP},
#{auditorId,jdbcType=INTEGER},#{auditTime,jdbcType=TIMESTAMP},#{serviceId,jdbcType=INTEGER},
#{requestId,jdbcType=INTEGER},#{compileId,jdbcType=INTEGER},#{isAreaEffective,jdbcType=INTEGER},
#{classify,jdbcType=VARCHAR},#{attribute,jdbcType=VARCHAR},#{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR},#{ratelimit,jdbcType=INTEGER},#{functionId,jdbcType=INTEGER},
#{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER}
</sql>
<sql id="IpCfg_Column" >
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
@@ -438,6 +529,13 @@
FROM app_domain_cfg r
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
<!-- 主题网站 -->
<select id="getAppTopicDomainCfg" resultMap="AppTopicDomainCfgMap" parameterType="java.lang.Long" >
SELECT
<include refid="AppTopicDomainCfg_Column" />
FROM app_topic_domain_cfg r
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
<select id="getAppByteCfg" resultMap="AppByteCfgMap" parameterType="java.lang.Long" >
SELECT
<include refid="AppByteCfg_Column" />
@@ -462,6 +560,113 @@
FROM app_layer_header_cfg r
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
<select id="getAppTcpCfg" resultMap="AppTcpCfgMap" parameterType="java.lang.Long" >
SELECT
<include refid="AppTcpCfg_Column" />
FROM app_session_cfg r
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
<select id="findAppTcpList" resultMap="AppTcpCfgMap">
select
<include refid="AppTcpCfg_Column"/>
<trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName
</trim>
from app_session_cfg r
left join sys_user s on r.creator_id=s.id
left join sys_user e on r.editor_id=e.id
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
<if test="lowBoundary != null">
AND r.low_boundary=#{lowBoundary,jdbcType=INTEGER}
</if>
<if test="upBoundary != null">
AND r.up_boundary=#{upBoundary,jdbcType=INTEGER}
</if>
<if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
<if test="specServiceId != null">
AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER}
</if>
<if test="cfgType != null and cfgType != ''">
AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%')
</if>
<if test="action != null">
AND r.ACTION=#{action,jdbcType=INTEGER}
</if>
<if test="isValid != null">
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
<if test="isValid == null">
AND r.IS_VALID != -1
</if>
<if test="isAudit != null">
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
<if test="creatorName != null and creatorName != ''">
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
</if>
<if test="createTime != null and createTime != ''">
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
</if>
<if test="editorName != null and editorName != ''">
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
</if>
<if test="editTime != null and editTime != ''">
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
</if>
<if test="auditorName != null and auditorName != ''">
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
</if>
<if test="auditTime != null and auditTime != ''">
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
</if>
<if test="serviceId != null">
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
<if test="requestId != null">
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
<if test="compileId != null">
AND r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test="classify != null and classify != ''">
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
</if>
<if test="attribute != null and attribute != ''">
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
</if>
<if test="lable != null and lable != ''">
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
</if>
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
</if>
<!-- 数据范围过滤 -->
${sqlMap.dsf}
</trim>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY CFG_ID desc
</otherwise>
</choose>
</select>
<select id="findAppPolicyList" resultMap="AppPolicyCfgMap" parameterType="com.nis.domain.configuration.AppPolicyCfg" >
select
@@ -476,6 +681,9 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -616,7 +824,9 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -738,7 +948,9 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -839,6 +1051,110 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
<if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
<if test="specServiceId != null">
AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER}
</if>
<if test="cfgType != null and cfgType != ''">
AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%')
</if>
<if test="domain != null and domain != ''">
AND r.DOMAIN like concat(concat('%',#{domain,jdbcType=VARCHAR}),'%')
</if>
<if test="action != null">
AND r.ACTION=#{action,jdbcType=INTEGER}
</if>
<if test="isValid != null">
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
<if test="isValid == null">
AND r.IS_VALID != -1
</if>
<if test="isAudit != null">
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
<if test="creatorName != null and creatorName != ''">
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
</if>
<if test="createTime != null and createTime != ''">
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
</if>
<if test="editorName != null and editorName != ''">
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
</if>
<if test="editTime != null and editTime != ''">
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
</if>
<if test="auditorName != null and auditorName != ''">
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
</if>
<if test="auditTime != null and auditTime != ''">
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
</if>
<if test="serviceId != null">
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
<if test="requestId != null">
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
<if test="compileId != null">
AND r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test="classify != null and classify != ''">
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
</if>
<if test="attribute != null and attribute != ''">
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
</if>
<if test="lable != null and lable != ''">
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
</if>
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
</if>
<!-- 数据范围过滤 -->
${sqlMap.dsf}
</trim>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY CFG_ID desc
</otherwise>
</choose>
</select>
<!-- 主题网站列表 -->
<select id="findAppTopicDomainList" resultMap="AppTopicDomainCfgMap">
select
<include refid="AppTopicDomainCfg_Column"/>
<trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName
</trim>
from app_topic_domain_cfg r
left join sys_user s on r.creator_id=s.id
left join sys_user e on r.editor_id=e.id
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -936,6 +1252,9 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -1033,6 +1352,9 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -1125,7 +1447,9 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -1226,7 +1550,9 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -1315,6 +1641,22 @@
</choose>
</select>
<insert id="insertAppTcpCfg" parameterType="com.nis.domain.configuration.AppTcpCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
</selectKey>
insert into app_session_cfg (
APP_CODE,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
low_boundary,up_boundary,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG
)values (
<include refid="AppCommonCfg_Value_List" />,
#{lowBoundary,jdbcType=INTEGER},#{upBoundary,jdbcType=INTEGER},
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER}
)
</insert>
<insert id="insertAppPolicyCfg" parameterType="com.nis.domain.configuration.AppPolicyCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
@@ -1330,7 +1672,7 @@
<include refid="AppCommonCfg_Value_List" />,
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}
,#{userRegion1,jdbcType=VARCHAR} ,#{userRegion2,jdbcType=VARCHAR} ,#{userRegion3,jdbcType=VARCHAR}
,#{userRegion4,jdbcType=VARCHAR} ,#{userRegion5,jdbcType=VARCHAR}
,#{userRegion4,jdbcType=VARCHAR} ,#{userRegion5,jdbcType=VARCHAR} ,#{doLog,jdbcType=INTEGER}
)
</insert>
<insert id="insertAppIpCfg" parameterType="com.nis.domain.configuration.AppIpCfg" >
@@ -1383,6 +1725,23 @@
#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER}
)
</insert>
<!-- 主题网站新增 -->
<insert id="insertAppTopicDomainCfg" parameterType="com.nis.domain.configuration.AppTopicDomainCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
</selectKey>
insert into app_topic_domain_cfg (
TOPIC,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
DOMAIN,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG
)values (
<include refid="AppTopicCommonCfg_Value_List" />,
#{domain,jdbcType=VARCHAR},#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},
#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER}
)
</insert>
<insert id="insertAppByteCfg" parameterType="com.nis.domain.configuration.AppByteCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
@@ -1933,6 +2292,106 @@
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
<!-- 主题网站 -->
<update id="updateAppTopicDomainCfg" parameterType="com.nis.domain.configuration.AppTopicDomainCfg" >
update app_topic_domain_cfg
<set >
<trim suffixOverrides=",">
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="topic != null">
TOPIC = #{topic,jdbcType=VARCHAR},
</if>
<if test="behavCode != null">
BEHAV_CODE = #{behavCode,jdbcType=INTEGER},
</if>
<if test="specServiceId != null">
SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER},
</if>
<if test="action != null" >
action = #{action,jdbcType=INTEGER},
</if>
<if test="isValid != null" >
is_valid = #{isValid,jdbcType=INTEGER},
</if>
<if test="isAudit != null" >
is_audit = #{isAudit,jdbcType=INTEGER},
</if>
<if test="creatorId != null" >
creator_id = #{creatorId,jdbcType=INTEGER},
</if>
<if test="createTime != null and createTime != ''" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="editorId != null" >
editor_id = #{editorId,jdbcType=INTEGER},
</if>
<if test="editTime != null and editTime != ''" >
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="auditorId != null" >
auditor_id = #{auditorId,jdbcType=INTEGER},
</if>
<if test="auditTime != null and auditTime != ''" >
audit_time = #{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="serviceId != null" >
service_id = #{serviceId,jdbcType=INTEGER},
</if>
<if test="requestId != null" >
request_id = #{requestId,jdbcType=INTEGER},
</if>
<if test="compileId != null" >
compile_id = #{compileId,jdbcType=INTEGER},
</if>
<if test="isAreaEffective != null" >
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
</if>
<if test="classify != null and classify != ''" >
classify = #{classify,jdbcType=VARCHAR},
</if>
<if test="attribute != null and attribute != ''" >
attribute = #{attribute,jdbcType=VARCHAR},
</if>
<if test="lable != null and lable != ''" >
lable = #{lable,jdbcType=VARCHAR},
</if>
<if test="areaEffectiveIds != null" >
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
</if>
<if test="functionId != null" >
function_id = #{functionId,jdbcType=INTEGER},
</if>
<if test="ratelimit != null">
RATELIMIT=#{ratelimit,jdbcType=INTEGER},
</if>
<if test="cfgRegionCode != null">
CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER},
</if>
<if test="cfgType != null and cfgType != ''">
CFG_TYPE =#{cfgType,jdbcType=VARCHAR},
</if>
<if test="domain != null and domain != ''">
domain=#{domain,jdbcType=VARCHAR},
</if>
<if test="exprType != null">
expr_type=#{exprType,jdbcType=INTEGER},
</if>
<if test="matchMethod != null">
match_method=#{matchMethod,jdbcType=INTEGER},
</if>
<if test="isHexbin != null">
is_hexbin=#{isHexbin,jdbcType=INTEGER},
</if>
<!-- <if test="doLog != null" >
do_log = #{doLog,jdbcType=INTEGER},
</if> -->
</trim>
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
<update id="updateAppByteCfg" parameterType="com.nis.domain.configuration.AppByteCfg" >
update app_byte_cfg
<set >
@@ -2267,6 +2726,108 @@
</update>
<update id="updateAppTcpCfg" parameterType="com.nis.domain.configuration.AppTcpCfg" >
update app_session_cfg
<set >
<trim suffixOverrides=",">
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="appCode != null">
APP_CODE = #{appCode,jdbcType=INTEGER},
</if>
<if test="behavCode != null">
BEHAV_CODE = #{behavCode,jdbcType=INTEGER},
</if>
<if test="specServiceId != null">
SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER},
</if>
<if test="action != null" >
action = #{action,jdbcType=INTEGER},
</if>
<if test="isValid != null" >
is_valid = #{isValid,jdbcType=INTEGER},
</if>
<if test="isAudit != null" >
is_audit = #{isAudit,jdbcType=INTEGER},
</if>
<if test="creatorId != null" >
creator_id = #{creatorId,jdbcType=INTEGER},
</if>
<if test="createTime != null and createTime != ''" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="editorId != null" >
editor_id = #{editorId,jdbcType=INTEGER},
</if>
<if test="editTime != null and editTime != ''" >
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="auditorId != null" >
auditor_id = #{auditorId,jdbcType=INTEGER},
</if>
<if test="auditTime != null and auditTime != ''" >
audit_time = #{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="serviceId != null" >
service_id = #{serviceId,jdbcType=INTEGER},
</if>
<if test="requestId != null" >
request_id = #{requestId,jdbcType=INTEGER},
</if>
<if test="compileId != null" >
compile_id = #{compileId,jdbcType=INTEGER},
</if>
<if test="isAreaEffective != null" >
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
</if>
<if test="classify != null and classify != ''" >
classify = #{classify,jdbcType=VARCHAR},
</if>
<if test="attribute != null and attribute != ''" >
attribute = #{attribute,jdbcType=VARCHAR},
</if>
<if test="lable != null and lable != ''" >
lable = #{lable,jdbcType=VARCHAR},
</if>
<if test="areaEffectiveIds != null" >
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
</if>
<if test="functionId != null" >
function_id = #{functionId,jdbcType=INTEGER},
</if>
<if test="ratelimit != null">
RATELIMIT=#{ratelimit,jdbcType=INTEGER},
</if>
<if test="cfgRegionCode != null">
CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER},
</if>
<if test="cfgType != null and cfgType != ''">
CFG_TYPE =#{cfgType,jdbcType=VARCHAR},
</if>
<if test="lowBoundary != null and lowBoundary != ''">
low_boundary=#{lowBoundary,jdbcType=INTEGER},
</if>
<if test="upBoundary != null and upBoundary != ''">
up_boundary=#{upBoundary,jdbcType=INTEGER},
</if>
<if test="exprType != null">
expr_type=#{exprType,jdbcType=INTEGER},
</if>
<if test="matchMethod != null">
match_method=#{matchMethod,jdbcType=INTEGER},
</if>
<if test="isHexbin != null">
is_hexbin=#{isHexbin,jdbcType=INTEGER},
</if>
<if test="doLog != null">
do_log=#{doLog,jdbcType=INTEGER},
</if>
</trim>
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
<!-- 删除APP策略IP子配置 -->
<delete id="deleteAppPolicyIpCfg" >
delete from ip_port_cfg where compile_id=#{compileId} and function_id=#{functionId}

View File

@@ -41,6 +41,7 @@ public interface BgpCfgDao extends CrudDao<CfgIndexInfo>{
public void saveIpPortCfg(IpPortCfg entity);
public void updateBgpAsCfg(CfgIndexInfo entity);
public void updateSubscribeIdCfg(CfgIndexInfo entity);
public void deleteSubscribeIdCfg(CfgIndexInfo entity);
//public void saveHttpUrlCfg(HttpUrlCfg entity);
public void deleteHttpIpCfg(CfgIndexInfo entity);
//public void deleteHttpUrlCfg(CfgIndexInfo entity);

View File

@@ -639,6 +639,10 @@
delete from ntc_bgp_as_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
<delete id="deleteSubscribeIdCfg" >
delete from ntc_subscribe_id_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
<update id="updateCfgValid" parameterType="com.nis.domain.configuration.BaseCfg">
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER},
editor_id = #{editorId,jdbcType=INTEGER} ,

View File

@@ -38,6 +38,8 @@ public interface FileTransferCfgDao extends CrudDao<CfgIndexInfo> {
public void auditCfg(BaseCfg entity);
public FileDigestCfg getFileDigest(Long id);
public void updateFileDigestCfg(FileDigestCfg entity);
public void deleteFileDigestSubscribeIdCfg(FileDigestCfg entity);
public List<NtcSubscribeIdCfg> getFileDigestSubscribeidList(FileDigestCfg entity);
// P2P域配置新增
public void saveP2pHashCfg(BaseStringCfg cfg);
@@ -53,4 +55,5 @@ public interface FileTransferCfgDao extends CrudDao<CfgIndexInfo> {
public void deleteP2pHashCfg(CfgIndexInfo entity);
public void deleteP2pKeywordCfg(CfgIndexInfo entity);
public void deleteP2pSubscribeIdCfg(CfgIndexInfo entity);
}

View File

@@ -1051,11 +1051,14 @@
<delete id="deleteP2pKeywordCfg">
delete from p2p_keyword_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
<!-- 删除p2pSubscribeId配置 -->
<!-- 删除p2pSubscribeId配置 -->
<delete id="deleteP2pSubscribeIdCfg">
delete from ntc_subscribe_id_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
<!-- 删除FileDigest SubscribeId配置 -->
<delete id="deleteFileDigestSubscribeIdCfg">
delete from ntc_subscribe_id_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
<!-- File Digest Cfg -->
<select id="getFileDigestList" resultMap="digestCfgMap" parameterType="com.nis.domain.configuration.FileDigestCfg" >
@@ -1151,6 +1154,15 @@
FROM file_digest_cfg a where cfg_id=#{cfgId}
</select>
<select id="getFileDigestSubscribeidList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.FileDigestCfg">
SELECT
<include refid="StrCfg_Column" />
FROM ntc_subscribe_id_cfg a where compile_id=#{compileId} and function_id=#{functionId}
<!-- <if test="cfgType != null and cfgType != ''">
and a.cfg_type =#{cfgType,jdbcType=VARCHAR}
</if> -->
</select>
<update id="updateFileDigestCfg" parameterType="com.nis.domain.configuration.FileDigestCfg" >
update file_digest_cfg
<set >

View File

@@ -23,6 +23,7 @@
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap>
<resultMap id="ipPortMap" type="com.nis.domain.configuration.IpPortCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
@@ -121,7 +122,7 @@
a.CFG_ID,a.CFG_DESC,a.ACTION,a.IS_VALID,a.IS_AUDIT,
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,do_log
</sql>
<sql id="IpCfg_Column" >
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
@@ -301,7 +302,8 @@
ATTRIBUTE,
LABLE,
AREA_EFFECTIVE_IDS,
function_id
function_id,
do_log
)values (
#{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER},
@@ -321,7 +323,8 @@
#{attribute,jdbcType=VARCHAR},
#{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER}
#{functionId,jdbcType=INTEGER},
#{doLog,jdbcType=INTEGER}
)
</insert>
<!-- insert ip_port_cfg表信息 -->
@@ -445,6 +448,9 @@
</if>
<if test="functionId != null" >
function_id = #{functionId,jdbcType=INTEGER},
</if>
<if test="doLog != null" >
do_log = #{doLog,jdbcType=INTEGER},
</if>
</trim>
</set>

View File

@@ -50,5 +50,6 @@ public interface SpecificServiceCfgDao extends CrudDao<SpecificServiceCfg> {
Integer getParentType(Integer specServiceId);
Integer getParentCode(Integer specServiceId);
SpecificServiceCfg getRepeat(@Param("specServiceCode")Integer code, @Param("cfgType")Integer cfgType,@Param("parentId")Integer parentId);
Integer getMaxServiceCode(@Param("maxCode")Integer code, @Param("cfgType")Integer cfgType,@Param("addFlag")Integer addFlag);
}

View File

@@ -12,6 +12,7 @@
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER" />
<result column="group_id" property="groupId" jdbcType="INTEGER" />
<result column="cfg_type" property="cfgType" jdbcType="INTEGER" />
<result column="add_flag" property="addFlag" jdbcType="INTEGER" />
<result column="business_type" property="businessType" jdbcType="VARCHAR" />
<!-- 父id -->
<association property="parent" javaType="com.nis.domain.specific.SpecificServiceCfg">
@@ -30,7 +31,8 @@
s.is_leaf AS isLeaf,
s.group_id AS groupId,
s.cfg_type AS cfgType,
s.business_type AS businessType
s.business_type AS businessType,
s.add_flag AS addFlag
</sql>
@@ -152,6 +154,9 @@
<if test="specificServiceCfg.endDate != null" >
AND op_time &lt; #{specificServiceCfg.endDate}
</if>
<if test="specificServiceCfg.addFlag != null and specificServiceCfg.addFlag != '' ">
AND add_flag = #{specificServiceCfg.addFlag}
</if>
<choose>
<when test="orderBy != null and orderBy != '' ">
ORDER BY ${orderBy}
@@ -161,11 +166,23 @@
</otherwise>
</choose>
</select>
<select id="getMaxServiceCode" resultType="java.lang.Integer" >
SELECT MAX(spec_service_code) FROM specific_service_cfg WHERE is_valid=1 AND spec_service_code &lt; #{maxCode}
<if test="cfgType != null and cfgType != '' ">
AND cfg_type = #{cfgType}
</if>
<if test="addFlag != null and addFlag != '' ">
AND add_flag = #{addFlag}
</if>
</select>
<!-- 新增 -->
<insert id="insert" parameterType="com.nis.domain.specific.SpecificServiceCfg" useGeneratedKeys="true">
insert into specific_service_cfg (spec_service_code,spec_service_name,spec_service_desc,is_valid, op_time, parent_id,is_leaf,group_id,cfg_type,business_type)
values(#{specServiceCode},#{specServiceName},#{specServiceDesc},#{isValid},#{opTime},#{parent.specServiceId},#{isLeaf},#{groupId},#{cfgType},#{businessType})
<selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="specServiceId">
SELECT LAST_INSERT_ID()
</selectKey>
insert into specific_service_cfg (spec_service_code,spec_service_name,spec_service_desc,is_valid, op_time, parent_id,is_leaf,group_id,cfg_type,business_type,add_flag)
values(#{specServiceCode},#{specServiceName},#{specServiceDesc},#{isValid},#{opTime},#{parent.specServiceId},#{isLeaf},#{groupId},#{cfgType},
#{businessType},#{addFlag})
</insert>
<!-- 修改 -->

View File

@@ -18,6 +18,8 @@ import com.nis.domain.configuration.AppHttpCfg;
import com.nis.domain.configuration.AppIpCfg;
import com.nis.domain.configuration.AppPolicyCfg;
import com.nis.domain.configuration.AppSslCertCfg;
import com.nis.domain.configuration.AppTcpCfg;
import com.nis.domain.configuration.AppTopicDomainCfg;
import com.nis.domain.configuration.AreaIpCfg;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
@@ -85,6 +87,14 @@ public class AppCfgService extends BaseService {
page.setList(list);
return page;
}
//主题网站列表
public Page<AppTopicDomainCfg> findAppTopicDomainList(Page<AppTopicDomainCfg> page, AppTopicDomainCfg entity) {
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
entity.setPage(page);
List<AppTopicDomainCfg> list = appCfgDao.findAppTopicDomainList(entity);
page.setList(list);
return page;
}
public Page<AppByteCfg> findAppByteList(Page<AppByteCfg> page, AppByteCfg entity) {
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
entity.setPage(page);
@@ -99,6 +109,21 @@ public class AppCfgService extends BaseService {
page.setList(list);
return page;
}
public Page<AppTcpCfg> findAppTcpList(Page<AppTcpCfg> page, AppTcpCfg entity) {
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
entity.setPage(page);
List<AppTcpCfg> list = appCfgDao.findAppTcpList(entity);
page.setList(list);
return page;
}
public AppTcpCfg getAppTcpCfg(Long cfgId){
return appCfgDao.getAppTcpCfg(cfgId);
}
public AppPolicyCfg getAppPolicyCfg(Long cfgId){
AppPolicyCfg policy = appCfgDao.getAppPolicyCfg(cfgId);
List<IpPortCfg> ipPortList = appCfgDao.getAppPolicyIpList(policy);
@@ -122,6 +147,10 @@ public class AppCfgService extends BaseService {
public AppDomainCfg getAppDomainCfg(Long cfgId){
return appCfgDao.getAppDomainCfg(cfgId);
}
//主题网站form
public AppTopicDomainCfg getAppTopicDomainCfg(Long cfgId){
return appCfgDao.getAppTopicDomainCfg(cfgId);
}
public AppByteCfg getAppByteCfg(Long cfgId){
return appCfgDao.getAppByteCfg(cfgId);
}
@@ -209,7 +238,7 @@ public class AppCfgService extends BaseService {
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
entity.setCfgKeywords(cfg.getCfgKeywords());
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType","exprType","matchMethod","isHexbin"});
stringcfgDao.saveSubscribeIdCfg(cfg);
}
}
@@ -397,6 +426,62 @@ public class AppCfgService extends BaseService {
}
}
}
//主题网站新增 修改
public void saveOrUpdateAppTopicDomainCfg(AppTopicDomainCfg entity) throws Exception{
//设置区域运营商信息
setAreaEffectiveIds(entity);
if(entity.getCfgId()==null){
Integer compileId = 0;
try {
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
}
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
entity.setIsValid(0);
entity.setIsAudit(0);
appCfgDao.insertAppTopicDomainCfg(entity);
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
}catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException(e.getMessage());
}
}else{
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
entity.setIsValid(0);
entity.setIsAudit(0);
appCfgDao.updateAppTopicDomainCfg(entity);
//删除旧的区域IP新增新的区域IP
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
areaIpCfgDao.deleteAreaIpCfg(area);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
}
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdateAppByteCfg(AppByteCfg entity) throws Exception{
//设置区域运营商信息
@@ -508,6 +593,142 @@ public class AppCfgService extends BaseService {
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdateAppTcpeCfg(AppTcpCfg entity) throws Exception{
//设置区域运营商信息
setAreaEffectiveIds(entity);
if(entity.getCfgId()==null){
Integer compileId = 0;
try {
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
}
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
entity.setIsValid(0);
entity.setIsAudit(0);
appCfgDao.insertAppTcpCfg(entity);
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
}catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException(e.getMessage());
}
}else{
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
entity.setIsValid(0);
entity.setIsAudit(0);
appCfgDao.updateAppTcpCfg(entity);
//删除旧的区域IP新增新的区域IP
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
areaIpCfgDao.deleteAreaIpCfg(area);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
}
}
public void auditAppTcpCfg(AppTcpCfg entity,Integer isAudit){
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
List<GroupCfg> groupRelationList = new ArrayList();
List<IpCfg> ipRegionList = new ArrayList();
List<StringCfg> strRegionList = new ArrayList();
List<NumBoundaryCfg> numRegionList = new ArrayList();
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
entity.setTableName(AppTcpCfg.getTablename());
appCfgDao.auditCfg(entity);
if(isAudit==1){
List<AppTcpCfg> list = new ArrayList();
list.add(entity);
Map<String,List> map = cfgConvert(numRegionList,list,4,entity,groupRelationList);
groupRelationList=map.get("groupList");
numRegionList=map.get("dstList");
}
/* //保存区域IP信息
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
appCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,4,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
}
}*/
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();
BeanUtils.copyProperties(entity, maatCfg);
maatCfg.setAction(entity.getAction());
maatCfg.setAuditTime(entity.getAuditTime());
maatCfg.setIpRegionList(ipRegionList);
maatCfg.setStrRegionList(strRegionList);
maatCfg.setNumRegionList(numRegionList);
maatCfg.setDigestRegionList(digestRegionList);
maatCfg.setGroupRelationList(groupRelationList);
maatCfg.setGroupNum(groupRelationList.size());
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
//设置APP自定义域
String userRegion = "APP_ID="+entity.getAppCode();
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("app SSL配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("app TCP配置下发响应信息"+result.getMsg());
}else if(isAudit==3){
maatCfg.setCompileId(entity.getCompileId());
maatCfg.setServiceId(entity.getServiceId());
maatCfg.setIsValid(0);//无效
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.UPDATE_ACTION);
//调用服务接口取消配置
String json=gsonToJson(maatBean);
logger.info("app TCP配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.put(json,1);
logger.info("app TCP配置取消配置响应信息"+result.getMsg());
}
}
public void auditAppPolicyCfg(AppPolicyCfg entity,Integer isAudit){
String configType=entity.getConfigType();
ToMaatBean maatBean = new ToMaatBean();
@@ -910,6 +1131,98 @@ public class AppCfgService extends BaseService {
logger.info("app域名配置取消配置响应信息"+result.getMsg());
}
}
//app主题网站配置审核
public void auditAppTopicDomainCfg(AppTopicDomainCfg entity,Integer isAudit){
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
List<GroupCfg> groupRelationList = new ArrayList();
List<IpCfg> ipRegionList = new ArrayList();
List<StringCfg> strRegionList = new ArrayList();
List<NumBoundaryCfg> numRegionList = new ArrayList();
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
entity.setTableName(AppTopicDomainCfg.getTablename());
appCfgDao.auditCfg(entity);
//域名为关键字
if(isAudit==1){
entity.setCfgKeywords(entity.getDomain());
List<AppTopicDomainCfg> list = new ArrayList();
list.add(entity);
Map<String,List> map = cfgConvert(strRegionList,list,2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
//保存区域IP信息
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
appCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
}
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();
BeanUtils.copyProperties(entity, maatCfg);
maatCfg.setAction(entity.getAction());
maatCfg.setAuditTime(entity.getAuditTime());
maatCfg.setIpRegionList(ipRegionList);
maatCfg.setStrRegionList(strRegionList);
maatCfg.setNumRegionList(numRegionList);
maatCfg.setDigestRegionList(digestRegionList);
maatCfg.setGroupRelationList(groupRelationList);
maatCfg.setGroupNum(groupRelationList.size());
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
//设置APP自定义域
// "APP_ID="+entity.getAppCode()+Constants.USER_REGION_SPLIT+
String userRegion = "DOMAIN_ID="+entity.getCompileId()+Constants.USER_REGION_SPLIT+
"DOMAIN_STR="+keywordsEscape(entity.getDomain());
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("app主题网站配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("app主题网站配置下发响应信息"+result.getMsg());
}else if(isAudit==3){
maatCfg.setCompileId(entity.getCompileId());
maatCfg.setServiceId(entity.getServiceId());
maatCfg.setIsValid(0);//无效
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.UPDATE_ACTION);
//调用服务接口取消配置
String json=gsonToJson(maatBean);
logger.info("app主题网站配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.put(json,1);
logger.info("app主题网站配置取消配置响应信息"+result.getMsg());
}
}
public void auditAppByteCfg(AppByteCfg entity,Integer isAudit){
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
@@ -1097,7 +1410,7 @@ public class AppCfgService extends BaseService {
if(entity.getNtcSubscribeIdCfgList()!=null&&entity.getNtcSubscribeIdCfgList().size()>0){
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
BeanUtils.copyProperties(entity, ntcSubscribeIdCfg, new String[]{"cfgId"});
stringcfgDao.deleteSubscribeIdCfg(ntcSubscribeIdCfg);
stringcfgDao.updateSubscribeIdCfg(ntcSubscribeIdCfg);
}
//保存区域IP信息
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
@@ -1132,6 +1445,30 @@ public class AppCfgService extends BaseService {
}
}
public void updateAppTcpCfgValid(Integer isValid,String ids,Integer functionId){
AppTcpCfg entity = new AppTcpCfg();
String[] idArray = ids.split(",");
for(String id :idArray){
entity.setCfgId(Long.parseLong(id));
entity.setIsValid(isValid);
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(new Date());
entity.setTableName(AppTcpCfg.getTablename());
entity.setFunctionId(functionId);
appCfgDao.updateCfgValid(entity);
//保存区域IP信息
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
appCfgDao.updateCfgValid(cfg);
}
}
}
public void updateAppHttpCfgValid(Integer isValid,String ids,Integer functionId){
AppHttpCfg entity = new AppHttpCfg();
String[] idArray = ids.split(",");
@@ -1176,6 +1513,30 @@ public class AppCfgService extends BaseService {
}
}
//主题网站配置删除
public void updateAppTopicDomainCfgValid(Integer isValid,String ids,Integer functionId){
AppTopicDomainCfg entity = new AppTopicDomainCfg();
String[] idArray = ids.split(",");
for(String id :idArray){
entity.setCfgId(Long.parseLong(id));
entity.setIsValid(isValid);
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(new Date());
entity.setTableName(AppTopicDomainCfg.getTablename());
entity.setFunctionId(functionId);
appCfgDao.updateCfgValid(entity);
//保存区域IP信息
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
appCfgDao.updateCfgValid(cfg);
}
}
}
public void updateAppByteCfgValid(Integer isValid,String ids,Integer functionId){
AppByteCfg entity = new AppByteCfg();
String[] idArray = ids.split(",");

View File

@@ -135,10 +135,10 @@ public class BgpCfgService extends CrudService<BgpCfgDao,CfgIndexInfo> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
} catch (Exception e) {
} catch (MaatConvertException e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}
}else{
@@ -146,9 +146,7 @@ public class BgpCfgService extends CrudService<BgpCfgDao,CfgIndexInfo> {
//无效子配置后,再新增子配置
bgpCfgDao.deleteIpCfg(entity);
bgpCfgDao.deleteBgpAsCfg(entity);
if(entity.getNtcSubscribeIdCfg()!=null){
stringCfgDao.deleteSubscribeIdCfg(entity.getNtcSubscribeIdCfg());
}
bgpCfgDao.deleteSubscribeIdCfg(entity);
//TODO
//bgpCfgDao.deleteDnsDomainCfg(entity);
AreaIpCfg area = new AreaIpCfg();

View File

@@ -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
}
}
}

View File

@@ -15,6 +15,7 @@ import com.nis.domain.configuration.AreaIpCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.ComplexkeywordCfg;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.domain.maat.MaatCfg;
import com.nis.domain.maat.MaatCfg.DigestCfg;
import com.nis.domain.maat.MaatCfg.GroupCfg;
@@ -28,6 +29,7 @@ import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.AreaIpCfgDao;
import com.nis.web.dao.configuration.StringCfgDao;
import com.nis.web.dao.configuration.XmppCfgDao;
import com.nis.web.security.UserUtils;
import com.nis.web.service.CrudService;
@@ -43,10 +45,19 @@ public class XmppCfgService extends CrudService<XmppCfgDao,CfgIndexInfo> {
protected XmppCfgDao xmppCfgDao;
@Autowired
protected AreaIpCfgDao areaIpCfgDao;
@Autowired
protected StringCfgDao stringCfgDao;
public CfgIndexInfo getXmppCfg(Long cfgId){
CfgIndexInfo entity = xmppCfgDao.getCfgIndexInfo(cfgId);
List<IpPortCfg> ipPortList = xmppCfgDao.getIpPortList(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);
return entity;
}
@@ -68,6 +79,10 @@ public class XmppCfgService extends CrudService<XmppCfgDao,CfgIndexInfo> {
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
}
} catch (MaatConvertException e) {
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
@@ -78,6 +93,14 @@ public class XmppCfgService extends CrudService<XmppCfgDao,CfgIndexInfo> {
xmppCfgDao.saveIpPortCfg(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()){
@@ -86,16 +109,13 @@ public class XmppCfgService extends CrudService<XmppCfgDao,CfgIndexInfo> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
} catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
}else{
xmppCfgDao.updateCfgIndex(entity);
//无效子配置后,再新增子配置
xmppCfgDao.deleteXmppIpCfg(entity);
stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity);
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
@@ -108,6 +128,14 @@ public class XmppCfgService extends CrudService<XmppCfgDao,CfgIndexInfo> {
xmppCfgDao.saveIpPortCfg(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()){
@@ -137,6 +165,13 @@ public class XmppCfgService extends CrudService<XmppCfgDao,CfgIndexInfo> {
cfg.setTableName(IpPortCfg.getTablename());
xmppCfgDao.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());
xmppCfgDao.updateCfgValid(cfg);
}
// if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){
// HttpUrlCfg cfg = new HttpUrlCfg();
// BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
@@ -185,6 +220,17 @@ public class XmppCfgService extends CrudService<XmppCfgDao,CfgIndexInfo> {
}
}
}
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
xmppCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
}
// if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){
// HttpUrlCfg cfg = new HttpUrlCfg();
// BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});

View File

@@ -12,6 +12,7 @@ import com.nis.domain.Page;
import com.nis.domain.specific.ConfigGroupInfo;
import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.web.dao.specific.SpecificServiceCfgDao;
import com.nis.web.service.BaseService;
@@ -89,6 +90,21 @@ public class SpecificServiceCfgService extends BaseService{
specificServiceCfg.setIsValid(1);
specificServiceCfg.setOpTime(new Date());
//用户添加的需要自增
if(specificServiceCfg.getAddFlag()!=null) {
Integer serviceCode=specificServiceCfgDao.getMaxServiceCode(Constants.APP_SPEC_SERVICE_CODE_MAX_VAL,specificServiceCfg.getCfgType(),specificServiceCfg.getAddFlag());
if(serviceCode==null) {//用户没有添加标签,获取最大的
serviceCode=specificServiceCfgDao.getMaxServiceCode(Constants.APP_SPEC_SERVICE_CODE_MAX_VAL,specificServiceCfg.getCfgType(),null);
}
if(serviceCode==null) {//没有标签,取开始值
serviceCode=Constants.APP_SPEC_SERVICE_CODE_MIN_VAL;
}else if(serviceCode>Constants.APP_SPEC_SERVICE_CODE_MAX_VAL){
throw new RuntimeException("Get specific service code failed,specific service code is beyond the scope of application");
}else if(serviceCode<Constants.APP_SPEC_SERVICE_CODE_MIN_VAL) {
serviceCode=Constants.APP_SPEC_SERVICE_CODE_MIN_VAL;
}
specificServiceCfg.setSpecServiceCode(serviceCode.intValue()+1);
}
specificServiceCfgDao.insert(specificServiceCfg);
}else{//修改
if(specificServiceCfg.getIsLeaf()==null){
@@ -145,5 +161,8 @@ public class SpecificServiceCfgService extends BaseService{
public SpecificServiceCfg getRepeat (Integer code,Integer cfgType,Integer parentId) {
return specificServiceCfgDao.getRepeat(code,cfgType,parentId);
}
public Integer getMaxServiceCode (Integer code, Integer cfgType,Integer addFlag) {
return specificServiceCfgDao.getMaxServiceCode(code,cfgType,addFlag);
}
}