From 39de0e7a6baafe452a4c8bed8fc95ae2de91b084 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Tue, 27 Feb 2018 11:22:02 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9D=A5=E5=87=BD?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=A1=AE=E8=AE=A4=E6=A1=86=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/WEB-INF/views/cfg/requestList.jsp | 26 +++---------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/cfg/requestList.jsp b/src/main/webapp/WEB-INF/views/cfg/requestList.jsp index 08ad9d2b6..7d284aaf4 100644 --- a/src/main/webapp/WEB-INF/views/cfg/requestList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/requestList.jsp @@ -117,12 +117,12 @@ -
  • +
  • -
  • -
  • -
  • +
  • +
  • +
  • @@ -155,24 +155,6 @@ $("#searchForm").submit(); return false; } - //确认框 - function confirmx(m,id){ - var submit = function (v, h, f) { - if (v == 'ok'){ - window.location='${ctx}/cfg/request/'+m+"?id="+id; - jBox.tip(v, 'info'); - } - else if (v == 'cancel') - jBox.tip(v, 'info'); - return true; //close - }; - - top.$.jBox.confirm("确定吗?", "提示", submit); - - top.$('.jbox-button-panel').css('height','auto'); - top.$('.jbox-title-panel').css('height','32px'); - top.$('.jbox-content').css('font-size','16px'); - } + + \ No newline at end of file From f400075d308c4c8bba74d828336dedecc2293af2 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Tue, 27 Feb 2018 15:59:46 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=9D=A5=E5=87=BD=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=90=E5=8A=9F=E4=BF=A1=E6=81=AF=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=EF=BC=8Cmessage.tag=E5=8E=BB=E6=8E=89=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=EF=BC=8C=E4=BF=AE=E6=94=B9=E7=BF=BB=E9=A1=B5=E5=90=8E?= =?UTF-8?q?=E5=A4=A7=E6=AE=B5=E7=A9=BA=E7=99=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/RequestInfoController.java | 14 +++++++++++--- src/main/webapp/WEB-INF/tags/sys/message.tag | 2 +- src/main/webapp/WEB-INF/views/cfg/requestForm.jsp | 2 +- src/main/webapp/WEB-INF/views/cfg/requestList.jsp | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/nis/web/controller/configuration/RequestInfoController.java b/src/main/java/com/nis/web/controller/configuration/RequestInfoController.java index 1aab4a8bd..a43656ba0 100644 --- a/src/main/java/com/nis/web/controller/configuration/RequestInfoController.java +++ b/src/main/java/com/nis/web/controller/configuration/RequestInfoController.java @@ -12,6 +12,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; import com.nis.domain.configuration.RequestInfo; +import com.nis.util.Constants; import com.nis.util.StringUtils; import com.nis.web.controller.BaseController; import com.nis.web.service.configuration.RequestInfoService; @@ -58,18 +59,22 @@ public class RequestInfoController extends BaseController{ try { if(requestInfo.getId()!=null){ // 保存用户信息 + logger.info(requestInfo.getId()+"修改成功"); requestInfoService.saveOrUpdate(requestInfo); addMessage(redirectAttributes, "success"); }else{ if (!"true".equals(checkRequestNumber(requestInfo.getRequestNumber()))){ + logger.info(requestInfo.getRequestNumber()+"重复数据"); addMessage(model, "error"); return form(requestInfo, model); } // 保存用户信息 requestInfoService.saveOrUpdate(requestInfo); addMessage(redirectAttributes, "success"); + logger.info(requestInfo.getId()+"保存成功"); } } catch (Exception e) { + logger.error(e.getMessage()); e.printStackTrace(); addMessage(model, "error"); } @@ -95,8 +100,9 @@ public class RequestInfoController extends BaseController{ * @return */ @RequestMapping(value = "requestExamine") - public String requestExamine(RequestInfo requestInfo, Model model){ + public String requestExamine(RequestInfo requestInfo, Model model,RedirectAttributes redirectAttributes){ requestInfoService.requestExamine(requestInfo); + addMessage(redirectAttributes, "success"); return "redirect:" + adminPath + "/cfg/request/list?repage"; } @@ -107,8 +113,9 @@ public class RequestInfoController extends BaseController{ * @return */ @RequestMapping(value = "requestCancelExamine") - public String requestCancelExamine(RequestInfo requestInfo, Model model){ + public String requestCancelExamine(RequestInfo requestInfo, Model model,RedirectAttributes redirectAttributes){ requestInfoService.requestCancelExamine(requestInfo); + addMessage(redirectAttributes, "success"); return "redirect:" + adminPath + "/cfg/request/list?repage"; } @@ -119,8 +126,9 @@ public class RequestInfoController extends BaseController{ * @return */ @RequestMapping(value = "delete") - public String delete(RequestInfo requestInfo, Model model){ + public String delete(RequestInfo requestInfo, Model model,RedirectAttributes redirectAttributes){ requestInfoService.delete(requestInfo); + addMessage(redirectAttributes, "success"); return "redirect:" + adminPath + "/cfg/request/list?repage"; } diff --git a/src/main/webapp/WEB-INF/tags/sys/message.tag b/src/main/webapp/WEB-INF/tags/sys/message.tag index bd46fd1e0..29af115b5 100644 --- a/src/main/webapp/WEB-INF/tags/sys/message.tag +++ b/src/main/webapp/WEB-INF/tags/sys/message.tag @@ -6,5 +6,5 @@
    ${content}
    - +
    \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/requestForm.jsp b/src/main/webapp/WEB-INF/views/cfg/requestForm.jsp index 0be62863e..918e282d0 100644 --- a/src/main/webapp/WEB-INF/views/cfg/requestForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/requestForm.jsp @@ -7,7 +7,7 @@ -
    +
    diff --git a/src/main/webapp/WEB-INF/views/cfg/requestList.jsp b/src/main/webapp/WEB-INF/views/cfg/requestList.jsp index b6d49cf94..06f66dffb 100644 --- a/src/main/webapp/WEB-INF/views/cfg/requestList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/requestList.jsp @@ -8,7 +8,7 @@ -
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/complexCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/complexCfgList.jsp new file mode 100644 index 000000000..e4e118ea2 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/complexCfgList.jsp @@ -0,0 +1,212 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + + + +
    + + +

    + 详情 +

    + +
    +
    +
    +
    +
    + 详情 +
    +
    + +
    +
    +
    +
    + + + +
    + : + + + + + + + : + + + + + + + + : + + + 按创建时间顺序 + 按创建时间倒序 + 按修改时间顺序 + 按修改时间倒序 + 按审核时间顺序 + 按审核时间倒序 + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    配置ID配置描述匹配区域关键字管控类型业务id来函编译id是否区域管控分类性质标签区域生效id有效标识是否审核创建人员配置时间修改人员修改时间审核人员审核时间
    ${cfg.cfgId }${cfg.cfgDesc }${cfg.district }${cfg.keywords } + 阻断 + 监测 + 封堵白名单 + 监测白名单 + 封堵监测白名单 + 灰名单 + ${cfg.serviceId }${cfg.requestName }${cfg.compileId } + + + ${cfg.classifyName }${cfg.attributeName }${cfg.lableName }${cfg.areaEffectiveIds } + + + 已删除 + + + + + + + + ${cfg.creatorName }${cfg.editorName }${cfg.auditorName } +
    + + +
    +
    +
    ${page}
    +
    + +
    +
    +
    + + + \ No newline at end of file From d2ff00a622bc17214adaaafe6ba1028aa8420965 Mon Sep 17 00:00:00 2001 From: wangxin Date: Wed, 28 Feb 2018 12:16:37 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/nis/domain/configuration/ComplexkeywordCfg.java | 2 +- src/main/java/com/nis/web/controller/BaseController.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/nis/domain/configuration/ComplexkeywordCfg.java b/src/main/java/com/nis/domain/configuration/ComplexkeywordCfg.java index 01a6f1e8e..ff87ee0da 100644 --- a/src/main/java/com/nis/domain/configuration/ComplexkeywordCfg.java +++ b/src/main/java/com/nis/domain/configuration/ComplexkeywordCfg.java @@ -138,7 +138,7 @@ public class ComplexkeywordCfg extends BaseCfg{ * @see com.nis.domain.configuration.BaseCfg#initDefaultValue() */ @Override - protected void initDefaultValue() { + public void initDefaultValue() { // TODO Auto-generated method stub super.initDefaultValue(); this.exprType=0; diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index ff56deeae..dd560e564 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -15,7 +15,6 @@ import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.servlet.mvc.support.RedirectAttributes; -import com.nis.domain.configuration.BaseCfg; import com.nis.util.DateUtils; import com.nis.util.JsonMapper; import com.nis.web.service.ArchiveServcie; @@ -28,10 +27,12 @@ import com.nis.web.service.RoleService; import com.nis.web.service.SystemService; import com.nis.web.service.UserService; import com.nis.web.service.configuration.AppCfgService; +import com.nis.web.service.configuration.ComplexStringCfgService; import com.nis.web.service.configuration.FtpCfgService; import com.nis.web.service.configuration.IpCfgService; import com.nis.web.service.configuration.MailCfgService; import com.nis.web.service.configuration.MediaCfgService; +import com.nis.web.service.configuration.NumCfgService; import com.nis.web.service.configuration.RequestInfoService; import com.nis.web.service.configuration.ServiceDictInfoService; import com.nis.web.service.configuration.SslCfgService; @@ -113,6 +114,10 @@ public class BaseController { protected RequestInfoService requestInfoService; @Autowired protected StringCfgService stringCfgService; + @Autowired + protected NumCfgService numCfgService; + @Autowired + protected ComplexStringCfgService complexStringCfgService; /** * 管理基础路径 */ From b07485f7f57a15435d8f2e93e9370b15cfb4eed6 Mon Sep 17 00:00:00 2001 From: zhangshilin Date: Thu, 1 Mar 2018 19:13:57 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E8=BE=85=E5=8A=A9?= =?UTF-8?q?=E8=A1=A8-=E4=B8=9A=E5=8A=A1=E5=AD=97=E5=85=B8=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=B9=B3=E5=8F=B0=20=E5=88=86=E9=A1=B5=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E6=9D=A1=E4=BB=B6=E6=90=9C=E7=B4=A2=EF=BC=8C=EF=BC=88?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=9C=AA=E5=AE=8C=E5=96=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .tern-project | 3 + .../domain/configuration/ServiceDictInfo.java | 39 ++- .../ServiceDictInfoController.java | 182 +++++++++++-- .../dao/configuration/ServiceDictInfoDao.java | 54 +++- .../dao/configuration/ServiceDictInfoDao.xml | 132 +++++++++- .../configuration/ServiceDictInfoService.java | 120 +++++++-- .../WEB-INF/views/cfg/serviceDictForm.jsp | 9 +- .../WEB-INF/views/cfg/serviceDictInfo.jsp | 2 +- .../views/cfg/serviceDictInfoSearchList.jsp | 122 +++++++++ .../cfg/serviceDictInfoSearchMarkList.jsp | 122 +++++++++ .../WEB-INF/views/cfg/serviceDictList.jsp | 239 +++++++++-------- .../WEB-INF/views/cfg/serviceDictMarkForm.jsp | 25 +- .../WEB-INF/views/cfg/serviceDictMarkList.jsp | 241 +++++++++--------- src/main/webapp/static/pages/css/dictInfo.css | 13 + src/main/webapp/static/pages/scripts/dict.js | 34 +++ 15 files changed, 1016 insertions(+), 321 deletions(-) create mode 100644 .tern-project create mode 100644 src/main/webapp/WEB-INF/views/cfg/serviceDictInfoSearchList.jsp create mode 100644 src/main/webapp/WEB-INF/views/cfg/serviceDictInfoSearchMarkList.jsp create mode 100644 src/main/webapp/static/pages/scripts/dict.js diff --git a/.tern-project b/.tern-project new file mode 100644 index 000000000..077404aaa --- /dev/null +++ b/.tern-project @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/src/main/java/com/nis/domain/configuration/ServiceDictInfo.java b/src/main/java/com/nis/domain/configuration/ServiceDictInfo.java index 464d8ed9d..6c2cdcbff 100644 --- a/src/main/java/com/nis/domain/configuration/ServiceDictInfo.java +++ b/src/main/java/com/nis/domain/configuration/ServiceDictInfo.java @@ -128,19 +128,19 @@ public class ServiceDictInfo extends BaseEntity{ this.endDate = endDate; } @JsonIgnore - public static void sortList(List list, List sourcelist, Long parentId, boolean cascade){ + public static void sortList(List list, List sourcelist, Integer parentId, boolean cascade){ for (int i=0; i{ } } } + + @JsonIgnore + public static void checkList(List list,List parentList, List sourcelist, boolean cascade){ + for(ServiceDictInfo serviceUp:parentList){ + list.add(serviceUp); + //判断是否有子节点,有则继续获取子节点 + sortList(list, sourcelist, serviceUp.getServiceDictId(), true); + } + + } + + + //顶层的数量 + + public static Integer topCount(List list,Integer parentId){ + Integer count = 0; + List listTemp = new ArrayList(); + for(ServiceDictInfo serviceDictInfo:list){ + if(serviceDictInfo.getParent()!=null&&serviceDictInfo.getParent().getServiceDictId()!=null&&serviceDictInfo.getParent().getServiceDictId()==parentId){ + listTemp.add(serviceDictInfo); + } + } + + return listTemp.size(); + } + + } diff --git a/src/main/java/com/nis/web/controller/configuration/ServiceDictInfoController.java b/src/main/java/com/nis/web/controller/configuration/ServiceDictInfoController.java index 1b0f17756..0a54cee6c 100644 --- a/src/main/java/com/nis/web/controller/configuration/ServiceDictInfoController.java +++ b/src/main/java/com/nis/web/controller/configuration/ServiceDictInfoController.java @@ -18,8 +18,6 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.nis.domain.Page; -import com.nis.domain.SysDataDictionaryName; -import com.nis.domain.SysMenu; import com.nis.domain.configuration.ServiceDictInfo; import com.nis.util.StringUtil; import com.nis.util.StringUtils; @@ -58,7 +56,7 @@ public class ServiceDictInfoController extends BaseController { /** - * 查询业务辅助表-业务字典信息列表 + * 查询业务辅助表-业务字典信息列表(无条件分页查询) * @param serviceDictInfo * @param request * @param response @@ -68,13 +66,66 @@ public class ServiceDictInfoController extends BaseController { @RequiresPermissions("sys:dict:view") @RequestMapping(value = {"list", ""}) public String list(ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) { + //查出顶层分页数据 + Page page = serviceDictInfoService.findTopDictList(new Page(request, response), serviceDictInfo); + model.addAttribute("page", page); + //查出所有数据 + List allList = serviceDictInfoService.findAllDictList(); + //处理数据,保留顶层中的所有下层数据 + List list = Lists.newArrayList(); + boolean flag = false; + for(int i=allList.size()-1;i>=0;i--){ + ServiceDictInfo temp = allList.get(i); + if(temp.getParent()!=null&&temp.getParent().getServiceDictId()!=null&&temp.getParent().getServiceDictId()==0){ + for(ServiceDictInfo topTemp:page.getList()){ + if(temp.getServiceDictId()==topTemp.getServiceDictId()){ + flag = true; + break; + } + } + if(!flag){ + allList.remove(temp); + flag=false; + }else{ + flag=false; + } + } + + } - Page page = serviceDictInfoService.findDictList(new Page(request, response), serviceDictInfo); - model.addAttribute("page", page); - + ServiceDictInfo.sortList(list,allList,0,true); + //ServiceDictInfo.sortList(list, allList, 0, true); + model.addAttribute("list", list); return "/cfg/serviceDictList"; } + + /** + * 查询业务辅助表-业务字典信息列表(含条件查询) + * @param serviceDictInfo + * @param request + * @param response + * @param model + * @return + */ + @RequiresPermissions("sys:dict:view") + @RequestMapping(value = {"searchList"}) + public String searchList(ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) { + if(StringUtils.strIsBlank(serviceDictInfo.getItemValue()) + &&serviceDictInfo.getItemCode()==null + &&serviceDictInfo.getItemType()==null + &&serviceDictInfo.getBeginDate()==null + &&serviceDictInfo.getEditTime()==null){ + + return "redirect:"+ adminPath + "/configuration/serviceDictInfo/list"; + } + Page page = serviceDictInfoService.findDictSearchList(new Page(request, response), serviceDictInfo); + model.addAttribute("page", page); + + return "/cfg/serviceDictInfoSearchList"; + } + + /** * 进入添加或修改页面 * @param serviceDictInfo @@ -86,6 +137,13 @@ public class ServiceDictInfoController extends BaseController { if(doAction!=null&&doAction.equals("0")){ return "/cfg/serviceDictInfo"; } + if (serviceDictInfo.getParent() == null || serviceDictInfo.getParent().getId() == null) { + ServiceDictInfo parent = new ServiceDictInfo(); + parent.setServiceDictId(0); + serviceDictInfo.setParent(parent); + } + model.addAttribute("serviceDictInfo", serviceDictInfo); + return "/cfg/serviceDictForm"; } /** @@ -106,13 +164,17 @@ public class ServiceDictInfoController extends BaseController { e.printStackTrace(); addMessage(redirectAttributes, "保存配置失败!"); } + if(serviceDictInfo.getItemType()==3){ + return "redirect:" + adminPath + "/configuration/serviceDictInfo/markList"; + }else{ + return "redirect:" + adminPath + "/configuration/serviceDictInfo/list"; + } - return "redirect:" + adminPath + "/configuration/serviceDictInfo/list"; } /** - * 删除 + * 删除(删除时删除所有下级菜单) * @param serviceDictInfo * @param model * @return @@ -142,11 +204,12 @@ public class ServiceDictInfoController extends BaseController { @RequestMapping(value = "treeData") public List> treeData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, HttpServletResponse response) { List> mapList = Lists.newArrayList(); - List list = serviceDictInfoService.findAllDict(); + //找出所有的非叶子配置 + List list = serviceDictInfoService.findAllNoLeafDictList(); for (int i=0; i map = Maps.newHashMap(); @@ -178,12 +241,19 @@ public class ServiceDictInfoController extends BaseController { if(doAction!=null&&doAction.equals("0")){ return "/cfg/serviceDictMarkInfo"; } + if (serviceDictInfo.getParent() == null || serviceDictInfo.getParent().getId() == null) { + ServiceDictInfo parent = new ServiceDictInfo(); + parent.setServiceDictId(0); + serviceDictInfo.setParent(parent); + } + model.addAttribute("serviceDictInfo", serviceDictInfo); + return "/cfg/serviceDictMarkForm"; } /** - * 查询业务辅助表-业务字典信息列表 + * 查询标签列表(无条件分页查询) * @param serviceDictInfo * @param request * @param response @@ -191,15 +261,67 @@ public class ServiceDictInfoController extends BaseController { * @return */ @RequiresPermissions("sys:dict:view") - @RequestMapping(value = {"markList"}) + @RequestMapping(value = {"markList", ""}) public String markList(ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) { + //查出顶层分页数据 + Page page = serviceDictInfoService.findTopDictMarkList(new Page(request, response), serviceDictInfo); + model.addAttribute("page", page); + //查出所有数据 + List allList = serviceDictInfoService.findAllDictMarkList(); + //处理数据,保留顶层中的所有下层数据 + List list = Lists.newArrayList(); + boolean flag = false; + for(int i=allList.size()-1;i>=0;i--){ + ServiceDictInfo temp = allList.get(i); + if(temp.getParent()!=null&&temp.getParent().getServiceDictId()!=null&&temp.getParent().getServiceDictId()==0){ + for(ServiceDictInfo topTemp:page.getList()){ + if(temp.getServiceDictId()==topTemp.getServiceDictId()){ + flag = true; + break; + } + } + if(!flag){ + allList.remove(temp); + flag=false; + }else{ + flag=false; + } + } + + } - Page page = serviceDictInfoService.findDictMarkList(new Page(request, response), serviceDictInfo); - model.addAttribute("page", page); - + ServiceDictInfo.sortList(list,allList,0,true); + //ServiceDictInfo.sortList(list, allList, 0, true); + model.addAttribute("list", list); return "/cfg/serviceDictMarkList"; } + /** + * 查询业务辅助表-业务字典信息列表(含条件查询) + * @param serviceDictInfo + * @param request + * @param response + * @param model + * @return + */ + @RequiresPermissions("sys:dict:view") + @RequestMapping(value = {"searchMarkList"}) + public String searchMarkList(ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) { + if(StringUtils.strIsBlank(serviceDictInfo.getItemValue()) + &&serviceDictInfo.getItemCode()==null + &&serviceDictInfo.getItemType()==null + &&serviceDictInfo.getBeginDate()==null + &&serviceDictInfo.getEditTime()==null){ + + return "redirect:"+ adminPath + "/configuration/serviceDictInfo/markList"; + } + Page page = serviceDictInfoService.findDictSearchMarkList(new Page(request, response), serviceDictInfo); + model.addAttribute("page", page); + + return "/cfg/serviceDictInfoSearchMarkList"; + } + + /** * 新增或修改 @@ -242,4 +364,34 @@ public class ServiceDictInfoController extends BaseController { return "redirect:" + adminPath + "/configuration/serviceDictInfo/markList"; } + /** + * isShowHide是否显示隐藏菜单 + * @param extId + * @param isShowHidden + * @param response + * @return + */ + @RequiresPermissions("user") + @ResponseBody + @RequestMapping(value = "treeMarkData") + public List> treeMarkData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, HttpServletResponse response) { + List> mapList = Lists.newArrayList(); + //找出所有的非叶子配置 + List list = serviceDictInfoService.findAllNoLeafDictMarkList(); + for (int i=0; i map = Maps.newHashMap(); + map.put("id", serviceDictInfo.getServiceDictId()); + map.put("pId", serviceDictInfo.getParent().getServiceDictId()); + map.put("name",serviceDictInfo.getItemValue()); + mapList.add(map); + } + } + return mapList; + } + } diff --git a/src/main/java/com/nis/web/dao/configuration/ServiceDictInfoDao.java b/src/main/java/com/nis/web/dao/configuration/ServiceDictInfoDao.java index af714deae..31760377a 100644 --- a/src/main/java/com/nis/web/dao/configuration/ServiceDictInfoDao.java +++ b/src/main/java/com/nis/web/dao/configuration/ServiceDictInfoDao.java @@ -4,6 +4,7 @@ import java.util.List; import org.apache.ibatis.annotations.Param; +import com.nis.domain.SysMenu; import com.nis.domain.configuration.ServiceDictInfo; import com.nis.web.dao.CrudDao; import com.nis.web.dao.MyBatisDao; @@ -12,18 +13,25 @@ import com.nis.web.dao.MyBatisDao; public interface ServiceDictInfoDao extends CrudDao { /** - * 查询分类性质字典列表, + * 查询分类性质顶层字典列表(无条件查询) * @param serviceDictInfo * @return */ - List findDictList(ServiceDictInfo serviceDictInfo); - + List findTopDictList(ServiceDictInfo serviceDictInfo); /** - * 查询标签字典列表 + * 查出所有分类性质 + */ + List findAllDictList(ServiceDictInfo serviceDictInfo); + /** + * 查询所有的非叶子配置 + */ + List findAllNoLeafDictList(); + /** + * 查询分类性质字典列表(含条件查询) * @param serviceDictInfo * @return */ - List findDictMarkList(ServiceDictInfo serviceDictInfo); + List findDictSearchList(ServiceDictInfo serviceDictInfo); /** @@ -39,14 +47,40 @@ public interface ServiceDictInfoDao extends CrudDao { */ ServiceDictInfo getDictById(Integer serviceDictId); - /** - * 查询所有非叶子节点字典配置信息 - * @return - */ - List findAllDict(); + + //标签管理 + /** + * 查询标签顶层字典列表(无条件查询) + * @param serviceDictInfo + * @return + */ + List findTopDictMarkList(ServiceDictInfo serviceDictInfo); + /** + * 查出所有标签 + */ + List findAllDictMarkList(ServiceDictInfo serviceDictInfo); + /** + * 查询标签字典列表(条件查询) + * @param serviceDictInfo + * @return + */ + List findDictSearchMarkList(ServiceDictInfo serviceDictInfo); + /** + * 查询所有的非叶子配置 + * @return + */ + List findAllNoLeafDictMarkList(); + List findItemDict(@Param("itemType")int itemType,@Param("isValid")int isValid); List findAllItemDict(@Param("itemType")int itemType); + + + + + + + diff --git a/src/main/java/com/nis/web/dao/configuration/ServiceDictInfoDao.xml b/src/main/java/com/nis/web/dao/configuration/ServiceDictInfoDao.xml index c06339474..3e207f2c6 100644 --- a/src/main/java/com/nis/web/dao/configuration/ServiceDictInfoDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/ServiceDictInfoDao.xml @@ -52,12 +52,12 @@ - - + SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type ]]> 3 AND parent_id = 0 - AND item_type like '%${itemType}%' + AND item_value like '%${itemValue}%' AND item_code like '%${itemCode}%' @@ -81,8 +81,110 @@ - - + SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type = 3 AND parent_id = 0 + + + AND item_value like '%${itemValue}%' + + + AND item_code like '%${itemCode}%' + + + + AND create_time >= #{beginDate,jdbcType=TIMESTAMP} + + + AND create_time <= #{endDate,jdbcType=TIMESTAMP} + + + + + ORDER BY ${page.orderBy} + + + ORDER BY create_time desc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LEFT JOIN service_dict_info p ON p.service_dict_id = s.parent_id + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/configuration/ServiceDictInfoService.java b/src/main/java/com/nis/web/service/configuration/ServiceDictInfoService.java index 0cfe52330..01ef35013 100644 --- a/src/main/java/com/nis/web/service/configuration/ServiceDictInfoService.java +++ b/src/main/java/com/nis/web/service/configuration/ServiceDictInfoService.java @@ -8,6 +8,7 @@ import org.springframework.stereotype.Service; import com.google.common.collect.Lists; import com.nis.domain.Page; +import com.nis.domain.SysMenu; import com.nis.domain.SysUser; import com.nis.domain.configuration.ServiceDictInfo; import com.nis.util.Constants; @@ -23,40 +24,51 @@ public class ServiceDictInfoService extends BaseService{ private ServiceDictInfoDao serviceDictInfoDao; /** - * 查询分类性质字典分页 + * 查询分类性质字典分页(无条件查询) * @param page * @param serviceDictInfo * @return */ - public Page findDictList(Page page, ServiceDictInfo serviceDictInfo) { + public Page findTopDictList(Page page, ServiceDictInfo serviceDictInfo) { // 设置分页参数 serviceDictInfo.setPage(page); - // 执行分页查询 - List list = Lists.newArrayList(); - List sourcelist = serviceDictInfoDao.findDictList(serviceDictInfo); - ServiceDictInfo.sortList(list, sourcelist, 0l, true); - page.setList(sourcelist); + //查出顶层分页查询 + List parentList = serviceDictInfoDao.findTopDictList(serviceDictInfo); + page.setList(parentList); return page; } + /** + * 查询所有有效字典配置 + * @return + */ + public List findAllDictList() { + + return serviceDictInfoDao.findAllDictList(new ServiceDictInfo()); + } /** - * 查询标签分页 + * 查询所有的非叶子配置 + */ + public List findAllNoLeafDictList() { + return serviceDictInfoDao.findAllNoLeafDictList(); + } + /** + * 查询分类性质字典分页(含条件查询) * @param page * @param serviceDictInfo * @return */ - public Page findDictMarkList(Page page, ServiceDictInfo serviceDictInfo) { + public Page findDictSearchList(Page page, ServiceDictInfo serviceDictInfo) { // 设置分页参数 - serviceDictInfo.setPage(page); - // 执行分页查询 - List list = Lists.newArrayList(); - List sourcelist = serviceDictInfoDao.findDictMarkList(serviceDictInfo); - ServiceDictInfo.sortList(list, sourcelist, 0l, true); - page.setList(sourcelist); - return page; + serviceDictInfo.setPage(page); + List parentList = serviceDictInfoDao.findDictSearchList(serviceDictInfo); + page.setList(parentList); + return page; } + + /** * 根据主键查询字典详细信息 * @param serviceDictId @@ -99,19 +111,82 @@ public class ServiceDictInfoService extends BaseService{ * 查询所有非叶子节点字典配置信息 * @return */ - public List findAllDict() { +/* public List findAllDict() { return serviceDictInfoDao.findAllDict(); - } + }*/ /** * 删除 * @param serviceDictInfo */ public void deleteDict(ServiceDictInfo serviceDictInfo) { - serviceDictInfo.setIsValid(0); - serviceDictInfoDao.delete(serviceDictInfo); + List list = Lists.newArrayList(); + //找出所有下级 + //查出所有节点 + ServiceDictInfo.sortList(list, serviceDictInfoDao.findAllDictList(new ServiceDictInfo()), serviceDictInfo.getServiceDictId(), true); + list.add(serviceDictInfo); + for(ServiceDictInfo se:list){ + se.setIsValid(0); + serviceDictInfoDao.delete(se); + } + } + + + + //标签管理 + + /** + * 查询标签分页(无条件查询) + * @param page + * @param serviceDictInfo + * @return + */ + public Page findTopDictMarkList(Page page, ServiceDictInfo serviceDictInfo) { + // 设置分页参数 + serviceDictInfo.setPage(page); + //查出顶层分页查询 + List parentList = serviceDictInfoDao.findTopDictMarkList(serviceDictInfo); + page.setList(parentList); + return page; + } + /** + * 查询所有有效标签配置 + * @return + */ + public List findAllDictMarkList() { + + return serviceDictInfoDao.findAllDictMarkList(new ServiceDictInfo()); + } + + /** + * 查询标签字典分页(含条件查询) + * @param page + * @param serviceDictInfo + * @return + */ + public Page findDictSearchMarkList(Page page, ServiceDictInfo serviceDictInfo) { + // 设置分页参数 + serviceDictInfo.setPage(page); + List parentList = serviceDictInfoDao.findDictSearchMarkList(serviceDictInfo); + page.setList(parentList); + return page; + } + + + + /** + * 查询所有的非叶子配置 + */ + public List findAllNoLeafDictMarkList() { + return serviceDictInfoDao.findAllNoLeafDictMarkList(); + } + + + + + /** * * findFlDict(查找所有有效的分类) @@ -185,5 +260,10 @@ public class ServiceDictInfoService extends BaseService{ public List findAllLableDict() { return serviceDictInfoDao.findAllItemDict(Constants.ITEM_TYPE_LABEL); } + + + + + } diff --git a/src/main/webapp/WEB-INF/views/cfg/serviceDictForm.jsp b/src/main/webapp/WEB-INF/views/cfg/serviceDictForm.jsp index 743cc5fb7..edb42c577 100644 --- a/src/main/webapp/WEB-INF/views/cfg/serviceDictForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/serviceDictForm.jsp @@ -91,14 +91,9 @@
    - <%--
    - -
    --%> -
    - <%-- --%> - +
    diff --git a/src/main/webapp/WEB-INF/views/cfg/serviceDictInfo.jsp b/src/main/webapp/WEB-INF/views/cfg/serviceDictInfo.jsp index 166eaa0a4..345755641 100644 --- a/src/main/webapp/WEB-INF/views/cfg/serviceDictInfo.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/serviceDictInfo.jsp @@ -71,7 +71,7 @@
    - +
    diff --git a/src/main/webapp/WEB-INF/views/cfg/serviceDictInfoSearchList.jsp b/src/main/webapp/WEB-INF/views/cfg/serviceDictInfoSearchList.jsp new file mode 100644 index 000000000..99710a3da --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/serviceDictInfoSearchList.jsp @@ -0,0 +1,122 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +分类性质配置信息 + + + + + + +
    + + +

    + 分类性质管理 +

    + +
    +
    +
    +
    +
    + 分类性质搜索结果 +
    +
    +
    + +
    + + + +
    + + + + : " onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/> + : " onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/> + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    配置内容配置编码描述信息数据类型叶子节点创建人员创建时间最近修改人员最近修改时间操作
    ${serviceDictInfo.itemValue}${serviceDictInfo.itemCode}${fns:abbr(serviceDictInfo.itemDesc,15)}${fns:getDictLabel("SERVICE_DICT_ITM_TYPE",serviceDictInfo.itemType,"0")}${fns:getDictLabel("SYS_YES_NO",serviceDictInfo.isLeaf,"0")}${serviceDictInfo.serviceDictCreator.id}${serviceDictInfo.serviceDictEditor.name} +
    + + +
    +
    +
    ${page}
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/serviceDictInfoSearchMarkList.jsp b/src/main/webapp/WEB-INF/views/cfg/serviceDictInfoSearchMarkList.jsp new file mode 100644 index 000000000..579cb1552 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/serviceDictInfoSearchMarkList.jsp @@ -0,0 +1,122 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +标签配置信息 + + + + + + +
    + + +

    + 标签管理 +

    + +
    +
    +
    +
    +
    + 标签搜索结果 +
    +
    +
    + +
    + + + +
    + + + + : " onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/> + : " onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/> + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    配置内容配置编码描述信息数据类型叶子节点创建人员创建时间最近修改人员最近修改时间操作
    ${serviceDictInfo.itemValue}${serviceDictInfo.itemCode}${fns:abbr(serviceDictInfo.itemDesc,15)}${fns:getDictLabel("SERVICE_DICT_ITM_TYPE",serviceDictInfo.itemType,"0")}${fns:getDictLabel("SYS_YES_NO",serviceDictInfo.isLeaf,"0")}${serviceDictInfo.serviceDictCreator.id}${serviceDictInfo.serviceDictEditor.name} +
    + + +
    +
    +
    ${page}
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/serviceDictList.jsp b/src/main/webapp/WEB-INF/views/cfg/serviceDictList.jsp index bb559abc9..8ac7b72c9 100644 --- a/src/main/webapp/WEB-INF/views/cfg/serviceDictList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/serviceDictList.jsp @@ -3,137 +3,134 @@ 分类性质配置信息 - - - + - - -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - - - -
    - - - - " onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/> - " onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/> - - +

    + 分类性质管理 +

    + +
    +
    +
    +
    +
    + 分类性质配置列表
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- --%> - - - - - -
    编码编码对应值描述信息数据类型创建时间操作
    ${serviceDictInfo.itemCode}${serviceDictInfo.itemValue}${fns:abbr(serviceDictInfo.itemDesc,15)}${fns:getDictLabel("SERVICE_DICT_ITM_TYPE",serviceDictInfo.itemType,"0")} - - -
    - 操作 - - -
    - -
    -
    ${page}
    -
    -
    -
    -
    +
    +
    +
    + + + + +
    + + + + : " onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/> + : " onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/> + + +
    +
    + + + + + + + + + + + + + + + + +
    配置内容配置编码描述信息数据类型叶子节点创建人员创建时间最近修改人员最近修改时间操作
    ${serviceDictInfo.itemValue}${serviceDictInfo.itemCode}${fns:abbr(serviceDictInfo.itemDesc,15)}${fns:getDictLabel("SERVICE_DICT_ITM_TYPE",serviceDictInfo.itemType,"0")}${fns:getDictLabel("SYS_YES_NO",serviceDictInfo.isLeaf,"0")} + ${fns:getUserById(serviceDictInfo.serviceDictCreator.id).name} + + ${fns:getUserById(serviceDictInfo.serviceDictEditor.id).name} + +
    + 操作 + +
    +
    + + +
    +
    +
    + +
    +
    +
    ${page}
    \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/serviceDictMarkForm.jsp b/src/main/webapp/WEB-INF/views/cfg/serviceDictMarkForm.jsp index 923e08db4..360c44617 100644 --- a/src/main/webapp/WEB-INF/views/cfg/serviceDictMarkForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/serviceDictMarkForm.jsp @@ -86,26 +86,31 @@
    - +
    - <%--
    - -
    --%> -
    - <%-- --%> - +
    - - +
    diff --git a/src/main/webapp/WEB-INF/views/cfg/serviceDictMarkList.jsp b/src/main/webapp/WEB-INF/views/cfg/serviceDictMarkList.jsp index c2fdefd12..eb1ac56e4 100644 --- a/src/main/webapp/WEB-INF/views/cfg/serviceDictMarkList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/serviceDictMarkList.jsp @@ -2,138 +2,135 @@ <%@ include file="/WEB-INF/include/taglib.jsp"%> -分标签配置信息 - - - + - - -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - - - -
    - - - - " onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/> - " onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/> - - +

    + 标签配置管理 +

    + +
    +
    +
    +
    +
    + 标签配置列表
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- --%> - - - - - -
    编码编码对应值描述信息数据类型创建时间操作
    ${serviceDictInfo.itemCode}${serviceDictInfo.itemValue}${fns:abbr(serviceDictInfo.itemDesc,15)}${fns:getDictLabel("SERVICE_DICT_ITM_TYPE",serviceDictInfo.itemType,"0")} - - -
    - 操作 - - -
    - -
    -
    ${page}
    -
    -
    -
    -
    +
    +
    +
    + + + + +
    + + + + : " onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/> + : " onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/> + + +
    +
    + + + + + + + + + + + + + + + + +
    配置内容配置编码描述信息数据类型叶子节点创建人员创建时间最近修改人员最近修改时间操作
    ${serviceDictInfo.itemValue}${serviceDictInfo.itemCode}${fns:abbr(serviceDictInfo.itemDesc,15)}${fns:getDictLabel("SERVICE_DICT_ITM_TYPE",serviceDictInfo.itemType,"0")}${fns:getDictLabel("SYS_YES_NO",serviceDictInfo.isLeaf,"0")} + ${fns:getUserById(serviceDictInfo.serviceDictCreator.id).name} + + ${fns:getUserById(serviceDictInfo.serviceDictEditor.id).name} + +
    + 操作 + +
    +
    + + +
    +
    +
    + +
    +
    +
    ${page}
    \ No newline at end of file diff --git a/src/main/webapp/static/pages/css/dictInfo.css b/src/main/webapp/static/pages/css/dictInfo.css index 98551a010..3e9220df3 100644 --- a/src/main/webapp/static/pages/css/dictInfo.css +++ b/src/main/webapp/static/pages/css/dictInfo.css @@ -6,3 +6,16 @@ sysDict serviceDict margin-right: 5px; margin-left: 8px; } + + .input-medium { + width: 155px !important; +} + .Wdate { + border: #c2cad8 1px solid; + height: 26px; +} + +.dropdown-menu { + min-width: 50px; +} + diff --git a/src/main/webapp/static/pages/scripts/dict.js b/src/main/webapp/static/pages/scripts/dict.js new file mode 100644 index 000000000..321cc231d --- /dev/null +++ b/src/main/webapp/static/pages/scripts/dict.js @@ -0,0 +1,34 @@ +$(document).ready(function() { + jQuery.validator.addMethod("codeNumber",function(value,element){ + return value>=0&value<=20000000},"请填写正确的数值"); + $("#name").focus(); + $("#searchForm").validate({ + //需验证 item_code item_value + rules: { + 'itemCode':{ + digits:true, + codeNumber:true + } + }, + messages: { + 'itemCode':{ + digits:'请填写整数值', + codeNumber:'请填写合适的数值(0~200000000)' + } + }, + + submitHandler: function(form){ + loading('正在处理,请稍等...'); + form.submit(); + }, + errorContainer: "#messageBox", + errorPlacement: function(error, element) { + $("#messageBox").text("输入有误,请先更正。"); + if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){ + error.appendTo(element.parent().parent()); + } else { + error.insertAfter(element); + } + } + }); + }); \ No newline at end of file