diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 50eca84b9..847f8e84a 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -325,7 +325,7 @@ public class BaseController { } protected void setSaveOrUpdateProps(Model model,BaseCfg cfg,String areaCfgIds) throws Exception{ String tableName=cfg.getTableName(); - List areaCfg=cfg.getAreaCfg(); + List areaCfg=cfg.getAreaCfg(); List areaIsps=cfg.getAreaIsp(); if(Constants.IS_AREA_EFFECTIVE_NO==cfg.getIsAreaEffective()){ cfg.setAreaEffectiveIds(""); @@ -372,11 +372,11 @@ public class BaseController { Date date=new Date(); cfg.setIsValid(Constants.VALID_NO); cfg.setIsAudit(Constants.AUDIT_NOT_YET); - if(cfg.getCfgId()==null){ + if(cfg.getCfgId()==null){//新增 cfg.setCreatorId(cfg.getCurrentUser().getId()); cfg.setCreateTime(date); if(Constants.IS_AREA_EFFECTIVE_YES==cfg.getIsAreaEffective()&&areaCfg!=null){ - for(AreaIpCfg area:areaCfg){ + for(BaseIpCfg area:areaCfg){ area.setTableName(AreaIpCfg.getTablename()); area.setServiceId(serviceId); area.setCompileId(cfg.getCompileId()); @@ -400,18 +400,18 @@ public class BaseController { }else if(cfg instanceof ComplexkeywordCfg){ complexStringCfgService.addStringCfg((ComplexkeywordCfg)cfg,areaCfg); } - }else{ + }else{//修改 cfg.setEditorId(cfg.getCurrentUser().getId()); cfg.setEditTime(new Date()); - List updateAreaCfg=new ArrayList<>(); - List deleteAreaCfg=new ArrayList<>(); - List addAreaCfg=new ArrayList<>(); + List updateAreaCfg=new ArrayList<>(); + List deleteAreaCfg=new ArrayList<>(); + List addAreaCfg=new ArrayList<>(); String[] cfgIds=null; if(!StringUtils.isBlank(areaCfgIds)){ cfgIds=areaCfgIds.split(","); } if(Constants.IS_AREA_EFFECTIVE_YES==cfg.getIsAreaEffective()&&areaCfg!=null){ - for(AreaIpCfg area:areaCfg){ + for(BaseIpCfg area:areaCfg){ area.setTableName(AreaIpCfg.getTablename()); area.setServiceId(serviceId); area.setCompileId(cfg.getCompileId()); diff --git a/src/main/java/com/nis/web/controller/configuration/ComplexStringCfgController.java b/src/main/java/com/nis/web/controller/configuration/ComplexStringCfgController.java index cf3c1a887..de83a8f33 100644 --- a/src/main/java/com/nis/web/controller/configuration/ComplexStringCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ComplexStringCfgController.java @@ -204,13 +204,15 @@ public class ComplexStringCfgController extends BaseController{ if(StringUtils.isNotBlank(ids)){ List beans=complexStringCfgService.getList(tableName,ids); List auditBeans=new ArrayList<>(); - List auditAreaBeans=new ArrayList<>(); + List auditAreaBeans=new ArrayList<>(); Date date=new Date(); for(ComplexkeywordCfg bean:beans){ ComplexkeywordCfg auditBean=new ComplexkeywordCfg(); auditBean.setTableName(tableName); + auditBean.setMaatTable(maatTable); auditBean.setCfgId(bean.getCfgId()); bean.setTableName(tableName); + bean.setMaatTable(maatTable); int audit=bean.getIsAudit().intValue(); if(audit==Constants.AUDIT_YES&&isAudit!=Constants.AUDIT_NOT_YES){ logger.error("审核通过的配置只能取消审核通过!"); @@ -225,18 +227,23 @@ public class ComplexStringCfgController extends BaseController{ bean.setIsAudit(isAudit); if(isAudit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 auditBean.setIsValid(Constants.VALID_NO); - auditBean.setMaatTable(maatTable); bean.setIsValid(Constants.VALID_NO); - bean.setMaatTable(maatTable); }else if(isAudit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 auditBean.setIsValid(Constants.VALID_YES); - auditBean.setMaatTable(maatTable); bean.setIsValid(Constants.VALID_YES); - bean.setMaatTable(maatTable); } List areaCfg=ipCfgService.getAreaCfgByCompileId(bean.getCompileId()); for(AreaIpCfg c:areaCfg){ + c.setMaatTable(AreaIpCfg.getMaattable()); c.setTableName(AreaIpCfg.getTablename()); + c.setAuditorId(c.getCurrentUser().getId()); + c.setAuditTime(date); + c.setIsAudit(isAudit); + if(isAudit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 + c.setIsValid(Constants.VALID_NO); + }else if(isAudit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 + c.setIsValid(Constants.VALID_YES); + } } bean.setAreaCfg(areaCfg); auditAreaBeans.addAll(areaCfg); @@ -277,7 +284,7 @@ public class ComplexStringCfgController extends BaseController{ } } List complexCfgs=new ArrayList(); - List areaCfgs=new ArrayList(); + List areaCfgs=new ArrayList(); Date date =new Date(); if(StringUtils.isNotBlank(ids)){ for(String compileIdStr:ids.split(",")){ diff --git a/src/main/java/com/nis/web/controller/configuration/IpCfgController.java b/src/main/java/com/nis/web/controller/configuration/IpCfgController.java index e2e64a4a5..44f15d752 100644 --- a/src/main/java/com/nis/web/controller/configuration/IpCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/IpCfgController.java @@ -31,44 +31,6 @@ import com.nis.web.controller.BaseController; @Controller @RequestMapping("${adminPath}/cfg/ip") public class IpCfgController extends BaseController{ - /** - * - * cfgList(配置列表) - * (这里描述这个方法适用条件 – 可选) - * @param model - * @param cfgName - * @param ipCfg - * @param request - * @param response - * @return - *String - * @exception - * @since 1.0.0 - */ -// @RequestMapping(value = {"cfgList"}) -// @RequiresPermissions("cfg:ip:edit") -// public String cfgList(Model model,String cfgName,@ModelAttribute("ipCfg")BaseIpCfg ipCfg,HttpServletRequest request,HttpServletResponse response){ -// return ipCfgList(model,Constants.CFG_PAGE,cfgName,ipCfg,request,response); -// } - /** - * - * auditList(审核列表) - * (这里描述这个方法适用条件 – 可选) - * @param model - * @param cfgName - * @param ipCfg - * @param request - * @param response - * @return - *String - * @exception - * @since 1.0.0 - */ -// @RequestMapping(value = {"auditList"}) -// @RequiresPermissions("cfg:ip:audit") -// public String auditList(Model model,String cfgName,@ModelAttribute("ipCfg")BaseIpCfg ipCfg,HttpServletRequest request,HttpServletResponse response){ -// return ipCfgList(model,Constants.AUDIT_PAGE,cfgName,ipCfg,request,response); -// } @RequestMapping(value = {"list"}) @RequiresPermissions(value={"cfg:ip:view"}) public String ipCfgList(Model model,Integer audit,String cfgName,@ModelAttribute("ipCfg")BaseIpCfg ipCfg,HttpServletRequest request,HttpServletResponse response) { @@ -279,13 +241,15 @@ public class IpCfgController extends BaseController{ if(StringUtils.isNotBlank(ids)){ List beans=ipCfgService.getList(tableName,ids); List auditBeans=new ArrayList<>(); - List auditAreaBeans=new ArrayList<>(); + List auditAreaBeans=new ArrayList<>(); Date date=new Date(); for(BaseIpCfg bean:beans){ BaseIpCfg auditBean=new BaseIpCfg(); auditBean.setTableName(tableName); + auditBean.setMaatTable(maatTable); auditBean.setCfgId(bean.getCfgId()); bean.setTableName(tableName); + bean.setMaatTable(maatTable); int audit=bean.getIsAudit().intValue(); if(audit==Constants.AUDIT_YES&&isAudit!=Constants.AUDIT_NOT_YES){ logger.error("审核通过的配置只能取消审核通过!"); @@ -300,18 +264,23 @@ public class IpCfgController extends BaseController{ bean.setIsAudit(isAudit); if(isAudit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 auditBean.setIsValid(Constants.VALID_NO); - auditBean.setMaatTable(maatTable); bean.setIsValid(Constants.VALID_NO); - bean.setMaatTable(maatTable); }else if(isAudit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 auditBean.setIsValid(Constants.VALID_YES); - auditBean.setMaatTable(maatTable); bean.setIsValid(Constants.VALID_YES); - bean.setMaatTable(maatTable); } List areaCfg=ipCfgService.getAreaCfgByCompileId(bean.getCompileId()); for(AreaIpCfg c:areaCfg){ + c.setMaatTable(AreaIpCfg.getMaattable()); c.setTableName(AreaIpCfg.getTablename()); + c.setAuditorId(c.getCurrentUser().getId()); + c.setAuditTime(date); + c.setIsAudit(isAudit); + if(isAudit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 + c.setIsValid(Constants.VALID_NO); + }else if(isAudit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 + c.setIsValid(Constants.VALID_YES); + } } bean.setAreaCfg(areaCfg); auditAreaBeans.addAll(areaCfg); diff --git a/src/main/java/com/nis/web/controller/configuration/MultipleCfgController.java b/src/main/java/com/nis/web/controller/configuration/MultipleCfgController.java index 9d6b2f3db..ccb678c63 100644 --- a/src/main/java/com/nis/web/controller/configuration/MultipleCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/MultipleCfgController.java @@ -11,6 +11,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -19,7 +21,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.nis.domain.Page; import com.nis.domain.ServiceConfigInfo; -import com.nis.domain.basics.ServiceDictInfo; +import com.nis.domain.configuration.AreaBean; +import com.nis.domain.configuration.AreaIpCfg; import com.nis.domain.configuration.BaseCfg; import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.BaseStringCfg; @@ -27,7 +30,6 @@ import com.nis.domain.configuration.ComplexkeywordCfg; import com.nis.domain.configuration.MultipleCfg; import com.nis.domain.configuration.MultipleSearchCfg; import com.nis.domain.configuration.NumBoundaryCfg; -import com.nis.domain.configuration.RequestInfo; import com.nis.domain.configuration.TableBean; import com.nis.main.ConvertTool; import com.nis.util.Constants; @@ -61,45 +63,57 @@ public class MultipleCfgController extends BaseController{ */ @SuppressWarnings({"unchecked","rawtypes"}) @RequestMapping(value = {"list"}) + @RequiresPermissions(value={"cfg:multiple:view"}) public String list(Model model,Integer audit,String cfgName,@ModelAttribute("cfg")MultipleSearchCfg cfg,HttpServletRequest request,HttpServletResponse response) { model.addAttribute("cfgName", cfgName); model.addAttribute("cfgType", "multiple"); model.addAttribute("audit", audit); model.addAttribute("mainTable", cfg.getMainTable()); + model.addAttribute("action", cfg.getAction()); Page resultPage=new Page(request,response); Integer serviceId=cfg.getServiceId(); model.addAttribute("serviceId", serviceId); - List otherTables=null; - if(cfg.getOtherTables()==null){ - otherTables=new ArrayList(); - cfg.setOtherTables(otherTables); - }else{ - otherTables=cfg.getOtherTables(); - } if(cfg.getMainTable()==null){ logger.error("cannot get main table"); return "/cfg/multipleCfgList"; }else{//从菜单url获取mainTable String mainTable=cfg.getMainTable(); //获取相关表名 - List serviceConfigInfos=serviceConfigInfoService.findList(serviceId); + List infos=serviceConfigInfoService.findList(serviceId); + model.addAttribute("tableInfos", infos); List resultList=new ArrayList(); resultPage.setList(resultList); List mainList=null; //查询主表,将主表中的数据set到结果中 - for(ServiceConfigInfo info:serviceConfigInfos){ + for(ServiceConfigInfo info:infos){ + if(info.getTableName().equals(mainTable)){ + model.addAttribute("mainTableType", info.getTableType()); + model.addAttribute("mainTableDesc", info.getTableDesc()); + } int type=info.getTableType(); String tableName=info.getTableName(); if(mainTable.equals(tableName)){ - model.addAttribute("mainTableType", String.valueOf(info.getTableType())); - model.addAttribute("mainTableDesc", info.getTableDesc()); cfg.setMainTableType(String.valueOf(type)); cfg.setMainTableDesc(info.getTableDesc()); if(Constants.TABLE_TYPE_COMPLEX==type){//增强字符串类型 ComplexkeywordCfg _cfg=cfg.getComplexCfg()==null?new ComplexkeywordCfg():cfg.getComplexCfg(); _cfg.setTableName(mainTable); this.setProperties(cfg,_cfg); - Page mainPage=complexStringCfgService.findPage(new Page(request,response,"r"), _cfg); + Page searchPage=new Page(request,response,"r"); + String addWhrere=null; + if(audit==Constants.CFG_PAGE){// + addWhrere="r.is_audit in ("+Constants.AUDIT_NOT_YET+","+Constants.AUDIT_NO+")"; + }else if(audit==Constants.AUDIT_PAGE){ + addWhrere="r.is_audit in ("+Constants.AUDIT_NOT_YET+","+Constants.AUDIT_YES+")"; + } + if(addWhrere!=null){ + if(StringUtils.isNotBlank(resultPage.getWhere())){ + searchPage.setWhere(resultPage.getWhere()+" AND "+addWhrere); + }else{ + searchPage.setWhere(addWhrere); + } + } + Page mainPage=complexStringCfgService.findPage(searchPage, _cfg); setPageProps(mainPage,resultPage); mainList=mainPage.getList();//主表结果 if(mainList!=null){ @@ -123,7 +137,21 @@ public class MultipleCfgController extends BaseController{ BaseStringCfg _cfg=cfg.getStringCfg()==null?new BaseStringCfg():cfg.getStringCfg(); _cfg.setTableName(mainTable); this.setProperties(cfg,_cfg); - Page mainPage=stringCfgService.findPage(new Page(request,response,"r"), _cfg); + Page searchPage=new Page(request,response,"r"); + String addWhrere=null; + if(audit==Constants.CFG_PAGE){// + addWhrere="r.is_audit in ("+Constants.AUDIT_NOT_YET+","+Constants.AUDIT_NO+")"; + }else if(audit==Constants.AUDIT_PAGE){ + addWhrere="r.is_audit in ("+Constants.AUDIT_NOT_YET+","+Constants.AUDIT_YES+")"; + } + if(addWhrere!=null){ + if(StringUtils.isNotBlank(resultPage.getWhere())){ + searchPage.setWhere(resultPage.getWhere()+" AND "+addWhrere); + }else{ + searchPage.setWhere(addWhrere); + } + } + Page mainPage=stringCfgService.findPage(searchPage, _cfg); mainList=mainPage.getList();//主表结果 setPageProps(mainPage,resultPage); if(mainList!=null){ @@ -146,7 +174,21 @@ public class MultipleCfgController extends BaseController{ BaseIpCfg _cfg=cfg.getIpCfg()==null?new BaseIpCfg():cfg.getIpCfg(); _cfg.setTableName(mainTable); this.setProperties(cfg, _cfg); - Page mainPage=ipCfgService.findPage(new Page(request,response,"r"), _cfg); + Page searchPage=new Page(request,response,"r"); + String addWhrere=null; + if(audit==Constants.CFG_PAGE){// + addWhrere="r.is_audit in ("+Constants.AUDIT_NOT_YET+","+Constants.AUDIT_NO+")"; + }else if(audit==Constants.AUDIT_PAGE){ + addWhrere="r.is_audit in ("+Constants.AUDIT_NOT_YET+","+Constants.AUDIT_YES+")"; + } + if(addWhrere!=null){ + if(StringUtils.isNotBlank(resultPage.getWhere())){ + searchPage.setWhere(resultPage.getWhere()+" AND "+addWhrere); + }else{ + searchPage.setWhere(addWhrere); + } + } + Page mainPage=ipCfgService.findPage(searchPage, _cfg); mainList=mainPage.getList();//主表结果 setPageProps(mainPage,resultPage); if(mainList!=null){ @@ -169,7 +211,21 @@ public class MultipleCfgController extends BaseController{ NumBoundaryCfg _cfg=cfg.getNumCfg()==null?new NumBoundaryCfg():cfg.getNumCfg(); _cfg.setTableName(mainTable); this.setProperties(cfg,_cfg); - Page mainPage=numCfgService.findPage(new Page(request,response,"r"), _cfg); + Page searchPage=new Page(request,response,"r"); + String addWhrere=null; + if(audit==Constants.CFG_PAGE){// + addWhrere="r.is_audit in ("+Constants.AUDIT_NOT_YET+","+Constants.AUDIT_NO+")"; + }else if(audit==Constants.AUDIT_PAGE){ + addWhrere="r.is_audit in ("+Constants.AUDIT_NOT_YET+","+Constants.AUDIT_YES+")"; + } + if(addWhrere!=null){ + if(StringUtils.isNotBlank(resultPage.getWhere())){ + searchPage.setWhere(resultPage.getWhere()+" AND "+addWhrere); + }else{ + searchPage.setWhere(addWhrere); + } + } + Page mainPage=numCfgService.findPage(searchPage, _cfg); mainList=mainPage.getList();//主表结果 setPageProps(mainPage,resultPage); if(mainList!=null){ @@ -192,7 +248,6 @@ public class MultipleCfgController extends BaseController{ break; } } - if(mainList!=null&&mainList.size()>0){ Page page=new Page(request,response,"r"); StringBuffer compileIds=new StringBuffer(); @@ -208,11 +263,11 @@ public class MultipleCfgController extends BaseController{ }else{ page.setWhere(page.getWhere()+"AND r.compile_id in ("+compileIds+")"); } - for(ServiceConfigInfo info:serviceConfigInfos){ + for(ServiceConfigInfo info:infos){ int type=info.getTableType(); TableBean tableBean=new TableBean(info.getTableName(),String.valueOf(type),info.getTableDesc()); if(!mainTable.equals(info.getTableName())){ - otherTables.add(tableBean); +// otherTables.add(tableBean); if(Constants.TABLE_TYPE_COMPLEX==type){//增强字符串类型 ComplexkeywordCfg _cfg=cfg.getComplexCfg()==null?new ComplexkeywordCfg():cfg.getComplexCfg(); _cfg.setTableName(info.getTableName()); @@ -345,33 +400,15 @@ public class MultipleCfgController extends BaseController{ } } } - }else{ - for(ServiceConfigInfo info:serviceConfigInfos){ - int type=info.getTableType(); - TableBean tableBean=new TableBean(info.getTableName(),String.valueOf(type),info.getTableDesc()); - if(!mainTable.equals(info.getTableName())){ - otherTables.add(tableBean); - } - } - } } - model.addAttribute("mainTableType", cfg.getMainTableType()); - model.addAttribute("mainTableDesc", cfg.getMainTableDesc()); - model.addAttribute("action", cfg.getAction()); model.addAttribute("page", resultPage); - List requestInfos=requestInfoService.getAllRequestInfo(); - model.addAttribute("requestInfos", requestInfos); - List fls=serviceDictInfoService.findAllFlDict(); - model.addAttribute("fls", fls); - List xzs=serviceDictInfoService.findAllXzDict(); - model.addAttribute("xzs", xzs); - List lables=serviceDictInfoService.findAllLableDict(); - model.addAttribute("lables", lables); + initPageCondition(model); return "/cfg/multipleCfgList"; } @RequestMapping(value = {"form"}) - public String cfgForm(int action,String mainTable,String cfgName,Integer serviceId,Model model,HttpServletRequest request,HttpServletResponse response) { + @RequiresPermissions(value={"cfg:multiple:add"}) + public String cfgForm(int action,String mainTable,String cfgName,Integer serviceId,Model model) { model.addAttribute("cfgName", cfgName); model.addAttribute("action", action); model.addAttribute("serviceId", serviceId); @@ -384,22 +421,11 @@ public class MultipleCfgController extends BaseController{ cfg.setAction(action); cfg.setServiceId(serviceId); List serviceConfigInfos=serviceConfigInfoService.findList(serviceId); - List otherTables=new ArrayList(); - cfg.setOtherTables(otherTables); + model.addAttribute("tableInfos", serviceConfigInfos); for(ServiceConfigInfo info:serviceConfigInfos){ int type=info.getTableType(); - TableBean tableBean=new TableBean(info.getTableName(), String.valueOf(type),info.getTableDesc()); - if(mainTable.equals(info.getTableName())){ - cfg.setMainTableType(String.valueOf(type)); - cfg.setMainTableDesc(info.getTableDesc()); - model.addAttribute("mainTableType", String.valueOf(type)); - model.addAttribute("mainTableDesc", info.getTableDesc()); - }else{ - otherTables.add(tableBean); - } String tableName=info.getTableName(); if(Constants.TABLE_TYPE_IP==type){//ip类型 - tableBean.setCanEmpty(true); BaseIpCfg ipCfg=(BaseIpCfg)this.getClassBean(info.getTableName(), true); if(cfg.getIpCfg()==null){ Map map=new HashMap(); @@ -440,58 +466,45 @@ public class MultipleCfgController extends BaseController{ Map map=cfg.getComplexCfg(); map.put(tableName,complexCfg); } -// List districts=sysDictInfoService.getDistrictDict(tableName); -// model.addAttribute("districts", districts); } } cfg.setAction(action); cfg.setServiceId(serviceId); model.addAttribute("_cfg", cfg); - List requestInfos=requestInfoService.getValidRequestInfo(); - model.addAttribute("requestInfos", requestInfos); - List fls=serviceDictInfoService.findFlDict(); - model.addAttribute("fls", fls); - List xzs=serviceDictInfoService.findXzDict(); - model.addAttribute("xzs", xzs); - List lables=serviceDictInfoService.findLableDict(); - model.addAttribute("lables", lables); - + initFormCondition(model); return "/cfg/multipleCfgForm"; } @RequestMapping(value = {"updateForm"}) - public String updateCfgForm(String cfgName,MultipleCfg cfg,Model model,HttpServletRequest request,HttpServletResponse response) { + @RequiresPermissions(value={"cfg:multiple:edit"}) + public String updateCfgForm(String cfgName,String mainTable,String mainTableType,String mainTableDesc,int serviceId,int action,int compileId,Model model) { model.addAttribute("operator", "update"); model.addAttribute("cfgName", cfgName); - model.addAttribute("serviceId", cfg.getServiceId()); - model.addAttribute("action", cfg.getAction()); + model.addAttribute("serviceId", serviceId); + model.addAttribute("action", action); model.addAttribute("audit", Constants.CFG_PAGE); MultipleCfg resultCfg=new MultipleCfg(); - String mainTable=cfg.getMainTable(); model.addAttribute("mainTable", mainTable); resultCfg.setMainTable(mainTable); - String mainTableType=cfg.getMainTableType(); model.addAttribute("mainTableType", mainTableType); - model.addAttribute("mainTableDesc", cfg.getMainTableDesc()); + model.addAttribute("mainTableDesc", mainTableDesc); resultCfg.setMainTableType(mainTableType); - resultCfg.setMainTableDesc(cfg.getMainTableDesc()); - resultCfg.setAction(cfg.getAction()); - int serviceId=cfg.getServiceId(); - cfg.setServiceId(serviceId); - int compileId=cfg.getCompileId().intValue(); + resultCfg.setMainTableDesc(mainTableDesc); + resultCfg.setAction(action); resultCfg.setCompileId(compileId); List serviceConfigInfos=serviceConfigInfoService.findList(serviceId); - List otherTables=new ArrayList(); - resultCfg.setOtherTables(otherTables); + model.addAttribute("tableInfos", serviceConfigInfos); +// List otherTables=new ArrayList(); +// resultCfg.setOtherTables(otherTables); for(ServiceConfigInfo info:serviceConfigInfos){ - String tableName=info.getTableName(); +// String tableName=info.getTableName(); int type=info.getTableType(); - if(!tableName.equals(mainTable)){ - TableBean bean=new TableBean(tableName,String.valueOf(type),info.getTableDesc()); - if(Constants.TABLE_TYPE_IP==type){ - bean.setCanEmpty(true); - } - otherTables.add(bean); - } +// if(!tableName.equals(mainTable)){ +// TableBean bean=new TableBean(tableName,String.valueOf(type),info.getTableDesc()); +// if(Constants.TABLE_TYPE_IP==type){ +// bean.setCanEmpty(true); +// } +// otherTables.add(bean); +// } if(Constants.TABLE_TYPE_IP==type){ BaseIpCfg searchIpCfg=new BaseIpCfg(); searchIpCfg.setTableName(info.getTableName()); @@ -579,116 +592,62 @@ public class MultipleCfgController extends BaseController{ this.setPropertiesToMultipleCfg(resultCfg, resultComplexCfg,"update"); } } -// List districts=sysDictInfoService.getDistrictDict(tableName); -// model.addAttribute("districts", districts); } } model.addAttribute("_cfg", resultCfg); - List requestInfos=requestInfoService.getAllRequestInfo(); - model.addAttribute("requestInfos", requestInfos); - List fls=serviceDictInfoService.findAllFlDict(); - model.addAttribute("fls", fls); - List xzs=serviceDictInfoService.findAllXzDict(); - model.addAttribute("xzs", xzs); - List lables=serviceDictInfoService.findAllLableDict(); - model.addAttribute("lables", lables); - + initUpdateFormCondition(model,resultCfg); return "/cfg/multipleCfgForm"; } - @RequestMapping(value = {"deleteCfg"}) - public String deleteCfg(String cfgName,MultipleCfg cfg,Model model,HttpServletRequest request,HttpServletResponse response) { + @RequestMapping(value = {"delete"}) + @RequiresPermissions(value={"cfg:multiple:delete"}) + public String deleteCfg(String cfgName,String mainTable,int action,String ids,Integer serviceId,Model model) { model.addAttribute("operator", "delete"); model.addAttribute("cfgName", cfgName); model.addAttribute("cfgType", "multiple"); - model.addAttribute("serviceId", cfg.getServiceId()); - model.addAttribute("action", cfg.getAction()); + model.addAttribute("serviceId", serviceId); + model.addAttribute("action", action); model.addAttribute("audit", Constants.CFG_PAGE); - MultipleCfg resultCfg=new MultipleCfg(); - String mainTable=cfg.getMainTable(); model.addAttribute("mainTable", mainTable); - resultCfg.setMainTable(mainTable); - String mainTableType=cfg.getMainTableType(); - model.addAttribute("mainTableType", mainTableType); - model.addAttribute("mainTableDesc", cfg.getMainTableDesc()); - resultCfg.setMainTableType(mainTableType); - resultCfg.setMainTableDesc(cfg.getMainTableDesc()); - resultCfg.setAction(cfg.getAction()); - int serviceId=cfg.getServiceId(); - cfg.setServiceId(serviceId); - int compileId=cfg.getCompileId().intValue(); - resultCfg.setCompileId(compileId); - List serviceConfigInfos=serviceConfigInfoService.findList(serviceId); - Date date=new Date(); - for(ServiceConfigInfo info:serviceConfigInfos){ - int type=info.getTableType(); - if(Constants.TABLE_TYPE_IP==type){ - BaseIpCfg searchIpCfg=new BaseIpCfg(); - searchIpCfg.setTableName(info.getTableName()); - searchIpCfg.setCompileId(compileId); - searchIpCfg.setIsValid(Constants.VALID_DEL); - searchIpCfg.setIsAudit(Constants.AUDIT_NOT_YET); - searchIpCfg.setEditorId(cfg.getCurrentUser().getId()); - searchIpCfg.setEditTime(date); - if(resultCfg.getIpCfg()==null){ - Map map=new HashMap(); - map.put(info.getTableName(), searchIpCfg); - resultCfg.setIpCfg(map); - }else{ - Map map=resultCfg.getIpCfg(); - map.put(info.getTableName(), searchIpCfg); - } - }else if(Constants.TABLE_TYPE_STRING==type){ - BaseStringCfg searchStringCfg=new BaseStringCfg(); - searchStringCfg.setTableName(info.getTableName()); - searchStringCfg.setCompileId(compileId); - searchStringCfg.setIsValid(Constants.VALID_DEL); - searchStringCfg.setIsAudit(Constants.AUDIT_NOT_YET); - searchStringCfg.setEditorId(cfg.getCurrentUser().getId()); - searchStringCfg.setEditTime(date); - if(resultCfg.getStringCfg()==null){ - Map map=new HashMap(); - map.put(info.getTableName(), searchStringCfg); - resultCfg.setStringCfg(map); - }else{ - Map map=resultCfg.getStringCfg(); - map.put(info.getTableName(), searchStringCfg); - } - }else if(Constants.TABLE_TYPE_NUMBER==type){ - NumBoundaryCfg searchNumCfg=new NumBoundaryCfg(); - searchNumCfg.setTableName(info.getTableName()); - searchNumCfg.setCompileId(compileId); - searchNumCfg.setIsValid(Constants.VALID_DEL); - searchNumCfg.setIsAudit(Constants.AUDIT_NOT_YET); - searchNumCfg.setEditorId(cfg.getCurrentUser().getId()); - searchNumCfg.setEditTime(date); - if(resultCfg.getNumCfg()==null){ - Map map=new HashMap(); - map.put(info.getTableName(), searchNumCfg); - resultCfg.setNumCfg(map); - }else{ - Map map=resultCfg.getNumCfg(); - map.put(info.getTableName(), searchNumCfg); - } - }else if(Constants.TABLE_TYPE_COMPLEX==type){ - ComplexkeywordCfg searchComplexCfg=new ComplexkeywordCfg(); - searchComplexCfg.setTableName(info.getTableName()); - searchComplexCfg.setCompileId(compileId); - searchComplexCfg.setIsValid(Constants.VALID_DEL); - searchComplexCfg.setIsAudit(Constants.AUDIT_NOT_YET); - searchComplexCfg.setEditorId(cfg.getCurrentUser().getId()); - searchComplexCfg.setEditTime(date); - if(resultCfg.getComplexCfg()==null){ - Map map=new HashMap(); - map.put(info.getTableName(), searchComplexCfg); - resultCfg.setComplexCfg(map); - }else{ - Map map=resultCfg.getComplexCfg(); - map.put(info.getTableName(), searchComplexCfg); +// String mainTableType=cfg.getMainTableType(); +// model.addAttribute("mainTableType", mainTableType); +// model.addAttribute("mainTableDesc", cfg.getMainTableDesc()); +// resultCfg.setMainTableType(mainTableType); +// resultCfg.setMainTableDesc(cfg.getMainTableDesc()); + try{ + List delIpCfgs=new ArrayList<>(); + List delStringCfgs=new ArrayList<>(); + List delNumCfgs=new ArrayList<>(); + List delComplexCfgs=new ArrayList<>(); + Date date=new Date(); + if(StringUtils.isNotBlank(ids)){ + List serviceConfigInfos=serviceConfigInfoService.findList(serviceId); + for(String compileIdStr: ids.split(",")){ + for(ServiceConfigInfo info:serviceConfigInfos){ + int type=info.getTableType(); + if(Constants.TABLE_TYPE_IP==type){ + BaseIpCfg searchIpCfg=new BaseIpCfg(); + setDelProps(date,Integer.parseInt(compileIdStr),info,searchIpCfg); + delIpCfgs.add(searchIpCfg); + }else if(Constants.TABLE_TYPE_STRING==type){ + BaseStringCfg searchStringCfg=new BaseStringCfg(); + setDelProps(date,Integer.parseInt(compileIdStr),info,searchStringCfg); + delStringCfgs.add(searchStringCfg); + }else if(Constants.TABLE_TYPE_NUMBER==type){ + NumBoundaryCfg searchNumCfg=new NumBoundaryCfg(); + setDelProps(date,Integer.parseInt(compileIdStr),info,searchNumCfg); + delNumCfgs.add(searchNumCfg); + }else if(Constants.TABLE_TYPE_COMPLEX==type){ + ComplexkeywordCfg searchComplexCfg=new ComplexkeywordCfg(); + setDelProps(date,Integer.parseInt(compileIdStr),info,searchComplexCfg); + delComplexCfgs.add(searchComplexCfg); + } + } + AreaIpCfg searchAreaCfg=new AreaIpCfg(); + setDelProps(date,Integer.parseInt(compileIdStr),null,searchAreaCfg); + delIpCfgs.add(searchAreaCfg); } } - } - try{ - multipleCfgService.deleteCfg(resultCfg); + multipleCfgService.deleteCfg(delIpCfgs,delStringCfgs,delNumCfgs,delComplexCfgs); }catch (Exception e) { logger.error("删除失败"); addMessage(model,"delete_failed"); @@ -707,7 +666,8 @@ public class MultipleCfgController extends BaseController{ * @since 1.0.0 */ @RequestMapping(value = {"saveOrUpdateCfg"}) - public String saveOrUpdateCfg(String operator,String cfgName,Model model, MultipleCfg cfg) { + @RequiresPermissions(value={"cfg:multiple:add","cfg:multiple:edit"},logical=Logical.OR) + public String saveOrUpdateCfg(String operator,String cfgName,Model model, MultipleCfg cfg,String areaCfgIds) { model.addAttribute("cfgName",cfgName); model.addAttribute("action",cfg.getAction()); model.addAttribute("cfgType", "multiple"); @@ -720,6 +680,38 @@ public class MultipleCfgController extends BaseController{ model.addAttribute("serviceId",serviceId); model.addAttribute("action",cfg.getAction()); try{ + List areaCfg=cfg.getAreaCfg(); + List areaIsps=cfg.getAreaIsp(); + if(Constants.IS_AREA_EFFECTIVE_NO==cfg.getIsAreaEffective()){ + cfg.setAreaEffectiveIds(""); + cfg.setAreaType(null); + }else if(Constants.IS_AREA_EFFECTIVE_YES==cfg.getIsAreaEffective()){ + if(Constants.AREA_EFFECTIVE_TYPE_AREA_ISP==cfg.getAreaType()&&areaIsps!=null&&areaIsps.size()>0){ + StringBuffer areaEffectiveIds=new StringBuffer(); + for(int i=0;i0){ + cfg.setAreaEffectiveIds(""); + }else{ + logger.error("区域管控,但是地域+ISP以及地域IP全部为空!"); + addMessage(model,"save_failed"); + return "/cfg/resultPage"; + } + } List serviceConfigInfos=serviceConfigInfoService.findList(cfg.getServiceId()); List deleteCfg=new ArrayList<>(); Integer compileId=0; @@ -747,7 +739,7 @@ public class MultipleCfgController extends BaseController{ } } } - }else{//表单没有提交IP配置,但是根据编译ID却查到了IP配置,说明用户选择删除IP配置 + }else if("update".equals(operator)){//表单没有提交IP配置,但是根据编译ID却查到了IP配置,说明用户选择删除IP配置 BaseIpCfg entity=new BaseIpCfg(); entity.setTableName(info.getTableName()); entity.setCompileId(compileId); @@ -775,6 +767,15 @@ public class MultipleCfgController extends BaseController{ } } } + }else if("update".equals(operator)){//表单没有提交配置,但是根据编译ID却查到了配置,说明用户选择删除配置 + BaseStringCfg entity=new BaseStringCfg(); + entity.setTableName(info.getTableName()); + entity.setCompileId(compileId); + BaseStringCfg resultString=stringCfgService.get(entity); + if(resultString!=null){ + resultString.setTableName(info.getTableName()); + deleteCfg.add(resultString); + } } }else if(Constants.TABLE_TYPE_NUMBER==info.getTableType()){ if(cfg.getNumCfg()!=null){ @@ -794,6 +795,15 @@ public class MultipleCfgController extends BaseController{ } } } + }else if("update".equals(operator)){//表单没有提交配置,但是根据编译ID却查到了配置,说明用户选择删除配置 + NumBoundaryCfg entity=new NumBoundaryCfg(); + entity.setTableName(info.getTableName()); + entity.setCompileId(compileId); + NumBoundaryCfg resultString=numCfgService.get(entity); + if(resultString!=null){ + resultString.setTableName(info.getTableName()); + deleteCfg.add(resultString); + } } }else if(Constants.TABLE_TYPE_COMPLEX==info.getTableType()){ if(cfg.getComplexCfg()!=null){ @@ -814,13 +824,85 @@ public class MultipleCfgController extends BaseController{ } } + }else if("update".equals(operator)){//表单没有提交配置,但是根据编译ID却查到了配置,说明用户选择删除配置 + ComplexkeywordCfg entity=new ComplexkeywordCfg(); + entity.setTableName(info.getTableName()); + entity.setCompileId(compileId); + ComplexkeywordCfg resultString=complexStringCfgService.get(entity); + if(resultString!=null){ + resultString.setTableName(info.getTableName()); + deleteCfg.add(resultString); + } } } } if("save".equals(operator)){ + if(Constants.IS_AREA_EFFECTIVE_YES==cfg.getIsAreaEffective()&&areaCfg!=null){ + for(AreaIpCfg area:areaCfg){ + area.setTableName(AreaIpCfg.getTablename()); + area.setCompileId(compileId); + area.setIsValid(Constants.VALID_NO); + area.setIsAudit(Constants.AUDIT_NOT_YET); + area.setCreatorId(cfg.getCurrentUser().getId()); + area.setCreateTime(date); + setProperties(cfg,area); + } + } multipleCfgService.addCfg(cfg); }else if("update".equals(operator)){ - multipleCfgService.updateCfg(cfg,deleteCfg); + List updateAreaCfg=new ArrayList<>(); + List deleteAreaCfg=new ArrayList<>(); + List addAreaCfg=new ArrayList<>(); + String[] cfgIds=null; + if(!StringUtils.isBlank(areaCfgIds)){ + cfgIds=areaCfgIds.split(","); + } + if(Constants.IS_AREA_EFFECTIVE_YES==cfg.getIsAreaEffective()&&areaCfg!=null){ + for(AreaIpCfg area:areaCfg){ + area.setTableName(AreaIpCfg.getTablename()); + area.setCompileId(compileId); + area.setIsValid(Constants.VALID_NO); + area.setIsAudit(Constants.AUDIT_NOT_YET); + setProperties(cfg,area); + if(area.getCfgId()==null){ + area.setCreatorId(cfg.getCurrentUser().getId()); + area.setCreateTime(date); + addAreaCfg.add(area); + }else if(cfgIds!=null){ + area.setEditorId(cfg.getCurrentUser().getId()); + area.setEditTime(date); + boolean contains=false; + for(String cfgId:cfgIds){ + if(!StringUtils.isBlank(cfgId)&&area.getCfgId().longValue()==Long.parseLong(cfgId)){ + contains=true; + break; + } + } + if(contains){ + updateAreaCfg.add(area); + }else{ + deleteAreaCfg.add(area); + } + } + + } + }else{ + if(cfgIds!=null){ + for(String cfgId:cfgIds){ + if(!StringUtils.isBlank(cfgId)){ + AreaIpCfg area=new AreaIpCfg(); + area.setTableName(AreaIpCfg.getTablename()); + area.setIsValid(Constants.VALID_DEL); + area.setCfgId(Long.parseLong(cfgId)); + area.setEditorId(cfg.getCurrentUser().getId()); + area.setEditTime(date); + deleteAreaCfg.add(area); + + } + } + } + } + multipleCfgService.updateCfg(cfg,deleteCfg,addAreaCfg,updateAreaCfg,deleteAreaCfg); } addMessage(model,"save_success"); }catch (Exception e) { @@ -840,215 +922,187 @@ public class MultipleCfgController extends BaseController{ * @exception * @since 1.0.0 */ - @RequestMapping(value = {"auditCfg"}) - public String auditCfg(String cfgName,MultipleCfg cfg,Model model) { + @RequestMapping(value = {"audit"}) + @RequiresPermissions(value={"cfg:multiple:audit"}) + public String auditCfg(String cfgName,int isAudit,int serviceId,int action,String mainTable,String ids,Model model) { model.addAttribute("cfgName", cfgName); model.addAttribute("audit", Constants.AUDIT_PAGE); model.addAttribute("cfgType", "multiple"); - model.addAttribute("serviceId", cfg.getServiceId()); - model.addAttribute("action", cfg.getAction()); - model.addAttribute("mainTable", cfg.getMainTable()); - int compileId=cfg.getCompileId().intValue(); - int audit=cfg.getIsAudit(); + model.addAttribute("serviceId", serviceId); + model.addAttribute("action", action); + model.addAttribute("mainTable", mainTable); try{ - MultipleCfg resultCfg=new MultipleCfg(); - MultipleCfg searchCfg=new MultipleCfg(); - searchCfg.setIsAudit(cfg.getIsAudit()); - List serviceConfigInfos=serviceConfigInfoService.findList(cfg.getServiceId()); - Date date=new Date(); - for(ServiceConfigInfo info:serviceConfigInfos){ - int type=info.getTableType(); - String tableName=info.getTableName(); - if(cfg.getMainTable().equals(tableName)){ - model.addAttribute("mainTableType", String.valueOf(type)); - model.addAttribute("mainTableDesc", info.getTableDesc()); + List infos=serviceConfigInfoService.findList(serviceId); + List auduitIpCfgs=new ArrayList<>(); + List auduitStringCfgs=new ArrayList<>(); + List auduitNumCfgs=new ArrayList<>(); + List auduitComplexCfgs=new ArrayList<>(); + List sendCfgList=new ArrayList<>(); + Date date=new Date(); + if(StringUtils.isNotBlank(ids)){ + for(String compileIdStr:ids.split(",")){ + MultipleCfg resultCfg=new MultipleCfg(); + int compileId=Integer.parseInt(compileIdStr); + for(ServiceConfigInfo info:infos){ + int type=info.getTableType(); + String tableName=info.getTableName(); + if(Constants.TABLE_TYPE_IP==type){ + BaseIpCfg searchCfg=new BaseIpCfg(); + searchCfg.setTableName(tableName); + searchCfg.setCompileId(compileId); + //根据表名,编译ID查询唯一结果 + BaseIpCfg _resultCfg=ipCfgService.get(searchCfg); + if(_resultCfg!=null){ + resultCfg.setMaatTable(info.getMaatTable()); + searchCfg.setAuditorId(searchCfg.getCurrentUser().getId()); + searchCfg.setAuditTime(date); + searchCfg.setCfgId(_resultCfg.getCfgId()); + searchCfg.setIsAudit(isAudit); + if(isAudit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 + searchCfg.setIsValid(Constants.VALID_NO); + _resultCfg.setIsValid(Constants.VALID_NO); + }else if(isAudit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 + searchCfg.setIsValid(Constants.VALID_YES); + _resultCfg.setIsValid(Constants.VALID_YES); + } + //更新gwall库表数据 + auduitIpCfgs.add(searchCfg); + //传入maat数据 + if(_resultCfg!=null){ + if(resultCfg.getIpCfg()==null){ + Map map=new HashMap(); + map.put(tableName, _resultCfg); + resultCfg.setIpCfg(map); + }else{ + Map map=resultCfg.getIpCfg(); + map.put(tableName, _resultCfg); + } + } + } + }else if(Constants.TABLE_TYPE_STRING==type){ + BaseStringCfg searchCfg=new BaseStringCfg(); + searchCfg.setTableName(tableName); + searchCfg.setCompileId(compileId); + //根据表名,编译ID查询唯一结果 + BaseStringCfg _resultCfg=stringCfgService.get(searchCfg); + if(_resultCfg!=null){ + _resultCfg.setMaatTable(info.getMaatTable()); + searchCfg.setAuditorId(searchCfg.getCurrentUser().getId()); + searchCfg.setAuditTime(date); + searchCfg.setCfgId(_resultCfg.getCfgId()); + searchCfg.setIsAudit(isAudit); + if(isAudit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 + searchCfg.setIsValid(Constants.VALID_NO); + _resultCfg.setIsValid(Constants.VALID_NO); + }else if(isAudit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 + searchCfg.setIsValid(Constants.VALID_YES); + _resultCfg.setIsValid(Constants.VALID_YES); + } + //更新gwall库表数据 + auduitStringCfgs.add(searchCfg); + //传入maat数据 + if(_resultCfg!=null){ + if(resultCfg.getStringCfg()==null){ + Map map=new HashMap(); + map.put(tableName, _resultCfg); + resultCfg.setStringCfg(map); + }else{ + Map map=resultCfg.getStringCfg(); + map.put(tableName, _resultCfg); + } + } + } + }else if(Constants.TABLE_TYPE_NUMBER==type){ + NumBoundaryCfg searchCfg=new NumBoundaryCfg(); + searchCfg.setTableName(tableName); + searchCfg.setCompileId(compileId); + //根据表名,编译ID查询唯一结果 + NumBoundaryCfg _resultCfg=numCfgService.get(searchCfg); + if(_resultCfg!=null){ + _resultCfg.setMaatTable(info.getMaatTable()); + searchCfg.setAuditorId(searchCfg.getCurrentUser().getId()); + searchCfg.setAuditTime(date); + searchCfg.setCfgId(_resultCfg.getCfgId()); + searchCfg.setIsAudit(isAudit); + if(isAudit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 + searchCfg.setIsValid(Constants.VALID_NO); + _resultCfg.setIsValid(Constants.VALID_NO); + }else if(isAudit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 + searchCfg.setIsValid(Constants.VALID_YES); + _resultCfg.setIsValid(Constants.VALID_YES); + } + //更新gwall库表数据 + auduitNumCfgs.add(searchCfg); + //传入maat数据 + if(_resultCfg!=null){ + if(resultCfg.getNumCfg()==null){ + Map map=new HashMap(); + map.put(tableName, _resultCfg); + resultCfg.setNumCfg(map); + }else{ + Map map=resultCfg.getNumCfg(); + map.put(tableName, _resultCfg); + } + } + } + }else if(Constants.TABLE_TYPE_COMPLEX==type){ + ComplexkeywordCfg searchCfg=new ComplexkeywordCfg(); + searchCfg.setTableName(tableName); + searchCfg.setCompileId(compileId); + //根据表名,编译ID查询唯一结果 + ComplexkeywordCfg _resultCfg=complexStringCfgService.get(searchCfg); + if(_resultCfg!=null){ + _resultCfg.setMaatTable(info.getMaatTable()); + searchCfg.setAuditorId(searchCfg.getCurrentUser().getId()); + searchCfg.setAuditTime(date); + searchCfg.setCfgId(_resultCfg.getCfgId()); + searchCfg.setIsAudit(isAudit); + if(isAudit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 + searchCfg.setIsValid(Constants.VALID_NO); + _resultCfg.setIsValid(Constants.VALID_NO); + }else if(isAudit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 + searchCfg.setIsValid(Constants.VALID_YES); + _resultCfg.setIsValid(Constants.VALID_YES); + } + //更新gwall库表数据 + auduitComplexCfgs.add(searchCfg); + //传入maat数据 + if(_resultCfg!=null){ + if(resultCfg.getComplexCfg()==null){ + Map map=new HashMap(); + map.put(tableName, _resultCfg); + resultCfg.setComplexCfg(map); + }else{ + Map map=resultCfg.getComplexCfg(); + map.put(tableName, _resultCfg); + } + } + } + } + } + //查询区域Ip + List areaCfgs=ipCfgService.getAreaCfgByCompileId(compileId); + for(AreaIpCfg areaCfg:areaCfgs){ + areaCfg.setTableName(AreaIpCfg.getTablename()); + areaCfg.setMaatTable(AreaIpCfg.getMaattable()); + areaCfg.setAuditorId(areaCfg.getCurrentUser().getId()); + areaCfg.setAuditTime(date); + areaCfg.setIsAudit(isAudit); + if(isAudit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 + areaCfg.setIsValid(Constants.VALID_NO); + }else if(isAudit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 + areaCfg.setIsValid(Constants.VALID_YES); + } + } + resultCfg.setAreaCfg(areaCfgs); + //发送Maat集合 + sendCfgList.add(resultCfg); + } + } - if(Constants.TABLE_TYPE_IP==type){ - BaseIpCfg searchIpCfg=new BaseIpCfg(); - searchIpCfg.setTableName(tableName); - searchIpCfg.setCompileId(compileId); - //根据表名,编译ID查询唯一结果 - BaseIpCfg resultIpCfg=ipCfgService.get(searchIpCfg); - if(resultIpCfg!=null){ - searchIpCfg.setAuditorId(searchIpCfg.getCurrentUser().getId()); - searchIpCfg.setAuditTime(date); - searchIpCfg.setCfgId(resultIpCfg.getCfgId()); - searchIpCfg.setIsAudit(audit); - if(audit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 - searchIpCfg.setIsValid(Constants.VALID_NO); - if(resultIpCfg!=null){ - resultIpCfg.setIsValid(Constants.VALID_NO); - resultIpCfg.setMaatTable(info.getMaatTable()); - } - }else if(audit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 - searchIpCfg.setIsValid(Constants.VALID_YES); - if(resultIpCfg!=null){ - resultIpCfg.setIsValid(Constants.VALID_YES); - resultIpCfg.setMaatTable(info.getMaatTable()); - } - } - //更新gwall库表数据 - if(searchCfg.getIpCfg()==null){ - Map map=new HashMap(); - map.put(tableName, searchIpCfg); - searchCfg.setIpCfg(map); - }else{ - Map map=searchCfg.getIpCfg(); - map.put(tableName, searchIpCfg); - } - //传入maat数据 - if(resultIpCfg!=null){ - if(resultCfg.getIpCfg()==null){ - Map map=new HashMap(); - map.put(tableName, resultIpCfg); - resultCfg.setIpCfg(map); - }else{ - Map map=resultCfg.getIpCfg(); - map.put(tableName, resultIpCfg); - } - } - } - }else if(Constants.TABLE_TYPE_STRING==type){ - BaseStringCfg searchStringCfg=new BaseStringCfg(); - searchStringCfg.setTableName(tableName); - searchStringCfg.setCompileId(compileId); - //根据表名,编译ID查询唯一结果 - BaseStringCfg resultStringCfg=stringCfgService.get(searchStringCfg); - if(resultStringCfg!=null){ - searchStringCfg.setAuditorId(searchStringCfg.getCurrentUser().getId()); - searchStringCfg.setAuditTime(date); - searchStringCfg.setCfgId(resultStringCfg.getCfgId()); - searchStringCfg.setIsAudit(audit); - if(audit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 - searchStringCfg.setIsValid(Constants.VALID_NO); - if(resultStringCfg!=null){ - resultStringCfg.setIsValid(Constants.VALID_NO); - resultStringCfg.setMaatTable(info.getMaatTable()); - } - }else if(audit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 - searchStringCfg.setIsValid(Constants.VALID_YES); - if(resultStringCfg!=null){ - resultStringCfg.setIsValid(Constants.VALID_YES); - resultStringCfg.setMaatTable(info.getMaatTable()); - } - } - //更新gwall库表数据 - if(searchCfg.getStringCfg()==null){ - Map map=new HashMap(); - map.put(tableName, searchStringCfg); - searchCfg.setStringCfg(map); - }else{ - Map map=searchCfg.getStringCfg(); - map.put(tableName, searchStringCfg); - } - //传入maat数据 - if(resultStringCfg!=null){ - if(resultCfg.getStringCfg()==null){ - Map map=new HashMap(); - map.put(tableName, resultStringCfg); - resultCfg.setStringCfg(map); - }else{ - Map map=resultCfg.getStringCfg(); - map.put(tableName, resultStringCfg); - } - } - } - }else if(Constants.TABLE_TYPE_NUMBER==type){ - NumBoundaryCfg searchNumCfg=new NumBoundaryCfg(); - searchNumCfg.setTableName(tableName); - searchNumCfg.setCompileId(compileId); - NumBoundaryCfg resultNumCfg=numCfgService.get(searchNumCfg); - if(resultNumCfg!=null){ - searchNumCfg.setAuditorId(searchNumCfg.getCurrentUser().getId()); - searchNumCfg.setAuditTime(date); - searchNumCfg.setCfgId(resultNumCfg.getCfgId()); - searchNumCfg.setIsAudit(audit); - if(audit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 - searchNumCfg.setIsValid(Constants.VALID_NO); - if(resultNumCfg!=null){ - resultNumCfg.setIsValid(Constants.VALID_NO); - resultNumCfg.setMaatTable(info.getMaatTable()); - } - }else if(audit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 - searchNumCfg.setIsValid(Constants.VALID_YES); - if(resultNumCfg!=null){ - resultNumCfg.setIsValid(Constants.VALID_YES); - resultNumCfg.setMaatTable(info.getMaatTable()); - } - } - //更新gwall库表数据 - if(searchCfg.getNumCfg()==null){ - Map map=new HashMap(); - map.put(tableName, searchNumCfg); - searchCfg.setNumCfg(map); - }else{ - Map map=searchCfg.getNumCfg(); - map.put(tableName, searchNumCfg); - } - //传入maat数据 - if(resultNumCfg!=null){ - if(resultCfg.getNumCfg()==null){ - Map map=new HashMap(); - map.put(tableName, resultNumCfg); - resultCfg.setNumCfg(map); - }else{ - Map map=resultCfg.getNumCfg(); - map.put(tableName, resultNumCfg); - } - } - } - }else if(Constants.TABLE_TYPE_COMPLEX==type){ - ComplexkeywordCfg searchComplexCfg=new ComplexkeywordCfg(); - searchComplexCfg.setTableName(tableName); - searchComplexCfg.setCompileId(compileId); - ComplexkeywordCfg resultComplexCfg=complexStringCfgService.get(searchComplexCfg); - if(resultComplexCfg!=null){ - searchComplexCfg.setAuditorId(searchComplexCfg.getCurrentUser().getId()); - searchComplexCfg.setAuditTime(date); - searchComplexCfg.setCfgId(resultComplexCfg.getCfgId()); - searchComplexCfg.setIsAudit(audit); - if(audit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 - searchComplexCfg.setIsValid(Constants.VALID_NO); - if(resultComplexCfg!=null){ - resultComplexCfg.setIsValid(Constants.VALID_NO); - resultComplexCfg.setMaatTable(info.getMaatTable()); - } - }else if(audit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 - searchComplexCfg.setIsValid(Constants.VALID_YES); - if(resultComplexCfg!=null){ - resultComplexCfg.setIsValid(Constants.VALID_YES); - resultComplexCfg.setMaatTable(info.getMaatTable()); - } - } - //更新gwall库表数据 - if(searchCfg.getComplexCfg()==null){ - Map map=new HashMap(); - map.put(tableName, searchComplexCfg); - searchCfg.setComplexCfg(map); - }else{ - Map map=searchCfg.getComplexCfg(); - map.put(tableName, searchComplexCfg); - } - //传入maat数据 - if(resultComplexCfg!=null){ - if(resultCfg.getComplexCfg()==null){ - Map map=new HashMap(); - map.put(tableName, resultComplexCfg); - resultCfg.setComplexCfg(map); - }else{ - Map map=resultCfg.getComplexCfg(); - map.put(tableName, resultComplexCfg); - } - } - } - } - } - boolean result=multipleCfgService.auditCfg(resultCfg,searchCfg); - if(!result){ - addMessage(model,"audit_failed"); - }else{ + multipleCfgService.auditCfg(isAudit,sendCfgList,auduitIpCfgs, + auduitStringCfgs,auduitNumCfgs,auduitComplexCfgs); addMessage(model,"audit_success"); - } }catch (Exception e) { logger.error("审核失败",e); addMessage(model,"audit_failed"); @@ -1183,4 +1237,16 @@ public class MultipleCfgController extends BaseController{ target.setPageNo(source.getPageNo()); target.setPageSize(source.getPageSize()); } + protected void setDelProps(Date date,int compileId,ServiceConfigInfo info,BaseCfg cfg){ + if(cfg instanceof AreaIpCfg){ + cfg.setTableName(AreaIpCfg.getTablename()); + }else{ + cfg.setTableName(info.getTableName()); + } + cfg.setCompileId(compileId); + cfg.setIsValid(Constants.VALID_DEL); + cfg.setIsAudit(Constants.AUDIT_NOT_YET); + cfg.setEditorId(cfg.getCurrentUser().getId()); + cfg.setEditTime(date); + } } diff --git a/src/main/java/com/nis/web/controller/configuration/NumCfgController.java b/src/main/java/com/nis/web/controller/configuration/NumCfgController.java index 31066dad7..0123dd3a2 100644 --- a/src/main/java/com/nis/web/controller/configuration/NumCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/NumCfgController.java @@ -1,6 +1,5 @@ package com.nis.web.controller.configuration; import java.util.Date; -import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -12,9 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.nis.domain.Page; import com.nis.domain.ServiceConfigInfo; -import com.nis.domain.basics.ServiceDictInfo; import com.nis.domain.configuration.NumBoundaryCfg; -import com.nis.domain.configuration.RequestInfo; import com.nis.main.ConvertTool; import com.nis.util.Constants; import com.nis.web.controller.BaseController; @@ -136,8 +133,8 @@ public class NumCfgController extends BaseController{ * @exception * @since 1.0.0 */ - @RequestMapping(value = {"auditCfg"}) - public String auditStringCfg(String cfgName,NumBoundaryCfg cfg,Model model) { + @RequestMapping(value = {"audit"}) + public String auditCfg(String cfgName,NumBoundaryCfg cfg,Model model) { model.addAttribute("cfgName", cfgName); model.addAttribute("audit", Constants.AUDIT_PAGE); model.addAttribute("cfgType","num"); @@ -190,8 +187,8 @@ public class NumCfgController extends BaseController{ * @exception * @since 1.0.0 */ - @RequestMapping(value = {"deleteCfg"}) - public String deleteStringCfg(int action,long cfgId,String cfgName,Integer serviceId,Model model) { + @RequestMapping(value = {"delete"}) + public String deleteCfg(int action,long cfgId,String cfgName,Integer serviceId,Model model) { model.addAttribute("serviceId", serviceId); model.addAttribute("cfgName", cfgName); model.addAttribute("action", action); diff --git a/src/main/java/com/nis/web/controller/configuration/StringCfgController.java b/src/main/java/com/nis/web/controller/configuration/StringCfgController.java index efed1820a..18156408c 100644 --- a/src/main/java/com/nis/web/controller/configuration/StringCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/StringCfgController.java @@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.nis.domain.Page; import com.nis.domain.ServiceConfigInfo; import com.nis.domain.configuration.AreaIpCfg; +import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.BaseStringCfg; import com.nis.util.Constants; import com.nis.web.controller.BaseController; @@ -221,13 +222,15 @@ public class StringCfgController extends BaseController{ if(StringUtils.isNotBlank(ids)){ List beans=stringCfgService.getList(tableName,ids); List auditBeans=new ArrayList<>(); - List auditAreaBeans=new ArrayList<>(); + List auditAreaBeans=new ArrayList<>(); Date date=new Date(); for(BaseStringCfg bean:beans){ BaseStringCfg auditBean=new BaseStringCfg(); auditBean.setTableName(tableName); + auditBean.setMaatTable(maatTable); auditBean.setCfgId(bean.getCfgId()); bean.setTableName(tableName); + bean.setMaatTable(maatTable); int audit=bean.getIsAudit().intValue(); if(audit==Constants.AUDIT_YES&&isAudit!=Constants.AUDIT_NOT_YES){ logger.error("审核通过的配置只能取消审核通过!"); @@ -242,18 +245,23 @@ public class StringCfgController extends BaseController{ bean.setIsAudit(isAudit); if(isAudit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 auditBean.setIsValid(Constants.VALID_NO); - auditBean.setMaatTable(maatTable); bean.setIsValid(Constants.VALID_NO); - bean.setMaatTable(maatTable); }else if(isAudit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 auditBean.setIsValid(Constants.VALID_YES); - auditBean.setMaatTable(maatTable); bean.setIsValid(Constants.VALID_YES); - bean.setMaatTable(maatTable); } List areaCfg=ipCfgService.getAreaCfgByCompileId(bean.getCompileId()); for(AreaIpCfg c:areaCfg){ + c.setMaatTable(AreaIpCfg.getMaattable()); c.setTableName(AreaIpCfg.getTablename()); + c.setAuditorId(c.getCurrentUser().getId()); + c.setAuditTime(date); + c.setIsAudit(isAudit); + if(isAudit==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0 + c.setIsValid(Constants.VALID_NO); + }else if(isAudit==Constants.AUDIT_YES){//审核通过,设置有效标志为1 + c.setIsValid(Constants.VALID_YES); + } } bean.setAreaCfg(areaCfg); auditAreaBeans.addAll(areaCfg); @@ -297,7 +305,7 @@ public class StringCfgController extends BaseController{ } model.addAttribute("tableName", tableName); List stringCfgs=new ArrayList(); - List areaCfgs=new ArrayList(); + List areaCfgs=new ArrayList(); Date date =new Date(); if(StringUtils.isNotBlank(ids)){ for(String compileIdStr:ids.split(",")){ diff --git a/src/main/java/com/nis/web/dao/configuration/ComplexStringCfgDao.java b/src/main/java/com/nis/web/dao/configuration/ComplexStringCfgDao.java index 57d3366e7..22fff4855 100644 --- a/src/main/java/com/nis/web/dao/configuration/ComplexStringCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/ComplexStringCfgDao.java @@ -20,7 +20,7 @@ public interface ComplexStringCfgDao extends CrudDao{ public List getList(@Param("tableName")String tableName,@Param("ids")String ids) ; public List findList(ComplexkeywordCfg entity) ; public int insert(ComplexkeywordCfg entity) ; - public int updateByPrimaryKeySelective(ComplexkeywordCfg entity) ; + public int update(ComplexkeywordCfg entity) ; public int updateValid(ComplexkeywordCfg entity) ; public int audit(ComplexkeywordCfg entity) ; public int getIsValid(@Param("tableName")String tableName,@Param("cfgId")Long id); diff --git a/src/main/java/com/nis/web/dao/configuration/ComplexStringCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/ComplexStringCfgDao.xml index 55080ca4c..0c4032723 100644 --- a/src/main/java/com/nis/web/dao/configuration/ComplexStringCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/ComplexStringCfgDao.xml @@ -325,7 +325,7 @@ ) - + update ${tableName} diff --git a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.java b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.java index 48b2c22c0..dee190703 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.java @@ -20,7 +20,7 @@ public interface IpCfgDao extends CrudDao{ public List findList(BaseIpCfg entity) ; public List getList(@Param("tableName")String tableName,@Param("ids")String ids) ; public int insert(BaseIpCfg entity) ; - public int updateByPrimaryKeySelective(BaseIpCfg entity) ; + public int update(BaseIpCfg entity) ; public int updateValid(BaseIpCfg entity) ; public int audit(BaseIpCfg entity) ; public int getIsValid(@Param("tableName")String tableName,@Param("cfgId")Long id); diff --git a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml index bc09e7a84..ae985a63f 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml @@ -441,7 +441,7 @@ ) - + update ${tableName} diff --git a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.java b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.java index 61357ba4f..781caa59e 100644 --- a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.java @@ -19,7 +19,7 @@ public interface StringCfgDao extends CrudDao{ public BaseStringCfg get(BaseStringCfg entity) ; public List findList(BaseStringCfg entity) ; public int insert(BaseStringCfg entity) ; - public int updateByPrimaryKeySelective(BaseStringCfg entity) ; + public int update(BaseStringCfg entity) ; public int updateValid(BaseStringCfg entity) ; public int audit(BaseStringCfg entity) ; public int getIsValid(@Param("tableName")String tableName,@Param("cfgId")Long id); diff --git a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml index 822e83e87..51786b3a5 100644 --- a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml @@ -341,7 +341,7 @@ ) - + update ${tableName} diff --git a/src/main/java/com/nis/web/service/CrudService.java b/src/main/java/com/nis/web/service/CrudService.java index f186712df..f5a7ccd97 100644 --- a/src/main/java/com/nis/web/service/CrudService.java +++ b/src/main/java/com/nis/web/service/CrudService.java @@ -138,7 +138,7 @@ public abstract class CrudService, T extends BaseEntity> * @exception * @since 1.0.0 */ - public void saveIpBatch(List areaIpCfgs) { + public void saveIpBatch(List areaIpCfgs) { SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); SqlSession batchSqlSession = null; try{ @@ -189,7 +189,7 @@ public abstract class CrudService, T extends BaseEntity> * @exception * @since 1.0.0 */ - public void updateIpBatch(List areaCfg) { + public void updateIpBatch(List areaCfg) { SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); SqlSession batchSqlSession = null; try{ @@ -267,7 +267,7 @@ public abstract class CrudService, T extends BaseEntity> * @exception * @since 1.0.0 */ - public void auditIpBatch(List data) { + public void auditIpBatch(List data) { SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); SqlSession batchSqlSession = null; try{ @@ -292,7 +292,7 @@ public abstract class CrudService, T extends BaseEntity> * @exception * @since 1.0.0 */ - public void deleteIpBatch(List data) { + public void deleteIpBatch(List data) { SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); SqlSession batchSqlSession = null; try{ @@ -320,7 +320,7 @@ public abstract class CrudService, T extends BaseEntity> * @exception * @since 1.0.0 */ - public boolean sendToMaatConvertorBatch(int operation,List cfgs) throws Exception{ + public boolean sendToMaatConvertorBatch(int operation,List> cfgs) throws Exception{ if(cfgs==null){ throw new RuntimeException("转换出错,配置为空"); } @@ -330,7 +330,7 @@ public abstract class CrudService, T extends BaseEntity> .create(); if(Constants.AUDIT_NOT_YES==operation){ List beans=new ArrayList(); - for(BaseCfg[] cfg:cfgs){ + for(List cfg:cfgs){ ToMaatUnAuditBean toMaatUnAuditBean=new ToMaatUnAuditBean(); toMaatUnAuditBean.setServiceCfg(new ArrayList()); for(BaseCfg c:cfg){ @@ -364,7 +364,7 @@ public abstract class CrudService, T extends BaseEntity> return new ConvertTool().setConfigInValid(json); }else{ List beans=new ArrayList(); - for(BaseCfg[] cfg:cfgs){ + for(List cfg:cfgs){ int compileId=0; ToMaatBean toMaatBean=new ToMaatBean(); toMaatBean.setServiceCfg(new ArrayList()); @@ -491,7 +491,7 @@ public abstract class CrudService, T extends BaseEntity> } } toMaatBean.getServiceCfg().add(maatCfg); - BaseCfg baseCfg=(BaseCfg)cfg[0]; + BaseCfg baseCfg=cfg.get(0); if(compileId==0){ throw new RuntimeException("转换出错,未获取到正确的compileId"); }else{ 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 fba38a2b9..3443672cf 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -1,13 +1,9 @@ package com.nis.web.service.configuration; -import java.lang.annotation.Annotation; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.Map; -import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -18,10 +14,9 @@ import com.nis.domain.Page; import com.nis.domain.ServiceConfigInfo; import com.nis.domain.configuration.AppComplexKeywordCfg; import com.nis.domain.configuration.AppIdCfg; -import com.nis.domain.configuration.AppStringCfg; -import com.nis.domain.configuration.AreaIpCfg; -import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.AppIdCfg.AppFeaturesIndex; +import com.nis.domain.configuration.AppStringCfg; +import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.maat.AppMaatCfg; import com.nis.domain.specific.ConfigGroupInfo; import com.nis.domain.specific.SpecificServiceCfg; @@ -212,7 +207,7 @@ public class AppCfgService extends CrudService { c.setIsValid(cfg.getIsValid()); complexStringCfgDao.insert(c); }else{ - complexStringCfgDao.updateByPrimaryKeySelective(c); + complexStringCfgDao.update(c); } @@ -248,7 +243,7 @@ public class AppCfgService extends CrudService { s.setIsValid(cfg.getIsValid()); stringCfgDao.insert(s); }else{ - stringCfgDao.updateByPrimaryKeySelective(s); + stringCfgDao.update(s); } } diff --git a/src/main/java/com/nis/web/service/configuration/ComplexStringCfgService.java b/src/main/java/com/nis/web/service/configuration/ComplexStringCfgService.java index 9487f23ee..f8a1d69d4 100644 --- a/src/main/java/com/nis/web/service/configuration/ComplexStringCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/ComplexStringCfgService.java @@ -36,7 +36,7 @@ public class ComplexStringCfgService extends CrudService areaIpCfgs){ + public int addStringCfg(ComplexkeywordCfg cfg,List areaIpCfgs){ if(areaIpCfgs!=null&&areaIpCfgs.size()>0){ this.saveIpBatch(areaIpCfgs); } @@ -53,7 +53,7 @@ public class ComplexStringCfgService extends CrudService addAreaCfg,List updateAreaCfg,List deleteAreaCfgs){ + public int updateStringCfg(ComplexkeywordCfg cfg,List addAreaCfg,List updateAreaCfg,List deleteAreaCfgs){ if(addAreaCfg!=null&&addAreaCfg.size()>0){ this.saveIpBatch(addAreaCfg); } @@ -63,7 +63,7 @@ public class ComplexStringCfgService extends CrudService0){ this.deleteIpBatch(deleteAreaCfgs); } - return complexStringCfgDao.updateByPrimaryKeySelective(cfg); + return complexStringCfgDao.update(cfg); } /** * @@ -77,11 +77,11 @@ public class ComplexStringCfgService extends CrudService auditCfg,List areaCfg,List sendCfg) throws Exception{ - List sendCfgs=new ArrayList(); + public void auditStringCfg(int isAduit,List auditCfg,List areaCfg,List sendCfg) throws Exception{ + List> sendCfgs=new ArrayList>(); for(ComplexkeywordCfg c:sendCfg){ - BaseCfg[] cArr=new BaseCfg[1]; - cArr[0]=c; + List cArr=new ArrayList<>(); + cArr.add(c); sendCfgs.add(cArr); } if(Constants.AUDIT_NOT_YES==isAduit|| @@ -110,7 +110,7 @@ public class ComplexStringCfgService extends CrudService cfgs,List areaCfg){ + public void deleteStringCfg(List cfgs,List areaCfg){ if(areaCfg!=null&&areaCfg.size()>0){ this.deleteIpBatch(areaCfg); } diff --git a/src/main/java/com/nis/web/service/configuration/IpCfgService.java b/src/main/java/com/nis/web/service/configuration/IpCfgService.java index 3da1a896e..458be09da 100644 --- a/src/main/java/com/nis/web/service/configuration/IpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/IpCfgService.java @@ -37,7 +37,7 @@ public class IpCfgService extends CrudService { * @since 1.0.0 */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public int addIpCfg(BaseIpCfg baseIpCfg,List areaIpCfgs){ + public int addIpCfg(BaseIpCfg baseIpCfg,List areaIpCfgs){ if(areaIpCfgs!=null&&areaIpCfgs.size()>0){ this.saveIpBatch(areaIpCfgs); } @@ -54,7 +54,7 @@ public class IpCfgService extends CrudService { * @since 1.0.0 */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public int updateIpCfg(BaseIpCfg baseIpCfg,List addAreaCfg,List updateAreaCfg,List deleteAreaCfgs){ + public int updateIpCfg(BaseIpCfg baseIpCfg,List addAreaCfg,List updateAreaCfg,List deleteAreaCfgs){ if(addAreaCfg!=null&&addAreaCfg.size()>0){ this.saveIpBatch(addAreaCfg); } @@ -64,7 +64,7 @@ public class IpCfgService extends CrudService { if(deleteAreaCfgs!=null&&deleteAreaCfgs.size()>0){ this.deleteIpBatch(deleteAreaCfgs); } - return ipCfgDao.updateByPrimaryKeySelective(baseIpCfg); + return ipCfgDao.update(baseIpCfg); } /** * @@ -78,11 +78,11 @@ public class IpCfgService extends CrudService { * @since 1.0.0 */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void auditIpCfg(int isAduit,List auditCfg,List areaCfg,List sendCfg) throws Exception{ - List sendCfgs=new ArrayList(); + public void auditIpCfg(int isAduit,List auditCfg,List areaCfg,List sendCfg) throws Exception{ + List> sendCfgs=new ArrayList>(); for(BaseIpCfg c:sendCfg){ - BaseCfg[] cArr=new BaseCfg[1]; - cArr[0]=c; + List cArr=new ArrayList<>(); + cArr.add(c); sendCfgs.add(cArr); } if(Constants.AUDIT_NOT_YES==isAduit|| diff --git a/src/main/java/com/nis/web/service/configuration/MultipleCfgService.java b/src/main/java/com/nis/web/service/configuration/MultipleCfgService.java index f40fdb238..9670164a5 100644 --- a/src/main/java/com/nis/web/service/configuration/MultipleCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/MultipleCfgService.java @@ -3,6 +3,9 @@ package com.nis.web.service.configuration; import java.util.ArrayList; import java.util.List; +import org.apache.ibatis.session.ExecutorType; +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -16,12 +19,14 @@ import com.nis.domain.configuration.MultipleCfg; import com.nis.domain.configuration.MultipleSearchCfg; import com.nis.domain.configuration.NumBoundaryCfg; import com.nis.util.Constants; +import com.nis.web.dao.CrudDao; import com.nis.web.dao.configuration.ComplexStringCfgDao; import com.nis.web.dao.configuration.IpCfgDao; import com.nis.web.dao.configuration.MultipleCfgDao; import com.nis.web.dao.configuration.NumCfgDao; import com.nis.web.dao.configuration.StringCfgDao; import com.nis.web.service.CrudService; +import com.nis.web.service.SpringContextHolder; /** * 多域相关配置事务类 @@ -51,98 +56,112 @@ public class MultipleCfgService extends CrudService0){ + List areaCfg=new ArrayList<>(); + areaCfg.addAll(cfg.getAreaCfg()); + this.saveIpBatch(areaCfg); } } - if(cfg.getStringCfg()!=null){ - for(BaseStringCfg _cfg:cfg.getStringCfg().values()){ - stringCfgDao.insert(_cfg); - } - } - if(cfg.getNumCfg()!=null){ - for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){ - numCfgDao.insert(_cfg); - } - } - if(cfg.getComplexCfg()!=null){ - for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){ - complexStringCfgDao.insert(_cfg); - } - } - return 1; + } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public int updateCfg(MultipleCfg cfg,List deleteCfg){ - if(cfg==null) return 0; - if(cfg.getIpCfg()!=null){ - for(BaseIpCfg _cfg:cfg.getIpCfg().values()){ - if(_cfg.getCfgId()==null){//修改配置时用户可能希望新增IP配置,此时新增的IP配置无配置ID - ipCfgDao.insert(_cfg); - }else{ - ipCfgDao.updateByPrimaryKeySelective(_cfg); - } - - } - } - if(cfg.getStringCfg()!=null){ - for(BaseStringCfg _cfg:cfg.getStringCfg().values()){ - stringCfgDao.updateByPrimaryKeySelective(_cfg); - } - } - if(cfg.getNumCfg()!=null){ - for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){ - numCfgDao.updateByPrimaryKeySelective(_cfg); - } - } - if(cfg.getComplexCfg()!=null){ - for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){ - complexStringCfgDao.updateByPrimaryKeySelective(_cfg); - } - } - if(deleteCfg!=null&&deleteCfg.size()>0){ - for(BaseCfg _cfg:deleteCfg){ - if(_cfg instanceof BaseIpCfg){ - ipCfgDao.deleteByCompileId((BaseIpCfg)_cfg); - }else if(_cfg instanceof BaseStringCfg){ - stringCfgDao.deleteByCompileId((BaseStringCfg)_cfg); - }else if(_cfg instanceof NumBoundaryCfg){ - numCfgDao.deleteByCompileId((NumBoundaryCfg)_cfg); - }else if(_cfg instanceof ComplexkeywordCfg){ - complexStringCfgDao.deleteByCompileId((ComplexkeywordCfg)_cfg); + public void updateCfg(MultipleCfg cfg,List deleteCfg,List addAreaCfg,List updateAreaCfg,List deleteAreaCfgs){ + if(cfg!=null){ + if(cfg.getIpCfg()!=null){ + for(BaseIpCfg _cfg:cfg.getIpCfg().values()){ + if(_cfg.getCfgId()==null){//修改配置时用户可能希望新增IP配置,此时新增的IP配置无配置ID + ipCfgDao.insert(_cfg); + }else{ + ipCfgDao.update(_cfg); + } + } } + if(cfg.getStringCfg()!=null){ + for(BaseStringCfg _cfg:cfg.getStringCfg().values()){ + if(_cfg.getCfgId()==null){ + stringCfgDao.insert(_cfg); + }else + stringCfgDao.update(_cfg); + } + } + if(cfg.getNumCfg()!=null){ + for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){ + if(_cfg.getCfgId()==null){ + numCfgDao.insert(_cfg); + }else + numCfgDao.updateByPrimaryKeySelective(_cfg); + } + } + if(cfg.getComplexCfg()!=null){ + for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){ + if(_cfg.getCfgId()==null){ + complexStringCfgDao.insert(_cfg); + }else + complexStringCfgDao.update(_cfg); + } + } + if(deleteCfg!=null&&deleteCfg.size()>0){ + for(BaseCfg _cfg:deleteCfg){ + if(_cfg instanceof BaseIpCfg){ + ipCfgDao.deleteByCompileId((BaseIpCfg)_cfg); + }else if(_cfg instanceof BaseStringCfg){ + stringCfgDao.deleteByCompileId((BaseStringCfg)_cfg); + }else if(_cfg instanceof NumBoundaryCfg){ + numCfgDao.deleteByCompileId((NumBoundaryCfg)_cfg); + }else if(_cfg instanceof ComplexkeywordCfg){ + complexStringCfgDao.deleteByCompileId((ComplexkeywordCfg)_cfg); + } + } + } + if(addAreaCfg!=null&&addAreaCfg.size()>0){ + this.saveIpBatch(addAreaCfg); + } + if(updateAreaCfg!=null&&updateAreaCfg.size()>0){ + this.updateIpBatch(updateAreaCfg); + } + if(deleteAreaCfgs!=null&&deleteAreaCfgs.size()>0){ + this.deleteIpBatch(deleteAreaCfgs); + } } - return 1; } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public int deleteCfg(MultipleCfg cfg){ - if(cfg==null) return 0; - if(cfg.getIpCfg()!=null){ - for(BaseIpCfg _cfg:cfg.getIpCfg().values()){ - ipCfgDao.deleteByCompileId(_cfg); - } + public void deleteCfg(List delIpCfgs,List delStringCfgs,List delNumCfgs,List delComplexCfgs){ + if(delIpCfgs!=null&&delIpCfgs.size()>0){ + this.deleteIpBatch(delIpCfgs); } - if(cfg.getStringCfg()!=null){ - for(BaseStringCfg _cfg:cfg.getStringCfg().values()){ - stringCfgDao.deleteByCompileId(_cfg); - } + if(delStringCfgs!=null&&delStringCfgs.size()>0){ + this.deleteStringBatch(delStringCfgs); } - if(cfg.getNumCfg()!=null){ - for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){ - numCfgDao.deleteByCompileId(_cfg); - } + if(delNumCfgs!=null&&delNumCfgs.size()>0){ + this.deleteNumBatch(delNumCfgs); } - if(cfg.getComplexCfg()!=null){ - for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){ - complexStringCfgDao.deleteByCompileId(_cfg); - } + if(delComplexCfgs!=null&&delComplexCfgs.size()>0){ + this.deleteComplexBatch(delComplexCfgs); } - return 1; } /** * @@ -156,93 +175,72 @@ public class MultipleCfgService extends CrudService cfgs=new ArrayList(); - if(sendCfg.getIpCfg()!=null){ - for(BaseIpCfg _cfg:sendCfg.getIpCfg().values()){ - cfgs.add(_cfg); - } - } - if(sendCfg.getStringCfg()!=null){ - for(BaseStringCfg _cfg:sendCfg.getStringCfg().values()){ - cfgs.add(_cfg); - } - } - if(sendCfg.getNumCfg()!=null){ - for(NumBoundaryCfg _cfg:sendCfg.getNumCfg().values()){ - cfgs.add(_cfg); - } - } - if(sendCfg.getComplexCfg()!=null){ - for(ComplexkeywordCfg _cfg:sendCfg.getComplexCfg().values()){ - cfgs.add(_cfg); - } - } - BaseCfg[] cfgArray=new BaseCfg[cfgs.size()]; - cfgs.toArray(cfgArray); - if(this.sendToMaatConvertor(cfg.getIsAudit(), null, cfgArray)){ - if(cfg.getIpCfg()!=null){ - for(BaseIpCfg _cfg:cfg.getIpCfg().values()){ - result+=ipCfgDao.audit(_cfg); + public void auditCfg(int isAudit,List sendCfgs,List auduitIpCfgs, + List auduitStringCfgs,List auduitNumCfgs,List auduitComplexCfgs) throws Exception{ + if(Constants.AUDIT_YES==isAudit||Constants.AUDIT_NOT_YES==isAudit){ + List> cfgs=new ArrayList>(); + for(MultipleCfg sendCfg:sendCfgs){ + List cfg=new ArrayList<>(); + if(sendCfg.getIpCfg()!=null){ + for(BaseIpCfg _cfg:sendCfg.getIpCfg().values()){ + cfg.add(_cfg); } } - if(cfg.getStringCfg()!=null){ - for(BaseStringCfg _cfg:cfg.getStringCfg().values()){ - result+=stringCfgDao.audit(_cfg); + if(sendCfg.getStringCfg()!=null){ + for(BaseStringCfg _cfg:sendCfg.getStringCfg().values()){ + cfg.add(_cfg); } } - if(cfg.getNumCfg()!=null){ - for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){ - result+=numCfgDao.audit(_cfg); + if(sendCfg.getNumCfg()!=null){ + for(NumBoundaryCfg _cfg:sendCfg.getNumCfg().values()){ + cfg.add(_cfg); } } - if(cfg.getComplexCfg()!=null){ - for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){ - result+=complexStringCfgDao.audit(_cfg); + if(sendCfg.getComplexCfg()!=null){ + for(ComplexkeywordCfg _cfg:sendCfg.getComplexCfg().values()){ + cfg.add(_cfg); } } + //设置区域ip + if(sendCfg.getAreaCfg()!=null){ + if(cfg.size()>0){ + cfg.get(0).setAreaCfg(sendCfg.getAreaCfg()); + }else{ + throw new RuntimeException("发送至maat异常,没有有效的配置!"); + } + } + cfgs.add(cfg); + } + if(this.sendToMaatConvertorBatch(isAudit, cfgs)){ + if(auduitIpCfgs!=null&&auduitIpCfgs.size()>0){ + this.auditIpBatch(auduitIpCfgs); + } + if(auduitStringCfgs!=null&&auduitStringCfgs.size()>0){ + this.auditStringBatch(auduitStringCfgs); + } + if(auduitNumCfgs!=null&&auduitNumCfgs.size()>0){ + this.auditNumBatch(auduitNumCfgs); + } + if(auduitComplexCfgs!=null&&auduitComplexCfgs.size()>0){ + this.auditComplexBatch(auduitComplexCfgs); + } }else{ - result=0; + throw new RuntimeException("发送至maat失败,返回false!"); } - }else{ - if(cfg.getIpCfg()!=null){ - for(BaseIpCfg _cfg:cfg.getIpCfg().values()){ - result+=ipCfgDao.audit(_cfg); - } + if(auduitIpCfgs!=null&&auduitIpCfgs.size()>0){ + this.auditIpBatch(auduitIpCfgs); } - if(cfg.getStringCfg()!=null){ - for(BaseStringCfg _cfg:cfg.getStringCfg().values()){ - result+=stringCfgDao.audit(_cfg); - } + if(auduitStringCfgs!=null&&auduitStringCfgs.size()>0){ + this.auditStringBatch(auduitStringCfgs); } - if(cfg.getNumCfg()!=null){ - for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){ - result+=numCfgDao.audit(_cfg); - } + if(auduitNumCfgs!=null&&auduitNumCfgs.size()>0){ + this.auditNumBatch(auduitNumCfgs); } - if(cfg.getComplexCfg()!=null){ - for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){ - result+=complexStringCfgDao.audit(_cfg); - } + if(auduitComplexCfgs!=null&&auduitComplexCfgs.size()>0){ + this.auditComplexBatch(auduitComplexCfgs); } } - return should==result; } /** @@ -252,5 +250,100 @@ public class MultipleCfgService extends CrudService findPage(Page page, MultipleSearchCfg entity) { return super.findPage(page, entity); } - + private void deleteStringBatch(List data) { + SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); + SqlSession batchSqlSession = null; + try{ + batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); + for(int index = 0; index < data.size();index++){ + BaseStringCfg t = data.get(index); + ((CrudDao) batchSqlSession.getMapper(StringCfgDao.class)).delete(t); + } + batchSqlSession.commit(); + }finally { + if(batchSqlSession != null){ + batchSqlSession.close(); + } + } + } + private void deleteComplexBatch(List data) { + SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); + SqlSession batchSqlSession = null; + try{ + batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); + for(int index = 0; index < data.size();index++){ + ComplexkeywordCfg t = data.get(index); + ((CrudDao) batchSqlSession.getMapper(ComplexStringCfgDao.class)).delete(t); + } + batchSqlSession.commit(); + }finally { + if(batchSqlSession != null){ + batchSqlSession.close(); + } + } + } + private void deleteNumBatch(List data) { + SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); + SqlSession batchSqlSession = null; + try{ + batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); + for(int index = 0; index < data.size();index++){ + NumBoundaryCfg t = data.get(index); + ((CrudDao) batchSqlSession.getMapper(NumCfgDao.class)).delete(t); + } + batchSqlSession.commit(); + }finally { + if(batchSqlSession != null){ + batchSqlSession.close(); + } + } + } + private void auditStringBatch(List data) { + SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); + SqlSession batchSqlSession = null; + try{ + batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); + for(int index = 0; index < data.size();index++){ + BaseStringCfg t = data.get(index); + ((CrudDao) batchSqlSession.getMapper(StringCfgDao.class)).audit(t); + } + batchSqlSession.commit(); + }finally { + if(batchSqlSession != null){ + batchSqlSession.close(); + } + } + } + private void auditNumBatch(List data) { + SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); + SqlSession batchSqlSession = null; + try{ + batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); + for(int index = 0; index < data.size();index++){ + NumBoundaryCfg t = data.get(index); + ((CrudDao) batchSqlSession.getMapper(NumCfgDao.class)).audit(t); + } + batchSqlSession.commit(); + }finally { + if(batchSqlSession != null){ + batchSqlSession.close(); + } + } + } + private void auditComplexBatch(List data) { + SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); + SqlSession batchSqlSession = null; + try{ + batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); + for(int index = 0; index < data.size();index++){ + ComplexkeywordCfg t = data.get(index); + ((CrudDao) batchSqlSession.getMapper(ComplexStringCfgDao.class)).audit(t); + } + batchSqlSession.commit(); + }finally { + if(batchSqlSession != null){ + batchSqlSession.close(); + } + } + } } diff --git a/src/main/java/com/nis/web/service/configuration/NumCfgService.java b/src/main/java/com/nis/web/service/configuration/NumCfgService.java index ea8110492..53b66a6b1 100644 --- a/src/main/java/com/nis/web/service/configuration/NumCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/NumCfgService.java @@ -7,6 +7,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.nis.domain.configuration.AreaIpCfg; +import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.NumBoundaryCfg; import com.nis.util.Constants; import com.nis.web.dao.configuration.NumCfgDao; @@ -32,7 +33,7 @@ public class NumCfgService extends CrudService { * @since 1.0.0 */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public int addNumCfg(NumBoundaryCfg cfg,List areaIpCfgs){ + public int addNumCfg(NumBoundaryCfg cfg,List areaIpCfgs){ if(areaIpCfgs!=null&&areaIpCfgs.size()>0){ this.saveIpBatch(areaIpCfgs); } @@ -49,7 +50,7 @@ public class NumCfgService extends CrudService { * @since 1.0.0 */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public int updateNumCfg(NumBoundaryCfg cfg,List addAreaCfg,List updateAreaCfg,List deleteAreaCfgs){ + public int updateNumCfg(NumBoundaryCfg cfg,List addAreaCfg,List updateAreaCfg,List deleteAreaCfgs){ if(addAreaCfg!=null&&addAreaCfg.size()>0){ this.saveIpBatch(addAreaCfg); } diff --git a/src/main/java/com/nis/web/service/configuration/StringCfgService.java b/src/main/java/com/nis/web/service/configuration/StringCfgService.java index ab0555311..ad196db53 100644 --- a/src/main/java/com/nis/web/service/configuration/StringCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/StringCfgService.java @@ -36,7 +36,7 @@ public class StringCfgService extends CrudService { * @since 1.0.0 */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public int addStringCfg(BaseStringCfg baseStringCfg,List areaIpCfgs){ + public int addStringCfg(BaseStringCfg baseStringCfg,List areaIpCfgs){ if(areaIpCfgs!=null&&areaIpCfgs.size()>0){ this.saveIpBatch(areaIpCfgs); } @@ -53,7 +53,7 @@ public class StringCfgService extends CrudService { * @since 1.0.0 */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public int updateStringCfg(BaseStringCfg baseStringCfg,List addAreaCfg,List updateAreaCfg,List deleteAreaCfgs){ + public int updateStringCfg(BaseStringCfg baseStringCfg,List addAreaCfg,List updateAreaCfg,List deleteAreaCfgs){ if(addAreaCfg!=null&&addAreaCfg.size()>0){ this.saveIpBatch(addAreaCfg); } @@ -63,7 +63,7 @@ public class StringCfgService extends CrudService { if(deleteAreaCfgs!=null&&deleteAreaCfgs.size()>0){ this.deleteIpBatch(deleteAreaCfgs); } - return stringCfgDao.updateByPrimaryKeySelective(baseStringCfg); + return stringCfgDao.update(baseStringCfg); } /** * @@ -77,11 +77,11 @@ public class StringCfgService extends CrudService { * @since 1.0.0 */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void auditStringCfg(int isAduit,List auditCfg,List areaCfg,List sendCfg) throws Exception{ - List sendCfgs=new ArrayList(); + public void auditStringCfg(int isAduit,List auditCfg,List areaCfg,List sendCfg) throws Exception{ + List> sendCfgs=new ArrayList>(); for(BaseStringCfg c:sendCfg){ - BaseStringCfg[] cArr=new BaseStringCfg[1]; - cArr[0]=c; + List cArr=new ArrayList<>(); + cArr.add(c); sendCfgs.add(cArr); } if(Constants.AUDIT_NOT_YES==isAduit|| @@ -107,7 +107,7 @@ public class StringCfgService extends CrudService { * @since 1.0.0 */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void deleteStringCfg(List stringCfg,List areaCfg){ + public void deleteStringCfg(List stringCfg,List areaCfg){ if(areaCfg!=null&&areaCfg.size()>0){ this.deleteIpBatch(areaCfg); } diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index e4254032d..ec5a12fa6 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -404,10 +404,10 @@ organizer=organizer password=password nochange_blank=please fill blank if you have no change confirm_password=confirm password -manager_info=\u7ba1\u7406\u4eba\u5458\u9700\u6307\u5b9a\u8eab\u4efd\u6807\u8bc6\u4e3a\u201c\u7ba1\u7406\u4eba\u5458\u201d,\u5426\u5219\u5f71\u54cd\u5ba1\u6838\u6d41\u7a0b! +manager_info=the manager needs to specify the identity as the "manager",otherwise the audit process will be affected! name_existed=name existed -company_range=\u90e8\u95e8\u4e0d\u518d\u516c\u53f8\u8303\u56f4\u5185 -equal_password=\u8f93\u5165\u4e0e\u4e0a\u9762\u76f8\u540c\u7684\u5bc6\u7801 +company_range=The department does not belong to the company +equal_password=Please enter the same password as above enter_error=enter error choose_org=choose organization org_name=organization name @@ -421,7 +421,7 @@ delete_all_child=Do you want to delete this and all level parent_org=parent organization org_level=organization level is_useable=whether useable -is_useable_info=\u201c\u662f\u201d\u4ee3\u8868\u6b64\u8d26\u53f7\u5141\u8bb8\u767b\u9646,\u201c\u5426\u201d\u5219\u8868\u793a\u6b64\u8d26\u53f7\u4e0d\u5141\u8bb8\u767b\u9646 +is_useable_info="Yes" indicates that the account is allowed to login and "No" is not. leader=leader vice_leader=vice leader address=address @@ -443,9 +443,9 @@ edit_record=edit record edit_record_view=edit record view dict_edit_info=dictionary is very import in the system,Do you decide to edit? dict_delete_info=dictionary is very import in the system,Do you decide to delete? -dict_saveitem_error=save message error,\u8bf7\u6dfb\u52a0\u8bcd\u6761\u9879! -dict_saveitem_nullerror=\u4fdd\u5b58\u4fe1\u606f\u51fa\u73b0\u95ee\u9898,\u6bcf\u4e2a\u8bcd\u6761\u6807\u8bc6\u4e0e\u503c\u90fd\u4e0d\u80fd\u4e3a\u7a7a! -submit_error=\u63d0\u4ea4\u914d\u7f6e\u51fa\u73b0\u95ee\u9898,\u8bf7\u770b\u9519\u8bef\u63d0\u793a! +dict_saveitem_error=save message error,enter a entry! +dict_saveitem_nullerror=Save info error,every entry and value can not be empty! +submit_error=configuration submit error,please look at the error info! form_validate=form validate success entry=entry add_entry=add entry @@ -466,22 +466,22 @@ menu=menu parent_menu=parent menu aim=aim click_menu_turn=the page of click the menu -link_window_info=the aim window of the link,default\uff1amainFrame +link_window_info=the aim window of the link,default:mainFrame is_top_menu=whether the top menu icon=icon -is_top_menu_info=\u8be5\u83dc\u5355\u6216\u64cd\u4f5c\u662f\u5426\u9876\u90e8\u5bfc\u822a\u83dc\u5355 +is_top_menu_info=Is the menu or operation the top navigation menu? sort_info=order by asc -is_show_sysmenu=\u8be5\u83dc\u5355\u6216\u64cd\u4f5c\u662f\u5426\u663e\u793a\u5230\u7cfb\u7edf\u83dc\u5355\u4e2d -control_permission_info=\u63a7\u5236\u5668\u4e2d\u5b9a\u4e49\u7684\u6743\u9650\u6807\u8bc6,\u5982\uff1a@RequiresPermissions("permission mark") +is_show_sysmenu=Is the menu or operation displayed in the system menu? +control_permission_info=Permission identity defined in the controller,for example:@RequiresPermissions("permission mark") role_name=role name data_range=data range allot=allot role_type=role type role_permission=role permission task_allot=task allot -role_type_title=activiti\u67093\u79cd\u9884\u5b9a\u4e49\u7684\u7ec4\u7c7b\u578b\uff1asecurity-role\u3001assignment\u3001user \u5982\u679c\u4f7f\u7528Activiti Explorer,\u9700\u8981security-role\u624d\u80fd\u770b\u5230manage\u9875\u7b7e,\u9700\u8981assignment\u624d\u80fdclaim\u4efb\u52a1 -role_type_info=\u5de5\u4f5c\u6d41\u7ec4\u7528\u6237\u7ec4\u7c7b\u578b\uff08\u4efb\u52a1\u5206\u914d\uff1aassignment\u3001\u7ba1\u7406\u89d2\u8272\uff1asecurity-role\u3001\u666e\u901a\u89d2\u8272\uff1auser\uff09 -data_range_info=\u7279\u6b8a\u60c5\u51b5\u4e0b,\u8bbe\u7f6e\u4e3a\u201c\u6309\u660e\u7ec6\u8bbe\u7f6e\u201d,\u53ef\u8fdb\u884c\u8de8\u673a\u6784\u6388\u6743 +role_type_title=activiti\u67093\u79cd\u9884\u5b9a\u4e49\u7684\u7ec4\u7c7b\u578b:security-role,assignment,user \u5982\u679c\u4f7f\u7528Activiti Explorer,\u9700\u8981security-role\u624d\u80fd\u770b\u5230manage\u9875\u7b7e,\u9700\u8981assignment\u624d\u80fdclaim\u4efb\u52a1 +role_type_info=workflow group user type(task allocation:assignment,management role:security-role,ordinary role:user) +data_range_info=in special cases,\u8bbe\u7f6e\u4e3a"\u6309\u660e\u7ec6\u8bbe\u7f6e",\u53ef\u8fdb\u884c\u8de8\u673a\u6784\u6388\u6743 permission_list=permission list area_name=area name area_code=area code @@ -493,22 +493,25 @@ latitude=latitude role_list=role list role_allot=role allot staff_list=staff list -choose_and_allot=\u901a\u8fc7\u9009\u62e9\u90e8\u95e8\uff0c\u7136\u540e\u4e3a\u5217\u51fa\u7684\u4eba\u5458\u5206\u914d\u89d2\u8272\u3002 +choose_and_allot=By selecting department,we assign roles to the listed people. loading=loading... remove=remove -sure_remove_role= role will be removed from this user\uff1f +sure_remove_role= role will be removed from this user? system_prompt=system prompt old_password=old password new_password=new password sure_new_password=confirm new password be_selected_staff=be selected staff selected_staff=selected staff -old_remove_error=old role can be removed\uff01 -selected_clear_success=selected staff clear success\uff01 -cancel_clear=cancel clear\uff01 +old_remove_error=old role can be removed! +selected_clear_success=selected staff clear success! +cancel_clear=cancel clear! sure_clear=clear -role_no_new=role dont have new staff\uff01 +role_no_new=role dont have new staff! #==========xitongguanli end====================== #===============multiole cfg start==================== optional=optional -#===============multiole cfg end==================== \ No newline at end of file +custom_region=custom region +please_input=please input +area_control_type=area control type +#===============multiole cfg end==================== diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 1f543dd18..15f217bf5 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -335,4 +335,7 @@ protocol_desc=protocol description #==========tedingfuwu end===================== #===============multiole cfg start==================== optional=optional -#===============multiole cfg end==================== \ No newline at end of file +custom_region=custom region +please_input=please input +area_control_type=area control type +#===============multiole cfg end==================== diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index b63872cd6..4734590c0 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -512,4 +512,7 @@ role_no_new=\u89d2\u8272\u672a\u5206\u914d\u65b0\u6210\u5458\uff01 #==========xitongguanli end====================== #===============multiole cfg start==================== optional=\u53EF\u9009 -#===============multiole cfg end==================== \ No newline at end of file +custom_region=\u81EA\u5B9A\u4E49\u57DF +please_input=\u8BF7\u8F93\u5165 +area_control_type=\u533A\u57DF\u7BA1\u63A7\u7C7B\u578B +#===============multiole cfg end==================== diff --git a/src/main/webapp/WEB-INF/include/form/areaInfo.jsp b/src/main/webapp/WEB-INF/include/form/areaInfo.jsp index 812e7884d..54fa61a56 100644 --- a/src/main/webapp/WEB-INF/include/form/areaInfo.jsp +++ b/src/main/webapp/WEB-INF/include/form/areaInfo.jsp @@ -163,6 +163,7 @@ function delAreaIsp(obj){ - <%-- -
-
- -
- -
-
-
-
--%>
@@ -108,7 +98,7 @@
- - - - - - - - +
- - -
-
- -
-
-
+
@@ -207,46 +93,18 @@
- - - - - - - - +
- - -
-
- -
-
-
+
- - - - - - - - +
- - -
-
- -
-
-
+
@@ -255,75 +113,30 @@
- - - - - - - - + <%-- --%>
- - -
-
- -
-
-
+
- - - - - - - - +
- - -
-
- -
-
-
+
- - - - - - - - - - + + diff --git a/src/main/webapp/WEB-INF/include/form/multiple/numInfo.jsp b/src/main/webapp/WEB-INF/include/form/multiple/numInfo.jsp index abc3d47e2..1b686ff31 100644 --- a/src/main/webapp/WEB-INF/include/form/multiple/numInfo.jsp +++ b/src/main/webapp/WEB-INF/include/form/multiple/numInfo.jsp @@ -1,29 +1,14 @@ <%@ page contentType="text/html;charset=UTF-8"%> <%@ include file="/WEB-INF/include/taglib.jsp"%>

- - - - - - - - 数值 - +

- - - - - - - - +
@@ -32,14 +17,7 @@
- - - - - - - - +
@@ -50,14 +28,7 @@
- - - - - - - - +
@@ -66,32 +37,16 @@
- - - - - - - - - - + +
@@ -102,26 +57,13 @@
- - - - - - - - +
@@ -130,34 +72,15 @@
- - - - - - - - +
- - - - - - - - +
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/include/form/multiple/stringInfo.jsp b/src/main/webapp/WEB-INF/include/form/multiple/stringInfo.jsp index ca9a718b1..af5d21908 100644 --- a/src/main/webapp/WEB-INF/include/form/multiple/stringInfo.jsp +++ b/src/main/webapp/WEB-INF/include/form/multiple/stringInfo.jsp @@ -1,29 +1,17 @@ <%@ page contentType="text/html;charset=UTF-8"%> <%@ include file="/WEB-INF/include/taglib.jsp"%>

- - - - - - - - 字符串 - -

-
+ +checked +/> + +
- - - - - - - - +
@@ -31,145 +19,62 @@
- - - - - - - - +
- - -
-
- -
-
-
+
-
+
- - - - - - - - - - + +
- - -
-
- -
-
-
+
- - - - - - - - +
- - -
-
- -
-
-
+
-
+
- - - - - - - - +
- - -
-
- -
-
-
+
- - - - - - - - +
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/include/form/stringInfo.jsp b/src/main/webapp/WEB-INF/include/form/stringInfo.jsp index 4c885ba07..7bf902008 100644 --- a/src/main/webapp/WEB-INF/include/form/stringInfo.jsp +++ b/src/main/webapp/WEB-INF/include/form/stringInfo.jsp @@ -115,7 +115,7 @@
--%>