业务辅助配置-分类管理、菜单管理 (业务字典),生效范围管理(系统字典)
This commit is contained in:
151
src/main/java/com/nis/domain/configuration/ServiceDictInfo.java
Normal file
151
src/main/java/com/nis/domain/configuration/ServiceDictInfo.java
Normal file
@@ -0,0 +1,151 @@
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonBackReference;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.nis.domain.BaseEntity;
|
||||
import com.nis.domain.SysMenu;
|
||||
import com.nis.domain.SysUser;
|
||||
/**
|
||||
* 业务辅助表-业务字典信息表
|
||||
* @author zsl
|
||||
*
|
||||
*/
|
||||
public class ServiceDictInfo extends BaseEntity<ServiceDictInfo>{
|
||||
|
||||
private static final long serialVersionUID = 4680466118906894338L;
|
||||
|
||||
private Integer serviceDictId; //service_dict_id 字典ID int N 主键,自增
|
||||
private Integer itemType; //item_type 数据类型 int N 1:分类 2:性质 3:标签
|
||||
private Integer itemCode; //item_code编码 int N
|
||||
private String itemValue; //item_value 编码对应值 varchar2(64) N
|
||||
private String itemDesc; //item_desc 描述信息 varcahr2(128) Y
|
||||
private ServiceDictInfo parent; //parent_id 父ID number(9) N 无父属性,默认填0
|
||||
private Integer isLeaf; //is_leaf 是否叶子节点 int N 0-否 1-是;只有一级填0;
|
||||
private Integer isValid; //is_valid 有效标志 int N 1-有效 0-无效
|
||||
private SysUser serviceDictCreator; //creator_id 创建人员 int N 取自sys_user.id
|
||||
private Date createTime; //create_time 配置时间 date N
|
||||
private SysUser serviceDictEditor; //editor_id 修改人员 int Y 取自sys_user.id
|
||||
private Date editTime; //edit_time 修改时间 date Y
|
||||
private List<ServiceDictInfo> ChildrenList = new ArrayList<ServiceDictInfo>();//字列表
|
||||
|
||||
private Date beginDate; // 开始日期
|
||||
private Date endDate; // 结束日期
|
||||
|
||||
public Integer getServiceDictId() {
|
||||
return serviceDictId;
|
||||
}
|
||||
public void setServiceDictId(Integer serviceDictId) {
|
||||
this.serviceDictId = serviceDictId;
|
||||
}
|
||||
public Integer getItemType() {
|
||||
return itemType;
|
||||
}
|
||||
public void setItemType(Integer itemType) {
|
||||
this.itemType = itemType;
|
||||
}
|
||||
public Integer getItemCode() {
|
||||
return itemCode;
|
||||
}
|
||||
public void setItemCode(Integer itemCode) {
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
public String getItemValue() {
|
||||
return itemValue;
|
||||
}
|
||||
public void setItemValue(String itemValue) {
|
||||
this.itemValue = itemValue;
|
||||
}
|
||||
public String getItemDesc() {
|
||||
return itemDesc;
|
||||
}
|
||||
public void setItemDesc(String itemDesc) {
|
||||
this.itemDesc = itemDesc;
|
||||
}
|
||||
@JsonBackReference
|
||||
public ServiceDictInfo getParent() {
|
||||
return parent;
|
||||
}
|
||||
public void setParent(ServiceDictInfo parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
public Integer getIsLeaf() {
|
||||
return isLeaf;
|
||||
}
|
||||
public void setIsLeaf(Integer isLeaf) {
|
||||
this.isLeaf = isLeaf;
|
||||
}
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
|
||||
public SysUser getServiceDictCreator() {
|
||||
return serviceDictCreator;
|
||||
}
|
||||
public void setServiceDictCreator(SysUser serviceDictCreator) {
|
||||
this.serviceDictCreator = serviceDictCreator;
|
||||
}
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
public SysUser getServiceDictEditor() {
|
||||
return serviceDictEditor;
|
||||
}
|
||||
public void setServiceDictEditor(SysUser serviceDictEditor) {
|
||||
this.serviceDictEditor = serviceDictEditor;
|
||||
}
|
||||
public Date getEditTime() {
|
||||
return editTime;
|
||||
}
|
||||
public void setEditTime(Date editTime) {
|
||||
this.editTime = editTime;
|
||||
}
|
||||
public List<ServiceDictInfo> getChildrenList() {
|
||||
return ChildrenList;
|
||||
}
|
||||
public void setChildrenList(List<ServiceDictInfo> childrenList) {
|
||||
ChildrenList = childrenList;
|
||||
}
|
||||
public Date getBeginDate() {
|
||||
return beginDate;
|
||||
}
|
||||
public void setBeginDate(Date beginDate) {
|
||||
this.beginDate = beginDate;
|
||||
}
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
@JsonIgnore
|
||||
public static void sortList(List<ServiceDictInfo> list, List<ServiceDictInfo> sourcelist, Long parentId, boolean cascade){
|
||||
for (int i=0; i<sourcelist.size(); i++){
|
||||
ServiceDictInfo serviceDictInfo = sourcelist.get(i);
|
||||
if (serviceDictInfo.getParent()!=null && serviceDictInfo.getParent().getId()!=null
|
||||
&& serviceDictInfo.getParent().getId().equals(parentId)){
|
||||
list.add(serviceDictInfo);
|
||||
if (cascade){
|
||||
// 判断是否还有子节点, 有则继续获取子节点
|
||||
for (int j=0; j<sourcelist.size(); j++){
|
||||
ServiceDictInfo child = sourcelist.get(j);
|
||||
if (child.getParent()!=null && child.getParent().getId()!=null
|
||||
&& child.getParent().getId().equals(serviceDictInfo.getId())){
|
||||
sortList(list, sourcelist, serviceDictInfo.getId(), true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
149
src/main/java/com/nis/domain/configuration/SysDictInfo.java
Normal file
149
src/main/java/com/nis/domain/configuration/SysDictInfo.java
Normal file
@@ -0,0 +1,149 @@
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.nis.domain.BaseEntity;
|
||||
import com.nis.domain.SysUser;
|
||||
/**
|
||||
* 业务辅助表-系统字典信息表
|
||||
* @author zsl
|
||||
*
|
||||
*/
|
||||
public class SysDictInfo extends BaseEntity<SysDictInfo>{
|
||||
|
||||
private static final long serialVersionUID = 893702645278342859L;
|
||||
|
||||
private Integer sysDictId; //service_dict_id 字典ID int N 主键,自增
|
||||
private Integer itemType; //item_type 数据类型 int N 1:分类 2:性质 3:标签
|
||||
private Integer itemCode; //item_code编码 int N
|
||||
private String itemValue; //item_value 编码对应值 varchar2(64) N
|
||||
private String desc; //desc 描述信息 varcahr2(128) Y
|
||||
private SysDictInfo parent; //parent_id 父ID number(9) N 无父属性,默认填0
|
||||
private Integer isLeaf; //is_leaf 是否叶子节点 int N 0-否 1-是;只有一级填0;
|
||||
private Integer isValid; //is_valid 有效标志 int N 1-有效 0-无效
|
||||
private SysUser sysDictCreator; //creator_id 创建人员 int N 取自sys_user.id
|
||||
private Date createTime; //create_time 配置时间 date N
|
||||
private SysUser sysDictEditor; //editor_id 修改人员 int Y 取自sys_user.id
|
||||
private Date editTime; //edit_time 修改时间 date Y
|
||||
private List<ServiceDictInfo> ChildrenList = new ArrayList<ServiceDictInfo>();//字列表
|
||||
|
||||
private Date beginDate; // 开始日期
|
||||
private Date endDate; // 结束日期
|
||||
|
||||
|
||||
public Integer getSysDictId() {
|
||||
return sysDictId;
|
||||
}
|
||||
public void setSysDictId(Integer sysDictId) {
|
||||
this.sysDictId = sysDictId;
|
||||
}
|
||||
public Integer getItemType() {
|
||||
return itemType;
|
||||
}
|
||||
public void setItemType(Integer itemType) {
|
||||
this.itemType = itemType;
|
||||
}
|
||||
public Integer getItemCode() {
|
||||
return itemCode;
|
||||
}
|
||||
public void setItemCode(Integer itemCode) {
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
public String getItemValue() {
|
||||
return itemValue;
|
||||
}
|
||||
public void setItemValue(String itemValue) {
|
||||
this.itemValue = itemValue;
|
||||
}
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
public SysDictInfo getParent() {
|
||||
return parent;
|
||||
}
|
||||
public void setParent(SysDictInfo parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
public Integer getIsLeaf() {
|
||||
return isLeaf;
|
||||
}
|
||||
public void setIsLeaf(Integer isLeaf) {
|
||||
this.isLeaf = isLeaf;
|
||||
}
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
public SysUser getSysDictCreator() {
|
||||
return sysDictCreator;
|
||||
}
|
||||
public void setSysDictCreator(SysUser sysDictCreator) {
|
||||
this.sysDictCreator = sysDictCreator;
|
||||
}
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
public SysUser getSysDictEditor() {
|
||||
return sysDictEditor;
|
||||
}
|
||||
public void setSysDictEditor(SysUser sysDictEditor) {
|
||||
this.sysDictEditor = sysDictEditor;
|
||||
}
|
||||
public Date getEditTime() {
|
||||
return editTime;
|
||||
}
|
||||
public void setEditTime(Date editTime) {
|
||||
this.editTime = editTime;
|
||||
}
|
||||
public List<ServiceDictInfo> getChildrenList() {
|
||||
return ChildrenList;
|
||||
}
|
||||
public void setChildrenList(List<ServiceDictInfo> childrenList) {
|
||||
ChildrenList = childrenList;
|
||||
}
|
||||
public Date getBeginDate() {
|
||||
return beginDate;
|
||||
}
|
||||
public void setBeginDate(Date beginDate) {
|
||||
this.beginDate = beginDate;
|
||||
}
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
@JsonIgnore
|
||||
public static void sortList(List<SysDictInfo> list, List<SysDictInfo> sourcelist, Integer parentId, boolean cascade){
|
||||
for (int i=0; i<sourcelist.size(); i++){
|
||||
SysDictInfo sysDictInfo = sourcelist.get(i);
|
||||
if (sysDictInfo.getParent()!=null && sysDictInfo.getParent().getSysDictId()!=null
|
||||
&& sysDictInfo.getParent().getSysDictId().equals(parentId)){
|
||||
list.add(sysDictInfo);
|
||||
if (cascade){
|
||||
// 判断是否还有子节点, 有则继续获取子节点
|
||||
for (int j=0; j<sourcelist.size(); j++){
|
||||
SysDictInfo child = sourcelist.get(j);
|
||||
if (child.getParent()!=null && child.getParent().getSysDictId()!=null
|
||||
&& child.getParent().getSysDictId().equals(sysDictInfo.getSysDictId())){
|
||||
sortList(list, sourcelist, sysDictInfo.getSysDictId(), true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,7 +31,9 @@ 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.ServiceDictInfoService;
|
||||
import com.nis.web.service.configuration.SslCfgService;
|
||||
import com.nis.web.service.configuration.SysDictInfoService;
|
||||
import com.nis.web.service.configuration.TunnelCfgService;
|
||||
import com.nis.web.service.configuration.WebCfgService;
|
||||
import com.nis.web.service.systemService.SystemServiceService;
|
||||
@@ -92,6 +94,12 @@ public class BaseController {
|
||||
@Autowired
|
||||
protected SystemServiceService systemServiceService;
|
||||
|
||||
@Autowired
|
||||
protected ServiceDictInfoService serviceDictInfoService;
|
||||
|
||||
@Autowired
|
||||
protected SysDictInfoService sysDictInfoService;
|
||||
|
||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
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;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/configuration/serviceDictInfo")
|
||||
public class ServiceDictInfoController extends BaseController {
|
||||
|
||||
|
||||
@ModelAttribute
|
||||
public ServiceDictInfo get(@RequestParam(required=false) Integer serviceDictId) {
|
||||
if (!StringUtil.isEmpty(serviceDictId)){
|
||||
return serviceDictInfoService.getDictById(serviceDictId);
|
||||
}else{
|
||||
return new ServiceDictInfo();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据serviceDictId查出配置对象
|
||||
* @param serviceDictId
|
||||
* @param request
|
||||
* @param response
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "loadDataDict")
|
||||
public ServiceDictInfo loadDataDict(@RequestParam(required=false) Integer serviceDictId,HttpServletRequest request, HttpServletResponse response, Model model){
|
||||
|
||||
return serviceDictInfoService.getDictById(serviceDictId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询业务辅助表-业务字典信息列表
|
||||
* @param serviceDictInfo
|
||||
* @param request
|
||||
* @param response
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findDictList(new Page<ServiceDictInfo>(request, response), serviceDictInfo);
|
||||
model.addAttribute("page", page);
|
||||
|
||||
return "/cfg/serviceDictList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入添加或修改页面
|
||||
* @param serviceDictInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value={"form"})
|
||||
public String form(ServiceDictInfo serviceDictInfo, Model model,String doAction) {
|
||||
if(doAction!=null&&doAction.equals("0")){
|
||||
return "/cfg/serviceDictInfo";
|
||||
}
|
||||
return "/cfg/serviceDictForm";
|
||||
}
|
||||
/**
|
||||
* 新增或修改
|
||||
* @param serviceDictInfo
|
||||
* @param model
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:edit")
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(ServiceDictInfo serviceDictInfo,Model model, RedirectAttributes redirectAttributes) {
|
||||
|
||||
try {
|
||||
serviceDictInfoService.saveOrUpdate(serviceDictInfo);
|
||||
addMessage(redirectAttributes, "保存配置成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "保存配置失败!");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/list";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param serviceDictInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value={"delete"})
|
||||
public String delete(ServiceDictInfo serviceDictInfo, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
serviceDictInfoService.deleteDict(serviceDictInfo);
|
||||
addMessage(redirectAttributes, "删除配置成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "删除配置失败!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/list";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* isShowHide是否显示隐藏菜单
|
||||
* @param extId
|
||||
* @param isShowHidden
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "treeData")
|
||||
public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, HttpServletResponse response) {
|
||||
List<Map<String, Object>> mapList = Lists.newArrayList();
|
||||
List<ServiceDictInfo> list = serviceDictInfoService.findAllDict();
|
||||
for (int i=0; i<list.size(); i++){
|
||||
ServiceDictInfo serviceDictInfo = list.get(i);
|
||||
if (StringUtils.isBlank(extId) || (extId !=null && !extId.equals(serviceDictInfo.getServiceDictId().toString()))) {
|
||||
if(isShowHide != null && isShowHide.equals("0") && serviceDictInfo.getIsValid().equals(0)){
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("id", serviceDictInfo.getServiceDictId());
|
||||
map.put("pId", serviceDictInfo.getParent().getServiceDictId());
|
||||
map.put("name",serviceDictInfo.getItemValue());
|
||||
mapList.add(map);
|
||||
}
|
||||
}
|
||||
return mapList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//标签配置
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 进入添加或修改页面
|
||||
* @param serviceDictInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value={"markForm"})
|
||||
public String markForm(ServiceDictInfo serviceDictInfo, Model model,String doAction) {
|
||||
if(doAction!=null&&doAction.equals("0")){
|
||||
return "/cfg/serviceDictMarkInfo";
|
||||
}
|
||||
return "/cfg/serviceDictMarkForm";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询业务辅助表-业务字典信息列表
|
||||
* @param serviceDictInfo
|
||||
* @param request
|
||||
* @param response
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = {"markList"})
|
||||
public String markList(ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findDictMarkList(new Page<ServiceDictInfo>(request, response), serviceDictInfo);
|
||||
model.addAttribute("page", page);
|
||||
|
||||
return "/cfg/serviceDictMarkList";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增或修改
|
||||
* @param serviceDictInfo
|
||||
* @param model
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:edit")
|
||||
@RequestMapping(value = "markSaveOrUpdate")
|
||||
public String markSaveOrUpdate(ServiceDictInfo serviceDictInfo,Model model, RedirectAttributes redirectAttributes) {
|
||||
|
||||
try {
|
||||
serviceDictInfoService.saveOrUpdate(serviceDictInfo);
|
||||
addMessage(redirectAttributes, "保存配置成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "保存配置失败!");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/markList";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param serviceDictInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value={"markDelete"})
|
||||
public String markDelete(ServiceDictInfo serviceDictInfo, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
serviceDictInfoService.deleteDict(serviceDictInfo);
|
||||
addMessage(redirectAttributes, "删除配置成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "删除配置失败!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/markList";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
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.configuration.SysDictInfo;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/configuration/sysDictInfo")
|
||||
public class SysDictInfoController extends BaseController {
|
||||
|
||||
|
||||
@ModelAttribute
|
||||
public SysDictInfo get(@RequestParam(required=false) Integer sysDictId) {
|
||||
if (!StringUtil.isEmpty(sysDictId)){
|
||||
return sysDictInfoService.getDictById(sysDictId);
|
||||
}else{
|
||||
return new SysDictInfo();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据sysDictId查出配置对象
|
||||
* @param sysDictId
|
||||
* @param request
|
||||
* @param response
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "loadDataDict")
|
||||
public SysDictInfo loadDataDict(@RequestParam(required=false) Integer sysDictId,HttpServletRequest request, HttpServletResponse response, Model model){
|
||||
|
||||
return sysDictInfoService.getDictById(sysDictId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询业务辅助表-生效范围系统字典信息列表
|
||||
* @param sysDictInfo
|
||||
* @param request
|
||||
* @param response
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(SysDictInfo sysDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
|
||||
Page<SysDictInfo> page = sysDictInfoService.findDictList(new Page<SysDictInfo>(request, response), sysDictInfo);
|
||||
model.addAttribute("page", page);
|
||||
|
||||
return "/cfg/sysDictList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入添加或修改页面
|
||||
* @param sysDictInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value={"form"})
|
||||
public String form(SysDictInfo sysDictInfo, Model model,String doAction) {
|
||||
if(doAction!=null&&doAction.equals("0")){
|
||||
return "/cfg/sysDictInfo";
|
||||
}
|
||||
return "/cfg/sysDictForm";
|
||||
}
|
||||
/**
|
||||
* 新增或修改
|
||||
* @param sysDictInfo
|
||||
* @param model
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:edit")
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(SysDictInfo sysDictInfo,Model model, RedirectAttributes redirectAttributes) {
|
||||
|
||||
try {
|
||||
sysDictInfoService.saveOrUpdate(sysDictInfo);
|
||||
addMessage(redirectAttributes, "保存配置成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "保存配置失败!");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/configuration/sysDictInfo/list";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param sysDictInfo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value={"delete"})
|
||||
public String delete(SysDictInfo sysDictInfo, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
sysDictInfoService.deleteDict(sysDictInfo);
|
||||
addMessage(redirectAttributes, "删除配置成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "删除配置失败!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/configuration/sysDictInfo/list";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.nis.web.dao.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
|
||||
|
||||
/**
|
||||
* 查询分类性质字典列表,
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findDictList(ServiceDictInfo serviceDictInfo);
|
||||
|
||||
/**
|
||||
* 查询标签字典列表
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findDictMarkList(ServiceDictInfo serviceDictInfo);
|
||||
|
||||
|
||||
/**
|
||||
* 添加字典信息
|
||||
* @param serviceDictInfo
|
||||
*/
|
||||
void insertDict(ServiceDictInfo serviceDictInfo);
|
||||
|
||||
/**
|
||||
* 根据主键查询字典详细信息
|
||||
* @param serviceDictId
|
||||
* @return
|
||||
*/
|
||||
ServiceDictInfo getDictById(Integer serviceDictId);
|
||||
|
||||
/**
|
||||
* 查询所有非叶子节点字典配置信息
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findAllDict();
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.configuration.ServiceDictInfoDao" >
|
||||
|
||||
<resultMap id="dictResultMap" type="com.nis.domain.configuration.ServiceDictInfo" >
|
||||
<id column="service_dict_id" property="serviceDictId" jdbcType="INTEGER" />
|
||||
<result column="item_type" property="itemType" jdbcType="INTEGER" />
|
||||
<result column="item_code" property="itemCode" jdbcType="INTEGER" />
|
||||
<result column="item_value" property="itemValue" jdbcType="VARCHAR" />
|
||||
<result column="item_desc" property="itemDesc" jdbcType="VARCHAR" />
|
||||
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||
<!-- 父id -->
|
||||
<association property="parent" javaType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
<id column="service_dict_id" property="serviceDictId" jdbcType="INTEGER" />
|
||||
<result column="item_type" property="itemType" jdbcType="INTEGER" />
|
||||
<result column="item_code" property="itemCode" jdbcType="INTEGER" />
|
||||
<result column="item_value" property="itemValue" jdbcType="VARCHAR" />
|
||||
<result column="item_desc" property="itemDesc" jdbcType="VARCHAR" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
</association>
|
||||
<!-- 创建人员 -->
|
||||
<association property="serviceDictCreator" javaType="com.nis.domain.SysUser">
|
||||
<id property="id" column="id"/>
|
||||
<result property="loginId" column="login_id"/>
|
||||
<result property="name" column="name"/>
|
||||
</association>
|
||||
<!-- 修改人员 -->
|
||||
<association property="serviceDictEditor" javaType="com.nis.domain.SysUser">
|
||||
<id property="id" column="id"/>
|
||||
<result property="loginId" column="login_id"/>
|
||||
<result property="name" column="name"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<sql id="serviceDictInfoColumns">
|
||||
s.service_dict_id AS serviceDictId,
|
||||
s.item_type AS itemType,
|
||||
s.item_code AS itemCode,
|
||||
s.item_value AS itemValue,
|
||||
s.item_desc AS itemDesc,
|
||||
s.parent_id AS "parent.serviceDictId",
|
||||
s.is_leaf AS isLeaf,
|
||||
s.is_valid AS isValid,
|
||||
s.creator_id AS "serviceDictCreator.id",
|
||||
s.create_time AS createTime,
|
||||
s.editor_id AS "serviceDictEditor.id",
|
||||
s.edit_time AS editTime
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<!-- 查询分类性质列表 -->
|
||||
<select id="findDictList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type <![CDATA[<>]]> 3
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type like '%${itemType}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 查询标签列表 -->
|
||||
<select id="findDictMarkList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type=3
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type like '%${itemType}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 根据主键查询字典详细信息 -->
|
||||
|
||||
<select id="getDictById" resultType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
from service_dict_info s where s.service_dict_id = #{serviceDictId}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!-- 新增字典信息 -->
|
||||
|
||||
<insert id="insertDict" parameterType="com.nis.domain.configuration.ServiceDictInfo" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into service_dict_info (item_type, item_code, item_value, item_desc, parent_id, is_leaf, is_valid, creator_id, create_time, editor_id, edit_time)
|
||||
values ( #{itemType,jdbcType=INTEGER}, #{itemCode,jdbcType=INTEGER},
|
||||
#{itemValue,jdbcType=VARCHAR}, #{itemDesc,jdbcType=VARCHAR},
|
||||
#{parent.serviceDictId,jdbcType=INTEGER}, #{isLeaf,jdbcType=INTEGER}, #{isValid,jdbcType=INTEGER},
|
||||
#{serviceDictCreator.id,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{serviceDictEditor.id,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 查询非叶子节点的所有字典信息 -->
|
||||
|
||||
<select id="findAllDict">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns" />
|
||||
from service_dict_info s where s.is_leaf = 0;
|
||||
</select>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="update">
|
||||
UPDATE service_dict_info s SET
|
||||
s.service_dict_id = #{serviceDictId},
|
||||
s.item_type = #{itemType},
|
||||
s.item_code = #{itemCode},
|
||||
s.item_value = #{itemValue},
|
||||
s.item_desc = #{itemDesc},
|
||||
s.parent_id = #{parent.serviceDictId},
|
||||
s.is_leaf = #{isLeaf},
|
||||
s.creator_id = #{serviceDictCreator.id},
|
||||
s.editor_id = #{serviceDictEditor.id},
|
||||
s.edit_time = #{editTime}
|
||||
WHERE s.service_dict_id = #{serviceDictId}
|
||||
</update>
|
||||
|
||||
<!-- 删除 -->
|
||||
|
||||
<update id="delete">
|
||||
UPDATE service_dict_info s set s.is_valid = #{isValid} where s.service_dict_id = #{serviceDictId}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.nis.web.dao.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.configuration.SysDictInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface SysDictInfoDao extends CrudDao<SysDictInfo> {
|
||||
|
||||
/**
|
||||
* 查询生效范围字典列表,
|
||||
* @param sysDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> findDictList(SysDictInfo sysDictInfo);
|
||||
|
||||
|
||||
/**
|
||||
* 添加字典信息
|
||||
* @param sysDictInfo
|
||||
*/
|
||||
void insertDict(SysDictInfo sysDictInfo);
|
||||
|
||||
/**
|
||||
* 根据主键查询字典详细信息
|
||||
* @param sysDictId
|
||||
* @return
|
||||
*/
|
||||
SysDictInfo getDictById(Integer sysDictId);
|
||||
|
||||
/**
|
||||
* 查询所有非叶子节点字典配置信息
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> findAllDict();
|
||||
|
||||
|
||||
}
|
||||
135
src/main/java/com/nis/web/dao/configuration/SysDictInfoDao.xml
Normal file
135
src/main/java/com/nis/web/dao/configuration/SysDictInfoDao.xml
Normal file
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.configuration.SysDictInfoDao" >
|
||||
|
||||
<resultMap id="dictResultMap" type="com.nis.domain.configuration.SysDictInfo" >
|
||||
<id column="sys_dict_id" property="sysDictId" jdbcType="INTEGER" />
|
||||
<result column="item_type" property="itemType" jdbcType="INTEGER" />
|
||||
<result column="item_code" property="itemCode" jdbcType="INTEGER" />
|
||||
<result column="item_value" property="itemValue" jdbcType="VARCHAR" />
|
||||
<result column="item_desc" property="itemDesc" jdbcType="VARCHAR" />
|
||||
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||
<!-- 父id -->
|
||||
<association property="parent" javaType="com.nis.domain.configuration.SysDictInfo">
|
||||
<id column="sys_dict_id" property="sysDictId" jdbcType="INTEGER" />
|
||||
<result column="item_type" property="itemType" jdbcType="INTEGER" />
|
||||
<result column="item_code" property="itemCode" jdbcType="INTEGER" />
|
||||
<result column="item_value" property="itemValue" jdbcType="VARCHAR" />
|
||||
<result column="item_desc" property="itemDesc" jdbcType="VARCHAR" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
</association>
|
||||
<!-- 创建人员 -->
|
||||
<association property="sysDictCreator" javaType="com.nis.domain.SysUser">
|
||||
<id property="id" column="id"/>
|
||||
<result property="loginId" column="login_id"/>
|
||||
<result property="name" column="name"/>
|
||||
</association>
|
||||
<!-- 修改人员 -->
|
||||
<association property="sysDictEditor" javaType="com.nis.domain.SysUser">
|
||||
<id property="id" column="id"/>
|
||||
<result property="loginId" column="login_id"/>
|
||||
<result property="name" column="name"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<sql id="sysDictInfoColumns">
|
||||
s.sys_dict_id AS sysDictId,
|
||||
s.item_type AS itemType,
|
||||
s.item_code AS itemCode,
|
||||
s.item_value AS itemValue,
|
||||
s.item_desc AS itemDesc,
|
||||
s.parent_id AS "parent.sysDictId",
|
||||
s.is_leaf AS isLeaf,
|
||||
s.is_valid AS isValid,
|
||||
s.creator_id AS "sysDictCreator.id",
|
||||
s.create_time AS createTime,
|
||||
s.editor_id AS "sysDictEditor.id",
|
||||
s.edit_time AS editTime
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<!-- 查询分类性质列表 -->
|
||||
<select id="findDictList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.SysDictInfo">
|
||||
SELECT * FROM sys_dict_info WHERE is_valid=1
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type like '%${itemType}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 根据主键查询字典详细信息 -->
|
||||
|
||||
<select id="getDictById" resultType="com.nis.domain.configuration.SysDictInfo">
|
||||
select
|
||||
<include refid="sysDictInfoColumns"/>
|
||||
from sys_dict_info s where s.sys_dict_id = #{sysDictId}
|
||||
</select>
|
||||
|
||||
<!-- 新增字典信息 -->
|
||||
|
||||
<insert id="insertDict" parameterType="com.nis.domain.configuration.SysDictInfo" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into sys_dict_info (item_type, item_code, item_value, item_desc, parent_id, is_leaf, is_valid, creator_id, create_time, editor_id, edit_time)
|
||||
values ( #{itemType,jdbcType=INTEGER}, #{itemCode,jdbcType=INTEGER},
|
||||
#{itemValue,jdbcType=VARCHAR}, #{itemDesc,jdbcType=VARCHAR},
|
||||
#{parent.sysDictId,jdbcType=INTEGER}, #{isLeaf,jdbcType=INTEGER}, #{isValid,jdbcType=INTEGER},
|
||||
#{sysDictCreator.id,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{sysDictEditor.id,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 查询非叶子节点的所有字典信息 -->
|
||||
|
||||
<select id="findAllDict">
|
||||
select
|
||||
<include refid="sysDictInfoColumns" />
|
||||
from sys_dict_info s where s.is_leaf = 0;
|
||||
</select>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="update">
|
||||
UPDATE sys_dict_info s SET
|
||||
s.sys_dict_id = #{sysDictId},
|
||||
s.item_type = #{itemType},
|
||||
s.item_code = #{itemCode},
|
||||
s.item_value = #{itemValue},
|
||||
s.item_desc = #{itemDesc},
|
||||
s.parent_id = #{parent.sysDictId},
|
||||
s.is_leaf = #{isLeaf},
|
||||
s.creator_id = #{sysDictCreator.id},
|
||||
s.editor_id = #{sysDictEditor.id},
|
||||
s.edit_time = #{editTime}
|
||||
WHERE s.sys_dict_id = #{sysDictId}
|
||||
</update>
|
||||
|
||||
<!-- 删除 -->
|
||||
|
||||
<update id="delete">
|
||||
UPDATE sys_dict_info s set s.is_valid = #{isValid} where s.sys_dict_id = #{sysDictId}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.SysMenu;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.util.DateUtil;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.ServiceDictInfoDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
@Service
|
||||
public class ServiceDictInfoService extends BaseService{
|
||||
|
||||
@Autowired
|
||||
private ServiceDictInfoDao serviceDictInfoDao;
|
||||
|
||||
/**
|
||||
* 查询分类性质字典分页
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
public Page<ServiceDictInfo> findDictList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
// 执行分页查询
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
List<ServiceDictInfo> sourcelist = serviceDictInfoDao.findDictList(serviceDictInfo);
|
||||
ServiceDictInfo.sortList(list, sourcelist, 0l, true);
|
||||
page.setList(sourcelist);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询标签分页
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
public Page<ServiceDictInfo> findDictMarkList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
// 执行分页查询
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
List<ServiceDictInfo> sourcelist = serviceDictInfoDao.findDictMarkList(serviceDictInfo);
|
||||
ServiceDictInfo.sortList(list, sourcelist, 0l, true);
|
||||
page.setList(sourcelist);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询字典详细信息
|
||||
* @param serviceDictId
|
||||
* @return
|
||||
*/
|
||||
public ServiceDictInfo getDictById(Integer serviceDictId) {
|
||||
return serviceDictInfoDao.getDictById(serviceDictId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或修改业务字典表
|
||||
* @param serviceDictInfo
|
||||
*/
|
||||
public void saveOrUpdate(ServiceDictInfo serviceDictInfo) {
|
||||
SysUser user = UserUtils.getUser();
|
||||
if(StringUtil.isEmpty(serviceDictInfo.getServiceDictId())) {//新增
|
||||
serviceDictInfo.setIsValid(1);
|
||||
serviceDictInfo.setServiceDictCreator(user);
|
||||
serviceDictInfo.setCreateTime(new Date());
|
||||
serviceDictInfo.setServiceDictEditor(user);
|
||||
serviceDictInfo.setEditTime(serviceDictInfo.getCreateTime());
|
||||
if(serviceDictInfo.getParent()==null||(serviceDictInfo.getParent()!=null&&serviceDictInfo.getParent().getServiceDictId()==null)){
|
||||
ServiceDictInfo parent = new ServiceDictInfo();
|
||||
parent.setServiceDictId(0);
|
||||
serviceDictInfo.setParent(parent);
|
||||
}
|
||||
serviceDictInfoDao.insertDict(serviceDictInfo);
|
||||
|
||||
}
|
||||
|
||||
else {//修改
|
||||
serviceDictInfo.setServiceDictEditor(user);
|
||||
serviceDictInfo.setEditTime(new Date());
|
||||
serviceDictInfoDao.update(serviceDictInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有非叶子节点字典配置信息
|
||||
* @return
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllDict() {
|
||||
|
||||
return serviceDictInfoDao.findAllDict();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param serviceDictInfo
|
||||
*/
|
||||
public void deleteDict(ServiceDictInfo serviceDictInfo) {
|
||||
serviceDictInfo.setIsValid(0);
|
||||
serviceDictInfoDao.delete(serviceDictInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.domain.configuration.SysDictInfo;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.SysDictInfoDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
|
||||
@Service
|
||||
public class SysDictInfoService extends BaseService{
|
||||
|
||||
@Autowired
|
||||
private SysDictInfoDao sysDictInfoDao;
|
||||
|
||||
/**
|
||||
* 查询生效范围字典分页
|
||||
* @param page
|
||||
* @param sysDictInfo
|
||||
* @return
|
||||
*/
|
||||
public Page<SysDictInfo> findDictList(Page<SysDictInfo> page, SysDictInfo sysDictInfo) {
|
||||
// 设置分页参数
|
||||
sysDictInfo.setPage(page);
|
||||
// 执行分页查询
|
||||
List<SysDictInfo> list = Lists.newArrayList();
|
||||
List<SysDictInfo> sourcelist = sysDictInfoDao.findDictList(sysDictInfo);
|
||||
SysDictInfo.sortList(list, sourcelist, 0, true);
|
||||
page.setList(sourcelist);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询生效范围字典详细信息
|
||||
* @param sysDictId
|
||||
* @return
|
||||
*/
|
||||
public SysDictInfo getDictById(Integer sysDictId) {
|
||||
return sysDictInfoDao.getDictById(sysDictId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或修改生效范围字典表
|
||||
* @param sysDictInfo
|
||||
*/
|
||||
public void saveOrUpdate(SysDictInfo sysDictInfo) {
|
||||
SysUser user = UserUtils.getUser();
|
||||
if(StringUtil.isEmpty(sysDictInfo.getSysDictId())) {//新增
|
||||
sysDictInfo.setIsValid(1);
|
||||
sysDictInfo.setSysDictCreator(user);
|
||||
sysDictInfo.setCreateTime(new Date());
|
||||
sysDictInfo.setSysDictEditor(user);
|
||||
sysDictInfo.setEditTime(sysDictInfo.getCreateTime());
|
||||
if(sysDictInfo.getParent()==null||(sysDictInfo.getParent()!=null&&sysDictInfo.getParent().getSysDictId()==null)){
|
||||
SysDictInfo parent = new SysDictInfo();
|
||||
parent.setSysDictId(0);
|
||||
sysDictInfo.setParent(parent);
|
||||
}
|
||||
sysDictInfoDao.insertDict(sysDictInfo);
|
||||
|
||||
}
|
||||
|
||||
else {//修改
|
||||
sysDictInfo.setSysDictEditor(user);
|
||||
sysDictInfo.setEditTime(new Date());
|
||||
sysDictInfoDao.update(sysDictInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有非叶子节点生效范围字典配置信息
|
||||
* @return
|
||||
*/
|
||||
public List<SysDictInfo> findAllDict() {
|
||||
|
||||
return sysDictInfoDao.findAllDict();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param sysDictInfo
|
||||
*/
|
||||
public void deleteDict(SysDictInfo sysDictInfo) {
|
||||
sysDictInfo.setIsValid(0);
|
||||
sysDictInfoDao.delete(sysDictInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -212,6 +212,14 @@
|
||||
<example>${fns:getDictList(key)}</example>
|
||||
</function>
|
||||
|
||||
<function>
|
||||
<description>获取字典Map列表</description>
|
||||
<name>getDictOption</name>
|
||||
<function-class>com.nis.util.DictUtils</function-class>
|
||||
<function-signature>java.util.List getDictOption(java.lang.String)</function-signature>
|
||||
<example>${fns:getDictOption(key)}</example>
|
||||
</function>
|
||||
|
||||
<function>
|
||||
<description>获取字典标签</description>
|
||||
<name>getDictLabel</name>
|
||||
@@ -249,7 +257,7 @@
|
||||
<name>getDictCodeDefault</name>
|
||||
<function-class>com.nis.util.DictUtils</function-class>
|
||||
<function-signature>java.lang.String getDictCode(java.lang.String, java.lang.String)</function-signature>
|
||||
<example>${fns:getDictCode(dictKey, itemValue)}</example>
|
||||
<example>${fns:getDictCodeDefault(dictKey, itemValue)}</example>
|
||||
</function>
|
||||
|
||||
<function>
|
||||
|
||||
168
src/main/webapp/WEB-INF/views/cfg/serviceDictForm.jsp
Normal file
168
src/main/webapp/WEB-INF/views/cfg/serviceDictForm.jsp
Normal file
@@ -0,0 +1,168 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/pages/css/dictInfo.css" />
|
||||
<title>生效范围配置管理</title>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
jQuery.validator.addMethod("codeNumber",function(value,element){
|
||||
return value>=0&value<=20000000},"请填写正确的数值");
|
||||
$("#name").focus();
|
||||
$("#inputForm").validate({
|
||||
//需验证 item_code item_value
|
||||
rules: {
|
||||
'itemCode':{
|
||||
required:true,
|
||||
digits:true,
|
||||
codeNumber:true
|
||||
},
|
||||
'itemValue':{
|
||||
required:true
|
||||
}
|
||||
|
||||
},
|
||||
messages: {
|
||||
'itemCode':{
|
||||
required:'编码必须填写',
|
||||
digits:'请填写整数值',
|
||||
codeNumber:'请填写合适的数值(0~200000000)'
|
||||
},
|
||||
'itemValue':{
|
||||
required:'编码对应值必须填写'
|
||||
}
|
||||
},
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
|
||||
<button type="button" class="btn btn-default" onclick="history.go(-1)">返回</button>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h3 class="page-title">
|
||||
生效范围配置管理
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-gift"></i>分类性质配置<shiro:hasPermission name="sys:menu:edit">${not empty sysDictInfo.sysDictId?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="sys:menu:edit">查看</shiro:lacksPermission></div>
|
||||
<div class="tools">
|
||||
<!-- <a href="javascript:;" class="collapse"> </a>
|
||||
<a href="#portlet-config" data-toggle="modal" class="config"> </a>
|
||||
<a href="javascript:;" class="reload"> </a>
|
||||
<a href="javascript:;" class="remove"> </a> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body form">
|
||||
|
||||
|
||||
<div class="form-body">
|
||||
|
||||
<!-- BEGIN FORM-->
|
||||
<form:form id="inputForm" modelAttribute="sysDictInfo" action="${ctx}/configuration/sysDictInfo/saveOrUpdate" method="post" class="form-horizontal">
|
||||
<form:hidden path="sysDictId"/>
|
||||
<sys:message content="${message}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">上级配置:</label>
|
||||
<%-- <div class="col-md-4">
|
||||
<sys:treeselect id="serviceDictInfo" name="parent.id" value="${serviceDictInfo.parent.serviceDictId}" labelName="serviceDictInfo.parent.itemValue" labelValue="${serviceDictInfo.parent.itemValue}"
|
||||
title="父级字典" url="/configuration/serviceDictInfo/treeData" extId="${serviceDictInfo.id}" cssClass="required form-control"/>
|
||||
</div> --%>
|
||||
|
||||
<div class="col-md-4">
|
||||
<%-- <form:input path="parent.serviceDictId" htmlEscape="false" maxlength="50" class="form-control" disabled="disabled" readonly="readonly"/> --%>
|
||||
<form:input path="parent.sysDictId" htmlEscape="false" maxlength="50" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label radio-lable"><font color="red">*</font> 数据类型:</label>
|
||||
<div class="col-md-4">
|
||||
<select id="itemType" name="itemType" class="form-control">
|
||||
<c:forEach items="${fns:getDictList('SYS_DICT_ITM_TYPE')}" var="dict">
|
||||
<c:if test="${dict.itemCode eq sysDictInfo.itemType}">
|
||||
<option value="${sysDictInfo.itemType}" selected="selected">${dict.itemValue}</option>
|
||||
</c:if>
|
||||
<c:if test="${dict.itemCode ne sysDictInfo.itemType}">
|
||||
<option value="${dict.itemCode}">${dict.itemValue}</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>编码:</label>
|
||||
<div class="col-md-4">
|
||||
<form:input path="itemCode" htmlEscape="false" maxlength="50" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>编码对应值:</label>
|
||||
<div class="col-md-4">
|
||||
<form:input path="itemValue" htmlEscape="false" maxlength="2000" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>是否叶子节点:</label>
|
||||
<div class="col-md-4">
|
||||
<%-- <form:radiobuttons path="isLeaf" items="${fns:getDictOption('SYS_YES_NO')}" /> --%>
|
||||
<form:select path="isLeaf" class="form-control">
|
||||
<form:options items="${fns:getDictList('SYS_YES_NO')}" itemLabel="itemValue" itemValue="itemCode" htmlEscape="false"/>
|
||||
</form:select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">描述信息:</label>
|
||||
<div class="col-md-4">
|
||||
<form:textarea path="itemDesc" htmlEscape="false" maxlength="2000" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-9">
|
||||
<shiro:hasPermission name="sys:menu:edit"><button type="submit" class="btn btn-circle blue">保存</button></shiro:hasPermission>
|
||||
<button type="button" class="btn btn-circle grey-salsa btn-outline" onclick="history.go(-1)">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form:form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
91
src/main/webapp/WEB-INF/views/cfg/serviceDictInfo.jsp
Normal file
91
src/main/webapp/WEB-INF/views/cfg/serviceDictInfo.jsp
Normal file
@@ -0,0 +1,91 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/pages/css/dictInfo.css" />
|
||||
<title>生效范围配置管理</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
|
||||
<button type="button" class="btn btn-default" onclick="history.go(-1)">返回</button>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h3 class="page-title">
|
||||
生效范围配置管理
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-gift"></i>生效范围配置查看</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body form">
|
||||
|
||||
|
||||
<div class="form-body">
|
||||
|
||||
<!-- BEGIN FORM-->
|
||||
<form:form id="inputForm" modelAttribute="sysDictInfo" action="${ctx}/configuration/sysDictInfo/saveOrUpdate" method="post" class="form-horizontal">
|
||||
<form:hidden path="sysDictId"/>
|
||||
<sys:message content="${message}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">上级配置:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${sysDictInfo.parent.itemValue}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label radio-lable"><font color="red">*</font> 数据类型:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${fns:getDictLabel('SYS_DICT_ITM_TYPE',sysDictInfo.itemType,'0')}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>编码:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${sysDictInfo.itemCode}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>编码对应值:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${sysDictInfo.itemValue}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>是否叶子节点:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${fns:getDictLabel('SYS_YES_NO',sysDictInfo.isValid,'0')}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">描述信息:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${sysDictInfo.itemDesc}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
</form:form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
139
src/main/webapp/WEB-INF/views/cfg/serviceDictList.jsp
Normal file
139
src/main/webapp/WEB-INF/views/cfg/serviceDictList.jsp
Normal file
@@ -0,0 +1,139 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title>生效范围配置信息</title>
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/pages/css/dictInfo.css" />
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
});
|
||||
//查询
|
||||
function page(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/configuration/sysDictInfo/list");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.input-medium {
|
||||
width: 200px !important;
|
||||
}
|
||||
.Wdate {
|
||||
border: #c2cad8 1px solid;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
min-width: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<button type="button" class="btn btn-default" onclick="location='${ctx}/configuration/sysDictInfo/list'"><spring:message code="refresh"></spring:message></button>
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/configuration/sysDictInfo/form'">新增</button>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-cogs"></i><spring:message code="生效范围配置列表"></spring:message>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" modelAttribute="requestInfo" action="${ctx}/configuration/sysDictInfo/list" method="post" class="form-search">
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
<div class="col-md-12">
|
||||
<label class="search-lable">编码:</label><input id="itemCode" name="itemCode" type="text" maxlength="50" class="input-medium" value="${sysDictInfo.itemCode}"/>
|
||||
<label class="search-lable">值:</label><input id="itemValue" name="itemValue" type="text" maxlength="50" class="input-medium" value="${sysDictInfo.itemValue}"/>
|
||||
|
||||
<label class="search-lable">开始时间:</label><input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
|
||||
value="<fmt:formatDate value="${sysDictInfo.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
|
||||
<label class="search-lable">结束时间:</label><input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
|
||||
value="<fmt:formatDate value="${sysDictInfo.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="return page()">
|
||||
<i class="fa fa-edit"></i> <spring:message code="search"></spring:message>
|
||||
</button>
|
||||
</div>
|
||||
</form:form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div class="table-responsive"> -->
|
||||
<sys:message content="${message}"/>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="sort-column mark" width="5%">编码</th>
|
||||
<th class="sort-column mark" width="10%">编码对应值</th>
|
||||
<th class="sort-column mark" width="20%">描述信息</th>
|
||||
<th class="sort-column mark" width="9%">数据类型</th>
|
||||
<th class="sort-column create_time" width="15%">创建时间</th>
|
||||
<!-- <th width="10%">修改记录</th> -->
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<th width="10%">操作</th>
|
||||
</shiro:hasPermission>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list}" var="sysDictInfo">
|
||||
<tr>
|
||||
<td>${sysDictInfo.itemCode}</td>
|
||||
<td>${sysDictInfo.itemValue}</td>
|
||||
<td>${fns:abbr(sysDictInfo.itemDesc,15)}</td>
|
||||
<td>${fns:getDictLabel("SYS_DICT_ITM_TYPE",sysDictInfo.itemType,"0")}</td>
|
||||
<td><fmt:formatDate value="${sysDictInfo.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<%-- <td>
|
||||
<button class="btn revision popovers purple-stripe" data-content="${serviceDictInfo.itemDesc}">修改记录查看</button>
|
||||
</td> --%>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-primary" href="#"><i class="icon-cogs"></i> 操作</a>
|
||||
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
<li><a href="${ctx}/configuration/sysDictInfo/form?sysDictId=${sysDictInfo.sysDictId}&doAction=0"><i class="icon-list"></i>查看</a></li>
|
||||
<li class="divider"></li>
|
||||
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<li><a href="${ctx}/configuration/sysDictInfo/form?sysDictId=${sysDictInfo.sysDictId}" onclick="return confirmx('数据字典在系统中非常重要,您确认要修改吗?', this.href)"><i class="icon-edit"></i> 修改</a></li>
|
||||
<li class="divider"></li>
|
||||
</shiro:hasPermission>
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<li><a href="${ctx}/configuration/sysDictInfo/delete?sysDictId=${sysDictInfo.sysDictId}" onclick="return confirmx('数据字典在系统中非常重要,您确认要删除吗?', this.href)"><i class="icon-trash"></i> 删除</a></li>
|
||||
</shiro:hasPermission>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
160
src/main/webapp/WEB-INF/views/cfg/serviceDictMarkForm.jsp
Normal file
160
src/main/webapp/WEB-INF/views/cfg/serviceDictMarkForm.jsp
Normal file
@@ -0,0 +1,160 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/pages/css/dictInfo.css" />
|
||||
<title>标签配置管理</title>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
jQuery.validator.addMethod("codeNumber",function(value,element){
|
||||
return value>=0&value<=20000000},"请填写正确的数值");
|
||||
$("#name").focus();
|
||||
$("#inputForm").validate({
|
||||
//需验证 item_code item_value
|
||||
rules: {
|
||||
'itemCode':{
|
||||
required:true,
|
||||
digits:true,
|
||||
codeNumber:true
|
||||
},
|
||||
'itemValue':{
|
||||
required:true
|
||||
}
|
||||
|
||||
},
|
||||
messages: {
|
||||
'itemCode':{
|
||||
required:'编码必须填写',
|
||||
digits:'请填写整数值',
|
||||
codeNumber:'请填写合适的数值(0~200000000)'
|
||||
},
|
||||
'itemValue':{
|
||||
required:'编码对应值必须填写'
|
||||
}
|
||||
},
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
|
||||
<button type="button" class="btn btn-default" onclick="history.go(-1)">返回</button>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h3 class="page-title">
|
||||
标签配置管理
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-gift"></i>标签配置<shiro:hasPermission name="sys:menu:edit">${not empty serviceDictInfo.serviceDictId?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="sys:menu:edit">查看</shiro:lacksPermission></div>
|
||||
<div class="tools">
|
||||
<!-- <a href="javascript:;" class="collapse"> </a>
|
||||
<a href="#portlet-config" data-toggle="modal" class="config"> </a>
|
||||
<a href="javascript:;" class="reload"> </a>
|
||||
<a href="javascript:;" class="remove"> </a> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body form">
|
||||
|
||||
|
||||
<div class="form-body">
|
||||
|
||||
<!-- BEGIN FORM-->
|
||||
<form:form id="inputForm" modelAttribute="serviceDictInfo" action="${ctx}/configuration/serviceDictInfo/markSaveOrUpdate" method="post" class="form-horizontal">
|
||||
<form:hidden path="serviceDictId"/>
|
||||
<sys:message content="${message}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">上级配置:</label>
|
||||
<%-- <div class="col-md-4">
|
||||
<sys:treeselect id="serviceDictInfo" name="parent.id" value="${serviceDictInfo.parent.serviceDictId}" labelName="serviceDictInfo.parent.itemValue" labelValue="${serviceDictInfo.parent.itemValue}"
|
||||
title="父级字典" url="/configuration/serviceDictInfo/treeData" extId="${serviceDictInfo.id}" cssClass="required form-control"/>
|
||||
</div> --%>
|
||||
|
||||
<div class="col-md-4">
|
||||
<%-- <form:input path="parent.serviceDictId" htmlEscape="false" maxlength="50" class="form-control" disabled="disabled" readonly="readonly"/> --%>
|
||||
<form:input path="parent.serviceDictId" htmlEscape="false" maxlength="50" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label radio-lable"><font color="red">*</font> 数据类型:</label>
|
||||
<div class="col-md-4">
|
||||
<input name="itemType" value="3" type="hidden" />
|
||||
<input id="itemType" class="form-control" value="${fns:getDictLabel('SERVICE_DICT_ITM_TYPE','3','0')}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>编码:</label>
|
||||
<div class="col-md-4">
|
||||
<form:input path="itemCode" htmlEscape="false" maxlength="50" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>编码对应值:</label>
|
||||
<div class="col-md-4">
|
||||
<form:input path="itemValue" htmlEscape="false" maxlength="2000" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>是否叶子节点:</label>
|
||||
<div class="col-md-4">
|
||||
<%-- <form:radiobuttons path="isLeaf" items="${fns:getDictOption('SYS_YES_NO')}" /> --%>
|
||||
<form:select path="isLeaf" class="form-control">
|
||||
<form:options items="${fns:getDictList('SYS_YES_NO')}" itemLabel="itemValue" itemValue="itemCode" htmlEscape="false"/>
|
||||
</form:select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">描述信息:</label>
|
||||
<div class="col-md-4">
|
||||
<form:textarea path="itemDesc" htmlEscape="false" maxlength="2000" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-9">
|
||||
<shiro:hasPermission name="sys:menu:edit"><button type="submit" class="btn btn-circle blue">保存</button></shiro:hasPermission>
|
||||
<button type="button" class="btn btn-circle grey-salsa btn-outline" onclick="history.go(-1)">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form:form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
91
src/main/webapp/WEB-INF/views/cfg/serviceDictMarkInfo.jsp
Normal file
91
src/main/webapp/WEB-INF/views/cfg/serviceDictMarkInfo.jsp
Normal file
@@ -0,0 +1,91 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/pages/css/dictInfo.css" />
|
||||
<title>标签配置管理</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
|
||||
<button type="button" class="btn btn-default" onclick="history.go(-1)">返回</button>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h3 class="page-title">
|
||||
标签配置管理
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-gift"></i>标签配置查看</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body form">
|
||||
|
||||
|
||||
<div class="form-body">
|
||||
|
||||
<!-- BEGIN FORM-->
|
||||
<form:form id="inputForm" modelAttribute="serviceDictInfo" action="${ctx}/configuration/serviceDictInfo/markSaveOrUpdate" method="post" class="form-horizontal">
|
||||
<form:hidden path="serviceDictId"/>
|
||||
<sys:message content="${message}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">上级配置:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${serviceDictInfo.parent.itemValue}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label radio-lable"><font color="red">*</font> 数据类型:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${fns:getDictLabel('SERVICE_DICT_ITM_TYPE',serviceDictInfo.itemType,'0')}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>编码:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${serviceDictInfo.itemCode}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>编码对应值:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${serviceDictInfo.itemValue}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>是否叶子节点:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${fns:getDictLabel('SYS_YES_NO',serviceDictInfo.isValid,'0')}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">描述信息:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${serviceDictInfo.itemDesc}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
</form:form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
139
src/main/webapp/WEB-INF/views/cfg/serviceDictMarkList.jsp
Normal file
139
src/main/webapp/WEB-INF/views/cfg/serviceDictMarkList.jsp
Normal file
@@ -0,0 +1,139 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title>分标签配置信息</title>
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/pages/css/dictInfo.css" />
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
});
|
||||
//查询
|
||||
function page(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/configuration/serviceDictInfo/markList");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.input-medium {
|
||||
width: 200px !important;
|
||||
}
|
||||
.Wdate {
|
||||
border: #c2cad8 1px solid;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
min-width: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<button type="button" class="btn btn-default" onclick="location='${ctx}/configuration/serviceDictInfo/markList'"><spring:message code="refresh"></spring:message></button>
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/configuration/serviceDictInfo/markForm'">新增</button>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-cogs"></i><spring:message code="标签配置列表"></spring:message>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" modelAttribute="requestInfo" action="${ctx}/configuration/serviceDictInfo/markList" method="post" class="form-search">
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
<div class="col-md-12">
|
||||
<label class="search-lable">编码:</label><input id="itemCode" name="itemCode" type="text" maxlength="50" class="input-medium" value="${serviceDictInfo.itemCode}"/>
|
||||
<label class="search-lable">值:</label><input id="itemValue" name="itemValue" type="text" maxlength="50" class="input-medium" value="${serviceDictInfo.itemValue}"/>
|
||||
|
||||
<label class="search-lable">开始时间:</label><input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
|
||||
value="<fmt:formatDate value="${serviceDictInfo.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
|
||||
<label class="search-lable">结束时间:</label><input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
|
||||
value="<fmt:formatDate value="${serviceDictInfo.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="return page()">
|
||||
<i class="fa fa-edit"></i> <spring:message code="search"></spring:message>
|
||||
</button>
|
||||
</div>
|
||||
</form:form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div class="table-responsive"> -->
|
||||
<sys:message content="${message}"/>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="sort-column mark" width="5%">编码</th>
|
||||
<th class="sort-column mark" width="10%">编码对应值</th>
|
||||
<th class="sort-column mark" width="20%">描述信息</th>
|
||||
<th class="sort-column mark" width="9%">数据类型</th>
|
||||
<th class="sort-column create_time" width="15%">创建时间</th>
|
||||
<!-- <th width="10%">修改记录</th> -->
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<th width="10%">操作</th>
|
||||
</shiro:hasPermission>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list}" var="serviceDictInfo">
|
||||
<tr>
|
||||
<td>${serviceDictInfo.itemCode}</td>
|
||||
<td>${serviceDictInfo.itemValue}</td>
|
||||
<td>${fns:abbr(serviceDictInfo.itemDesc,15)}</td>
|
||||
<td>${fns:getDictLabel("SERVICE_DICT_ITM_TYPE",serviceDictInfo.itemType,"0")}</td>
|
||||
<td><fmt:formatDate value="${serviceDictInfo.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<%-- <td>
|
||||
<button class="btn revision popovers purple-stripe" data-content="${serviceDictInfo.itemDesc}">修改记录查看</button>
|
||||
</td> --%>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-primary" href="#"><i class="icon-cogs"></i> 操作</a>
|
||||
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}&doAction=0"><i class="icon-list"></i>查看</a></li>
|
||||
<li class="divider"></li>
|
||||
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}" onclick="return confirmx('数据字典在系统中非常重要,您确认要修改吗?', this.href)"><i class="icon-edit"></i> 修改</a></li>
|
||||
<li class="divider"></li>
|
||||
</shiro:hasPermission>
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/delete?serviceDictId=${serviceDictInfo.serviceDictId}" onclick="return confirmx('数据字典在系统中非常重要,您确认要删除吗?', this.href)"><i class="icon-trash"></i> 删除</a></li>
|
||||
</shiro:hasPermission>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
170
src/main/webapp/WEB-INF/views/cfg/sysDictForm.jsp
Normal file
170
src/main/webapp/WEB-INF/views/cfg/sysDictForm.jsp
Normal file
@@ -0,0 +1,170 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/pages/css/dictInfo.css" />
|
||||
<title>分类性质配置管理</title>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
jQuery.validator.addMethod("codeNumber",function(value,element){
|
||||
return value>=0&value<=20000000},"请填写正确的数值");
|
||||
$("#name").focus();
|
||||
$("#inputForm").validate({
|
||||
//需验证 item_code item_value
|
||||
rules: {
|
||||
'itemCode':{
|
||||
required:true,
|
||||
digits:true,
|
||||
codeNumber:true
|
||||
},
|
||||
'itemValue':{
|
||||
required:true
|
||||
}
|
||||
|
||||
},
|
||||
messages: {
|
||||
'itemCode':{
|
||||
required:'编码必须填写',
|
||||
digits:'请填写整数值',
|
||||
codeNumber:'请填写合适的数值(0~200000000)'
|
||||
},
|
||||
'itemValue':{
|
||||
required:'编码对应值必须填写'
|
||||
}
|
||||
},
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
|
||||
<button type="button" class="btn btn-default" onclick="history.go(-1)">返回</button>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h3 class="page-title">
|
||||
分类性质配置管理
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-gift"></i>分类性质配置<shiro:hasPermission name="sys:menu:edit">${not empty serviceDictInfo.serviceDictId?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="sys:menu:edit">查看</shiro:lacksPermission></div>
|
||||
<div class="tools">
|
||||
<!-- <a href="javascript:;" class="collapse"> </a>
|
||||
<a href="#portlet-config" data-toggle="modal" class="config"> </a>
|
||||
<a href="javascript:;" class="reload"> </a>
|
||||
<a href="javascript:;" class="remove"> </a> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body form">
|
||||
|
||||
|
||||
<div class="form-body">
|
||||
|
||||
<!-- BEGIN FORM-->
|
||||
<form:form id="inputForm" modelAttribute="serviceDictInfo" action="${ctx}/configuration/serviceDictInfo/saveOrUpdate" method="post" class="form-horizontal">
|
||||
<form:hidden path="serviceDictId"/>
|
||||
<sys:message content="${message}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">上级配置:</label>
|
||||
<%-- <div class="col-md-4">
|
||||
<sys:treeselect id="serviceDictInfo" name="parent.id" value="${serviceDictInfo.parent.serviceDictId}" labelName="serviceDictInfo.parent.itemValue" labelValue="${serviceDictInfo.parent.itemValue}"
|
||||
title="父级字典" url="/configuration/serviceDictInfo/treeData" extId="${serviceDictInfo.id}" cssClass="required form-control"/>
|
||||
</div> --%>
|
||||
|
||||
<div class="col-md-4">
|
||||
<%-- <form:input path="parent.serviceDictId" htmlEscape="false" maxlength="50" class="form-control" disabled="disabled" readonly="readonly"/> --%>
|
||||
<form:input path="parent.serviceDictId" htmlEscape="false" maxlength="50" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label radio-lable"><font color="red">*</font> 数据类型:</label>
|
||||
<div class="col-md-4">
|
||||
<select id="itemType" name="itemType" class="form-control">
|
||||
<c:forEach items="${fns:getDictList('SERVICE_DICT_ITM_TYPE')}" var="dict">
|
||||
<c:if test="${dict.itemCode ne '3'}">
|
||||
<c:if test="${dict.itemCode eq serviceDictInfo.itemType}">
|
||||
<option value="${serviceDictInfo.itemType}" selected="selected">${dict.itemValue}</option>
|
||||
</c:if>
|
||||
<c:if test="${dict.itemCode ne serviceDictInfo.itemType}">
|
||||
<option value="${dict.itemCode}">${dict.itemValue}</option>
|
||||
</c:if>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>编码:</label>
|
||||
<div class="col-md-4">
|
||||
<form:input path="itemCode" htmlEscape="false" maxlength="50" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>编码对应值:</label>
|
||||
<div class="col-md-4">
|
||||
<form:input path="itemValue" htmlEscape="false" maxlength="2000" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>是否叶子节点:</label>
|
||||
<div class="col-md-4">
|
||||
<%-- <form:radiobuttons path="isLeaf" items="${fns:getDictOption('SYS_YES_NO')}" /> --%>
|
||||
<form:select path="isLeaf" class="form-control">
|
||||
<form:options items="${fns:getDictList('SYS_YES_NO')}" itemLabel="itemValue" itemValue="itemCode" htmlEscape="false"/>
|
||||
</form:select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">描述信息:</label>
|
||||
<div class="col-md-4">
|
||||
<form:textarea path="itemDesc" htmlEscape="false" maxlength="2000" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-9">
|
||||
<shiro:hasPermission name="sys:menu:edit"><button type="submit" class="btn btn-circle blue">保存</button></shiro:hasPermission>
|
||||
<button type="button" class="btn btn-circle grey-salsa btn-outline" onclick="history.go(-1)">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form:form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
91
src/main/webapp/WEB-INF/views/cfg/sysDictInfo.jsp
Normal file
91
src/main/webapp/WEB-INF/views/cfg/sysDictInfo.jsp
Normal file
@@ -0,0 +1,91 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/pages/css/dictInfo.css" />
|
||||
<title>分类性质配置管理</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
|
||||
<button type="button" class="btn btn-default" onclick="history.go(-1)">返回</button>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h3 class="page-title">
|
||||
分类性质配置管理
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-gift"></i>分类性质配置查看</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body form">
|
||||
|
||||
|
||||
<div class="form-body">
|
||||
|
||||
<!-- BEGIN FORM-->
|
||||
<form:form id="inputForm" modelAttribute="serviceDictInfo" action="${ctx}/configuration/serviceDictInfo/saveOrUpdate" method="post" class="form-horizontal">
|
||||
<form:hidden path="serviceDictId"/>
|
||||
<sys:message content="${message}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">上级配置:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${serviceDictInfo.parent.itemValue}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label radio-lable"><font color="red">*</font> 数据类型:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${fns:getDictLabel('SERVICE_DICT_ITM_TYPE',serviceDictInfo.itemType,'0')}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>编码:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${serviceDictInfo.itemCode}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>编码对应值:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${serviceDictInfo.itemValue}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>是否叶子节点:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${fns:getDictLabel('SYS_YES_NO',serviceDictInfo.isValid,'0')}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">描述信息:</label>
|
||||
<div class="col-md-4">
|
||||
<input value="${serviceDictInfo.itemDesc}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
</form:form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
139
src/main/webapp/WEB-INF/views/cfg/sysDictList.jsp
Normal file
139
src/main/webapp/WEB-INF/views/cfg/sysDictList.jsp
Normal file
@@ -0,0 +1,139 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title>分类性质配置信息</title>
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/pages/css/dictInfo.css" />
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
});
|
||||
//查询
|
||||
function page(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/configuration/serviceDictInfo/list");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.input-medium {
|
||||
width: 200px !important;
|
||||
}
|
||||
.Wdate {
|
||||
border: #c2cad8 1px solid;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
min-width: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<button type="button" class="btn btn-default" onclick="location='${ctx}/configuration/serviceDictInfo/list'"><spring:message code="refresh"></spring:message></button>
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/configuration/serviceDictInfo/form'">新增</button>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-cogs"></i><spring:message code="分类性质配置列表"></spring:message>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" modelAttribute="requestInfo" action="${ctx}/configuration/serviceDictInfo/list" method="post" class="form-search">
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
<div class="col-md-12">
|
||||
<label class="search-lable">编码:</label><input id="itemCode" name="itemCode" type="text" maxlength="50" class="input-medium" value="${serviceDictInfo.itemCode}"/>
|
||||
<label class="search-lable">值:</label><input id="itemValue" name="itemValue" type="text" maxlength="50" class="input-medium" value="${serviceDictInfo.itemValue}"/>
|
||||
|
||||
<label class="search-lable">开始时间:</label><input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
|
||||
value="<fmt:formatDate value="${serviceDictInfo.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
|
||||
<label class="search-lable">结束时间:</label><input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
|
||||
value="<fmt:formatDate value="${serviceDictInfo.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="return page()">
|
||||
<i class="fa fa-edit"></i> <spring:message code="search"></spring:message>
|
||||
</button>
|
||||
</div>
|
||||
</form:form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div class="table-responsive"> -->
|
||||
<sys:message content="${message}"/>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="sort-column mark" width="5%">编码</th>
|
||||
<th class="sort-column mark" width="10%">编码对应值</th>
|
||||
<th class="sort-column mark" width="20%">描述信息</th>
|
||||
<th class="sort-column mark" width="9%">数据类型</th>
|
||||
<th class="sort-column create_time" width="15%">创建时间</th>
|
||||
<!-- <th width="10%">修改记录</th> -->
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<th width="10%">操作</th>
|
||||
</shiro:hasPermission>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list}" var="serviceDictInfo">
|
||||
<tr>
|
||||
<td>${serviceDictInfo.itemCode}</td>
|
||||
<td>${serviceDictInfo.itemValue}</td>
|
||||
<td>${fns:abbr(serviceDictInfo.itemDesc,15)}</td>
|
||||
<td>${fns:getDictLabel("SERVICE_DICT_ITM_TYPE",serviceDictInfo.itemType,"0")}</td>
|
||||
<td><fmt:formatDate value="${serviceDictInfo.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<%-- <td>
|
||||
<button class="btn revision popovers purple-stripe" data-content="${serviceDictInfo.itemDesc}">修改记录查看</button>
|
||||
</td> --%>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-primary" href="#"><i class="icon-cogs"></i> 操作</a>
|
||||
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}&doAction=0"><i class="icon-list"></i>查看</a></li>
|
||||
<li class="divider"></li>
|
||||
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}" onclick="return confirmx('数据字典在系统中非常重要,您确认要修改吗?', this.href)"><i class="icon-edit"></i> 修改</a></li>
|
||||
<li class="divider"></li>
|
||||
</shiro:hasPermission>
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/delete?serviceDictId=${serviceDictInfo.serviceDictId}" onclick="return confirmx('数据字典在系统中非常重要,您确认要删除吗?', this.href)"><i class="icon-trash"></i> 删除</a></li>
|
||||
</shiro:hasPermission>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
8
src/main/webapp/static/pages/css/dictInfo.css
Normal file
8
src/main/webapp/static/pages/css/dictInfo.css
Normal file
@@ -0,0 +1,8 @@
|
||||
/***
|
||||
sysDict serviceDict
|
||||
***/
|
||||
|
||||
.search-lable {
|
||||
margin-right: 5px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
Reference in New Issue
Block a user