diff --git a/src/main/java/com/nis/domain/configuration/AppHeaderCfg.java b/src/main/java/com/nis/domain/configuration/AppHeaderCfg.java new file mode 100644 index 000000000..f33e086f6 --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/AppHeaderCfg.java @@ -0,0 +1,147 @@ +/** + *@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 Header层头特征配置 + * @author dell + * + */ +public class AppHeaderCfg extends BaseCfg { + + /** + * + */ + private static final long serialVersionUID = -5024131931108849299L; + private static final String tableName="app_layer_header_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; + + @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 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; + } + +} diff --git a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java index 1a9ed2334..3bea15d32 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -19,6 +19,7 @@ import com.nis.domain.Page; import com.nis.domain.SysDataDictionaryItem; import com.nis.domain.configuration.AppByteCfg; import com.nis.domain.configuration.AppDomainCfg; +import com.nis.domain.configuration.AppHeaderCfg; import com.nis.domain.configuration.AppHttpCfg; import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppPolicyCfg; @@ -744,4 +745,113 @@ public class AppCfgController extends BaseController { appCfgService.updateAppSslCfgValid(isValid,ids,functionId); return "redirect:" + adminPath +"/app/sslCfgList?functionId="+functionId; } + /** + * APP header特征配置 列表 + * @param model + * @param cfg + * @param request + * @param response + * @return + */ + @RequestMapping(value = {"headerCfgList"}) + public String headerCfgList(Model model,@ModelAttribute("cfg")AppHeaderCfg cfg,HttpServletRequest request,HttpServletResponse response) { + Page searchPage=new Page(request,response,"r"); + Page page = appCfgService.findAppHeaderList(searchPage, cfg); + for(AppHeaderCfg entity:page.getList()){ + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); + entity.setAppName(app.getSpecServiceName()); + } + model.addAttribute("page", page); + initPageCondition(model,cfg); + return "/cfg/app/appHeaderCfgList"; + } + /** + * APP header特征配置表单 (修改/新增) + * @param model + * @param ids + * @param entity + * @return + */ + @RequestMapping(value = {"headerCfgForm"}) + @RequiresPermissions(value={"app:header:config"}) + public String headerCfgForm(Model model,String ids,AppHeaderCfg entity) { + if(StringUtils.isNotBlank(ids)){ + entity = appCfgService.getAppHeaderCfg(Long.parseLong(ids)); + initUpdateFormCondition(model,entity); + }else{ + initFormCondition(model,entity); + } + model.addAttribute("_cfg", entity); + return "/cfg/app/appHeaderCfgForm"; + } + /** + * APP header特征配置 (新增/修改)表单提交 + * @param model + * @param request + * @param response + * @param entity + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"saveAppHeaderCfg"}) + @RequiresPermissions(value={"app:header:config"}) + public String saveAppHeaderCfg(Model model,HttpServletRequest request,HttpServletResponse response, + AppHeaderCfg entity,RedirectAttributes redirectAttributes) { + try { + SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); + if(specificService!=null){ + entity.setAppCode(specificService.getSpecServiceCode()); + } + appCfgService.saveOrUpdateAppHeaderCfg(entity); + } catch (Exception e) { + e.printStackTrace(); + addMessage(redirectAttributes, e.getMessage()); + } + + return "redirect:" + adminPath +"/app/headerCfgList?functionId="+entity.getFunctionId(); + } + /** + * APP header特征配置 审核 + * @param isAudit + * @param isValid + * @param ids + * @param functionId + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"auditAppHeaderCfg"}) + @RequiresPermissions(value={"app:header:confirm"}) + public String auditAppHeaderCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + AppHeaderCfg entity = new AppHeaderCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity = appCfgService.getAppHeaderCfg(Long.parseLong(id)); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + entity.setFunctionId(functionId); + try { + appCfgService.auditAppHeaderCfg(entity,isAudit); + } catch (MaatConvertException e) { + e.printStackTrace(); + logger.info("app Header配置下发失败:"+e.getMessage()); + addMessage(redirectAttributes, e.getMessage()); + } + } + return "redirect:" + adminPath +"/app/headerCfgList?functionId="+functionId; + } + /** + * APP header特征配置 删除 + * @param isValid + * @param ids + * @param functionId + * @return + */ + @RequestMapping(value = {"updateAppHeaderCfgValid"}) + @RequiresPermissions(value={"app:header:config"}) + public String updateAppHeaderCfgValid(Integer isValid,String ids,Integer functionId) { + appCfgService.updateAppHeaderCfgValid(isValid,ids,functionId); + return "redirect:" + adminPath +"/app/headerCfgList?functionId="+functionId; + } } diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java index 6962964df..7c15dd79b 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java @@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param; import com.nis.domain.configuration.AppByteCfg; import com.nis.domain.configuration.AppComplexKeywordCfg; import com.nis.domain.configuration.AppDomainCfg; +import com.nis.domain.configuration.AppHeaderCfg; import com.nis.domain.configuration.AppHttpCfg; import com.nis.domain.configuration.AppIdCfg; import com.nis.domain.configuration.AppIdCfg.AppFeaturesIndex; @@ -66,11 +67,16 @@ public interface AppCfgDao { public AppInnerRuleCfg getAppInnerRuleCfg(Long cfgId) ; public int insertAppInnerRuleCfg(AppInnerRuleCfg entity); public int updateAppInnerRuleCfg(AppInnerRuleCfg entity); - //app ssl证书特征增删改查 + //app ssl证书特征配置CRUD public List findAppSslList(AppSslCertCfg entity); public AppSslCertCfg getAppSslCfg(Long cfgId); public int insertAppSslCfg(AppSslCertCfg entity); public int updateAppSslCfg(AppSslCertCfg entity); + //app header特征配置CRUD + public List findAppHeaderList(AppHeaderCfg entity); + public AppHeaderCfg getAppHeaderCfg(Long cfgId); + public int insertAppHeaderCfg(AppHeaderCfg entity); + public int updateAppHeaderCfg(AppHeaderCfg entity); //审核配置 public void auditCfg(BaseCfg entity); diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml index f42bd715c..79976960e 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml @@ -259,8 +259,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT, @@ -336,7 +368,14 @@ 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.DISTRICT,r.CFG_KEYWORDS,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN + r.DISTRICT,r.CFG_KEYWORDS,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.DO_LOG + + + r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,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.DISTRICT,r.CFG_KEYWORDS,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.DO_LOG + ${sqlMap.dsf} + + + + ORDER BY ${page.orderBy} + + + ORDER BY CFG_ID desc + + + @@ -1271,11 +1417,27 @@ 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, - DISTRICT,CFG_KEYWORDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN + DISTRICT,CFG_KEYWORDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG )values ( , - #{district,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR}, - #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER} + #{district,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR},#{exprType,jdbcType=INTEGER}, + #{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER} + ) + + + + SELECT LAST_INSERT_ID() + + insert into app_layer_header_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, + DISTRICT,CFG_KEYWORDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG + )values ( + , + #{district,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR},#{exprType,jdbcType=INTEGER}, + #{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER} ) @@ -1956,6 +2118,110 @@ is_hexbin=#{isHexbin,jdbcType=INTEGER}, + + do_log=#{doLog,jdbcType=INTEGER}, + + + + where cfg_id = #{cfgId,jdbcType=BIGINT} + + + update app_layer_header_cfg + + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + APP_CODE = #{appCode,jdbcType=INTEGER}, + + + BEHAV_CODE = #{behavCode,jdbcType=INTEGER}, + + + SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER}, + + + action = #{action,jdbcType=INTEGER}, + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + creator_id = #{creatorId,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + editor_id = #{editorId,jdbcType=INTEGER}, + + + edit_time = #{editTime,jdbcType=TIMESTAMP}, + + + auditor_id = #{auditorId,jdbcType=INTEGER}, + + + audit_time = #{auditTime,jdbcType=TIMESTAMP}, + + + service_id = #{serviceId,jdbcType=INTEGER}, + + + request_id = #{requestId,jdbcType=INTEGER}, + + + compile_id = #{compileId,jdbcType=INTEGER}, + + + is_area_effective = #{isAreaEffective,jdbcType=INTEGER}, + + + classify = #{classify,jdbcType=VARCHAR}, + + + attribute = #{attribute,jdbcType=VARCHAR}, + + + lable = #{lable,jdbcType=VARCHAR}, + + + area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, + + + function_id = #{functionId,jdbcType=INTEGER}, + + + RATELIMIT=#{ratelimit,jdbcType=INTEGER}, + + + CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}, + + + CFG_TYPE =#{cfgType,jdbcType=VARCHAR}, + + + district=#{district,jdbcType=VARCHAR}, + + + cfg_keywords=#{cfgKeywords,jdbcType=VARCHAR}, + + + expr_type=#{exprType,jdbcType=INTEGER}, + + + match_method=#{matchMethod,jdbcType=INTEGER}, + + + is_hexbin=#{isHexbin,jdbcType=INTEGER}, + + + do_log=#{doLog,jdbcType=INTEGER}, + where cfg_id = #{cfgId,jdbcType=BIGINT} diff --git a/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.xml index 5ded7c176..0e68484fe 100644 --- a/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.xml @@ -159,7 +159,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,a.do_log a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port @@ -346,7 +346,8 @@ ATTRIBUTE, LABLE, AREA_EFFECTIVE_IDS, - function_id + function_id, + do_log )values ( #{cfgDesc,jdbcType=VARCHAR}, #{action,jdbcType=INTEGER}, @@ -366,7 +367,8 @@ #{attribute,jdbcType=VARCHAR}, #{lable,jdbcType=VARCHAR}, #{areaEffectiveIds,jdbcType=VARCHAR}, - #{functionId,jdbcType=INTEGER} + #{functionId,jdbcType=INTEGER}, + #{doLog,jdbcType=INTEGER} ) @@ -500,6 +502,9 @@ function_id = #{functionId,jdbcType=INTEGER}, + + do_log = #{doLog,jdbcType=INTEGER} + where cfg_id = #{cfgId,jdbcType=BIGINT} diff --git a/src/main/java/com/nis/web/service/configuration/AppCfgService.java b/src/main/java/com/nis/web/service/configuration/AppCfgService.java index b99062c66..4a0ba1e0c 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -13,6 +13,7 @@ import org.springframework.transaction.annotation.Transactional; import com.nis.domain.Page; import com.nis.domain.configuration.AppByteCfg; import com.nis.domain.configuration.AppDomainCfg; +import com.nis.domain.configuration.AppHeaderCfg; import com.nis.domain.configuration.AppHttpCfg; import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppPolicyCfg; @@ -1006,8 +1007,8 @@ public class AppCfgService extends BaseService { String json=gsonToJson(maatBean); logger.info("app SSL配置下发配置参数:"+json); //调用服务接口下发配置 - //ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); - //logger.info("app SSL配置下发响应信息:"+result.getMsg()); + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("app SSL配置下发响应信息:"+result.getMsg()); }else if(isAudit==3){ maatCfg.setCompileId(entity.getCompileId()); @@ -1023,8 +1024,8 @@ public class AppCfgService extends BaseService { String json=gsonToJson(maatBean); logger.info("app SSL配置下发配置参数:"+json); //调用服务接口下发配置 - //ToMaatResult result = ConfigServiceUtil.put(json,1); - //logger.info("app SSL配置取消配置响应信息:"+result.getMsg()); + ToMaatResult result = ConfigServiceUtil.put(json,1); + logger.info("app SSL配置取消配置响应信息:"+result.getMsg()); } } public void updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId){ @@ -1168,4 +1169,174 @@ public class AppCfgService extends BaseService { } } + public void updateAppHeaderCfgValid(Integer isValid,String ids,Integer functionId){ + AppHeaderCfg entity = new AppHeaderCfg(); + 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(AppHeaderCfg.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 Page findAppHeaderList(Page page, AppHeaderCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r")); + entity.setPage(page); + List list = appCfgDao.findAppHeaderList(entity); + page.setList(list); + return page; + } + public AppHeaderCfg getAppHeaderCfg(Long cfgId){ + return appCfgDao.getAppHeaderCfg(cfgId); + } + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveOrUpdateAppHeaderCfg(AppHeaderCfg entity) throws Exception{ + //设置区域运营商信息 + setAreaEffectiveIds(entity); + if(entity.getCfgId()==null){ + Integer compileId = 0; + try { + List 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.insertAppHeaderCfg(entity); + //保存区域IP信息 + if(entity.getAreaCfg()!=null){ + for(AreaIpCfg cfg:entity.getAreaCfg()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } + } + + }catch (Exception e) { + e.printStackTrace(); + 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.updateAppHeaderCfg(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 auditAppHeaderCfg(AppHeaderCfg entity,Integer isAudit){ + ToMaatBean maatBean = new ToMaatBean(); + MaatCfg maatCfg = new MaatCfg(); + List configCompileList = new ArrayList(); + List groupRelationList = new ArrayList(); + List ipRegionList = new ArrayList(); + List strRegionList = new ArrayList(); + List numRegionList = new ArrayList(); + List digestRegionList = new ArrayList(); + List areaIpRegionList = new ArrayList(); + entity.setTableName(AppHeaderCfg.getTablename()); + appCfgDao.auditCfg(entity); + + if(isAudit==1){ + List list = new ArrayList(); + list.add(entity); + Map map = cfgConvert(strRegionList,list,3,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + //保存区域IP信息 + List 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 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自定义域 + 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 Header配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("app Header配置下发响应信息:"+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 Header配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.put(json,1); + logger.info("app Header配置取消配置响应信息:"+result.getMsg()); + } + } } diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp new file mode 100644 index 000000000..de1149108 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp @@ -0,0 +1,438 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + + +
+ + + + + +

+ +

+
+
+
+
+
+ + + +
+
+
+ +
+ + + + + + + +
+ +
+
+
+ + +
+ +
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+ + + + +
+
+ + +
+
+ +
+ + +
+
+
+
+
+ +
+
+ + + + + + + + + + + +
+
+
+
+
+
+ + + +
+ +
+
+ + +
+ +
+
+ +
+
+
+ +
+
+
+
+ + +
+ + + + + + > + + + + + + + + + + + + + +
+
+ +
+
+ +
+
+ +
+ +
+
+
+
+
+
+ +
+
+ +
+ + +
+
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+
+ + <%-- <%@include file="/WEB-INF/include/form/areaInfo.jsp" %> --%> + + <%-- <%@include file="/WEB-INF/include/form/basicInfo.jsp" %> --%> +
+
+
+
+
+
+ + +
+
+
+
+
+
+
+ +
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgList.jsp new file mode 100644 index 000000000..8dd19bd5c --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgList.jsp @@ -0,0 +1,437 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + + + +
+ + + + + +

+ + +

+ +
+
+
+
+ + + + + + + + + + +
+
+ + + + + + + + +
+ +
+ + +
+
+
+
+ + + + + + +
+ + + +
+
+
+ + + +
+
+ + + + + +
+ + +
+
+ href="javascript:;"> + + +
+
+ + + +
+ + +
+
+
+ + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+
+ + +
+ + +
+
+
+ + + + + + + + + + + + + <%-- + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + --%> + + + + + + + + + + + + +
+ + ${cfg.cfgDesc }${cfg.appName }${cfg.district } + + ${fns:abbr(fn:replace(cfg.cfgKeywords, "***and***", " "),20)} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${cfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + + + + + + + + + + + +
${cfg.creatorName }${cfg.editorName }${cfg.auditorName }
+
${page}
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgForm.jsp index 7af2fb3a0..34c1c2096 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appSslCfgForm.jsp @@ -5,9 +5,6 @@ <spring:message code="${cfgName}"></spring:message>