1.修订业务辅助表-业务字典 业务辅助表=-系统字典管理平台
2.新增修改页面添加校验
①校验必填项
②校验itemCode是否重复
③校验父级与添加或修改配置的数据类型是否一致
④校验修改配置的数据类型类型与其下级数据类型是否一致
⑤无上级时、有下级时不得选为叶子节点
3.待解决项:
①点击操作弹出项样式
②校验程序偶有存在报出提示但无法阻止提交 情况
This commit is contained in:
@@ -20,7 +20,7 @@ public class SysDictInfo extends BaseEntity<SysDictInfo>{
|
||||
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 String itemDesc; //item_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-无效
|
||||
@@ -58,11 +58,11 @@ public class SysDictInfo extends BaseEntity<SysDictInfo>{
|
||||
public void setItemValue(String itemValue) {
|
||||
this.itemValue = itemValue;
|
||||
}
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
public String getItemDesc() {
|
||||
return itemDesc;
|
||||
}
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
public void setItemDesc(String itemDesc) {
|
||||
this.itemDesc = itemDesc;
|
||||
}
|
||||
public SysDictInfo getParent() {
|
||||
return parent;
|
||||
|
||||
51
src/main/java/com/nis/util/ConfigDictUtils.java
Normal file
51
src/main/java/com/nis/util/ConfigDictUtils.java
Normal file
@@ -0,0 +1,51 @@
|
||||
package com.nis.util;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.SysDataDictionaryName;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.SysDictInfo;
|
||||
import com.nis.web.dao.SysDictDao;
|
||||
import com.nis.web.dao.configuration.ServiceDictInfoDao;
|
||||
import com.nis.web.dao.configuration.SysDictInfoDao;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 系统数据字典工具类
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public class ConfigDictUtils {
|
||||
|
||||
private final static ServiceDictInfoDao serviceDictInfoDao = SpringContextHolder.getBean(ServiceDictInfoDao.class);
|
||||
private final static SysDictInfoDao sysDictInfoDao = SpringContextHolder.getBean(SysDictInfoDao.class);
|
||||
|
||||
/**
|
||||
* 根据主键查询配置详情
|
||||
* @param serviceDictId
|
||||
* @return
|
||||
*/
|
||||
public static ServiceDictInfo getServiceDictInfoById(Integer serviceDictId){
|
||||
return serviceDictInfoDao.getDictById(serviceDictId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键查询配置详情
|
||||
* @param sysDictId
|
||||
* @return
|
||||
*/
|
||||
public static SysDictInfo getSysDictInfoById(Integer sysDictId){
|
||||
return sysDictInfoDao.getDictById(sysDictId);
|
||||
}
|
||||
|
||||
}
|
||||
311
src/main/java/com/nis/util/MyBeanUtils.java
Normal file
311
src/main/java/com/nis/util/MyBeanUtils.java
Normal file
@@ -0,0 +1,311 @@
|
||||
package com.nis.util;
|
||||
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.beanutils.DynaBean;
|
||||
import org.apache.commons.beanutils.DynaProperty;
|
||||
import org.apache.commons.beanutils.PropertyUtils;
|
||||
import org.apache.commons.beanutils.PropertyUtilsBean;
|
||||
|
||||
/**
|
||||
* <p>Title: </p>
|
||||
* <p>Description: </p>
|
||||
* @author 刘高峰
|
||||
* @version 2.0
|
||||
*/
|
||||
|
||||
public class MyBeanUtils
|
||||
extends PropertyUtilsBean {
|
||||
|
||||
private static void convert(Object dest, Object orig) throws
|
||||
IllegalAccessException, InvocationTargetException {
|
||||
|
||||
// Validate existence of the specified beans
|
||||
if (dest == null) {
|
||||
throw new IllegalArgumentException
|
||||
("No destination bean specified");
|
||||
}
|
||||
if (orig == null) {
|
||||
throw new IllegalArgumentException("No origin bean specified");
|
||||
}
|
||||
|
||||
// Copy the properties, converting as necessary
|
||||
if (orig instanceof DynaBean) {
|
||||
DynaProperty origDescriptors[] =
|
||||
( (DynaBean) orig).getDynaClass().getDynaProperties();
|
||||
for (int i = 0; i < origDescriptors.length; i++) {
|
||||
String name = origDescriptors[i].getName();
|
||||
if (PropertyUtils.isWriteable(dest, name)) {
|
||||
Object value = ( (DynaBean) orig).get(name);
|
||||
try {
|
||||
getInstance().setSimpleProperty(dest, name, value);
|
||||
}
|
||||
catch (Exception e) {
|
||||
; // Should not happen
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (orig instanceof Map) {
|
||||
Iterator names = ( (Map) orig).keySet().iterator();
|
||||
while (names.hasNext()) {
|
||||
String name = (String) names.next();
|
||||
if (PropertyUtils.isWriteable(dest, name)) {
|
||||
Object value = ( (Map) orig).get(name);
|
||||
try {
|
||||
getInstance().setSimpleProperty(dest, name, value);
|
||||
}
|
||||
catch (Exception e) {
|
||||
; // Should not happen
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
/* if (orig is a standard JavaBean) */
|
||||
{
|
||||
PropertyDescriptor origDescriptors[] =
|
||||
PropertyUtils.getPropertyDescriptors(orig);
|
||||
for (int i = 0; i < origDescriptors.length; i++) {
|
||||
String name = origDescriptors[i].getName();
|
||||
// String type = origDescriptors[i].getPropertyType().toString();
|
||||
if ("class".equals(name)) {
|
||||
continue; // No point in trying to set an object's class
|
||||
}
|
||||
if (PropertyUtils.isReadable(orig, name) &&
|
||||
PropertyUtils.isWriteable(dest, name)) {
|
||||
try {
|
||||
Object value = PropertyUtils.getSimpleProperty(orig, name);
|
||||
getInstance().setSimpleProperty(dest, name, value);
|
||||
}
|
||||
catch (java.lang.IllegalArgumentException ie) {
|
||||
; // Should not happen
|
||||
}
|
||||
catch (Exception e) {
|
||||
; // Should not happen
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 对象拷贝
|
||||
* 数据对象空值不拷贝到目标对象
|
||||
*
|
||||
* @param dataObject
|
||||
* @param toObject
|
||||
* @throws NoSuchMethodException
|
||||
* copy
|
||||
*/
|
||||
public static void copyBeanNotNull2Bean(Object databean,Object tobean)throws Exception
|
||||
{
|
||||
PropertyDescriptor origDescriptors[] = PropertyUtils.getPropertyDescriptors(databean);
|
||||
for (int i = 0; i < origDescriptors.length; i++) {
|
||||
String name = origDescriptors[i].getName();
|
||||
// String type = origDescriptors[i].getPropertyType().toString();
|
||||
if ("class".equals(name)) {
|
||||
continue; // No point in trying to set an object's class
|
||||
}
|
||||
if (PropertyUtils.isReadable(databean, name) &&PropertyUtils.isWriteable(tobean, name)) {
|
||||
try {
|
||||
Object value = PropertyUtils.getSimpleProperty(databean, name);
|
||||
if(value!=null){
|
||||
getInstance().setSimpleProperty(tobean, name, value);
|
||||
}
|
||||
}
|
||||
catch (java.lang.IllegalArgumentException ie) {
|
||||
; // Should not happen
|
||||
}
|
||||
catch (Exception e) {
|
||||
; // Should not happen
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 把orig和dest相同属性的value复制到dest中
|
||||
* @param dest
|
||||
* @param orig
|
||||
* @throws IllegalAccessException
|
||||
* @throws InvocationTargetException
|
||||
*/
|
||||
public static void copyBean2Bean(Object dest, Object orig) throws Exception {
|
||||
convert(dest, orig);
|
||||
}
|
||||
|
||||
public static void copyBean2Map(Map map, Object bean){
|
||||
PropertyDescriptor[] pds = PropertyUtils.getPropertyDescriptors(bean);
|
||||
for (int i =0;i<pds.length;i++)
|
||||
{
|
||||
PropertyDescriptor pd = pds[i];
|
||||
String propname = pd.getName();
|
||||
try {
|
||||
Object propvalue = PropertyUtils.getSimpleProperty(bean,propname);
|
||||
map.put(propname, propvalue);
|
||||
} catch (IllegalAccessException e) {
|
||||
//e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
//e.printStackTrace();
|
||||
} catch (NoSuchMethodException e) {
|
||||
//e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将Map内的key与Bean中属性相同的内容复制到BEAN中
|
||||
* @param bean Object
|
||||
* @param properties Map
|
||||
* @throws IllegalAccessException
|
||||
* @throws InvocationTargetException
|
||||
*/
|
||||
public static void copyMap2Bean(Object bean, Map properties) throws
|
||||
IllegalAccessException, InvocationTargetException {
|
||||
// Do nothing unless both arguments have been specified
|
||||
if ( (bean == null) || (properties == null)) {
|
||||
return;
|
||||
}
|
||||
// Loop through the property name/value pairs to be set
|
||||
Iterator names = properties.keySet().iterator();
|
||||
while (names.hasNext()) {
|
||||
String name = (String) names.next();
|
||||
// Identify the property name and value(s) to be assigned
|
||||
if (name == null) {
|
||||
continue;
|
||||
}
|
||||
Object value = properties.get(name);
|
||||
try {
|
||||
Class clazz = PropertyUtils.getPropertyType(bean, name);
|
||||
if (null == clazz) {
|
||||
continue;
|
||||
}
|
||||
String className = clazz.getName();
|
||||
if (className.equalsIgnoreCase("java.sql.Timestamp")) {
|
||||
if (value == null || value.equals("")) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
getInstance().setSimpleProperty(bean, name, value);
|
||||
}
|
||||
catch (NoSuchMethodException e) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 自动转Map key值大写
|
||||
* 将Map内的key与Bean中属性相同的内容复制到BEAN中
|
||||
* @param bean Object
|
||||
* @param properties Map
|
||||
* @throws IllegalAccessException
|
||||
* @throws InvocationTargetException
|
||||
*/
|
||||
public static void copyMap2Bean_Nobig(Object bean, Map properties) throws
|
||||
IllegalAccessException, InvocationTargetException {
|
||||
// Do nothing unless both arguments have been specified
|
||||
if ( (bean == null) || (properties == null)) {
|
||||
return;
|
||||
}
|
||||
// Loop through the property name/value pairs to be set
|
||||
Iterator names = properties.keySet().iterator();
|
||||
while (names.hasNext()) {
|
||||
String name = (String) names.next();
|
||||
// Identify the property name and value(s) to be assigned
|
||||
if (name == null) {
|
||||
continue;
|
||||
}
|
||||
Object value = properties.get(name);
|
||||
// 命名应该大小写应该敏感(否则取不到对象的属性)
|
||||
//name = name.toLowerCase();
|
||||
try {
|
||||
if (value == null) { // 不光Date类型,好多类型在null时会出错
|
||||
continue; // 如果为null不用设 (对象如果有特殊初始值也可以保留?)
|
||||
}
|
||||
Class clazz = PropertyUtils.getPropertyType(bean, name);
|
||||
if (null == clazz) { // 在bean中这个属性不存在
|
||||
continue;
|
||||
}
|
||||
String className = clazz.getName();
|
||||
// 临时对策(如果不处理默认的类型转换时会出错)
|
||||
if (className.equalsIgnoreCase("java.util.Date")) {
|
||||
value = new java.util.Date(((java.sql.Timestamp)value).getTime());// wait to do:貌似有时区问题, 待进一步确认
|
||||
}
|
||||
// if (className.equalsIgnoreCase("java.sql.Timestamp")) {
|
||||
// if (value == null || value.equals("")) {
|
||||
// continue;
|
||||
// }
|
||||
// }
|
||||
getInstance().setSimpleProperty(bean, name, value);
|
||||
}
|
||||
catch (NoSuchMethodException e) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Map内的key与Bean中属性相同的内容复制到BEAN中
|
||||
* 对于存在空值的取默认值
|
||||
* @param bean Object
|
||||
* @param properties Map
|
||||
* @param defaultValue String
|
||||
* @throws IllegalAccessException
|
||||
* @throws InvocationTargetException
|
||||
*/
|
||||
public static void copyMap2Bean(Object bean, Map properties, String defaultValue) throws
|
||||
IllegalAccessException, InvocationTargetException {
|
||||
// Do nothing unless both arguments have been specified
|
||||
if ( (bean == null) || (properties == null)) {
|
||||
return;
|
||||
}
|
||||
// Loop through the property name/value pairs to be set
|
||||
Iterator names = properties.keySet().iterator();
|
||||
while (names.hasNext()) {
|
||||
String name = (String) names.next();
|
||||
// Identify the property name and value(s) to be assigned
|
||||
if (name == null) {
|
||||
continue;
|
||||
}
|
||||
Object value = properties.get(name);
|
||||
try {
|
||||
Class clazz = PropertyUtils.getPropertyType(bean, name);
|
||||
if (null == clazz) {
|
||||
continue;
|
||||
}
|
||||
String className = clazz.getName();
|
||||
if (className.equalsIgnoreCase("java.sql.Timestamp")) {
|
||||
if (value == null || value.equals("")) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (className.equalsIgnoreCase("java.lang.String")) {
|
||||
if (value == null) {
|
||||
value = defaultValue;
|
||||
}
|
||||
}
|
||||
getInstance().setSimpleProperty(bean, name, value);
|
||||
}
|
||||
catch (NoSuchMethodException e) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public MyBeanUtils() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -19,6 +20,7 @@ import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.ServiceDictInfo;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
@@ -65,9 +67,21 @@ public class ServiceDictInfoController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
public String list(String itType, ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model,Integer selectedType) {
|
||||
//处理数据
|
||||
String[] strArr = itType.split("-");
|
||||
Integer[] intArr = new Integer[strArr.length];
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
intArr[i] = Integer.valueOf(strArr[i]);
|
||||
}
|
||||
if(serviceDictInfo.getItemType()!=null){
|
||||
model.addAttribute("selectedType", serviceDictInfo.getItemType());
|
||||
}else{
|
||||
model.addAttribute("selectedType", selectedType);
|
||||
}
|
||||
|
||||
//查出顶层分页数据
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findTopDictList(new Page<ServiceDictInfo>(request, response), serviceDictInfo);
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findTopDictList(new Page<ServiceDictInfo>(request, response), serviceDictInfo,intArr);
|
||||
model.addAttribute("page", page);
|
||||
//查出所有数据
|
||||
List<ServiceDictInfo> allList = serviceDictInfoService.findAllDictList();
|
||||
@@ -94,7 +108,9 @@ public class ServiceDictInfoController extends BaseController {
|
||||
}
|
||||
|
||||
ServiceDictInfo.sortList(list,allList,0,true);
|
||||
//ServiceDictInfo.sortList(list, allList, 0, true);
|
||||
|
||||
model.addAttribute("itType", itType);
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
model.addAttribute("list", list);
|
||||
return "/cfg/serviceDictList";
|
||||
}
|
||||
@@ -110,18 +126,29 @@ public class ServiceDictInfoController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = {"searchList"})
|
||||
public String searchList(ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
public String searchList(String itType, ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
if(StringUtils.strIsBlank(serviceDictInfo.getItemValue())
|
||||
&&serviceDictInfo.getItemCode()==null
|
||||
&&serviceDictInfo.getItemType()==null
|
||||
&&serviceDictInfo.getBeginDate()==null
|
||||
&&serviceDictInfo.getEditTime()==null){
|
||||
|
||||
return "redirect:"+ adminPath + "/configuration/serviceDictInfo/list";
|
||||
&&serviceDictInfo.getEndDate()==null){
|
||||
Integer selectedType = null;
|
||||
if(serviceDictInfo.getItemType()!=null){
|
||||
selectedType = serviceDictInfo.getItemType();
|
||||
return "redirect:"+ adminPath + "/configuration/serviceDictInfo/list?itType="+itType+"&selectedType="+selectedType;
|
||||
}
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findDictSearchList(new Page<ServiceDictInfo>(request, response), serviceDictInfo);
|
||||
return "redirect:"+ adminPath + "/configuration/serviceDictInfo/list?itType="+itType;
|
||||
}
|
||||
String[] strArr = itType.split("-");
|
||||
Integer[] intArr = new Integer[strArr.length];
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
intArr[i] = Integer.valueOf(strArr[i]);
|
||||
}
|
||||
model.addAttribute("itType", itType);
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findDictSearchList(new Page<ServiceDictInfo>(request, response), serviceDictInfo,intArr);
|
||||
model.addAttribute("page", page);
|
||||
|
||||
|
||||
return "/cfg/serviceDictInfoSearchList";
|
||||
}
|
||||
|
||||
@@ -133,17 +160,24 @@ public class ServiceDictInfoController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value={"form"})
|
||||
public String form(ServiceDictInfo serviceDictInfo, Model model,String doAction) {
|
||||
public String form(ServiceDictInfo serviceDictInfo, Model model,String doAction,String itType) {
|
||||
if(doAction!=null&&doAction.equals("0")){
|
||||
return "/cfg/serviceDictInfo";
|
||||
}
|
||||
if (serviceDictInfo.getParent() == null || serviceDictInfo.getParent().getId() == null) {
|
||||
if (serviceDictInfo.getParent() == null || serviceDictInfo.getParent().getServiceDictId() == null||serviceDictInfo.getParent().getServiceDictId() == 0) {
|
||||
ServiceDictInfo parent = new ServiceDictInfo();
|
||||
parent.setServiceDictId(0);
|
||||
parent.setItemValue("无上级");
|
||||
serviceDictInfo.setParent(parent);
|
||||
}
|
||||
String[] strArr = itType.split("-");
|
||||
Integer[] intArr = new Integer[strArr.length];
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
intArr[i] = Integer.valueOf(strArr[i]);
|
||||
}
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
model.addAttribute("serviceDictInfo", serviceDictInfo);
|
||||
|
||||
model.addAttribute("itType", itType);
|
||||
return "/cfg/serviceDictForm";
|
||||
}
|
||||
/**
|
||||
@@ -155,7 +189,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:edit")
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(ServiceDictInfo serviceDictInfo,Model model, RedirectAttributes redirectAttributes) {
|
||||
public String saveOrUpdate(ServiceDictInfo serviceDictInfo,Model model, RedirectAttributes redirectAttributes,String itType) {
|
||||
|
||||
try {
|
||||
serviceDictInfoService.saveOrUpdate(serviceDictInfo);
|
||||
@@ -164,11 +198,9 @@ public class ServiceDictInfoController extends BaseController {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "保存配置失败!");
|
||||
}
|
||||
if(serviceDictInfo.getItemType()==3){
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/markList";
|
||||
}else{
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/list";
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/list?itType="+itType;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -180,7 +212,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value={"delete"})
|
||||
public String delete(ServiceDictInfo serviceDictInfo, RedirectAttributes redirectAttributes) {
|
||||
public String delete(ServiceDictInfo serviceDictInfo, RedirectAttributes redirectAttributes,String itType) {
|
||||
try {
|
||||
serviceDictInfoService.deleteDict(serviceDictInfo);
|
||||
addMessage(redirectAttributes, "删除配置成功");
|
||||
@@ -188,7 +220,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "删除配置失败!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/list";
|
||||
return "redirect:" + adminPath + "/configuration/serviceDictInfo/list?itType="+itType;
|
||||
}
|
||||
|
||||
|
||||
@@ -202,10 +234,16 @@ public class ServiceDictInfoController extends BaseController {
|
||||
@RequiresPermissions("user")
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "treeData")
|
||||
public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, HttpServletResponse response) {
|
||||
public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, HttpServletResponse response, String itType) {
|
||||
List<Map<String, Object>> mapList = Lists.newArrayList();
|
||||
//找出所有的非叶子配置
|
||||
List<ServiceDictInfo> list = serviceDictInfoService.findAllNoLeafDictList();
|
||||
Map<String, Object> map2 = Maps.newHashMap();
|
||||
map2.put("id", -1);
|
||||
map2.put("pId", 0);
|
||||
map2.put("name","无上级");
|
||||
//map2.put("placeholder","0");
|
||||
mapList.add(map2);
|
||||
//找出该类型所有的非叶子配置
|
||||
List<ServiceDictInfo> list = serviceDictInfoService.findAllNoLeafDictList(itType);
|
||||
for (int i=0; i<list.size(); i++){
|
||||
ServiceDictInfo serviceDictInfo = list.get(i);
|
||||
if (StringUtils.isBlank(extId) || (extId !=null && !extId.equals(serviceDictInfo.getServiceDictId().toString()))) {
|
||||
@@ -216,6 +254,11 @@ public class ServiceDictInfoController extends BaseController {
|
||||
map.put("id", serviceDictInfo.getServiceDictId());
|
||||
map.put("pId", serviceDictInfo.getParent().getServiceDictId());
|
||||
map.put("name",serviceDictInfo.getItemValue());
|
||||
/*if(serviceDictInfo.getParent().getServiceDictId()!=0){
|
||||
ServiceDictInfo parent = serviceDictInfoService.getDictById(serviceDictInfo.getParent().getServiceDictId());
|
||||
//map.put("placeholder",parent.getItemType().toString());
|
||||
}*/
|
||||
|
||||
mapList.add(map);
|
||||
}
|
||||
}
|
||||
@@ -223,175 +266,124 @@ public class ServiceDictInfoController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//标签配置
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 进入添加或修改页面
|
||||
* @param serviceDictInfo
|
||||
* @param model
|
||||
* 校验itemCode是否重复
|
||||
* @param itemCode
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value={"markForm"})
|
||||
public String markForm(ServiceDictInfo serviceDictInfo, Model model,String doAction) {
|
||||
if(doAction!=null&&doAction.equals("0")){
|
||||
return "/cfg/serviceDictMarkInfo";
|
||||
}
|
||||
if (serviceDictInfo.getParent() == null || serviceDictInfo.getParent().getId() == null) {
|
||||
ServiceDictInfo parent = new ServiceDictInfo();
|
||||
parent.setServiceDictId(0);
|
||||
serviceDictInfo.setParent(parent);
|
||||
}
|
||||
model.addAttribute("serviceDictInfo", serviceDictInfo);
|
||||
|
||||
return "/cfg/serviceDictMarkForm";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询标签列表(无条件分页查询)
|
||||
* @param serviceDictInfo
|
||||
* @param request
|
||||
* @param response
|
||||
* @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.findTopDictMarkList(new Page<ServiceDictInfo>(request, response), serviceDictInfo);
|
||||
model.addAttribute("page", page);
|
||||
//查出所有数据
|
||||
List<ServiceDictInfo> allList = serviceDictInfoService.findAllDictMarkList();
|
||||
//处理数据,保留顶层中的所有下层数据
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
boolean flag = false;
|
||||
for(int i=allList.size()-1;i>=0;i--){
|
||||
ServiceDictInfo temp = allList.get(i);
|
||||
if(temp.getParent()!=null&&temp.getParent().getServiceDictId()!=null&&temp.getParent().getServiceDictId()==0){
|
||||
for(ServiceDictInfo topTemp:page.getList()){
|
||||
if(temp.getServiceDictId()==topTemp.getServiceDictId()){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!flag){
|
||||
allList.remove(temp);
|
||||
flag=false;
|
||||
}else{
|
||||
flag=false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ServiceDictInfo.sortList(list,allList,0,true);
|
||||
//ServiceDictInfo.sortList(list, allList, 0, true);
|
||||
model.addAttribute("list", list);
|
||||
return "/cfg/serviceDictMarkList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询业务辅助表-业务字典信息列表(含条件查询)
|
||||
* @param serviceDictInfo
|
||||
* @param request
|
||||
* @param response
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = {"searchMarkList"})
|
||||
public String searchMarkList(ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
if(StringUtils.strIsBlank(serviceDictInfo.getItemValue())
|
||||
&&serviceDictInfo.getItemCode()==null
|
||||
&&serviceDictInfo.getItemType()==null
|
||||
&&serviceDictInfo.getBeginDate()==null
|
||||
&&serviceDictInfo.getEditTime()==null){
|
||||
|
||||
return "redirect:"+ adminPath + "/configuration/serviceDictInfo/markList";
|
||||
}
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findDictSearchMarkList(new Page<ServiceDictInfo>(request, response), serviceDictInfo);
|
||||
model.addAttribute("page", page);
|
||||
|
||||
return "/cfg/serviceDictInfoSearchMarkList";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增或修改
|
||||
* @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";
|
||||
}
|
||||
|
||||
/**
|
||||
* isShowHide是否显示隐藏菜单
|
||||
* @param extId
|
||||
* @param isShowHidden
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "treeMarkData")
|
||||
public List<Map<String, Object>> treeMarkData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, HttpServletResponse response) {
|
||||
List<Map<String, Object>> mapList = Lists.newArrayList();
|
||||
//找出所有的非叶子配置
|
||||
List<ServiceDictInfo> list = serviceDictInfoService.findAllNoLeafDictMarkList();
|
||||
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(serviceDictInfo.getIsValid().equals(0)){
|
||||
continue;
|
||||
@RequestMapping(value = "isItemCodeRepeat")
|
||||
public boolean isItemCodeRepeat(String itemCode,String oldItemCode) {
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
if(oldItemCode!=null&&itemCode.trim().equals(oldItemCode.trim())){
|
||||
return true;
|
||||
}
|
||||
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);
|
||||
if(!StringUtil.isEmpty(itemCode)){
|
||||
list = serviceDictInfoService.findByItemCode(Integer.valueOf(itemCode));
|
||||
}
|
||||
if(list==null||list.size()==0){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验上下级配置数据类型
|
||||
* @param parent 父级id
|
||||
* param parent 子级类型
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ajaxType")
|
||||
public boolean ajaxType(Integer parent,Integer child) {
|
||||
if(parent==-1||parent==0){
|
||||
return true;
|
||||
}
|
||||
ServiceDictInfo p = serviceDictInfoService.getDictById(parent);
|
||||
if(p.getItemType()==child){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验更改数据类型后校验数据类型是否与下级冲突
|
||||
* @param parent 父级id
|
||||
* param parent 子级类型
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ajaxChildrenType")
|
||||
public boolean ajaxChildrenType(Integer parent,Integer newItemType) {
|
||||
if(parent==null){
|
||||
return true;
|
||||
}
|
||||
//比较下级任意一个对象
|
||||
List<ServiceDictInfo> list = serviceDictInfoService.getDictByParentId(parent);
|
||||
if(list==null||list.size()==0){
|
||||
return true;
|
||||
}else{
|
||||
for(ServiceDictInfo serviceDictInfo:list){
|
||||
if(serviceDictInfo.getItemType()==newItemType){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return mapList;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id取itemType
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ajaxItemType")
|
||||
public Integer ajaxItemType(Integer parent) {
|
||||
if(parent==0||parent==-1){
|
||||
return 0;
|
||||
}
|
||||
ServiceDictInfo p = serviceDictInfoService.getDictById(parent);
|
||||
|
||||
return p.getItemType();
|
||||
}
|
||||
/**
|
||||
* 校验叶子节点有下级不得更改为叶子节点
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ajaxLeafChange")
|
||||
public boolean ajaxLeafChange(Integer parent,Integer newIsLeaf) {
|
||||
if(parent==null||parent==0){
|
||||
return true;
|
||||
}
|
||||
List<ServiceDictInfo> list = serviceDictInfoService.getDictByParentId(parent);
|
||||
if(list==null||list.size()==0){
|
||||
return true;
|
||||
}else{
|
||||
if(newIsLeaf==0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验叶子节点无父级不得更改为叶子节点
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ajaxLeafHasTree")
|
||||
public boolean ajaxLeafHasTree(Integer serviceDictId,Integer newIsLeaf,Integer parentId) {
|
||||
|
||||
if(parentId==null||parentId==0||parentId==-1){
|
||||
if(newIsLeaf==0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(parentId!=null&&parentId!=0){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -18,6 +19,7 @@ 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.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.SysDictInfo;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
@@ -56,7 +58,7 @@ public class SysDictInfoController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 查询业务辅助表-生效范围系统字典信息列表
|
||||
* 查询业务辅助表-生效范围系统字典信息列表(无条件分页查询)
|
||||
* @param sysDictInfo
|
||||
* @param request
|
||||
* @param response
|
||||
@@ -65,14 +67,99 @@ public class SysDictInfoController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(SysDictInfo sysDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
public String list(String itType, SysDictInfo sysDictInfo,HttpServletRequest request, HttpServletResponse response, Model model, Integer selectedType) {
|
||||
//处理数据
|
||||
String[] strArr = itType.split("-");
|
||||
Integer[] intArr = new Integer[strArr.length];
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
intArr[i] = Integer.valueOf(strArr[i]);
|
||||
}
|
||||
if(sysDictInfo.getItemType()!=null){
|
||||
model.addAttribute("selectedType", sysDictInfo.getItemType());
|
||||
}else{
|
||||
model.addAttribute("selectedType", selectedType);
|
||||
}
|
||||
|
||||
Page<SysDictInfo> page = sysDictInfoService.findDictList(new Page<SysDictInfo>(request, response), sysDictInfo);
|
||||
//查出顶层分页数据
|
||||
Page<SysDictInfo> page = sysDictInfoService.findTopDictList(new Page<SysDictInfo>(request, response), sysDictInfo,intArr);
|
||||
model.addAttribute("page", page);
|
||||
//查出所有数据
|
||||
List<SysDictInfo> allList = sysDictInfoService.findAllDictList();
|
||||
//处理数据,保留顶层中的所有下层数据
|
||||
List<SysDictInfo> list = Lists.newArrayList();
|
||||
boolean flag = false;
|
||||
for(int i=allList.size()-1;i>=0;i--){
|
||||
SysDictInfo temp = allList.get(i);
|
||||
if(temp.getParent()!=null&&temp.getParent().getSysDictId()!=null&&temp.getParent().getSysDictId()==0){
|
||||
for(SysDictInfo topTemp:page.getList()){
|
||||
if(temp.getSysDictId()==topTemp.getSysDictId()){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!flag){
|
||||
allList.remove(temp);
|
||||
flag=false;
|
||||
}else{
|
||||
flag=false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SysDictInfo.sortList(list,allList,0,true);
|
||||
|
||||
model.addAttribute("itType", itType);
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
model.addAttribute("list", list);
|
||||
return "/cfg/sysDictList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询业务辅助表-系统字典信息列表(含条件查询)
|
||||
* @param sysDictInfo
|
||||
* @param request
|
||||
* @param response
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = {"searchList"})
|
||||
public String searchList(String itType, SysDictInfo sysDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
if(StringUtils.strIsBlank(sysDictInfo.getItemValue())
|
||||
&&sysDictInfo.getItemCode()==null
|
||||
&&sysDictInfo.getBeginDate()==null
|
||||
&&sysDictInfo.getEndDate()==null){
|
||||
Integer selectedType = null;
|
||||
if(sysDictInfo.getItemType()!=null){
|
||||
selectedType = sysDictInfo.getItemType();
|
||||
return "redirect:"+ adminPath + "/configuration/sysDictInfo/list?itType="+itType+"&selectedType="+selectedType;
|
||||
}
|
||||
return "redirect:"+ adminPath + "/configuration/sysDictInfo/list?itType="+itType;
|
||||
}
|
||||
String[] strArr = itType.split("-");
|
||||
Integer[] intArr = new Integer[strArr.length];
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
intArr[i] = Integer.valueOf(strArr[i]);
|
||||
}
|
||||
model.addAttribute("itType", itType);
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
Page<SysDictInfo> page = sysDictInfoService.findDictSearchList(new Page<SysDictInfo>(request, response), sysDictInfo,intArr);
|
||||
model.addAttribute("page", page);
|
||||
|
||||
|
||||
return "/cfg/sysDictInfoSearchList";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 进入添加或修改页面
|
||||
* @param sysDictInfo
|
||||
@@ -80,10 +167,24 @@ public class SysDictInfoController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value={"form"})
|
||||
public String form(SysDictInfo sysDictInfo, Model model,String doAction) {
|
||||
public String form(SysDictInfo sysDictInfo, Model model, String doAction, String itType) {
|
||||
if(doAction!=null&&doAction.equals("0")){
|
||||
return "/cfg/sysDictInfo";
|
||||
}
|
||||
if (sysDictInfo.getParent() == null || sysDictInfo.getParent().getSysDictId() == null||sysDictInfo.getParent().getSysDictId() == 0) {
|
||||
SysDictInfo parent = new SysDictInfo();
|
||||
parent.setSysDictId(0);
|
||||
parent.setItemValue("无上级");
|
||||
sysDictInfo.setParent(parent);
|
||||
}
|
||||
String[] strArr = itType.split("-");
|
||||
Integer[] intArr = new Integer[strArr.length];
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
intArr[i] = Integer.valueOf(strArr[i]);
|
||||
}
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
model.addAttribute("sysDictInfo", sysDictInfo);
|
||||
model.addAttribute("itType", itType);
|
||||
return "/cfg/sysDictForm";
|
||||
}
|
||||
/**
|
||||
@@ -95,7 +196,7 @@ public class SysDictInfoController extends BaseController {
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:edit")
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(SysDictInfo sysDictInfo,Model model, RedirectAttributes redirectAttributes) {
|
||||
public String saveOrUpdate(SysDictInfo sysDictInfo,Model model, RedirectAttributes redirectAttributes, String itType) {
|
||||
|
||||
try {
|
||||
sysDictInfoService.saveOrUpdate(sysDictInfo);
|
||||
@@ -105,10 +206,9 @@ public class SysDictInfoController extends BaseController {
|
||||
addMessage(redirectAttributes, "保存配置失败!");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/configuration/sysDictInfo/list";
|
||||
return "redirect:" + adminPath + "/configuration/sysDictInfo/list?itType="+itType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param sysDictInfo
|
||||
@@ -116,7 +216,7 @@ public class SysDictInfoController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value={"delete"})
|
||||
public String delete(SysDictInfo sysDictInfo, RedirectAttributes redirectAttributes) {
|
||||
public String delete(SysDictInfo sysDictInfo, RedirectAttributes redirectAttributes, String itType) {
|
||||
try {
|
||||
sysDictInfoService.deleteDict(sysDictInfo);
|
||||
addMessage(redirectAttributes, "删除配置成功");
|
||||
@@ -124,7 +224,179 @@ public class SysDictInfoController extends BaseController {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "删除配置失败!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/configuration/sysDictInfo/list";
|
||||
return "redirect:" + adminPath + "/configuration/sysDictInfo/list?itType="+itType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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, String itType) {
|
||||
List<Map<String, Object>> mapList = Lists.newArrayList();
|
||||
Map<String, Object> map2 = Maps.newHashMap();
|
||||
map2.put("id", -1);
|
||||
map2.put("pId", 0);
|
||||
map2.put("name","无上级");
|
||||
//map2.put("placeholder","0");
|
||||
mapList.add(map2);
|
||||
//找出该类型所有的非叶子配置
|
||||
List<SysDictInfo> list = sysDictInfoService.findAllNoLeafDictList(itType);
|
||||
for (int i=0; i<list.size(); i++){
|
||||
SysDictInfo sysDictInfo = list.get(i);
|
||||
if (StringUtils.isBlank(extId) || (extId !=null && !extId.equals(sysDictInfo.getSysDictId().toString()))) {
|
||||
if(sysDictInfo.getIsValid().equals(0)){
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("id", sysDictInfo.getSysDictId());
|
||||
map.put("pId", sysDictInfo.getParent().getSysDictId());
|
||||
map.put("name",sysDictInfo.getItemValue());
|
||||
/*if(serviceDictInfo.getParent().getServiceDictId()!=0){
|
||||
ServiceDictInfo parent = serviceDictInfoService.getDictById(serviceDictInfo.getParent().getServiceDictId());
|
||||
//map.put("placeholder",parent.getItemType().toString());
|
||||
}*/
|
||||
|
||||
mapList.add(map);
|
||||
}
|
||||
}
|
||||
return mapList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 校验itemCode是否重复
|
||||
* @param itemCode
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "isItemCodeRepeat")
|
||||
public boolean isItemCodeRepeat(String itemCode,String oldItemCode) {
|
||||
List<SysDictInfo> list = Lists.newArrayList();
|
||||
if(oldItemCode!=null&&itemCode.trim().equals(oldItemCode.trim())){
|
||||
return true;
|
||||
}
|
||||
if(!StringUtil.isEmpty(itemCode)){
|
||||
list = sysDictInfoService.findByItemCode(Integer.valueOf(itemCode));
|
||||
}
|
||||
if(list==null||list.size()==0){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验上下级配置数据类型
|
||||
* @param parent 父级id
|
||||
* param parent 子级类型
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ajaxType")
|
||||
public boolean ajaxType(Integer parent,Integer child) {
|
||||
if(parent==-1||parent==0){
|
||||
return true;
|
||||
}
|
||||
SysDictInfo p = sysDictInfoService.getDictById(parent);
|
||||
if(p.getItemType()==child){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验更改数据类型后校验数据类型是否与下级冲突
|
||||
* @param parent 父级id
|
||||
* param parent 子级类型
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ajaxChildrenType")
|
||||
public boolean ajaxChildrenType(Integer parent,Integer newItemType) {
|
||||
if(parent==null){
|
||||
return true;
|
||||
}
|
||||
//比较下级任意一个对象
|
||||
List<SysDictInfo> list = sysDictInfoService.getDictByParentId(parent);
|
||||
if(list==null||list.size()==0){
|
||||
return true;
|
||||
}else{
|
||||
for(SysDictInfo sysDictInfo:list){
|
||||
if(sysDictInfo.getItemType()==newItemType){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id取itemType
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ajaxItemType")
|
||||
public Integer ajaxItemType(Integer parent) {
|
||||
if(parent==0||parent==-1){
|
||||
return 0;
|
||||
}
|
||||
SysDictInfo p = sysDictInfoService.getDictById(parent);
|
||||
|
||||
return p.getItemType();
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验叶子节点有下级不得更改为叶子节点
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ajaxLeafChange")
|
||||
public boolean ajaxLeafChange(Integer parent,Integer newIsLeaf) {
|
||||
if(parent==null||parent==0){
|
||||
return true;
|
||||
}
|
||||
List<SysDictInfo> list = sysDictInfoService.getDictByParentId(parent);
|
||||
if(list==null||list.size()==0){
|
||||
return true;
|
||||
}else{
|
||||
if(newIsLeaf==0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验叶子节点无父级不得更改为叶子节点
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ajaxLeafHasTree")
|
||||
public boolean ajaxLeafHasTree(Integer serviceDictId,Integer newIsLeaf,Integer parentId) {
|
||||
|
||||
if(parentId==null||parentId==0||parentId==-1){
|
||||
if(newIsLeaf==0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(parentId!=null&&parentId!=0){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,25 +13,43 @@ import com.nis.web.dao.MyBatisDao;
|
||||
public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
|
||||
|
||||
/**
|
||||
* 查询分类性质顶层字典列表(无条件查询)
|
||||
* 查询顶层字典列表(无条件查询(==))
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findTopDictList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查出所有分类性质
|
||||
* 查询顶层字典列表(无条件查询(!=))
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findTopDictListN(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查出所有有效数据
|
||||
*/
|
||||
List<ServiceDictInfo> findAllDictList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查询所有的非叶子配置
|
||||
*/
|
||||
List<ServiceDictInfo> findAllNoLeafDictList();
|
||||
List<ServiceDictInfo> findAllNoLeafDictList(@Param("itemType")Integer itemType);
|
||||
/**
|
||||
* 查询分类性质字典列表(含条件查询)
|
||||
* 根据上级id选出所有下级
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> getDictByParentId(Integer parentId);
|
||||
/**
|
||||
* 查询字典列表(含条件查询(==))
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findDictSearchList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查询字典列表(含条件查询(!=))
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findDictSearchListN(ServiceDictInfo serviceDictInfo);
|
||||
|
||||
|
||||
/**
|
||||
@@ -46,30 +64,14 @@ public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
|
||||
* @return
|
||||
*/
|
||||
ServiceDictInfo getDictById(Integer serviceDictId);
|
||||
/**
|
||||
* 根据itemCode查询字典对象列表
|
||||
* @param itemCode
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findByItemCode(Integer itemCode);
|
||||
|
||||
|
||||
//标签管理
|
||||
/**
|
||||
* 查询标签顶层字典列表(无条件查询)
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findTopDictMarkList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查出所有标签
|
||||
*/
|
||||
List<ServiceDictInfo> findAllDictMarkList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查询标签字典列表(条件查询)
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findDictSearchMarkList(ServiceDictInfo serviceDictInfo);
|
||||
/**
|
||||
* 查询所有的非叶子配置
|
||||
* @return
|
||||
*/
|
||||
List<ServiceDictInfo> findAllNoLeafDictMarkList();
|
||||
|
||||
|
||||
List<ServiceDictInfo> findItemDict(@Param("itemType")int itemType,@Param("isValid")int isValid);
|
||||
@@ -84,4 +86,7 @@ public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -52,22 +52,24 @@
|
||||
|
||||
|
||||
|
||||
<!-- 查询分类性质顶层分页列表 -->
|
||||
<!-- 查询顶层分页列表 (==)-->
|
||||
<select id="findTopDictList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type <![CDATA[<>]]> 3 AND parent_id = 0
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND parent_id = 0
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
<if test="itemValue != null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type = #{itemType}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
@@ -81,23 +83,24 @@
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 查询顶层分页列表 (!=)-->
|
||||
<select id="findTopDictListN" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND parent_id = 0
|
||||
|
||||
<!-- 查询标签顶层分页列表 -->
|
||||
<select id="findTopDictMarkList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type = 3 AND parent_id = 0
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
<if test="itemValue != null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type != #{itemType}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
@@ -114,44 +117,28 @@
|
||||
|
||||
|
||||
|
||||
<!-- 查出所有分类性质 -->
|
||||
|
||||
<!-- 查出所有 -->
|
||||
<select id="findAllDictList" resultType="serviceDictInfo">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
<include refid="menuJoins"/>
|
||||
WHERE s.is_valid =1 AND s.item_type <![CDATA[<>]]> 3
|
||||
WHERE s.is_valid =1
|
||||
</select>
|
||||
|
||||
<!-- 查出所有标签-->
|
||||
<select id="findAllDictMarkList" resultType="serviceDictInfo">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
<include refid="menuJoins"/>
|
||||
WHERE s.is_valid =1 AND s.item_type = 3
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 查询所有非叶子配置 -->
|
||||
<select id="findAllNoLeafDictList" resultType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
<select id="findAllNoLeafDictList" resultType="com.nis.domain.configuration.ServiceDictInfo" parameterType="java.lang.Integer">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type <![CDATA[<>]]> 3
|
||||
</select>
|
||||
<!-- 查询所有非叶子标签配置 -->
|
||||
<select id="findAllNoLeafDictMarkList" resultType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
FROM service_dict_info s
|
||||
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type = 3
|
||||
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type = #{itemType}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 分类性质条件查询 -->
|
||||
<!-- 条件查询分页(==) -->
|
||||
<select id="findDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1 AND item_type <![CDATA[<>]]> 3
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type like '%${itemType}%'
|
||||
@@ -166,7 +153,8 @@
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
@@ -180,27 +168,25 @@
|
||||
|
||||
</select>
|
||||
|
||||
<!-- 条件查询分页(!=) -->
|
||||
<select id="findDictSearchListN" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
SELECT * FROM service_dict_info WHERE is_valid=1
|
||||
|
||||
|
||||
|
||||
<!-- 标签条件查询 -->
|
||||
<select id="findDictSearchMarkList" 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="itemValue!= null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type != ${itemType}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
@@ -214,6 +200,7 @@
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据主键查询字典详细信息 -->
|
||||
|
||||
<select id="getDictById" resultType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
@@ -222,6 +209,22 @@
|
||||
from service_dict_info s where s.service_dict_id = #{serviceDictId}
|
||||
</select>
|
||||
|
||||
<!-- 根据上级id选出所有下级 -->
|
||||
|
||||
<select id="getDictByParentId" resultMap="dictResultMap">
|
||||
select *
|
||||
from service_dict_info s where parent_id = #{parentId}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据itemCode查询字典对象列表 -->
|
||||
|
||||
<select id="findByItemCode" resultType="com.nis.domain.configuration.ServiceDictInfo">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns"/>
|
||||
from service_dict_info s where s.item_code = #{itemCode}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!-- 新增字典信息 -->
|
||||
@@ -236,13 +239,6 @@
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 查询非叶子节点的所有字典信息 -->
|
||||
<!--
|
||||
<select id="findAllDict">
|
||||
select
|
||||
<include refid="serviceDictInfoColumns" />
|
||||
from service_dict_info s where s.is_leaf = 0;
|
||||
</select> -->
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="update">
|
||||
|
||||
@@ -9,12 +9,29 @@ import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface SysDictInfoDao extends CrudDao<SysDictInfo> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询生效范围字典列表,
|
||||
* 查询顶层字典列表(无条件查询(==))
|
||||
* @param sysDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> findDictList(SysDictInfo sysDictInfo);
|
||||
List<SysDictInfo> findTopDictList(SysDictInfo sysDictInfo);
|
||||
|
||||
/**
|
||||
* 查出所有有效数据
|
||||
* @param sysDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> findAllDictList(SysDictInfo sysDictInfo);
|
||||
|
||||
/**
|
||||
* 查询字典列表(含条件查询(==)
|
||||
* @param sysDictInfo
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> findDictSearchList(SysDictInfo sysDictInfo);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -30,11 +47,38 @@ public interface SysDictInfoDao extends CrudDao<SysDictInfo> {
|
||||
*/
|
||||
SysDictInfo getDictById(Integer sysDictId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有非叶子节点字典配置信息
|
||||
* 查询所有的非叶子配置
|
||||
* @param itemType
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> findAllDict();
|
||||
List<SysDictInfo> findAllNoLeafDictList(Integer itemType);
|
||||
|
||||
/**
|
||||
* 根据itemCode查询字典对象列表
|
||||
* @param itemCode
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> findByItemCode(Integer itemCode);
|
||||
|
||||
/**
|
||||
* 根据上级id选出所有下级
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
List<SysDictInfo> getDictByParentId(Integer parentId);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -34,7 +34,6 @@
|
||||
<result property="name" column="name"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<sql id="sysDictInfoColumns">
|
||||
s.sys_dict_id AS sysDictId,
|
||||
s.item_type AS itemType,
|
||||
@@ -50,8 +49,52 @@
|
||||
s.edit_time AS editTime
|
||||
</sql>
|
||||
|
||||
<!-- 查询分类性质列表 -->
|
||||
<select id="findDictList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.SysDictInfo">
|
||||
<sql id="menuJoins">
|
||||
LEFT JOIN sys_dict_info p ON p.sys_dict_id = s.parent_id
|
||||
</sql>
|
||||
|
||||
<!-- 查询顶层分页列表 (==)-->
|
||||
<select id="findTopDictList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.SysDictInfo">
|
||||
SELECT * FROM sys_dict_info WHERE is_valid=1 AND parent_id = 0
|
||||
|
||||
<if test="itemValue != null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
AND item_type = #{itemType}
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
</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="findAllDictList" resultType="sysDictInfo">
|
||||
SELECT
|
||||
<include refid="sysDictInfoColumns"/>
|
||||
FROM sys_dict_info s
|
||||
<include refid="menuJoins"/>
|
||||
WHERE s.is_valid =1
|
||||
</select>
|
||||
|
||||
<!-- 条件查询分页(==) -->
|
||||
<select id="findDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.configuration.SysDictInfo">
|
||||
SELECT * FROM sys_dict_info WHERE is_valid=1
|
||||
|
||||
<if test="itemType != null and itemType != '' " >
|
||||
@@ -60,12 +103,15 @@
|
||||
<if test="itemCode != null and itemCode != '' " >
|
||||
AND item_code like '%${itemCode}%'
|
||||
</if>
|
||||
|
||||
<if test="itemValue!= null and itemValue != '' " >
|
||||
AND item_value like '%${itemValue}%'
|
||||
</if>
|
||||
<if test="beginDate !=null" >
|
||||
AND create_time >= #{beginDate,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="endDate !=null" >
|
||||
AND create_time <= #{endDate,jdbcType=TIMESTAMP}
|
||||
AND create_time <= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
|
||||
|
||||
</if>
|
||||
|
||||
<choose>
|
||||
@@ -99,12 +145,13 @@
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 查询非叶子节点的所有字典信息 -->
|
||||
|
||||
<select id="findAllDict">
|
||||
select
|
||||
<include refid="sysDictInfoColumns" />
|
||||
from sys_dict_info s where s.is_leaf = 0;
|
||||
<!-- 查询所有非叶子配置 -->
|
||||
<select id="findAllNoLeafDictList" resultType="com.nis.domain.configuration.SysDictInfo" parameterType="java.lang.Integer">
|
||||
SELECT
|
||||
<include refid="sysDictInfoColumns"/>
|
||||
FROM sys_dict_info s
|
||||
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type = #{itemType}
|
||||
</select>
|
||||
|
||||
<!-- 修改 -->
|
||||
@@ -130,4 +177,20 @@
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据itemCode查询字典对象列表 -->
|
||||
|
||||
<select id="findByItemCode" resultType="com.nis.domain.configuration.SysDictInfo">
|
||||
select
|
||||
<include refid="sysDictInfoColumns"/>
|
||||
from sys_dict_info s where s.item_code = #{itemCode}
|
||||
</select>
|
||||
|
||||
<!-- 根据上级id选出所有下级 -->
|
||||
|
||||
<select id="getDictByParentId" resultMap="dictResultMap">
|
||||
select *
|
||||
from sys_dict_info s where parent_id = #{parentId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -24,16 +24,44 @@ public class ServiceDictInfoService extends BaseService{
|
||||
private ServiceDictInfoDao serviceDictInfoDao;
|
||||
|
||||
/**
|
||||
* 查询分类性质字典分页(无条件查询)
|
||||
* 查询业务字典分页(无条件查询)
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
public Page<ServiceDictInfo> findTopDictList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
public Page<ServiceDictInfo> findTopDictList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo,Integer[] itType) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
List<ServiceDictInfo> parentList = Lists.newArrayList();
|
||||
Integer tempType = 0;
|
||||
if(serviceDictInfo.getItemType()!=null){
|
||||
tempType = serviceDictInfo.getItemType();
|
||||
}
|
||||
//查出顶层分页查询
|
||||
List<ServiceDictInfo> parentList = serviceDictInfoDao.findTopDictList(serviceDictInfo);
|
||||
if(itType.length==1){
|
||||
serviceDictInfo.setItemType(itType[0]);
|
||||
parentList = serviceDictInfoDao.findTopDictList(serviceDictInfo);
|
||||
}
|
||||
if(itType.length==2){
|
||||
if(tempType!=0){
|
||||
parentList = serviceDictInfoDao.findTopDictList(serviceDictInfo);
|
||||
}else{
|
||||
List<Integer> tempList = Lists.newArrayList();
|
||||
tempList.add(1);tempList.add(2);tempList.add(3);
|
||||
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
|
||||
if(tempList.contains(itType[0])){
|
||||
tempList.remove(itType[0]);
|
||||
}
|
||||
if(tempList.contains(itType[1])){
|
||||
tempList.remove(itType[1]);
|
||||
}
|
||||
serviceDictInfo.setItemType(tempList.get(0));
|
||||
parentList = serviceDictInfoDao.findTopDictListN(serviceDictInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
page.setList(parentList);
|
||||
return page;
|
||||
}
|
||||
@@ -47,22 +75,62 @@ public class ServiceDictInfoService extends BaseService{
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有的非叶子配置
|
||||
* 查询该类型所有的非叶子配置
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllNoLeafDictList() {
|
||||
return serviceDictInfoDao.findAllNoLeafDictList();
|
||||
public List<ServiceDictInfo> findAllNoLeafDictList(String itType) {
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
String[] strArr = itType.split("-");
|
||||
Integer[] intArr = new Integer[strArr.length];
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
intArr[i] = Integer.valueOf(strArr[i]);
|
||||
List<ServiceDictInfo> tempList = serviceDictInfoDao.findAllNoLeafDictList(intArr[i]);
|
||||
for(ServiceDictInfo serviceDictInfo:tempList){
|
||||
list.add(serviceDictInfo);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
* 查询分类性质字典分页(含条件查询)
|
||||
* 查询字典分页(含条件查询)
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @param itType
|
||||
* @return
|
||||
*/
|
||||
public Page<ServiceDictInfo> findDictSearchList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
public Page<ServiceDictInfo> findDictSearchList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo, Integer[] itType) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
List<ServiceDictInfo> parentList = serviceDictInfoDao.findDictSearchList(serviceDictInfo);
|
||||
page.setList(parentList);
|
||||
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
Integer tempType = 0;
|
||||
if(serviceDictInfo.getItemType()!=null){
|
||||
tempType = serviceDictInfo.getItemType();
|
||||
}
|
||||
//查出分页
|
||||
if(itType.length==1){
|
||||
serviceDictInfo.setItemType(itType[0]);
|
||||
list = serviceDictInfoDao.findDictSearchList(serviceDictInfo);
|
||||
}
|
||||
if(itType.length==2){
|
||||
if(tempType!=0){
|
||||
list = serviceDictInfoDao.findTopDictList(serviceDictInfo);
|
||||
}else{
|
||||
List<Integer> tempList = Lists.newArrayList();
|
||||
tempList.add(1);tempList.add(2);tempList.add(3);
|
||||
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
|
||||
if(tempList.contains(itType[0])){
|
||||
tempList.remove(itType[0]);
|
||||
}
|
||||
if(tempList.contains(itType[1])){
|
||||
tempList.remove(itType[1]);
|
||||
}
|
||||
serviceDictInfo.setItemType(tempList.get(0));
|
||||
list = serviceDictInfoDao.findDictSearchListN(serviceDictInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
@@ -78,11 +146,30 @@ public class ServiceDictInfoService extends BaseService{
|
||||
return serviceDictInfoDao.getDictById(serviceDictId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据上级id选出所有下级
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
public List<ServiceDictInfo> getDictByParentId(Integer parentId) {
|
||||
|
||||
return serviceDictInfoDao.getDictByParentId(parentId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或修改业务字典表
|
||||
* @param serviceDictInfo
|
||||
*/
|
||||
public void saveOrUpdate(ServiceDictInfo serviceDictInfo) {
|
||||
if(serviceDictInfo.getParent()==null
|
||||
||(serviceDictInfo.getParent()!=null&&serviceDictInfo.getParent().getServiceDictId()==null)
|
||||
||(serviceDictInfo.getParent()!=null&&serviceDictInfo.getParent().getServiceDictId()==-1)
|
||||
||(serviceDictInfo.getParent()!=null&&serviceDictInfo.getParent().getServiceDictId()==0)
|
||||
){
|
||||
ServiceDictInfo parent = new ServiceDictInfo();
|
||||
parent.setServiceDictId(0);
|
||||
serviceDictInfo.setParent(parent);
|
||||
}
|
||||
SysUser user = UserUtils.getUser();
|
||||
if(StringUtil.isEmpty(serviceDictInfo.getServiceDictId())) {//新增
|
||||
serviceDictInfo.setIsValid(1);
|
||||
@@ -90,15 +177,8 @@ public class ServiceDictInfoService extends BaseService{
|
||||
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());
|
||||
@@ -107,15 +187,6 @@ public class ServiceDictInfoService extends BaseService{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有非叶子节点字典配置信息
|
||||
* @return
|
||||
*/
|
||||
/* public List<ServiceDictInfo> findAllDict() {
|
||||
|
||||
return serviceDictInfoDao.findAllDict();
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param serviceDictInfo
|
||||
@@ -133,55 +204,13 @@ public class ServiceDictInfoService extends BaseService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//标签管理
|
||||
|
||||
/**
|
||||
* 查询标签分页(无条件查询)
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
* 根据itemCode查出对象集合
|
||||
*/
|
||||
public Page<ServiceDictInfo> findTopDictMarkList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
//查出顶层分页查询
|
||||
List<ServiceDictInfo> parentList = serviceDictInfoDao.findTopDictMarkList(serviceDictInfo);
|
||||
page.setList(parentList);
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询所有有效标签配置
|
||||
* @return
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllDictMarkList() {
|
||||
|
||||
return serviceDictInfoDao.findAllDictMarkList(new ServiceDictInfo());
|
||||
public List<ServiceDictInfo> findByItemCode(Integer itemCode){
|
||||
return serviceDictInfoDao.findByItemCode(itemCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询标签字典分页(含条件查询)
|
||||
* @param page
|
||||
* @param serviceDictInfo
|
||||
* @return
|
||||
*/
|
||||
public Page<ServiceDictInfo> findDictSearchMarkList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo) {
|
||||
// 设置分页参数
|
||||
serviceDictInfo.setPage(page);
|
||||
List<ServiceDictInfo> parentList = serviceDictInfoDao.findDictSearchMarkList(serviceDictInfo);
|
||||
page.setList(parentList);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有的非叶子配置
|
||||
*/
|
||||
public List<ServiceDictInfo> findAllNoLeafDictMarkList() {
|
||||
return serviceDictInfoDao.findAllNoLeafDictMarkList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -266,4 +295,6 @@ public class ServiceDictInfoService extends BaseService{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ 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.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.SysDictInfo;
|
||||
import com.nis.domain.configuration.SysDictInfo;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.SysDictInfoDao;
|
||||
@@ -21,22 +23,61 @@ public class SysDictInfoService extends BaseService{
|
||||
@Autowired
|
||||
private SysDictInfoDao sysDictInfoDao;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询生效范围字典分页
|
||||
* 查询顶层分页(无条件查询)
|
||||
* @param page
|
||||
* @param sysDictInfo
|
||||
* @param intArr
|
||||
* @return
|
||||
*/
|
||||
public Page<SysDictInfo> findDictList(Page<SysDictInfo> page, SysDictInfo sysDictInfo) {
|
||||
public Page<SysDictInfo> findTopDictList(Page<SysDictInfo> page, SysDictInfo sysDictInfo, Integer[] intArr) {
|
||||
// 设置分页参数
|
||||
sysDictInfo.setPage(page);
|
||||
// 执行分页查询
|
||||
List<SysDictInfo> list = Lists.newArrayList();
|
||||
List<SysDictInfo> sourcelist = sysDictInfoDao.findDictList(sysDictInfo);
|
||||
SysDictInfo.sortList(list, sourcelist, 0, true);
|
||||
page.setList(sourcelist);
|
||||
List<SysDictInfo> parentList = Lists.newArrayList();
|
||||
Integer tempType = 0;
|
||||
//预留以后分开用
|
||||
if(sysDictInfo.getItemType()!=null){
|
||||
tempType = sysDictInfo.getItemType();
|
||||
}
|
||||
//查出顶层分页查询
|
||||
parentList = sysDictInfoDao.findTopDictList(sysDictInfo);
|
||||
|
||||
page.setList(parentList);
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 查询所有有效字典配置
|
||||
*/
|
||||
public List<SysDictInfo> findAllDictList() {
|
||||
return sysDictInfoDao.findAllDictList(new SysDictInfo());
|
||||
|
||||
}
|
||||
/**
|
||||
* 查询字典分页(含条件查询)
|
||||
* @param page
|
||||
* @param sysDictInfo
|
||||
* @param intArr
|
||||
* @return
|
||||
*/
|
||||
public Page<SysDictInfo> findDictSearchList(Page<SysDictInfo> page, SysDictInfo sysDictInfo, Integer[] itType) {
|
||||
// 设置分页参数
|
||||
sysDictInfo.setPage(page);
|
||||
|
||||
List<SysDictInfo> list = Lists.newArrayList();
|
||||
/*Integer tempType = 0;
|
||||
if(sysDictInfo.getItemType()!=null){
|
||||
tempType = sysDictInfo.getItemType();
|
||||
}*/
|
||||
//查出分页
|
||||
list = sysDictInfoDao.findDictSearchList(sysDictInfo);
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -53,6 +94,15 @@ public class SysDictInfoService extends BaseService{
|
||||
* @param sysDictInfo
|
||||
*/
|
||||
public void saveOrUpdate(SysDictInfo sysDictInfo) {
|
||||
if(sysDictInfo.getParent()==null
|
||||
||(sysDictInfo.getParent()!=null&&sysDictInfo.getParent().getSysDictId()==null)
|
||||
||(sysDictInfo.getParent()!=null&&sysDictInfo.getParent().getSysDictId()==-1)
|
||||
||(sysDictInfo.getParent()!=null&&sysDictInfo.getParent().getSysDictId()==0)
|
||||
){
|
||||
SysDictInfo parent = new SysDictInfo();
|
||||
parent.setSysDictId(0);
|
||||
sysDictInfo.setParent(parent);
|
||||
}
|
||||
SysUser user = UserUtils.getUser();
|
||||
if(StringUtil.isEmpty(sysDictInfo.getSysDictId())) {//新增
|
||||
sysDictInfo.setIsValid(1);
|
||||
@@ -60,11 +110,6 @@ public class SysDictInfoService extends BaseService{
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -77,24 +122,69 @@ public class SysDictInfoService extends BaseService{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有非叶子节点生效范围字典配置信息
|
||||
* @return
|
||||
*/
|
||||
public List<SysDictInfo> findAllDict() {
|
||||
|
||||
return sysDictInfoDao.findAllDict();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param sysDictInfo
|
||||
*/
|
||||
public void deleteDict(SysDictInfo sysDictInfo) {
|
||||
sysDictInfo.setIsValid(0);
|
||||
List<SysDictInfo> list = Lists.newArrayList();
|
||||
SysDictInfo.sortList(list, sysDictInfoDao.findAllDictList(new SysDictInfo()), sysDictInfo.getSysDictId(), true);
|
||||
list.add(sysDictInfo);
|
||||
for(SysDictInfo se:list){
|
||||
se.setIsValid(0);
|
||||
sysDictInfoDao.delete(sysDictInfo);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 查询该类型所有的非叶子配置
|
||||
* @param itType
|
||||
* @return
|
||||
*/
|
||||
public List<SysDictInfo> findAllNoLeafDictList(String itType) {
|
||||
List<SysDictInfo> list = Lists.newArrayList();
|
||||
String[] strArr = itType.split("-");
|
||||
Integer[] intArr = new Integer[strArr.length];
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
intArr[i] = Integer.valueOf(strArr[i]);
|
||||
List<SysDictInfo> tempList = sysDictInfoDao.findAllNoLeafDictList(intArr[i]);
|
||||
for(SysDictInfo sysDictInfo:tempList){
|
||||
list.add(sysDictInfo);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
* 根据itemCode查出对象集合
|
||||
* @param itemCode
|
||||
* @return
|
||||
*/
|
||||
public List<SysDictInfo> findByItemCode(Integer itemCode) {
|
||||
return sysDictInfoDao.findByItemCode(itemCode);
|
||||
}
|
||||
/**
|
||||
* 根据上级id选出所有下级
|
||||
* @param parent
|
||||
* @return
|
||||
*/
|
||||
public List<SysDictInfo> getDictByParentId(Integer parentId) {
|
||||
|
||||
return sysDictInfoDao.getDictByParentId(parentId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -295,4 +295,20 @@
|
||||
<example>${fns:toJson(object)}</example>
|
||||
</function>
|
||||
|
||||
<function>
|
||||
<description>根据id获取服务字典配置</description>
|
||||
<name>getServiceDictInfoById</name>
|
||||
<function-class>com.nis.util.ConfigDictUtils</function-class>
|
||||
<function-signature>java.lang.String getServiceDictInfoById(java.lang.Integer)</function-signature>
|
||||
<example>${fns:getServiceDictInfoById(id)}</example>
|
||||
</function>
|
||||
|
||||
<function>
|
||||
<description>根据id获取系统字典配置</description>
|
||||
<name>getSysDictInfoById</name>
|
||||
<function-class>com.nis.util.ConfigDictUtils</function-class>
|
||||
<function-signature>java.lang.String getSysDictInfoById(java.lang.Integer)</function-signature>
|
||||
<example>${fns:getSysDictInfoById(id)}</example>
|
||||
</function>
|
||||
|
||||
</taglib>
|
||||
|
||||
@@ -2,12 +2,90 @@
|
||||
<%@ 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>
|
||||
<link rel="stylesheet" type="text/css" href="${ctxStatic}/pages/css/dictInfo.css" />
|
||||
<script type="text/javascript" src="${ctxStatic}/pages/scripts/dict.js"></script>
|
||||
<title>配置管理</title>
|
||||
<script type="text/javascript">
|
||||
//上级选择数据类型自动改变
|
||||
function serviceDictInfoTreeselectCallBack(){
|
||||
var parent = $("#serviceDictInfoId").val();
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:true,
|
||||
cache:false,
|
||||
url:'${ctx}/configuration/serviceDictInfo/ajaxItemType',
|
||||
data:{parent:parent},
|
||||
success:function(data){
|
||||
$("#itemType option").each(function(){
|
||||
$(this).attr("selected",false);
|
||||
});
|
||||
$("#itemType").find("option[value='"+data+"']").attr("selected",true);
|
||||
}
|
||||
});
|
||||
}
|
||||
$(document).ready(function() {
|
||||
//校验itemCode数值
|
||||
jQuery.validator.addMethod("codeNumber",function(value,element){
|
||||
return value>=0&value<=20000000},"请填写正确的数值");
|
||||
jQuery.validator.addMethod("typeSame",function(value,element){
|
||||
var flag=false;
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url:'${ctx}/configuration/serviceDictInfo/ajaxType',
|
||||
data:{parent:$("#serviceDictInfoId").val(),child:$("#itemType option:selected").val()},
|
||||
success:function(data){
|
||||
flag=data;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
},"请选择正确的数据类型");
|
||||
//校验更改数据类型后校验数据类型是否与下级冲突
|
||||
jQuery.validator.addMethod("typeChild",function(value,element){
|
||||
var flag=false;
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url:'${ctx}/configuration/serviceDictInfo/ajaxChildrenType',
|
||||
data:{parent:"${serviceDictInfo.serviceDictId}",newItemType:$("#itemType option:selected").val()},
|
||||
success:function(data){
|
||||
flag=data;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
},"该配置包含下级配置,数据类型更改后上下级类型不一致");
|
||||
//校验叶子节点有下级不得更改为叶子节点
|
||||
jQuery.validator.addMethod("leafChange",function(value,element){
|
||||
var flag=false;
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url:'${ctx}/configuration/serviceDictInfo/ajaxLeafChange',
|
||||
data:{parent:"${serviceDictInfo.serviceDictId}",newIsLeaf:$("#isLeaf option:selected").val()},
|
||||
success:function(data){
|
||||
flag=data;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
},"该配置包含下级配置,不得改为叶子节点");
|
||||
|
||||
//校验叶子节点无上级不得选为叶子节点
|
||||
jQuery.validator.addMethod("leafHasTree",function(value,element){
|
||||
var flag=false;
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url:'${ctx}/configuration/serviceDictInfo/ajaxLeafHasTree',
|
||||
data:{serviceDictId:"${serviceDictInfo.serviceDictId}",newIsLeaf:$("#isLeaf option:selected").val(),parentId:$("#serviceDictInfoId").val()},
|
||||
success:function(data){
|
||||
flag=data;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
},"该配置无上级,不得设为叶子节点");
|
||||
|
||||
|
||||
|
||||
$("#name").focus();
|
||||
$("#inputForm").validate({
|
||||
//需验证 item_code item_value
|
||||
@@ -15,10 +93,19 @@
|
||||
'itemCode':{
|
||||
required:true,
|
||||
digits:true,
|
||||
codeNumber:true
|
||||
codeNumber:true,
|
||||
remote:"${ctx}/configuration/serviceDictInfo/isItemCodeRepeat?oldItemCode=${serviceDictInfo.itemCode}"
|
||||
},
|
||||
'itemValue':{
|
||||
required:true
|
||||
},
|
||||
'itemType':{
|
||||
typeSame:true,
|
||||
typeChild:true
|
||||
},
|
||||
'isLeaf':{
|
||||
leafChange:true,
|
||||
leafHasTree:true
|
||||
}
|
||||
|
||||
},
|
||||
@@ -26,10 +113,19 @@
|
||||
'itemCode':{
|
||||
required:'编码必须填写',
|
||||
digits:'请填写整数值',
|
||||
codeNumber:'请填写合适的数值(0~200000000)'
|
||||
codeNumber:'请填写合适的数值(0~200000000)',
|
||||
remote:"该配置编码已存在"
|
||||
},
|
||||
'itemValue':{
|
||||
required:'编码对应值必须填写'
|
||||
},
|
||||
'itemType':{
|
||||
typeSame:'请选择一致的上下级配置数据类型',
|
||||
typeChild:'该配置包含下级配置,数据类型更改后与子类不一致'
|
||||
},
|
||||
'isLeaf':{
|
||||
leafChange:'该配置包含下级配置,不得改为叶子节点',
|
||||
leafHasTree:'该配置无上级,不得设为叶子节点'
|
||||
}
|
||||
},
|
||||
|
||||
@@ -63,7 +159,7 @@
|
||||
|
||||
|
||||
<h3 class="page-title">
|
||||
分类性质配置管理
|
||||
配置管理
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
@@ -71,7 +167,7 @@
|
||||
<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>
|
||||
<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>
|
||||
@@ -86,14 +182,14 @@
|
||||
<div class="form-body">
|
||||
|
||||
<!-- BEGIN FORM-->
|
||||
<form:form id="inputForm" modelAttribute="serviceDictInfo" action="${ctx}/configuration/serviceDictInfo/saveOrUpdate" method="post" class="form-horizontal">
|
||||
<form:form id="inputForm" modelAttribute="serviceDictInfo" action="${ctx}/configuration/serviceDictInfo/saveOrUpdate?itType=${itType}" 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.serviceDictId" value="${serviceDictInfo.parent.serviceDictId}" labelName="parent.itemValue" labelValue="${serviceDictInfo.parent.itemCode}"
|
||||
title="菜单" url="/configuration/serviceDictInfo/treeData" extId="${serviceDictInfo.serviceDictId}" cssClass="required form-control"/>
|
||||
<sys:treeselect id="serviceDictInfo" name="parent.serviceDictId" value="${serviceDictInfo.parent.serviceDictId}" labelName="parent.itemValue" labelValue="${serviceDictInfo.parent.itemValue eq '无上级'?'无上级':fns:getServiceDictInfoById(serviceDictInfo.parent.serviceDictId).itemValue}"
|
||||
title="菜单" url="/configuration/serviceDictInfo/treeData?itType=${itType}" extId="${serviceDictInfo.serviceDictId}" cssClass="required form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -101,32 +197,31 @@
|
||||
<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:forEach items="${intArr}" var="itTemp">
|
||||
<c:if test="${dict.itemCode eq itTemp}">
|
||||
<option value="${dict.itemCode}"
|
||||
<c:if test="${serviceDictInfo.itemType eq dict.itemCode}">selected="selected"</c:if>
|
||||
>${dict.itemValue}</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>编码:</label>
|
||||
<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>
|
||||
<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>
|
||||
<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">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/pages/css/dictInfo.css" />
|
||||
<title>分类性质配置管理</title>
|
||||
<title>配置管理</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
|
||||
<h3 class="page-title">
|
||||
分类性质配置管理
|
||||
配置管理
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
@@ -26,7 +26,7 @@
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-gift"></i>分类性质配置查看</div>
|
||||
<i class="fa fa-gift"></i>配置查看</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body form">
|
||||
@@ -41,7 +41,7 @@
|
||||
<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"/>
|
||||
<input value="${serviceDictInfo.parent.serviceDictId == 0?'无上级':fns:getServiceDictInfoById(serviceDictInfo.parent.serviceDictId).itemValue}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -2,22 +2,48 @@
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title>分类性质配置信息</title>
|
||||
<title>配置信息</title>
|
||||
<link href="${ctxStatic}/global/plugins/treeTable/themes/vsStyle/treeTable.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="${ctxStatic}/pages/css/dictInfo.css" rel="stylesheet" type="text/css" />
|
||||
<script src="${ctxStatic}/global/plugins/treeTable/jquery.treeTable.min.js" type="text/javascript"></script>
|
||||
<script src="${ctxStatic}/pages/scripts/dict.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#treeTable").treeTable({expandLevel : 3}).show();
|
||||
});
|
||||
//查询
|
||||
function page(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/configuration/serviceDictInfo/searchList?itType=${itType}");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
function page2(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/configuration/serviceDictInfo/searchList?itType=${itType}");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.dropdown-menu {
|
||||
min-width: 70px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="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-default" onclick="location='${ctx}/configuration/serviceDictInfo/list?itType=${itType}'"><spring:message code="refresh"></spring:message></button>
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/configuration/serviceDictInfo/form'"><spring:message code="add_request"></spring:message></button>
|
||||
onClick="javascript:window.location='${ctx}/configuration/serviceDictInfo/form?itType=${itType}'">新增配置</button>
|
||||
</div>
|
||||
|
||||
<h3 class="page-title">
|
||||
分类性质管理
|
||||
配置管理
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
@@ -25,98 +51,86 @@
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-cogs"></i>分类性质搜索结果
|
||||
<i class="fa fa-cogs"></i>搜索结果
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" modelAttribute="serviceDictInfo" action="${ctx}/configuration/serviceDictInfo/searchList" method="post" class="form-search">
|
||||
<div class="col-md-12">
|
||||
<sys:message content="${message}"/>
|
||||
<form:form id="searchForm" modelAttribute="serviceDictInfo" action="${ctx}/configuration/serviceDictInfo/searchList?itType=${itType}" 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="itemValue" name="itemValue" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemValue}"/>
|
||||
<label class="search-lable">编码:</label><input id="itemCode" name="itemCode" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemCode}"/>
|
||||
<label class="search-lable">数据类型:</label> <select id="itemType" name="itemType" >
|
||||
<option selected="selected"></option>
|
||||
<label class="search-lable">配置内容:</label><input id="itemValue" name="itemValue" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemValue}"/>
|
||||
<label class="search-lable">配置编码:</label><input id="itemCode" name="itemCode" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemCode}"/>
|
||||
<label class="search-lable itemType">数据类型:</label>
|
||||
<select id="itemType" name="itemType" >
|
||||
<option value="" selected="selected">-请选择-</option>
|
||||
<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:forEach items="${intArr}" var="itTemp">
|
||||
<c:if test="${dict.itemCode eq itTemp}">
|
||||
<option value="${dict.itemCode}"
|
||||
<c:if test="${serviceDictInfo.itemType eq dict.itemCode}">selected="selected"</c:if>
|
||||
>${dict.itemValue}</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<spring:message code="begin_date"></spring:message> : <input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
|
||||
<spring:message code="begin_date"></spring:message>:<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});"/>
|
||||
<spring:message code="end_date"></spring:message> : <input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
|
||||
<spring:message code="end_date"></spring:message>:<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 type="button" class="btn btn-default btn-sm" onclick="return page2()">
|
||||
<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 id="contentTable" class="table table-striped table-bordered table-condensed">
|
||||
<table id="treeTable" class="table table-striped table-bordered table-condensed">
|
||||
<thead><tr><th>配置内容</th><th>配置编码</th><th>描述信息</th><th>数据类型</th><th>叶子节点</th><th>创建人员</th><th>创建时间</th><th>最近修改人员</th><th>最近修改时间</th><shiro:hasPermission name="sys:menu:edit"><th>操作</th></shiro:hasPermission></tr></thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list}" var="serviceDictInfo">
|
||||
<tr>
|
||||
<td>${serviceDictInfo.itemValue}</td>
|
||||
<tbody><c:forEach items="${page.list}" var="serviceDictInfo">
|
||||
<tr id="${serviceDictInfo.serviceDictId}" pId="${serviceDictInfo.parent.serviceDictId ne 0?serviceDictInfo.parent.serviceDictId:0}">
|
||||
<td nowrap><i class="icon-icon-tablet"></i><a href="${ctx}/configuration/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}&doAction=0">${serviceDictInfo.itemValue}</a></td>
|
||||
<td>${serviceDictInfo.itemCode}</td>
|
||||
<td title="${serviceDictInfo.itemDesc}">${fns:abbr(serviceDictInfo.itemDesc,15)}</td>
|
||||
<td>${fns:getDictLabel("SERVICE_DICT_ITM_TYPE",serviceDictInfo.itemType,"0")}</td>
|
||||
<td>${fns:getDictLabel("SYS_YES_NO",serviceDictInfo.isLeaf,"0")}</td>
|
||||
<td>${serviceDictInfo.serviceDictCreator.id}</td>
|
||||
<td><c:if test="${serviceDictInfo.serviceDictCreator != null}">
|
||||
${fns:getUserById(serviceDictInfo.serviceDictCreator.id).name}
|
||||
</c:if></td>
|
||||
<td><fmt:formatDate value="${serviceDictInfo.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${serviceDictInfo.serviceDictEditor.name}</td>
|
||||
<td><c:if test="${serviceDictInfo.serviceDictEditor != null}">
|
||||
${fns:getUserById(serviceDictInfo.serviceDictEditor.id).name}
|
||||
</c:if></td>
|
||||
<td><fmt:formatDate value="${serviceDictInfo.editTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>
|
||||
<div class="btn-group btn-xs">
|
||||
<a class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" href="#"><spring:message code="operation"></spring:message><span class="caret"></span></a>
|
||||
<a class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" href="#">操作<span class="caret"></span></a>
|
||||
<ul class="dropdown-menu btn-xs">
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}&doAction=0">查看</a></li>
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}" onclick="return confirmx('确定吗?', this.href)"><spring:message code="update_request"></spring:message></a></li>
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/delete?serviceDictId=${serviceDictInfo.serviceDictId}" onclick="return confirmx('确定吗?', this.href)"><spring:message code="delete"></spring:message></a></li>
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}&doAction=0&itType=${itType}">查看</a></li>
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}&itType=${itType}" onclick="return confirmx('您确认要修改该项配置吗?', this.href)">修改</a></li>
|
||||
</shiro:hasPermission>
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/delete?serviceDictId=${serviceDictInfo.serviceDictId}&itType=${itType}" onclick="return confirmx('您确认要删除该项配置吗?', this.href)">删除</a></li>
|
||||
</shiro:hasPermission>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</c:forEach></tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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/searchList");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,122 +0,0 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title>标签配置信息</title>
|
||||
<link href="${ctxStatic}/pages/css/dictInfo.css" rel="stylesheet" type="text/css" />
|
||||
<script src="${ctxStatic}/pages/scripts/dict.js" type="text/javascript"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="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'"><spring:message code="add_request"></spring:message></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-cogs"></i>标签搜索结果
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" modelAttribute="serviceDictInfo" action="${ctx}/configuration/serviceDictInfo/searchMarkList" 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="itemValue" name="itemValue" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemValue}"/>
|
||||
<label class="search-lable">编码:</label><input id="itemCode" name="itemCode" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemCode}"/>
|
||||
<label class="search-lable">数据类型:</label> <select id="itemType" name="itemType" >
|
||||
<option selected="selected"></option>
|
||||
<c:forEach items="${fns:getDictList('SERVICE_DICT_ITM_TYPE')}" var="dict">
|
||||
<c:if test="${dict.itemCode eq '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>
|
||||
<spring:message code="begin_date"></spring:message> : <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});"/>
|
||||
<spring:message code="end_date"></spring:message> : <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 id="contentTable" class="table table-striped table-bordered table-condensed">
|
||||
<thead><tr><th>配置内容</th><th>配置编码</th><th>描述信息</th><th>数据类型</th><th>叶子节点</th><th>创建人员</th><th>创建时间</th><th>最近修改人员</th><th>最近修改时间</th><shiro:hasPermission name="sys:menu:edit"><th>操作</th></shiro:hasPermission></tr></thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list}" var="serviceDictInfo">
|
||||
<tr>
|
||||
<td>${serviceDictInfo.itemValue}</td>
|
||||
<td>${serviceDictInfo.itemCode}</td>
|
||||
<td title="${serviceDictInfo.itemDesc}">${fns:abbr(serviceDictInfo.itemDesc,15)}</td>
|
||||
<td>${fns:getDictLabel("SERVICE_DICT_ITM_TYPE",serviceDictInfo.itemType,"0")}</td>
|
||||
<td>${fns:getDictLabel("SYS_YES_NO",serviceDictInfo.isLeaf,"0")}</td>
|
||||
<td>${serviceDictInfo.serviceDictCreator.id}</td>
|
||||
<td><fmt:formatDate value="${serviceDictInfo.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${serviceDictInfo.serviceDictEditor.name}</td>
|
||||
<td><fmt:formatDate value="${serviceDictInfo.editTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>
|
||||
<div class="btn-group btn-xs">
|
||||
<a class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" href="#"><spring:message code="operation"></spring:message><span class="caret"></span></a>
|
||||
<ul class="dropdown-menu btn-xs">
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/markForm?serviceDictId=${serviceDictInfo.serviceDictId}&doAction=0">查看</a></li>
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/markForm?serviceDictId=${serviceDictInfo.serviceDictId}" onclick="return confirmx('确定吗?', this.href)"><spring:message code="update_request"></spring:message></a></li>
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/delete?serviceDictId=${serviceDictInfo.serviceDictId}" onclick="return confirmx('确定吗?', this.href)"><spring:message code="delete"></spring:message></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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/searchMarkList");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,7 +2,7 @@
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title>分类性质配置信息</title>
|
||||
<title>配置信息</title>
|
||||
<link href="${ctxStatic}/global/plugins/treeTable/themes/vsStyle/treeTable.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="${ctxStatic}/pages/css/dictInfo.css" rel="stylesheet" type="text/css" />
|
||||
<script src="${ctxStatic}/global/plugins/treeTable/jquery.treeTable.min.js" type="text/javascript"></script>
|
||||
@@ -16,7 +16,7 @@
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/configuration/serviceDictInfo/list");
|
||||
$("#searchForm").attr("action","${ctx}/configuration/serviceDictInfo/list?itType=${itType}");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
@@ -24,7 +24,7 @@
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/configuration/serviceDictInfo/searchList");
|
||||
$("#searchForm").attr("action","${ctx}/configuration/serviceDictInfo/searchList?itType=${itType}");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
@@ -37,13 +37,13 @@
|
||||
</head>
|
||||
<body>
|
||||
<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-default" onclick="location='${ctx}/configuration/serviceDictInfo/list?itType=${itType}'"><spring:message code="refresh"></spring:message></button>
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/configuration/serviceDictInfo/form'">新增配置</button>
|
||||
onClick="javascript:window.location='${ctx}/configuration/serviceDictInfo/form?itType=${itType}'">新增配置</button>
|
||||
</div>
|
||||
|
||||
<h3 class="page-title">
|
||||
分类性质管理
|
||||
配置管理
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
@@ -51,36 +51,36 @@
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-cogs"></i>分类性质配置列表
|
||||
<i class="fa fa-cogs"></i>列表信息
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="row" >
|
||||
<div class="col-md-12">
|
||||
<sys:message content="${message}"/>
|
||||
<form:form id="searchForm" modelAttribute="serviceDictInfo" action="${ctx}/configuration/serviceDictInfo/searchList" method="post" class="form-search">
|
||||
<form:form id="searchForm" modelAttribute="serviceDictInfo" action="${ctx}/configuration/serviceDictInfo/searchList?itType=${itType}" 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="itemValue" name="itemValue" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemValue}"/>
|
||||
<label class="search-lable">编码:</label><input id="itemCode" name="itemCode" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemCode}"/>
|
||||
<label class="search-lable">数据类型:</label> <select id="itemType" name="itemType" >
|
||||
<option selected="selected"></option>
|
||||
<label class="search-lable">配置内容:</label><input id="itemValue" name="itemValue" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemValue}"/>
|
||||
<label class="search-lable">配置编码:</label><input id="itemCode" name="itemCode" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemCode}"/>
|
||||
<label class="search-lable itemType">数据类型:</label>
|
||||
<select id="itemType" name="itemType" >
|
||||
<option value="" selected="selected">-请选择-</option>
|
||||
<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:forEach items="${intArr}" var="itTemp">
|
||||
<c:if test="${dict.itemCode eq itTemp}">
|
||||
<option value="${dict.itemCode}"
|
||||
<c:if test="${selectedType eq dict.itemCode}">selected="selected"</c:if>
|
||||
>${dict.itemValue}</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<spring:message code="begin_date"></spring:message> : <input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
|
||||
value="<fmt:formatDate value="${requestInfo.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
|
||||
<spring:message code="end_date"></spring:message> : <input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
|
||||
value="<fmt:formatDate value="${requestInfo.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});"/>
|
||||
<spring:message code="begin_date"></spring:message>:<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});"/>
|
||||
<spring:message code="end_date"></spring:message>:<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 page2()">
|
||||
<i class="fa fa-edit"></i> <spring:message code="search"></spring:message>
|
||||
@@ -108,12 +108,12 @@
|
||||
<div class="btn-group btn-xs">
|
||||
<a class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" href="#">操作<span class="caret"></span></a>
|
||||
<ul class="dropdown-menu btn-xs">
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}&doAction=0">查看</a></li>
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}&doAction=0&itType=${itType}">查看</a></li>
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}" onclick="return confirmx('数据字典在系统中非常重要,您确认要修改吗?', this.href)">修改</a></li>
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}&itType=${itType}" onclick="return confirmx('您确认要修改该项配置吗?', this.href)">修改</a></li>
|
||||
</shiro:hasPermission>
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/delete?serviceDictId=${serviceDictInfo.serviceDictId}" onclick="return confirmx('数据字典在系统中非常重要,您确认要删除吗?', this.href)">删除</a></li>
|
||||
<li><a href="${ctx}/configuration/serviceDictInfo/delete?serviceDictId=${serviceDictInfo.serviceDictId}&itType=${itType}" onclick="return confirmx('您确认要删除该项配置吗?', this.href)">删除</a></li>
|
||||
</shiro:hasPermission>
|
||||
|
||||
</ul>
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
<%@ 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.serviceDictId" value="${serviceDictInfo.parent.serviceDictId}" labelName="parent.itemValue" labelValue="${serviceDictInfo.parent.itemCode}"
|
||||
title="菜单" url="/configuration/serviceDictInfo/treeMarkData" extId="${serviceDictInfo.serviceDictId}" cssClass="required 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 eq '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>
|
||||
@@ -1,91 +0,0 @@
|
||||
<%@ 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>
|
||||
@@ -2,12 +2,90 @@
|
||||
<%@ 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>
|
||||
<link rel="stylesheet" type="text/css" href="${ctxStatic}/pages/css/dictInfo.css" />
|
||||
<script type="text/javascript" src="${ctxStatic}/pages/scripts/dict.js"></script>
|
||||
<title>配置管理</title>
|
||||
<script type="text/javascript">
|
||||
//上级选择数据类型自动改变
|
||||
function sysDictInfoTreeselectCallBack(){
|
||||
var parent = $("#sysDictInfoId").val();
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:true,
|
||||
cache:false,
|
||||
url:'${ctx}/configuration/sysDictInfo/ajaxItemType',
|
||||
data:{parent:parent},
|
||||
success:function(data){
|
||||
$("#itemType option").each(function(){
|
||||
$(this).attr("selected",false);
|
||||
});
|
||||
$("#itemType").find("option[value='"+data+"']").attr("selected",true);
|
||||
}
|
||||
});
|
||||
}
|
||||
$(document).ready(function() {
|
||||
//校验itemCode数值
|
||||
jQuery.validator.addMethod("codeNumber",function(value,element){
|
||||
return value>=0&value<=20000000},"请填写正确的数值");
|
||||
jQuery.validator.addMethod("typeSame",function(value,element){
|
||||
var flag=false;
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url:'${ctx}/configuration/sysDictInfo/ajaxType',
|
||||
data:{parent:$("#sysDictInfoId").val(),child:$("#itemType option:selected").val()},
|
||||
success:function(data){
|
||||
flag=data;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
},"请选择正确的数据类型");
|
||||
//校验更改数据类型后校验数据类型是否与下级冲突
|
||||
jQuery.validator.addMethod("typeChild",function(value,element){
|
||||
var flag=false;
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url:'${ctx}/configuration/sysDictInfo/ajaxChildrenType',
|
||||
data:{parent:"${sysDictInfo.sysDictId}",newItemType:$("#itemType option:selected").val()},
|
||||
success:function(data){
|
||||
flag=data;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
},"该配置包含下级配置,数据类型更改后上下级类型不一致");
|
||||
//校验叶子节点有下级不得更改为叶子节点
|
||||
jQuery.validator.addMethod("leafChange",function(value,element){
|
||||
var flag=false;
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url:'${ctx}/configuration/sysDictInfo/ajaxLeafChange',
|
||||
data:{parent:"${sysDictInfo.sysDictId}",newIsLeaf:$("#isLeaf option:selected").val()},
|
||||
success:function(data){
|
||||
flag=data;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
},"该配置包含下级配置,不得改为叶子节点");
|
||||
|
||||
//校验叶子节点无上级不得选为叶子节点
|
||||
jQuery.validator.addMethod("leafHasTree",function(value,element){
|
||||
var flag=false;
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url:'${ctx}/configuration/sysDictInfo/ajaxLeafHasTree',
|
||||
data:{sysDictId:"${sysDictInfo.sysDictId}",newIsLeaf:$("#isLeaf option:selected").val(),parentId:$("#sysDictInfoId").val()},
|
||||
success:function(data){
|
||||
flag=data;
|
||||
}
|
||||
});
|
||||
return flag;
|
||||
},"该配置无上级,不得设为叶子节点");
|
||||
|
||||
|
||||
|
||||
$("#name").focus();
|
||||
$("#inputForm").validate({
|
||||
//需验证 item_code item_value
|
||||
@@ -15,10 +93,19 @@
|
||||
'itemCode':{
|
||||
required:true,
|
||||
digits:true,
|
||||
codeNumber:true
|
||||
codeNumber:true,
|
||||
remote:"${ctx}/configuration/sysDictInfo/isItemCodeRepeat?oldItemCode=${sysDictInfo.itemCode}"
|
||||
},
|
||||
'itemValue':{
|
||||
required:true
|
||||
},
|
||||
'itemType':{
|
||||
typeSame:true,
|
||||
typeChild:true
|
||||
},
|
||||
'isLeaf':{
|
||||
leafChange:true,
|
||||
leafHasTree:true
|
||||
}
|
||||
|
||||
},
|
||||
@@ -26,10 +113,19 @@
|
||||
'itemCode':{
|
||||
required:'编码必须填写',
|
||||
digits:'请填写整数值',
|
||||
codeNumber:'请填写合适的数值(0~200000000)'
|
||||
codeNumber:'请填写合适的数值(0~200000000)',
|
||||
remote:"该配置编码已存在"
|
||||
},
|
||||
'itemValue':{
|
||||
required:'编码对应值必须填写'
|
||||
},
|
||||
'itemType':{
|
||||
typeSame:'请选择一致的上下级配置数据类型',
|
||||
typeChild:'该配置包含下级配置,数据类型更改后与子类不一致'
|
||||
},
|
||||
'isLeaf':{
|
||||
leafChange:'该配置包含下级配置,不得改为叶子节点',
|
||||
leafHasTree:'该配置无上级,不得设为叶子节点'
|
||||
}
|
||||
},
|
||||
|
||||
@@ -63,7 +159,7 @@
|
||||
|
||||
|
||||
<h3 class="page-title">
|
||||
生效范围配置管理
|
||||
配置管理
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
@@ -71,7 +167,7 @@
|
||||
<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>
|
||||
<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>
|
||||
@@ -86,19 +182,14 @@
|
||||
<div class="form-body">
|
||||
|
||||
<!-- BEGIN FORM-->
|
||||
<form:form id="inputForm" modelAttribute="sysDictInfo" action="${ctx}/configuration/sysDictInfo/saveOrUpdate" method="post" class="form-horizontal">
|
||||
<form:form id="inputForm" modelAttribute="sysDictInfo" action="${ctx}/configuration/sysDictInfo/saveOrUpdate?itType=${itType}" 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"/>
|
||||
<sys:treeselect id="sysDictInfo" name="parent.sysDictId" value="${sysDictInfo.parent.sysDictId}" labelName="parent.itemValue" labelValue="${sysDictInfo.parent.itemValue eq '无上级'?'无上级':fns:getSysDictInfoById(sysDictInfo.parent.sysDictId).itemValue}"
|
||||
title="菜单" url="/configuration/sysDictInfo/treeData?itType=${itType}" extId="${sysDictInfo.sysDictId}" cssClass="required form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -106,30 +197,31 @@
|
||||
<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:forEach items="${intArr}" var="itTemp">
|
||||
<c:if test="${dict.itemCode eq itTemp}">
|
||||
<option value="${dict.itemCode}"
|
||||
<c:if test="${sysDictInfo.itemType eq dict.itemCode}">selected="selected"</c:if>
|
||||
>${dict.itemValue}</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font>编码:</label>
|
||||
<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>
|
||||
<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>
|
||||
<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">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/pages/css/dictInfo.css" />
|
||||
<title>生效范围配置管理</title>
|
||||
<title>配置管理</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
|
||||
<h3 class="page-title">
|
||||
生效范围配置管理
|
||||
配置管理
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
@@ -26,7 +26,7 @@
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-gift"></i>生效范围配置查看</div>
|
||||
<i class="fa fa-gift"></i>配置查看</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body form">
|
||||
@@ -41,7 +41,7 @@
|
||||
<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"/>
|
||||
<input value="${sysDictInfo.parent.sysDictId == 0?'无上级':fns:getSysDictInfoById(sysDictInfo.parent.sysDictId).itemValue}" maxlength="50" class="form-control" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -71,7 +71,7 @@
|
||||
<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"/>
|
||||
<form:textarea path="itemDesc" htmlEscape="false" maxlength="2000" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
</form:form>
|
||||
|
||||
136
src/main/webapp/WEB-INF/views/cfg/sysDictInfoSearchList.jsp
Normal file
136
src/main/webapp/WEB-INF/views/cfg/sysDictInfoSearchList.jsp
Normal file
@@ -0,0 +1,136 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title>配置信息</title>
|
||||
<link href="${ctxStatic}/global/plugins/treeTable/themes/vsStyle/treeTable.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="${ctxStatic}/pages/css/dictInfo.css" rel="stylesheet" type="text/css" />
|
||||
<script src="${ctxStatic}/global/plugins/treeTable/jquery.treeTable.min.js" type="text/javascript"></script>
|
||||
<script src="${ctxStatic}/pages/scripts/dict.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#treeTable").treeTable({expandLevel : 3}).show();
|
||||
});
|
||||
//查询
|
||||
function page(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/configuration/sysDictInfo/searchList?itType=${itType}");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
function page2(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/configuration/sysDictInfo/searchList?itType=${itType}");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.dropdown-menu {
|
||||
min-width: 70px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<button type="button" class="btn btn-default" onclick="location='${ctx}/configuration/sysDictInfo/list?itType=${itType}'"><spring:message code="refresh"></spring:message></button>
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/configuration/sysDictInfo/form?itType=${itType}'">新增配置</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-cogs"></i>搜索结果
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="row" >
|
||||
<div class="col-md-12">
|
||||
<sys:message content="${message}"/>
|
||||
<form:form id="searchForm" modelAttribute="sysDictInfo" action="${ctx}/configuration/sysDictInfo/searchList?itType=${itType}" 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="itemValue" name="itemValue" type="text" maxlength="25" class="input-medium" value="${sysDictInfo.itemValue}"/>
|
||||
<label class="search-lable">配置编码:</label><input id="itemCode" name="itemCode" type="text" maxlength="25" class="input-medium" value="${sysDictInfo.itemCode}"/>
|
||||
<label class="search-lable itemType">数据类型:</label>
|
||||
<select id="itemType" name="itemType" >
|
||||
<option value="" selected="selected">-请选择-</option>
|
||||
<c:forEach items="${fns:getDictList('SYS_DICT_ITM_TYPE')}" var="dict">
|
||||
<c:forEach items="${intArr}" var="itTemp">
|
||||
<c:if test="${dict.itemCode eq itTemp}">
|
||||
<option value="${dict.itemCode}"
|
||||
<c:if test="${sysDictInfo.itemType eq dict.itemCode}">selected="selected"</c:if>
|
||||
>${dict.itemValue}</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<spring:message code="begin_date"></spring:message>:<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});"/>
|
||||
<spring:message code="end_date"></spring:message>:<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 page2()">
|
||||
<i class="fa fa-edit"></i> <spring:message code="search"></spring:message>
|
||||
</button>
|
||||
</div>
|
||||
</form:form>
|
||||
<table id="treeTable" class="table table-striped table-bordered table-condensed">
|
||||
<thead><tr><th>配置内容</th><th>配置编码</th><th>描述信息</th><th>数据类型</th><th>叶子节点</th><th>创建人员</th><th>创建时间</th><th>最近修改人员</th><th>最近修改时间</th><shiro:hasPermission name="sys:menu:edit"><th>操作</th></shiro:hasPermission></tr></thead>
|
||||
<tbody><c:forEach items="${page.list}" var="sysDictInfo">
|
||||
<tr id="${sysDictInfo.sysDictId}" pId="${sysDictInfo.parent.sysDictId ne 0?sysDictInfo.parent.sysDictId:0}">
|
||||
<td nowrap><i class="icon-icon-tablet"></i><a href="${ctx}/configuration/sysDictInfo/form?sysDictId=${sysDictInfo.sysDictId}&doAction=0">${sysDictInfo.itemValue}</a></td>
|
||||
<td>${sysDictInfo.itemCode}</td>
|
||||
<td title="${sysDictInfo.itemDesc}">${fns:abbr(sysDictInfo.itemDesc,15)}</td>
|
||||
<td>${fns:getDictLabel("SYS_DICT_ITM_TYPE",sysDictInfo.itemType,"0")}</td>
|
||||
<td>${fns:getDictLabel("SYS_YES_NO",sysDictInfo.isLeaf,"0")}</td>
|
||||
<td><c:if test="${sysDictInfo.sysDictCreator != null}">
|
||||
${fns:getUserById(sysDictInfo.sysDictCreator.id).name}
|
||||
</c:if></td>
|
||||
<td><fmt:formatDate value="${sysDictInfo.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td><c:if test="${sysDictInfo.sysDictEditor != null}">
|
||||
${fns:getUserById(sysDictInfo.sysDictEditor.id).name}
|
||||
</c:if></td>
|
||||
<td><fmt:formatDate value="${sysDictInfo.editTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>
|
||||
<div class="btn-group btn-xs">
|
||||
<a class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" href="#">操作<span class="caret"></span></a>
|
||||
<ul class="dropdown-menu btn-xs">
|
||||
<li><a href="${ctx}/configuration/sysDictInfo/form?sysDictId=${sysDictInfo.sysDictId}&doAction=0&itType=${itType}">查看</a></li>
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<li><a href="${ctx}/configuration/sysDictInfo/form?sysDictId=${sysDictInfo.sysDictId}&itType=${itType}" onclick="return confirmx('您确认要修改该项配置吗?', this.href)">修改</a></li>
|
||||
</shiro:hasPermission>
|
||||
<shiro:hasPermission name="sys:dict:edit">
|
||||
<li><a href="${ctx}/configuration/sysDictInfo/delete?sysDictId=${sysDictInfo.sysDictId}&itType=${itType}" onclick="return confirmx('您确认要删除该项配置吗?', this.href)">删除</a></li>
|
||||
</shiro:hasPermission>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach></tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page">${page}</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,138 +2,135 @@
|
||||
<%@ 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>
|
||||
<title>配置信息</title>
|
||||
<link href="${ctxStatic}/global/plugins/treeTable/themes/vsStyle/treeTable.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="${ctxStatic}/pages/css/dictInfo.css" rel="stylesheet" type="text/css" />
|
||||
<script src="${ctxStatic}/global/plugins/treeTable/jquery.treeTable.min.js" type="text/javascript"></script>
|
||||
<script src="${ctxStatic}/pages/scripts/dict.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#treeTable").treeTable({expandLevel : 3}).show();
|
||||
});
|
||||
//查询
|
||||
function page(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/configuration/sysDictInfo/list");
|
||||
$("#searchForm").attr("action","${ctx}/configuration/sysDictInfo/list?itType=${itType}");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.input-medium {
|
||||
width: 200px !important;
|
||||
function page2(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/configuration/sysDictInfo/searchList?itType=${itType}");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.dropdown-menu {
|
||||
min-width: 70px;
|
||||
}
|
||||
.Wdate {
|
||||
border: #c2cad8 1px solid;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
min-width: 50px;
|
||||
}
|
||||
</style>
|
||||
</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-default" onclick="location='${ctx}/configuration/sysDictInfo/list?itType=${itType}'"><spring:message code="refresh"></spring:message></button>
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/configuration/sysDictInfo/form'">新增</button>
|
||||
onClick="javascript:window.location='${ctx}/configuration/sysDictInfo/form?itType=${itType}'">新增配置</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-cogs"></i><spring:message code="生效范围配置列表"></spring:message>
|
||||
<i class="fa fa-cogs"></i>列表信息
|
||||
</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">
|
||||
<div class="col-md-12">
|
||||
<sys:message content="${message}"/>
|
||||
<form:form id="searchForm" modelAttribute="sysDictInfo" action="${ctx}/configuration/sysDictInfo/searchList?itType=${itType}" 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"
|
||||
<label class="search-lable">配置内容:</label><input id="itemValue" name="itemValue" type="text" maxlength="25" class="input-medium" value="${sysDictInfo.itemValue}"/>
|
||||
<label class="search-lable">配置编码:</label><input id="itemCode" name="itemCode" type="text" maxlength="25" class="input-medium" value="${sysDictInfo.itemCode}"/>
|
||||
<label class="search-lable itemType">数据类型:</label>
|
||||
<select id="itemType" name="itemType" >
|
||||
<option value="" selected="selected">-请选择-</option>
|
||||
<c:forEach items="${fns:getDictList('SYS_DICT_ITM_TYPE')}" var="dict">
|
||||
<c:forEach items="${intArr}" var="itTemp">
|
||||
<c:if test="${dict.itemCode eq itTemp}">
|
||||
<option value="${dict.itemCode}"
|
||||
<c:if test="${selectedType eq dict.itemCode}">selected="selected"</c:if>
|
||||
>${dict.itemValue}</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<spring:message code="begin_date"></spring:message>:<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"
|
||||
<spring:message code="end_date"></spring:message>:<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()">
|
||||
<button type="button" class="btn btn-default btn-sm" onclick="return page2()">
|
||||
<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>
|
||||
<table id="treeTable" class="table table-striped table-bordered table-condensed">
|
||||
<thead><tr><th>配置内容</th><th>配置编码</th><th>描述信息</th><th>数据类型</th><th>叶子节点</th><th>创建人员</th><th>创建时间</th><th>最近修改人员</th><th>最近修改时间</th><shiro:hasPermission name="sys:menu:edit"><th>操作</th></shiro:hasPermission></tr></thead>
|
||||
<tbody><c:forEach items="${list}" var="sysDictInfo">
|
||||
<tr id="${sysDictInfo.sysDictId}" pId="${sysDictInfo.parent.sysDictId ne 0?sysDictInfo.parent.sysDictId:0}">
|
||||
<td nowrap><i class="icon-icon-tablet"></i><a href="${ctx}/configuration/sysDictInfo/form?sysDictId=${sysDictInfo.sysDictId}&doAction=0">${sysDictInfo.itemValue}</a></td>
|
||||
<td>${sysDictInfo.itemCode}</td>
|
||||
<td>${sysDictInfo.itemValue}</td>
|
||||
<td>${fns:abbr(sysDictInfo.itemDesc,15)}</td>
|
||||
<td title="${sysDictInfo.itemDesc}">${fns:abbr(sysDictInfo.itemDesc,15)}</td>
|
||||
<td>${fns:getDictLabel("SYS_DICT_ITM_TYPE",sysDictInfo.itemType,"0")}</td>
|
||||
<td>${fns:getDictLabel("SYS_YES_NO",sysDictInfo.isLeaf,"0")}</td>
|
||||
<td><c:if test="${sysDictInfo.sysDictCreator != null}">
|
||||
${fns:getUserById(sysDictInfo.sysDictCreator.id).name}
|
||||
</c:if></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><c:if test="${sysDictInfo.sysDictEditor != null}">
|
||||
${fns:getUserById(sysDictInfo.sysDictEditor.id).name}
|
||||
</c:if></td>
|
||||
<td><fmt:formatDate value="${sysDictInfo.editTime}" pattern="yyyy-MM-dd HH:mm:ss"/></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>
|
||||
|
||||
<div class="btn-group btn-xs">
|
||||
<a class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" href="#">操作<span class="caret"></span></a>
|
||||
<ul class="dropdown-menu btn-xs">
|
||||
<li><a href="${ctx}/configuration/sysDictInfo/form?sysDictId=${sysDictInfo.sysDictId}&doAction=0&itType=${itType}">查看</a></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>
|
||||
<li><a href="${ctx}/configuration/sysDictInfo/form?sysDictId=${sysDictInfo.sysDictId}&itType=${itType}" onclick="return confirmx('您确认要修改该项配置吗?', this.href)">修改</a></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>
|
||||
<li><a href="${ctx}/configuration/sysDictInfo/delete?sysDictId=${sysDictInfo.sysDictId}&itType=${itType}" onclick="return confirmx('您确认要删除该项配置吗?', this.href)">删除</a></li>
|
||||
</shiro:hasPermission>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
</tbody>
|
||||
</c:forEach></tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,10 +3,18 @@ sysDict serviceDict
|
||||
***/
|
||||
|
||||
.search-lable {
|
||||
margin-right: 5px;
|
||||
margin-left: 8px;
|
||||
margin-right: 3px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
.itemType {
|
||||
margin-right: 5px;
|
||||
}
|
||||
#itemType {
|
||||
margin-right: 5px;
|
||||
}
|
||||
.input-medium {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.input-medium {
|
||||
width: 155px !important;
|
||||
}
|
||||
@@ -19,3 +27,4 @@ margin-left: 8px;
|
||||
min-width: 50px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,34 +1,2 @@
|
||||
$(document).ready(function() {
|
||||
jQuery.validator.addMethod("codeNumber",function(value,element){
|
||||
return value>=0&value<=20000000},"请填写正确的数值");
|
||||
$("#name").focus();
|
||||
$("#searchForm").validate({
|
||||
//需验证 item_code item_value
|
||||
rules: {
|
||||
'itemCode':{
|
||||
digits:true,
|
||||
codeNumber:true
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
'itemCode':{
|
||||
digits:'请填写整数值',
|
||||
codeNumber:'请填写合适的数值(0~200000000)'
|
||||
}
|
||||
},
|
||||
|
||||
submitHandler: function(form){
|
||||
loading('正在处理,请稍等...');
|
||||
form.submit();
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
errorPlacement: function(error, element) {
|
||||
$("#messageBox").text("输入有误,请先更正。");
|
||||
if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
||||
error.appendTo(element.parent().parent());
|
||||
} else {
|
||||
error.insertAfter(element);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user