已完成:

①字典列表,配置编码移到配置内容前一列
    ②系统字典与业务字典的item_code字段int类型改为varchar(64)
    ③业务字典和系统字典表增加一个字段,level_no,层级(新增、修改已加入)
    ④完成条件分页查询(折叠逻辑与无条件查询一致,)
    ⑤优化分页查询代码(预留介入条件排序),
  
  待完善:修改、删除时下层级递归处理待添加事务性及测试(待手动抛异常重点测试)
                      生效范围测试尚未完毕,待处理
         jquery Validate验证层级关系受<sys:treeselect>影响,待处理
                      样式调整:分页样式(尚未调整),
This commit is contained in:
zhangshilin
2018-03-08 20:30:01 +08:00
parent fb383e8cf1
commit 67645d21ca
15 changed files with 717 additions and 185 deletions

View File

@@ -20,7 +20,7 @@ public class ServiceDictInfo extends BaseEntity<ServiceDictInfo>{
private Integer serviceDictId; //service_dict_id 字典ID int N 主键,自增 private Integer serviceDictId; //service_dict_id 字典ID int N 主键,自增
private Integer itemType; //item_type 数据类型 int N 1分类 2性质 3标签 private Integer itemType; //item_type 数据类型 int N 1分类 2性质 3标签
private Integer itemCode; //item_code编码 int N private String itemCode; //item_code编码 varchar(64) N
private String itemValue; //item_value 编码对应值 varchar2(64) N private String itemValue; //item_value 编码对应值 varchar2(64) N
private String itemDesc; //item_desc 描述信息 varcahr2(128) Y private String itemDesc; //item_desc 描述信息 varcahr2(128) Y
private ServiceDictInfo parent; //parent_id 父ID number(9) N 无父属性默认填0 private ServiceDictInfo parent; //parent_id 父ID number(9) N 无父属性默认填0
@@ -30,7 +30,8 @@ public class ServiceDictInfo extends BaseEntity<ServiceDictInfo>{
private Date createTime; //create_time 配置时间 date N private Date createTime; //create_time 配置时间 date N
private SysUser serviceDictEditor; //editor_id 修改人员 int Y 取自sys_user.id private SysUser serviceDictEditor; //editor_id 修改人员 int Y 取自sys_user.id
private Date editTime; //edit_time 修改时间 date Y private Date editTime; //edit_time 修改时间 date Y
private List<ServiceDictInfo> ChildrenList = new ArrayList<ServiceDictInfo>();//字列表 private Integer levelNo; //层级
private List<ServiceDictInfo> ChildrenList = new ArrayList<ServiceDictInfo>();//子列表
private Date beginDate; // 开始日期 private Date beginDate; // 开始日期
private Date endDate; // 结束日期 private Date endDate; // 结束日期
@@ -47,12 +48,18 @@ public class ServiceDictInfo extends BaseEntity<ServiceDictInfo>{
public void setItemType(Integer itemType) { public void setItemType(Integer itemType) {
this.itemType = itemType; this.itemType = itemType;
} }
public Integer getItemCode() { public String getItemCode() {
return itemCode; return itemCode;
} }
public void setItemCode(Integer itemCode) { public void setItemCode(String itemCode) {
this.itemCode = itemCode; this.itemCode = itemCode;
} }
public Integer getLevelNo() {
return levelNo;
}
public void setLevelNo(Integer levelNo) {
this.levelNo = levelNo;
}
public String getItemValue() { public String getItemValue() {
return itemValue; return itemValue;
} }
@@ -175,5 +182,4 @@ public class ServiceDictInfo extends BaseEntity<ServiceDictInfo>{
return listTemp.size(); return listTemp.size();
} }
} }

View File

@@ -18,7 +18,7 @@ public class SysDictInfo extends BaseEntity<SysDictInfo>{
private Integer sysDictId; //service_dict_id 字典ID int N 主键,自增 private Integer sysDictId; //service_dict_id 字典ID int N 主键,自增
private Integer itemType; //item_type 数据类型 int N 1分类 2性质 3标签 private Integer itemType; //item_type 数据类型 int N 1分类 2性质 3标签
private Integer itemCode; //item_code编码 int N private String itemCode; //item_code编码 varchar N
private String itemValue; //item_value 编码对应值 varchar2(64) N private String itemValue; //item_value 编码对应值 varchar2(64) N
private String itemDesc; //item_desc 描述信息 varcahr2(128) Y private String itemDesc; //item_desc 描述信息 varcahr2(128) Y
private SysDictInfo parent; //parent_id 父ID number(9) N 无父属性默认填0 private SysDictInfo parent; //parent_id 父ID number(9) N 无父属性默认填0
@@ -28,6 +28,7 @@ public class SysDictInfo extends BaseEntity<SysDictInfo>{
private Date createTime; //create_time 配置时间 date N private Date createTime; //create_time 配置时间 date N
private SysUser sysDictEditor; //editor_id 修改人员 int Y 取自sys_user.id private SysUser sysDictEditor; //editor_id 修改人员 int Y 取自sys_user.id
private Date editTime; //edit_time 修改时间 date Y private Date editTime; //edit_time 修改时间 date Y
private Integer levelNo; //层级
private List<ServiceDictInfo> ChildrenList = new ArrayList<ServiceDictInfo>();//字列表 private List<ServiceDictInfo> ChildrenList = new ArrayList<ServiceDictInfo>();//字列表
private Date beginDate; // 开始日期 private Date beginDate; // 开始日期
@@ -46,10 +47,10 @@ public class SysDictInfo extends BaseEntity<SysDictInfo>{
public void setItemType(Integer itemType) { public void setItemType(Integer itemType) {
this.itemType = itemType; this.itemType = itemType;
} }
public Integer getItemCode() { public String getItemCode() {
return itemCode; return itemCode;
} }
public void setItemCode(Integer itemCode) { public void setItemCode(String itemCode) {
this.itemCode = itemCode; this.itemCode = itemCode;
} }
public String getItemValue() { public String getItemValue() {
@@ -124,6 +125,12 @@ public class SysDictInfo extends BaseEntity<SysDictInfo>{
public void setEndDate(Date endDate) { public void setEndDate(Date endDate) {
this.endDate = endDate; this.endDate = endDate;
} }
public Integer getLevelNo() {
return levelNo;
}
public void setLevelNo(Integer levelNo) {
this.levelNo = levelNo;
}
@JsonIgnore @JsonIgnore
public static void sortList(List<SysDictInfo> list, List<SysDictInfo> sourcelist, Integer parentId, boolean cascade){ public static void sortList(List<SysDictInfo> list, List<SysDictInfo> sourcelist, Integer parentId, boolean cascade){
for (int i=0; i<sourcelist.size(); i++){ for (int i=0; i<sourcelist.size(); i++){

View File

@@ -96,6 +96,7 @@ public class ServiceDictInfoController extends BaseController {
allList.addAll(page.getList()); allList.addAll(page.getList());
ServiceDictInfo.sortList(list,allList,0,true); ServiceDictInfo.sortList(list,allList,0,true);
model.addAttribute("itType", itType); model.addAttribute("itType", itType);
model.addAttribute("intArr", Arrays.asList(intArr)); model.addAttribute("intArr", Arrays.asList(intArr));
model.addAttribute("list", list); model.addAttribute("list", list);
@@ -113,12 +114,11 @@ public class ServiceDictInfoController extends BaseController {
*/ */
@RequiresPermissions("sys:dict:view") @RequiresPermissions("sys:dict:view")
@RequestMapping(value = {"searchList"}) @RequestMapping(value = {"searchList"})
public String searchList(String itType, ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) { public String searchList(String itType, ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model,Integer selectedType) {
if(StringUtils.strIsBlank(serviceDictInfo.getItemValue()) if(StringUtils.strIsBlank(serviceDictInfo.getItemValue())
&&serviceDictInfo.getItemCode()==null &&StringUtils.strIsBlank(serviceDictInfo.getItemCode())
&&serviceDictInfo.getBeginDate()==null &&serviceDictInfo.getBeginDate()==null
&&serviceDictInfo.getEndDate()==null){ &&serviceDictInfo.getEndDate()==null){
Integer selectedType = null;
if(serviceDictInfo.getItemType()!=null){ if(serviceDictInfo.getItemType()!=null){
selectedType = serviceDictInfo.getItemType(); selectedType = serviceDictInfo.getItemType();
return "redirect:"+ adminPath + "/basics/serviceDictInfo/list?itType="+itType+"&selectedType="+selectedType; return "redirect:"+ adminPath + "/basics/serviceDictInfo/list?itType="+itType+"&selectedType="+selectedType;
@@ -130,11 +130,44 @@ public class ServiceDictInfoController extends BaseController {
for(int i=0;i<strArr.length;i++){ for(int i=0;i<strArr.length;i++){
intArr[i] = Integer.valueOf(strArr[i]); intArr[i] = Integer.valueOf(strArr[i]);
} }
if(serviceDictInfo.getItemType()!=null){
model.addAttribute("selectedType", serviceDictInfo.getItemType());
}else{
model.addAttribute("selectedType", selectedType);
serviceDictInfo.setItemType(selectedType);
}
//先查出条件查询所有数据(注意顺序)
List<ServiceDictInfo> allList = serviceDictInfoService.findAllDictSearchList(serviceDictInfo,intArr);
//查出条件查询顶层分页数据
Page<ServiceDictInfo> page = serviceDictInfoService.findDictTopSearchList(new Page<ServiceDictInfo>(request, response), serviceDictInfo,intArr);
model.addAttribute("page", page);
//处理数据,保留顶层中的所有下层数据
List<ServiceDictInfo> list = Lists.newArrayList();
//取出主键优化处理
List<Integer> tempList = Lists.newArrayList();
for(ServiceDictInfo se:page.getList()){
if(se!=null&&se.getServiceDictId()!=null){
tempList.add(se.getServiceDictId());
}
}
//删除所有重复
for(int i=allList.size()-1;i>=0;i--){
ServiceDictInfo se = allList.get(i);
if(se!=null&&se.getServiceDictId()!=null){
if(tempList.contains(se.getServiceDictId())){
allList.remove(se);
}
}
}
allList.addAll(page.getList());
ServiceDictInfo.sortList(list,allList,0,true);
model.addAttribute("itType", itType); model.addAttribute("itType", itType);
model.addAttribute("intArr", Arrays.asList(intArr)); model.addAttribute("intArr", Arrays.asList(intArr));
Page<ServiceDictInfo> page = serviceDictInfoService.findDictSearchList(new Page<ServiceDictInfo>(request, response), serviceDictInfo,intArr); model.addAttribute("list", list);
model.addAttribute("page", page);
return "/basics/serviceDictInfoSearchList"; return "/basics/serviceDictInfoSearchList";
} }
@@ -180,10 +213,10 @@ public class ServiceDictInfoController extends BaseController {
try { try {
serviceDictInfoService.saveOrUpdate(serviceDictInfo); serviceDictInfoService.saveOrUpdate(serviceDictInfo);
addMessage(redirectAttributes, "保存配置成功"); addMessage(redirectAttributes, "保存成功");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
addMessage(redirectAttributes, "保存配置失败!"); addMessage(redirectAttributes, "保存失败!");
} }
return "redirect:" + adminPath + "/basics/serviceDictInfo/list?itType="+itType; return "redirect:" + adminPath + "/basics/serviceDictInfo/list?itType="+itType;
@@ -202,10 +235,10 @@ public class ServiceDictInfoController extends BaseController {
public String delete(ServiceDictInfo serviceDictInfo, RedirectAttributes redirectAttributes,String itType) { public String delete(ServiceDictInfo serviceDictInfo, RedirectAttributes redirectAttributes,String itType) {
try { try {
serviceDictInfoService.deleteDict(serviceDictInfo); serviceDictInfoService.deleteDict(serviceDictInfo);
addMessage(redirectAttributes, "删除配置成功"); addMessage(redirectAttributes, "删除成功");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
addMessage(redirectAttributes, "删除配置失败!"); addMessage(redirectAttributes, "删除失败!");
} }
return "redirect:" + adminPath + "/basics/serviceDictInfo/list?itType="+itType; return "redirect:" + adminPath + "/basics/serviceDictInfo/list?itType="+itType;
} }
@@ -266,7 +299,7 @@ public class ServiceDictInfoController extends BaseController {
return true; return true;
} }
if(!StringUtil.isEmpty(itemCode)){ if(!StringUtil.isEmpty(itemCode)){
list = serviceDictInfoService.findByItemCode(Integer.valueOf(itemCode)); list = serviceDictInfoService.findByItemCode(itemCode);
} }
if(list==null||list.size()==0){ if(list==null||list.size()==0){
return true; return true;
@@ -373,4 +406,31 @@ public class ServiceDictInfoController extends BaseController {
return false; return false;
} }
/**
* 校验层级关系
* @return
*/
@ResponseBody
@RequestMapping(value = "isLevelTotalSure")
public boolean isLevelTotalSure(Integer parentId,Integer currentId) {
if(parentId==-1||parentId==0){
return true;
}else{
ServiceDictInfo p = serviceDictInfoService.getDictById(parentId);
if(currentId==null){
if(p.getLevelNo()<4){
return true;
}
}else{
ServiceDictInfo c = serviceDictInfoService.getDictById(currentId);
if((p.getLevelNo()+c.getLevelNo())<5){
return true;
}
}
}
return false;
}
} }

View File

@@ -112,12 +112,11 @@ public class SysDictInfoController extends BaseController {
*/ */
@RequiresPermissions("sys:dict:view") @RequiresPermissions("sys:dict:view")
@RequestMapping(value = {"searchList"}) @RequestMapping(value = {"searchList"})
public String searchList(String itType, SysDictInfo sysDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) { public String searchList(String itType, SysDictInfo sysDictInfo,HttpServletRequest request, HttpServletResponse response, Model model, Integer selectedType) {
if(StringUtils.strIsBlank(sysDictInfo.getItemValue()) if(StringUtils.strIsBlank(sysDictInfo.getItemValue())
&&sysDictInfo.getItemCode()==null &&StringUtils.strIsBlank(sysDictInfo.getItemCode())
&&sysDictInfo.getBeginDate()==null &&sysDictInfo.getBeginDate()==null
&&sysDictInfo.getEndDate()==null){ &&sysDictInfo.getEndDate()==null){
Integer selectedType = null;
if(sysDictInfo.getItemType()!=null){ if(sysDictInfo.getItemType()!=null){
selectedType = sysDictInfo.getItemType(); selectedType = sysDictInfo.getItemType();
return "redirect:"+ adminPath + "/basics/sysDictInfo/list?itType="+itType+"&selectedType="+selectedType; return "redirect:"+ adminPath + "/basics/sysDictInfo/list?itType="+itType+"&selectedType="+selectedType;
@@ -129,11 +128,46 @@ public class SysDictInfoController extends BaseController {
for(int i=0;i<strArr.length;i++){ for(int i=0;i<strArr.length;i++){
intArr[i] = Integer.valueOf(strArr[i]); intArr[i] = Integer.valueOf(strArr[i]);
} }
if(sysDictInfo.getItemType()!=null){
model.addAttribute("selectedType", sysDictInfo.getItemType());
}else{
model.addAttribute("selectedType", selectedType);
sysDictInfo.setItemType(selectedType);
}
//先查出条件查询所有数据(注意顺序)
List<SysDictInfo> allList = sysDictInfoService.findAllDictSearchList(sysDictInfo,intArr);
//查出条件查询顶层分页数据
Page<SysDictInfo> page = sysDictInfoService.findDictTopSearchList(new Page<SysDictInfo>(request, response), sysDictInfo,intArr);
model.addAttribute("page", page);
//处理数据,保留顶层中的所有下层数据
List<SysDictInfo> list = Lists.newArrayList();
//取出主键优化处理
List<Integer> tempList = Lists.newArrayList();
for(SysDictInfo se:page.getList()){
if(se!=null&&se.getSysDictId()!=null){
tempList.add(se.getSysDictId());
}
}
//删除所有重复
for(int i=allList.size()-1;i>=0;i--){
SysDictInfo se = allList.get(i);
System.out.println("山前顺序"+se.getSysDictId());
if(se!=null&&se.getSysDictId()!=null){
if(tempList.contains(se.getSysDictId())){
allList.remove(se);
}
}
}
allList.addAll(page.getList());
SysDictInfo.sortList(list,allList,0,true);
model.addAttribute("itType", itType); model.addAttribute("itType", itType);
model.addAttribute("intArr", Arrays.asList(intArr)); model.addAttribute("intArr", Arrays.asList(intArr));
Page<SysDictInfo> page = sysDictInfoService.findDictSearchList(new Page<SysDictInfo>(request, response), sysDictInfo,intArr); model.addAttribute("list", list);
model.addAttribute("page", page);
return "/basics/sysDictInfoSearchList"; return "/basics/sysDictInfoSearchList";
} }
@@ -187,10 +221,10 @@ public class SysDictInfoController extends BaseController {
try { try {
sysDictInfoService.saveOrUpdate(sysDictInfo); sysDictInfoService.saveOrUpdate(sysDictInfo);
addMessage(redirectAttributes, "保存配置成功"); addMessage(redirectAttributes, "保存成功");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
addMessage(redirectAttributes, "保存配置失败!"); addMessage(redirectAttributes, "保存失败!");
} }
return "redirect:" + adminPath + "/basics/sysDictInfo/list?itType="+itType; return "redirect:" + adminPath + "/basics/sysDictInfo/list?itType="+itType;
@@ -206,10 +240,10 @@ public class SysDictInfoController extends BaseController {
public String delete(SysDictInfo sysDictInfo, RedirectAttributes redirectAttributes, String itType) { public String delete(SysDictInfo sysDictInfo, RedirectAttributes redirectAttributes, String itType) {
try { try {
sysDictInfoService.deleteDict(sysDictInfo); sysDictInfoService.deleteDict(sysDictInfo);
addMessage(redirectAttributes, "删除配置成功"); addMessage(redirectAttributes, "删除成功");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
addMessage(redirectAttributes, "删除配置失败!"); addMessage(redirectAttributes, "删除失败!");
} }
return "redirect:" + adminPath + "/basics/sysDictInfo/list?itType="+itType; return "redirect:" + adminPath + "/basics/sysDictInfo/list?itType="+itType;
} }
@@ -245,10 +279,6 @@ public class SysDictInfoController extends BaseController {
map.put("id", sysDictInfo.getSysDictId()); map.put("id", sysDictInfo.getSysDictId());
map.put("pId", sysDictInfo.getParent().getSysDictId()); map.put("pId", sysDictInfo.getParent().getSysDictId());
map.put("name",sysDictInfo.getItemValue()); 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); mapList.add(map);
} }
@@ -276,7 +306,7 @@ public class SysDictInfoController extends BaseController {
return true; return true;
} }
if(!StringUtil.isEmpty(itemCode)){ if(!StringUtil.isEmpty(itemCode)){
list = sysDictInfoService.findByItemCode(Integer.valueOf(itemCode)); list = sysDictInfoService.findByItemCode(itemCode);
} }
if(list==null||list.size()==0){ if(list==null||list.size()==0){
return true; return true;
@@ -385,6 +415,30 @@ public class SysDictInfoController extends BaseController {
} }
return false; return false;
} }
/**
* 校验层级关系
* @return
*/
@ResponseBody
@RequestMapping(value = "isLevelTotalSure")
public boolean isLevelTotalSure(Integer parentId,Integer currentId) {
if(parentId==-1||parentId==0){
return true;
}else{
SysDictInfo p = sysDictInfoService.getDictById(parentId);
if(currentId==null){
if(p.getLevelNo()<4){
return true;
}
}else{
SysDictInfo c = sysDictInfoService.getDictById(currentId);
if((p.getLevelNo()+c.getLevelNo())<5){
return true;
}
}
}
return false;
}
} }

View File

@@ -39,17 +39,29 @@ public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
*/ */
List<ServiceDictInfo> getDictByParentId(Integer parentId); List<ServiceDictInfo> getDictByParentId(Integer parentId);
/** /**
* 查询字典列表(含条件查询(==) * 查询条件查询顶层字典列表(含条件查询(==)
* @param serviceDictInfo * @param serviceDictInfo
* @return * @return
*/ */
List<ServiceDictInfo> findDictSearchList(ServiceDictInfo serviceDictInfo); List<ServiceDictInfo> findDictTopSearchList(ServiceDictInfo serviceDictInfo);
/** /**
* 查询字典列表(含条件查询(!=) * 查询条件查询顶层字典列表(含条件查询(!=)
* @param serviceDictInfo * @param serviceDictInfo
* @return * @return
*/ */
List<ServiceDictInfo> findDictSearchListN(ServiceDictInfo serviceDictInfo); List<ServiceDictInfo> findDictTopSearchListN(ServiceDictInfo serviceDictInfo);
/**
* 查询条件查询所有字典列表(含条件查询(==)
* @param serviceDictInfo
* @return
*/
List<ServiceDictInfo> findAllDictSearchList(ServiceDictInfo serviceDictInfo);
/**
* 查询条件查询所有字典列表(含条件查询(!=)
* @param serviceDictInfo
* @return
*/
List<ServiceDictInfo> findAllDictSearchListN(ServiceDictInfo serviceDictInfo);
/** /**
@@ -57,6 +69,11 @@ public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
* @param serviceDictInfo * @param serviceDictInfo
*/ */
void insertDict(ServiceDictInfo serviceDictInfo); void insertDict(ServiceDictInfo serviceDictInfo);
/**
* 保存层级
* @param serviceDictInfo
*/
void updateLevelNo(ServiceDictInfo serviceDictInfo);
/** /**
* 根据主键查询字典详细信息 * 根据主键查询字典详细信息
@@ -69,7 +86,7 @@ public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
* @param itemCode * @param itemCode
* @return * @return
*/ */
List<ServiceDictInfo> findByItemCode(Integer itemCode); List<ServiceDictInfo> findByItemCode(String itemCode);
/** /**
* 查询itemCode最大值 * 查询itemCode最大值
* @return * @return

View File

@@ -5,10 +5,11 @@
<resultMap id="dictResultMap" type="com.nis.domain.basics.ServiceDictInfo" > <resultMap id="dictResultMap" type="com.nis.domain.basics.ServiceDictInfo" >
<id column="service_dict_id" property="serviceDictId" jdbcType="INTEGER" /> <id column="service_dict_id" property="serviceDictId" jdbcType="INTEGER" />
<result column="item_type" property="itemType" jdbcType="INTEGER" /> <result column="item_type" property="itemType" jdbcType="INTEGER" />
<result column="item_code" property="itemCode" jdbcType="INTEGER" /> <result column="item_code" property="itemCode" jdbcType="VARCHAR" />
<result column="item_value" property="itemValue" jdbcType="VARCHAR" /> <result column="item_value" property="itemValue" jdbcType="VARCHAR" />
<result column="item_desc" property="itemDesc" jdbcType="VARCHAR" /> <result column="item_desc" property="itemDesc" jdbcType="VARCHAR" />
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER" /> <result column="is_leaf" property="isLeaf" jdbcType="INTEGER" />
<result column="level_no" property="levelNo" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" /> <result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" /> <result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
@@ -46,6 +47,7 @@
s.item_desc AS itemDesc, s.item_desc AS itemDesc,
s.parent_id AS "parent.serviceDictId", s.parent_id AS "parent.serviceDictId",
s.is_leaf AS isLeaf, s.is_leaf AS isLeaf,
s.level_no AS levelNo,
s.is_valid AS isValid, s.is_valid AS isValid,
s.creator_id AS "serviceDictCreator.id", s.creator_id AS "serviceDictCreator.id",
s.create_time AS createTime, s.create_time AS createTime,
@@ -137,7 +139,7 @@
<include refid="serviceDictInfoColumns"/> <include refid="serviceDictInfoColumns"/>
FROM service_dict_info s FROM service_dict_info s
<include refid="menuJoins"/> <include refid="menuJoins"/>
WHERE s.is_valid =1 WHERE s.is_valid =1 AND s.parent_id != 0
</select> </select>
<!-- 查询所有非叶子配置 --> <!-- 查询所有非叶子配置 -->
@@ -146,72 +148,151 @@
<include refid="serviceDictInfoColumns"/> <include refid="serviceDictInfoColumns"/>
FROM service_dict_info s FROM service_dict_info s
WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type = #{itemType} WHERE s.is_valid = 1 AND s.is_leaf = 0 AND item_type = #{itemType}
ORDER BY s.create_time desc
</select> </select>
<!-- 条件查询顶层分页(==) -->
<!-- 条件查询分页(==) --> <select id="findDictTopSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
<select id="findDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo"> SELECT * FROM service_dict_info s WHERE s.is_valid=1
SELECT * FROM service_dict_info WHERE is_valid=1
<if test="itemType != null and itemType != '' " >
AND item_type like '%${itemType}%'
</if>
<if test="itemCode != null and itemCode != '' " >
AND item_code like '%${itemCode}%'
</if>
<if test="itemValue!= null and itemValue != '' " >
AND item_value like '%${itemValue}%'
</if>
<if test="beginDate !=null" >
AND create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND create_time &lt;= 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="findDictSearchListN" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
SELECT * FROM service_dict_info WHERE is_valid=1
<if test="itemCode != null and itemCode != '' " > <if test="itemCode != null and itemCode != '' " >
AND item_code like '%${itemCode}%' AND s.item_code like '%${itemCode}%'
</if> </if>
<if test="itemValue!= null and itemValue != '' " > <if test="itemValue!= null and itemValue != '' " >
AND item_value like '%${itemValue}%' AND s.item_value like '%${itemValue}%'
</if> </if>
<if test="itemType != null and itemType != '' " > <if test="itemType != null and itemType != '' " >
AND item_type != ${itemType} AND s.item_type = ${itemType}
</if>
<if test="beginDate !=null" >
AND s.create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND s.create_time &lt;= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
</if>
AND s.parent_id not in (
SELECT s2.service_dict_id FROM service_dict_info s2 WHERE s2.is_valid=1
<if test="itemCode != null and itemCode != '' " >
AND s2.item_code like '%${itemCode}%'
</if>
<if test="itemValue!= null and itemValue != '' " >
AND s2.item_value like '%${itemValue}%'
</if>
<if test="itemType != null and itemType != '' " >
AND s2.item_type = ${itemType}
</if>
<if test="beginDate !=null" >
AND s2.create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND s2.create_time &lt;= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
</if>
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY s.${page.orderBy}
</when>
<otherwise>
ORDER BY s.create_time desc
</otherwise>
</choose>
</select>
<!-- 条件查询顶层分页(!=) -->
<select id="findDictTopSearchListN" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
SELECT * FROM service_dict_info s WHERE s.is_valid=1
<if test="itemCode != null and itemCode != '' " >
AND s.item_code like '%${itemCode}%'
</if>
<if test="itemValue!= null and itemValue != '' " >
AND s.item_value like '%${itemValue}%'
</if>
<if test="itemType != null and itemType != '' " >
AND s.item_type != ${itemType}
</if>
<if test="beginDate !=null" >
AND s.create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND s.create_time &lt;= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
</if>
AND s.parent_id not in (
SELECT s2.service_dict_id FROM service_dict_info s2 WHERE s2.is_valid=1
<if test="itemCode != null and itemCode != '' " >
AND s2.item_code like '%${itemCode}%'
</if>
<if test="itemValue!= null and itemValue != '' " >
AND s2.item_value like '%${itemValue}%'
</if>
<if test="itemType != null and itemType != '' " >
AND s2.item_type != ${itemType}
</if>
<if test="beginDate !=null" >
AND s2.create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND s2.create_time &lt;= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
</if>
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY s.${page.orderBy}
</when>
<otherwise>
ORDER BY s.create_time desc
</otherwise>
</choose>
</select>
<!-- 条件查询所有列表 (==)-->
<select id="findAllDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
SELECT * FROM service_dict_info WHERE is_valid=1
<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>
<if test="beginDate !=null" > <if test="beginDate !=null" >
AND create_time &gt;= #{beginDate,jdbcType=TIMESTAMP} AND create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if> </if>
<if test="endDate !=null" > <if test="endDate !=null" >
AND create_time &lt;= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY) AND create_time &lt;= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
</if> </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>
<!-- 条件查询所有列表 (!=)-->
<select id="findAllDictSearchListN" resultMap="dictResultMap" parameterType="com.nis.domain.basics.ServiceDictInfo">
SELECT * FROM service_dict_info WHERE is_valid=1
<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 &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND create_time &lt;= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
</if>
</select>
<!-- 根据主键查询字典详细信息 --> <!-- 根据主键查询字典详细信息 -->
@@ -246,10 +327,10 @@
<!-- 新增字典信息 --> <!-- 新增字典信息 -->
<insert id="insertDict" parameterType="com.nis.domain.basics.ServiceDictInfo" useGeneratedKeys="true" keyProperty="id" > <insert id="insertDict" parameterType="com.nis.domain.basics.ServiceDictInfo" useGeneratedKeys="true" keyProperty="id" >
insert into service_dict_info (item_type, item_code, item_value, item_desc, parent_id, is_leaf, is_valid, creator_id, create_time, editor_id, edit_time) insert into service_dict_info (item_type, item_code, item_value, item_desc, parent_id, is_leaf, level_no, is_valid, creator_id, create_time, editor_id, edit_time)
values ( #{itemType,jdbcType=INTEGER}, #{itemCode,jdbcType=INTEGER}, values ( #{itemType,jdbcType=INTEGER}, #{itemCode,jdbcType=INTEGER},
#{itemValue,jdbcType=VARCHAR}, #{itemDesc,jdbcType=VARCHAR}, #{itemValue,jdbcType=VARCHAR}, #{itemDesc,jdbcType=VARCHAR},
#{parent.serviceDictId,jdbcType=INTEGER}, #{isLeaf,jdbcType=INTEGER}, #{isValid,jdbcType=INTEGER}, #{parent.serviceDictId,jdbcType=INTEGER}, #{isLeaf,jdbcType=INTEGER},#{levelNo,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER},
#{serviceDictCreator.id,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{serviceDictCreator.id,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{serviceDictEditor.id,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP}) #{serviceDictEditor.id,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP})
</insert> </insert>
@@ -266,11 +347,19 @@
s.item_desc = #{itemDesc}, s.item_desc = #{itemDesc},
s.parent_id = #{parent.serviceDictId}, s.parent_id = #{parent.serviceDictId},
s.is_leaf = #{isLeaf}, s.is_leaf = #{isLeaf},
s.level_no = #{levelNo},
s.creator_id = #{serviceDictCreator.id}, s.creator_id = #{serviceDictCreator.id},
s.editor_id = #{serviceDictEditor.id}, s.editor_id = #{serviceDictEditor.id},
s.edit_time = #{editTime} s.edit_time = #{editTime}
WHERE s.service_dict_id = #{serviceDictId} WHERE s.service_dict_id = #{serviceDictId}
</update> </update>
<!-- 保存层级 -->
<update id="updateLevelNo">
UPDATE service_dict_info s SET
s.level_no = #{levelNo}
WHERE s.service_dict_id = #{serviceDictId}
</update>
<!-- 删除 --> <!-- 删除 -->
@@ -296,7 +385,5 @@
</mapper> </mapper>

View File

@@ -24,13 +24,18 @@ public interface SysDictInfoDao extends CrudDao<SysDictInfo> {
* @return * @return
*/ */
List<SysDictInfo> findAllDictList(SysDictInfo sysDictInfo); List<SysDictInfo> findAllDictList(SysDictInfo sysDictInfo);
/** /**
* 查询字典列表(含条件查询(==) * 查询条件查询顶层字典列表(含条件查询(==)
* @param sysDictInfo * @param sysDictInfo
* @return * @return
*/ */
List<SysDictInfo> findDictSearchList(SysDictInfo sysDictInfo); List<SysDictInfo> findDictTopSearchList(SysDictInfo sysDictInfo);
/**
* 查询字典列表(含条件查询(==)
* @param sysDictInfo
* @return
*/
List<SysDictInfo> findAllDictSearchList(SysDictInfo sysDictInfo);
@@ -60,7 +65,7 @@ public interface SysDictInfoDao extends CrudDao<SysDictInfo> {
* @param itemCode * @param itemCode
* @return * @return
*/ */
List<SysDictInfo> findByItemCode(Integer itemCode); List<SysDictInfo> findByItemCode(String itemCode);
/** /**
* 根据上级id选出所有下级 * 根据上级id选出所有下级
@@ -74,6 +79,11 @@ public interface SysDictInfoDao extends CrudDao<SysDictInfo> {
* @return * @return
*/ */
Integer findMaxItemCode(); Integer findMaxItemCode();
/**
* 保存层级
* @param sysDictInfo
*/
void updateLevelNo(SysDictInfo sysDictInfo);

View File

@@ -5,10 +5,11 @@
<resultMap id="dictResultMap" type="com.nis.domain.basics.SysDictInfo" > <resultMap id="dictResultMap" type="com.nis.domain.basics.SysDictInfo" >
<id column="sys_dict_id" property="sysDictId" jdbcType="INTEGER" /> <id column="sys_dict_id" property="sysDictId" jdbcType="INTEGER" />
<result column="item_type" property="itemType" jdbcType="INTEGER" /> <result column="item_type" property="itemType" jdbcType="INTEGER" />
<result column="item_code" property="itemCode" jdbcType="INTEGER" /> <result column="item_code" property="itemCode" jdbcType="VARCHAR" />
<result column="item_value" property="itemValue" jdbcType="VARCHAR" /> <result column="item_value" property="itemValue" jdbcType="VARCHAR" />
<result column="item_desc" property="itemDesc" jdbcType="VARCHAR" /> <result column="item_desc" property="itemDesc" jdbcType="VARCHAR" />
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER" /> <result column="is_leaf" property="isLeaf" jdbcType="INTEGER" />
<result column="level_no" property="levelNo" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" /> <result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" /> <result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
@@ -37,6 +38,7 @@
s.item_desc AS itemDesc, s.item_desc AS itemDesc,
s.parent_id AS "parent.sysDictId", s.parent_id AS "parent.sysDictId",
s.is_leaf AS isLeaf, s.is_leaf AS isLeaf,
s.level_no AS levelNo,
s.is_valid AS isValid, s.is_valid AS isValid,
s.creator_id AS "sysDictCreator.id", s.creator_id AS "sysDictCreator.id",
s.create_time AS createTime, s.create_time AS createTime,
@@ -88,12 +90,60 @@
WHERE s.is_valid =1 WHERE s.is_valid =1
</select> </select>
<!-- 条件查询分页(==) --> <!-- 条件查询顶层分页(==) -->
<select id="findDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.SysDictInfo"> <select id="findDictTopSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.SysDictInfo">
SELECT * FROM sys_dict_info s WHERE s.is_valid=1
<if test="itemCode != null and itemCode != '' " >
AND s.item_code like '%${itemCode}%'
</if>
<if test="itemValue!= null and itemValue != '' " >
AND s.item_value like '%${itemValue}%'
</if>
<if test="itemType != null and itemType != '' " >
AND s.item_type = ${itemType}
</if>
<if test="beginDate !=null" >
AND s.create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND s.create_time &lt;= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
</if>
AND s.parent_id not in (
SELECT s2.sys_dict_id FROM sys_dict_info s2 WHERE s2.is_valid=1
<if test="itemCode != null and itemCode != '' " >
AND s2.item_code like '%${itemCode}%'
</if>
<if test="itemValue!= null and itemValue != '' " >
AND s2.item_value like '%${itemValue}%'
</if>
<if test="itemType != null and itemType != '' " >
AND s2.item_type = ${itemType}
</if>
<if test="beginDate !=null" >
AND s2.create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND s2.create_time &lt;= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
</if>
)
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY s.${page.orderBy}
</when>
<otherwise>
ORDER BY s.create_time desc
</otherwise>
</choose>
</select>
<!-- 条件查询所有(==) -->
<select id="findAllDictSearchList" resultMap="dictResultMap" parameterType="com.nis.domain.basics.SysDictInfo">
SELECT * FROM sys_dict_info WHERE is_valid=1 SELECT * FROM sys_dict_info WHERE is_valid=1
<if test="itemType != null and itemType != '' " > <if test="itemType != null and itemType != '' " >
AND item_type like '%${itemType}%' AND item_type = ${itemType}
</if> </if>
<if test="itemCode != null and itemCode != '' " > <if test="itemCode != null and itemCode != '' " >
AND item_code like '%${itemCode}%' AND item_code like '%${itemCode}%'
@@ -106,18 +156,7 @@
</if> </if>
<if test="endDate !=null" > <if test="endDate !=null" >
AND create_time &lt;= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY) AND create_time &lt;= DATE_ADD(#{endDate,jdbcType=TIMESTAMP},INTERVAL 1 DAY)
</if> </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>
<!-- 根据主键查询字典详细信息 --> <!-- 根据主键查询字典详细信息 -->
@@ -131,10 +170,10 @@
<!-- 新增字典信息 --> <!-- 新增字典信息 -->
<insert id="insertDict" parameterType="com.nis.domain.basics.SysDictInfo" useGeneratedKeys="true" keyProperty="id" > <insert id="insertDict" parameterType="com.nis.domain.basics.SysDictInfo" useGeneratedKeys="true" keyProperty="id" >
insert into sys_dict_info (item_type, item_code, item_value, item_desc, parent_id, is_leaf, is_valid, creator_id, create_time, editor_id, edit_time) insert into sys_dict_info (item_type, item_code, item_value, item_desc, parent_id, is_leaf,level_no, is_valid, creator_id, create_time, editor_id, edit_time)
values ( #{itemType,jdbcType=INTEGER}, #{itemCode,jdbcType=INTEGER}, values ( #{itemType,jdbcType=INTEGER}, #{itemCode,jdbcType=VARCHAR},
#{itemValue,jdbcType=VARCHAR}, #{itemDesc,jdbcType=VARCHAR}, #{itemValue,jdbcType=VARCHAR}, #{itemDesc,jdbcType=VARCHAR},
#{parent.sysDictId,jdbcType=INTEGER}, #{isLeaf,jdbcType=INTEGER}, #{isValid,jdbcType=INTEGER}, #{parent.sysDictId,jdbcType=INTEGER}, #{isLeaf,jdbcType=INTEGER}, #{levelNo,jdbcType=INTEGER}, #{isValid,jdbcType=INTEGER},
#{sysDictCreator.id,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{sysDictCreator.id,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{sysDictEditor.id,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP}) #{sysDictEditor.id,jdbcType=INTEGER}, #{editTime,jdbcType=TIMESTAMP})
</insert> </insert>
@@ -159,6 +198,7 @@
s.item_desc = #{itemDesc}, s.item_desc = #{itemDesc},
s.parent_id = #{parent.sysDictId}, s.parent_id = #{parent.sysDictId},
s.is_leaf = #{isLeaf}, s.is_leaf = #{isLeaf},
s.level_no = #{levelNo},
s.creator_id = #{sysDictCreator.id}, s.creator_id = #{sysDictCreator.id},
s.editor_id = #{sysDictEditor.id}, s.editor_id = #{sysDictEditor.id},
s.edit_time = #{editTime} s.edit_time = #{editTime}
@@ -191,5 +231,12 @@
<select id="findMaxItemCode" resultType="java.lang.Integer"> <select id="findMaxItemCode" resultType="java.lang.Integer">
select max(s.item_code) from sys_dict_info s select max(s.item_code) from sys_dict_info s
</select> </select>
<!-- 保存层级 -->
<update id="updateLevelNo">
UPDATE sys_dict_info s SET
s.level_no = #{levelNo}
WHERE s.sys_dict_id = #{sysDictId}
</update>
</mapper> </mapper>

View File

@@ -91,47 +91,172 @@ public class ServiceDictInfoService extends BaseService{
return list; return list;
} }
/** /**
* 查询字典分页(含条件查询) * 查询条件查询顶层分页(含条件查询,考虑排序接入可行性)
* @param page * @param page
* @param serviceDictInfo * @param serviceDictInfo
* @param itType * @param itType
* @return * @return
*/ */
public Page<ServiceDictInfo> findDictSearchList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo, Integer[] itType) { public Page<ServiceDictInfo> findDictTopSearchList(Page<ServiceDictInfo> page, ServiceDictInfo serviceDictInfo, Integer[] itType) {
// 设置分页参数 // 设置分页参数
serviceDictInfo.setPage(page); serviceDictInfo.setPage(page);
//根据条件查询符合数据
List<ServiceDictInfo> allList = Lists.newArrayList();
List<ServiceDictInfo> list = Lists.newArrayList();
Integer tempType = 0;
if(serviceDictInfo.getItemType()!=null){
tempType = serviceDictInfo.getItemType();
}
if(itType.length==1){
serviceDictInfo.setItemType(itType[0]);
allList = serviceDictInfoDao.findDictTopSearchList(serviceDictInfo);
}
if(itType.length==2){
if(tempType!=0){
allList = serviceDictInfoDao.findDictTopSearchList(serviceDictInfo);
}else{
List<Integer> tempIntegerList = Lists.newArrayList();
tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
if(tempIntegerList.contains(itType[0])){
tempIntegerList.remove(itType[0]);
}
if(tempIntegerList.contains(itType[1])){
tempIntegerList.remove(itType[1]);
}
serviceDictInfo.setItemType(tempIntegerList.get(0));
allList = serviceDictInfoDao.findDictTopSearchListN(serviceDictInfo);
}
}
ServiceDictInfo tempSe = new ServiceDictInfo();
tempSe.setServiceDictId(0);
for(ServiceDictInfo se:allList){
se.setParent(tempSe);
}
page.setList(allList);
/*//根据条件查询符合数据
List<ServiceDictInfo> allList = Lists.newArrayList();
List<Integer> tempList = Lists.newArrayList();
List<ServiceDictInfo> list = Lists.newArrayList();
List<ServiceDictInfo> listChild = Lists.newArrayList();
List<ServiceDictInfo> listParent = Lists.newArrayList();
Integer tempType = 0;
Integer total = 0;
Integer pageCount = 0;
Integer lostCount = 0;
if(serviceDictInfo.getItemType()!=null){
tempType = serviceDictInfo.getItemType();
}
if(itType.length==1){
serviceDictInfo.setItemType(itType[0]);
allList = serviceDictInfoDao.findDictSearchList(serviceDictInfo);
}
if(itType.length==2){
if(tempType!=0){
allList = serviceDictInfoDao.findDictSearchList(serviceDictInfo);
}else{
List<Integer> tempIntegerList = Lists.newArrayList();
tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
if(tempIntegerList.contains(itType[0])){
tempIntegerList.remove(itType[0]);
}
if(tempIntegerList.contains(itType[1])){
tempIntegerList.remove(itType[1]);
}
serviceDictInfo.setItemType(tempIntegerList.get(0));
allList = serviceDictInfoDao.findDictSearchListN(serviceDictInfo);
}
}
//处理数据
//page.list中有多少个不是page.list中的顶层(其上级在page.list)
ServiceDictInfo tempSe = new ServiceDictInfo();
tempSe.setServiceDictId(0);
//取出主键优化处理
for(ServiceDictInfo se:allList){
if(se!=null&&se.getServiceDictId()!=null){
tempList.add(se.getServiceDictId());
}
}
for(ServiceDictInfo se:allList){
if(se!=null&&se.getParent()!=null&&se.getParent().getServiceDictId()!=null){
//ServiceDictInfo temp = serviceDictInfoDao.getDictById(se.getParent().getServiceDictId());
if(tempList.contains(se.getParent().getServiceDictId())){
listChild.add(se);
lostCount+=lostCount;
}else{
se.setParent(tempSe);
listParent.add(se);
}
}
}
//确定总页数
total = allList.size() - lostCount;
pageCount = total%page.getPageSize()==0?total%page.getPageSize():(total%page.getPageSize()+1);
if(pageCount==0){
pageCount=1;
}
//取出所有的顶层
//获取分页 每页数量pageSize、、当前页数pageNo (排序,,,) 每页第一个(pageNo-1)*pageSize+1 最后一个pageNo*pageSize
List<ServiceDictInfo> parentShow = Lists.newArrayList();
for(int i=0;i<listParent.size();i++){
if(i>=((page.getPageNo()-1)*page.getPageSize())&&i<page.getPageNo()*page.getPageSize()){
parentShow.add(listParent.get(i));
}
}
parentShow.addAll(listChild);
ServiceDictInfo.sortList(list,parentShow,0,true);
page.setList(list);*/
return page;
}
/**
* 条件查询所有数据
* @param serviceDictInfo
* @param itType
* @return
*/
public List<ServiceDictInfo> findAllDictSearchList(ServiceDictInfo serviceDictInfo,Integer[] itType){
List<ServiceDictInfo> list = Lists.newArrayList(); List<ServiceDictInfo> list = Lists.newArrayList();
Integer tempType = 0; Integer tempType = 0;
if(serviceDictInfo.getItemType()!=null){ if(serviceDictInfo.getItemType()!=null){
tempType = serviceDictInfo.getItemType(); tempType = serviceDictInfo.getItemType();
} }
//查出分页
if(itType.length==1){ if(itType.length==1){
serviceDictInfo.setItemType(itType[0]); serviceDictInfo.setItemType(itType[0]);
list = serviceDictInfoDao.findDictSearchList(serviceDictInfo); list = serviceDictInfoDao.findAllDictSearchList(serviceDictInfo);
} }
if(itType.length==2){ if(itType.length==2){
if(tempType!=0){ if(tempType!=0){
list = serviceDictInfoDao.findTopDictList(serviceDictInfo); list = serviceDictInfoDao.findAllDictSearchList(serviceDictInfo);
}else{ }else{
List<Integer> tempList = Lists.newArrayList(); List<Integer> tempIntegerList = Lists.newArrayList();
tempList.add(1);tempList.add(2);tempList.add(3); tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3);
//Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE"); //Map<String,String> map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE");
if(tempList.contains(itType[0])){ if(tempIntegerList.contains(itType[0])){
tempList.remove(itType[0]); tempIntegerList.remove(itType[0]);
} }
if(tempList.contains(itType[1])){ if(tempIntegerList.contains(itType[1])){
tempList.remove(itType[1]); tempIntegerList.remove(itType[1]);
} }
serviceDictInfo.setItemType(tempList.get(0)); serviceDictInfo.setItemType(tempIntegerList.get(0));
list = serviceDictInfoDao.findDictSearchListN(serviceDictInfo); list = serviceDictInfoDao.findAllDictSearchListN(serviceDictInfo);
} }
}
if(tempType!=0){
serviceDictInfo.setItemType(tempType);
}else{
serviceDictInfo.setItemType(null);
} }
return list;
page.setList(list);
return page;
} }
@@ -157,7 +282,7 @@ public class ServiceDictInfoService extends BaseService{
} }
/** /**
* 新增或修改业务字典表 * 新增或修改业务字典表(添加层级改变)
* @param serviceDictInfo * @param serviceDictInfo
*/ */
public void saveOrUpdate(ServiceDictInfo serviceDictInfo) { public void saveOrUpdate(ServiceDictInfo serviceDictInfo) {
@@ -168,12 +293,16 @@ public class ServiceDictInfoService extends BaseService{
){ ){
ServiceDictInfo parent = new ServiceDictInfo(); ServiceDictInfo parent = new ServiceDictInfo();
parent.setServiceDictId(0); parent.setServiceDictId(0);
parent.setLevelNo(0);
serviceDictInfo.setParent(parent); serviceDictInfo.setParent(parent);
} }
if(serviceDictInfo.getParent().getServiceDictId()!=0){
ServiceDictInfo parent = serviceDictInfoDao.getDictById(serviceDictInfo.getParent().getServiceDictId());
serviceDictInfo.setParent(parent);
}
SysUser user = UserUtils.getUser(); SysUser user = UserUtils.getUser();
if(StringUtil.isEmpty(serviceDictInfo.getServiceDictId())) {//新增 if(StringUtil.isEmpty(serviceDictInfo.getServiceDictId())) {//新增
Integer maxCode = serviceDictInfoDao.findMaxItemCode(); serviceDictInfo.setLevelNo(serviceDictInfo.getParent().getLevelNo()+1);
serviceDictInfo.setItemCode(maxCode==null?1:(maxCode+1));
serviceDictInfo.setIsValid(1); serviceDictInfo.setIsValid(1);
serviceDictInfo.setServiceDictCreator(user); serviceDictInfo.setServiceDictCreator(user);
serviceDictInfo.setCreateTime(new Date()); serviceDictInfo.setCreateTime(new Date());
@@ -182,12 +311,41 @@ public class ServiceDictInfoService extends BaseService{
serviceDictInfoDao.insertDict(serviceDictInfo); serviceDictInfoDao.insertDict(serviceDictInfo);
} }
else {//修改 else {//修改
List<ServiceDictInfo> resultList = Lists.newArrayList();
List<ServiceDictInfo> list = serviceDictInfoDao.getDictByParentId(serviceDictInfo.getServiceDictId());
//处理层级
if(serviceDictInfo.getParent().getServiceDictId()==0){
serviceDictInfo.setLevelNo(1);
//处理子集
childLevel(serviceDictInfo,list,resultList);
}else{
serviceDictInfo.setLevelNo(serviceDictInfo.getParent().getLevelNo()+1);
//处理子集
childLevel(serviceDictInfo,list,resultList);
}
serviceDictInfo.setServiceDictEditor(user); serviceDictInfo.setServiceDictEditor(user);
serviceDictInfo.setEditTime(new Date()); serviceDictInfo.setEditTime(new Date());
for(ServiceDictInfo sc:resultList){
serviceDictInfoDao.updateLevelNo(sc);
}
serviceDictInfoDao.update(serviceDictInfo); serviceDictInfoDao.update(serviceDictInfo);
} }
} }
//处理子集层级
public void childLevel(ServiceDictInfo serviceDictInfo, List<ServiceDictInfo> list,List<ServiceDictInfo> resultList){
for(ServiceDictInfo se:list){
se.setLevelNo(serviceDictInfo.getLevelNo()+1);
resultList.add(se);
List<ServiceDictInfo> newList = serviceDictInfoDao.getDictByParentId(se.getServiceDictId());
childLevel(se,newList,resultList);
}
}
/** /**
* 删除 * 删除
@@ -209,7 +367,7 @@ public class ServiceDictInfoService extends BaseService{
/** /**
* 根据itemCode查出对象集合 * 根据itemCode查出对象集合
*/ */
public List<ServiceDictInfo> findByItemCode(Integer itemCode){ public List<ServiceDictInfo> findByItemCode(String itemCode){
return serviceDictInfoDao.findByItemCode(itemCode); return serviceDictInfoDao.findByItemCode(itemCode);
} }

View File

@@ -54,28 +54,43 @@ public class SysDictInfoService extends BaseService{
} }
/** /**
* 查询字典分页(含条件查询) * 条件查询所有数据
* @param page * @param page
* @param sysDictInfo * @param sysDictInfo
* @param intArr * @param intArr
* @return * @return
*/ */
public Page<SysDictInfo> findDictSearchList(Page<SysDictInfo> page, SysDictInfo sysDictInfo, Integer[] itType) { public List<SysDictInfo> findAllDictSearchList(SysDictInfo sysDictInfo, Integer[] itType) {
// 设置分页参数
sysDictInfo.setPage(page);
List<SysDictInfo> list = Lists.newArrayList(); List<SysDictInfo> list = Lists.newArrayList();
/*Integer tempType = 0;
if(sysDictInfo.getItemType()!=null){ list = sysDictInfoDao.findAllDictSearchList(sysDictInfo);
tempType = sysDictInfo.getItemType(); return list;
}*/ }
//查出分页 /**
list = sysDictInfoDao.findDictSearchList(sysDictInfo); * 查询条件查询顶层分页(含条件查询,考虑排序接入可行性)
page.setList(list); * @param page
* @param sysDictInfo
* @param itType
* @return
*/
public Page<SysDictInfo> findDictTopSearchList(Page<SysDictInfo> page, SysDictInfo sysDictInfo, Integer[] itType) {
// 设置分页参数
sysDictInfo.setPage(page);
//根据条件查询符合数据
List<SysDictInfo> allList = Lists.newArrayList();
List<SysDictInfo> list = Lists.newArrayList();
Integer tempType = 0;
allList = sysDictInfoDao.findDictTopSearchList(sysDictInfo);
SysDictInfo tempSe = new SysDictInfo();
tempSe.setSysDictId(0);
for(SysDictInfo se:allList){
se.setParent(tempSe);
}
page.setList(allList);
return page; return page;
} }
/** /**
@@ -99,14 +114,16 @@ public class SysDictInfoService extends BaseService{
){ ){
SysDictInfo parent = new SysDictInfo(); SysDictInfo parent = new SysDictInfo();
parent.setSysDictId(0); parent.setSysDictId(0);
parent.setLevelNo(0);
sysDictInfo.setParent(parent); sysDictInfo.setParent(parent);
} }
if(sysDictInfo.getParent().getSysDictId()!=0){
SysDictInfo parent = sysDictInfoDao.getDictById(sysDictInfo.getParent().getSysDictId());
sysDictInfo.setParent(parent);
}
SysUser user = UserUtils.getUser(); SysUser user = UserUtils.getUser();
if(StringUtil.isEmpty(sysDictInfo.getSysDictId())) {//新增 if(StringUtil.isEmpty(sysDictInfo.getSysDictId())) {//新增
if(sysDictInfo.getItemCode()==null){ sysDictInfo.setLevelNo(sysDictInfo.getParent().getLevelNo()+1);
Integer maxCode = sysDictInfoDao.findMaxItemCode();
sysDictInfo.setItemCode(maxCode==null?1:(maxCode+1));
}
sysDictInfo.setIsValid(1); sysDictInfo.setIsValid(1);
sysDictInfo.setSysDictCreator(user); sysDictInfo.setSysDictCreator(user);
sysDictInfo.setCreateTime(new Date()); sysDictInfo.setCreateTime(new Date());
@@ -117,12 +134,43 @@ public class SysDictInfoService extends BaseService{
} }
else {//修改 else {//修改
List<SysDictInfo> resultList = Lists.newArrayList();
List<SysDictInfo> list = sysDictInfoDao.getDictByParentId(sysDictInfo.getSysDictId());
//处理层级
if(sysDictInfo.getParent().getSysDictId()==0){
sysDictInfo.setLevelNo(1);
//处理子集
childLevel(sysDictInfo,list,resultList);
}else{
sysDictInfo.setLevelNo(sysDictInfo.getParent().getLevelNo()+1);
//处理子集
childLevel(sysDictInfo,list,resultList);
}
sysDictInfo.setSysDictEditor(user); sysDictInfo.setSysDictEditor(user);
sysDictInfo.setEditTime(new Date()); sysDictInfo.setEditTime(new Date());
for(SysDictInfo sc:resultList){
sysDictInfoDao.updateLevelNo(sc);
}
sysDictInfoDao.update(sysDictInfo); sysDictInfoDao.update(sysDictInfo);
} }
} }
//处理子集层级
public void childLevel(SysDictInfo sysDictInfo, List<SysDictInfo> list,List<SysDictInfo> resultList){
for(SysDictInfo se:list){
se.setLevelNo(sysDictInfo.getLevelNo()+1);
resultList.add(se);
List<SysDictInfo> newList = sysDictInfoDao.getDictByParentId(se.getSysDictId());
childLevel(se,newList,resultList);
}
}
/** /**
* 删除 * 删除
@@ -161,7 +209,7 @@ public class SysDictInfoService extends BaseService{
* @param itemCode * @param itemCode
* @return * @return
*/ */
public List<SysDictInfo> findByItemCode(Integer itemCode) { public List<SysDictInfo> findByItemCode(String itemCode) {
return sysDictInfoDao.findByItemCode(itemCode); return sysDictInfoDao.findByItemCode(itemCode);
} }
/** /**

View File

@@ -22,11 +22,33 @@
$("#itemType").find("option[value='"+data+"']").attr("selected",true); $("#itemType").find("option[value='"+data+"']").attr("selected",true);
} }
}); });
} }
$(document).ready(function() { $(document).ready(function() {
//校验itemCode数值 //层级校验
jQuery.validator.addMethod("codeNumber",function(value,element){ jQuery.validator.addMethod("isLevelNoSure",function(value,element){
return value>=0&value<=20000000},"请填写正确的数值"); var flag2=false;
$.ajax({
type:'post',
async:true,
cache:false,
url:'${ctx}/basics/serviceDictInfo/isLevelTotalSure',
data:{parentId:$("#serviceDictInfoId").val(),currentId:'${serviceDictInfo.serviceDictId}'},
success:function(data){
flag2=data;
/* if(data){
$("#uploadLevel").css("display","none");
}else{
$("#uploadLevel").css("display","block");
} */
}
});
return flag2
},"选择此配置上下层级数将超过四级");
//类型选择与上级是否冲突
jQuery.validator.addMethod("typeSame",function(value,element){ jQuery.validator.addMethod("typeSame",function(value,element){
var flag=false; var flag=false;
$.ajax({ $.ajax({
@@ -85,11 +107,17 @@
},"该配置上级为根节点,不得设为叶子节点"); },"该配置上级为根节点,不得设为叶子节点");
$("#name").focus(); $("#name").focus();
$("#inputForm").validate({ $("#inputForm").validate({
//需验证 item_code item_value //需验证 item_code item_value
rules: { rules: {
'parent.itemValue':{
remote:'${ctx}/basics/serviceDictInfo/isLevelTotalSure?parentId='+$("#serviceDictInfoId").val()+'&currentId=${serviceDictInfo.serviceDictId}'
},
'itemCode':{
required:true,
remote:'${ctx}/basics/serviceDictInfo/isItemCodeRepeat?oldItemCode=${serviceDictInfo.itemCode}'
},
'itemValue':{ 'itemValue':{
required:true required:true
}, },
@@ -104,6 +132,13 @@
}, },
messages: { messages: {
'parent.itemValue':{
remote:"选择此配置上下层级数将超过四级"
},
'itemCode':{
required:'请填写配置编码',
remote:'该配置编码已存在'
},
'itemValue':{ 'itemValue':{
required:'编码对应值必须填写' required:'编码对应值必须填写'
}, },
@@ -178,6 +213,7 @@
<div class="col-md-4"> <div class="col-md-4">
<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}" <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="/basics/serviceDictInfo/treeData?itType=${itType}" extId="${serviceDictInfo.serviceDictId}" cssClass="required form-control"/> title="菜单" url="/basics/serviceDictInfo/treeData?itType=${itType}" extId="${serviceDictInfo.serviceDictId}" cssClass="required form-control"/>
<!-- <label id="uploadLevel" style="display:none;" class="error" for="uploadLevel">选择此配置上下层级数将超过四级</label> -->
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@@ -196,12 +232,12 @@
</select> </select>
</div> </div>
</div> </div>
<%-- <div class="form-group"> <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"> <div class="col-md-4">
<form:input path="itemCode" htmlEscape="false" maxlength="50" class="form-control"/> <form:input path="itemCode" htmlEscape="false" maxlength="50" class="form-control"/>
</div> </div>
</div> --%> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="config_content"/>:</label> <label class="col-md-3 control-label"><font color="red">*</font><spring:message code="config_content"/>:</label>
<div class="col-md-4"> <div class="col-md-4">

View File

@@ -62,8 +62,8 @@
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/> <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/> <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<div class="col-md-12"> <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><input id="itemCode" name="itemCode" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemCode}"/>
<label class="search-lable">配置内容:</label><input id="itemValue" name="itemValue" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemValue}"/>
<label class="search-lable itemType">数据类型:</label> <label class="search-lable itemType">数据类型:</label>
<select id="itemType" name="itemType" > <select id="itemType" name="itemType" >
<option value="" selected="selected">-请选择-</option> <option value="" selected="selected">-请选择-</option>
@@ -71,7 +71,7 @@
<c:forEach items="${intArr}" var="itTemp"> <c:forEach items="${intArr}" var="itTemp">
<c:if test="${dict.itemCode eq itTemp}"> <c:if test="${dict.itemCode eq itTemp}">
<option value="${dict.itemCode}" <option value="${dict.itemCode}"
<c:if test="${serviceDictInfo.itemType eq dict.itemCode}">selected="selected"</c:if> <c:if test="${selectedType eq dict.itemCode}">selected="selected"</c:if>
>${dict.itemValue}</option> >${dict.itemValue}</option>
</c:if> </c:if>
</c:forEach> </c:forEach>
@@ -88,11 +88,11 @@
</div> </div>
</form:form> </form:form>
<table id="treeTable" 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> <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"> <tbody><c:forEach items="${list}" var="serviceDictInfo">
<tr id="${serviceDictInfo.serviceDictId}" pId="${serviceDictInfo.parent.serviceDictId ne 0?serviceDictInfo.parent.serviceDictId:0}"> <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}/basics/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}&doAction=0">${serviceDictInfo.itemValue}</a></td> <td nowrap><i class="icon-icon-tablet"></i><a href="${ctx}/basics/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}&doAction=0">${serviceDictInfo.itemCode}</a></td>
<td>${serviceDictInfo.itemCode}</td> <td>${serviceDictInfo.itemValue}</td>
<td title="${serviceDictInfo.itemDesc}">${fns:abbr(serviceDictInfo.itemDesc,15)}</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("SERVICE_DICT_ITM_TYPE",serviceDictInfo.itemType,"0")}</td>
<td>${fns:getDictLabel("SYS_YES_NO",serviceDictInfo.isLeaf,"0")}</td> <td>${fns:getDictLabel("SYS_YES_NO",serviceDictInfo.isLeaf,"0")}</td>

View File

@@ -62,8 +62,8 @@
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/> <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/> <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<div class="col-md-12"> <div class="col-md-12">
<label class="search-lable"><spring:message code="config_content"/>:</label><input id="itemValue" name="itemValue" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemValue}"/>
<label class="search-lable"><spring:message code="item_code"/>:</label><input id="itemCode" name="itemCode" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemCode}"/> <label class="search-lable"><spring:message code="item_code"/>:</label><input id="itemCode" name="itemCode" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemCode}"/>
<label class="search-lable"><spring:message code="config_content"/>:</label><input id="itemValue" name="itemValue" type="text" maxlength="25" class="input-medium" value="${serviceDictInfo.itemValue}"/>
<label class="search-lable itemType"><spring:message code="item_type"/>:</label> <label class="search-lable itemType"><spring:message code="item_type"/>:</label>
<select id="itemType" name="itemType" > <select id="itemType" name="itemType" >
<option value="" selected="selected"><spring:message code="select"/></option> <option value="" selected="selected"><spring:message code="select"/></option>
@@ -88,14 +88,15 @@
</div> </div>
</form:form> </form:form>
<table id="treeTable" class="table table-striped table-bordered table-condensed"> <table id="treeTable" class="table table-striped table-bordered table-condensed">
<thead><tr><th><spring:message code="config_content"/></th><th><spring:message code="item_code"/></th><th><spring:message code="desc"/></th><th><spring:message code="item_type"/></th><th><spring:message code="is_leaf"/></th><th><spring:message code="creator"/></th><th><spring:message code="create_time"/></th><th><spring:message code="editor"/></th><th><spring:message code="edit_time"/></th><shiro:hasPermission name="sys:menu:edit"><th><spring:message code="operation"/></th></shiro:hasPermission></tr></thead> <thead><tr><th><spring:message code="item_code"/></th><th><spring:message code="config_content"/></th><th><spring:message code="desc"/></th><th><spring:message code="item_type"/></th><th><spring:message code="is_leaf"/></th><th>层级</th><th><spring:message code="creator"/></th><th><spring:message code="create_time"/></th><th><spring:message code="editor"/></th><th><spring:message code="edit_time"/></th><shiro:hasPermission name="sys:menu:edit"><th><spring:message code="operation"/></th></shiro:hasPermission></tr></thead>
<tbody><c:forEach items="${list}" var="serviceDictInfo"> <tbody><c:forEach items="${list}" var="serviceDictInfo">
<tr id="${serviceDictInfo.serviceDictId}" pId="${serviceDictInfo.parent.serviceDictId ne 0?serviceDictInfo.parent.serviceDictId:0}"> <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}/basics/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}&doAction=0">${serviceDictInfo.itemValue}</a></td> <td nowrap><i class="icon-icon-tablet"></i><a href="${ctx}/basics/serviceDictInfo/form?serviceDictId=${serviceDictInfo.serviceDictId}&doAction=0">${serviceDictInfo.itemCode}</a></td>
<td>${serviceDictInfo.itemCode}</td> <td>${serviceDictInfo.itemValue}</td>
<td title="${serviceDictInfo.itemDesc}">${fns:abbr(serviceDictInfo.itemDesc,15)}</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("SERVICE_DICT_ITM_TYPE",serviceDictInfo.itemType,"0")}</td>
<td>${fns:getDictLabel("SYS_YES_NO",serviceDictInfo.isLeaf,"0")}</td> <td>${fns:getDictLabel("SYS_YES_NO",serviceDictInfo.isLeaf,"0")}</td>
<td>${serviceDictInfo.levelNo}</td>
<td><c:if test="${serviceDictInfo.serviceDictCreator != null}"> <td><c:if test="${serviceDictInfo.serviceDictCreator != null}">
${fns:getUserById(serviceDictInfo.serviceDictCreator.id).name} ${fns:getUserById(serviceDictInfo.serviceDictCreator.id).name}
</c:if></td> </c:if></td>

View File

@@ -196,12 +196,12 @@
</select> </select>
</div> </div>
</div> </div>
<%-- <div class="form-group"> <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"> <div class="col-md-4">
<form:input path="itemCode" htmlEscape="false" maxlength="50" class="form-control"/> <form:input path="itemCode" htmlEscape="false" maxlength="50" class="form-control"/>
</div> </div>
</div> --%> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="config_content"/>:</label> <label class="col-md-3 control-label"><font color="red">*</font><spring:message code="config_content"/>:</label>
<div class="col-md-4"> <div class="col-md-4">

View File

@@ -62,8 +62,8 @@
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/> <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/> <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<div class="col-md-12"> <div class="col-md-12">
<label class="search-lable"><spring:message code="config_content"/>:</label><input id="itemValue" name="itemValue" type="text" maxlength="25" class="input-medium" value="${sysDictInfo.itemValue}"/>
<label class="search-lable"><spring:message code="item_code"/>:</label><input id="itemCode" name="itemCode" type="text" maxlength="25" class="input-medium" value="${sysDictInfo.itemCode}"/> <label class="search-lable"><spring:message code="item_code"/>:</label><input id="itemCode" name="itemCode" type="text" maxlength="25" class="input-medium" value="${sysDictInfo.itemCode}"/>
<label class="search-lable"><spring:message code="config_content"/>:</label><input id="itemValue" name="itemValue" type="text" maxlength="25" class="input-medium" value="${sysDictInfo.itemValue}"/>
<label class="search-lable itemType"><spring:message code="item_value"/>:</label> <label class="search-lable itemType"><spring:message code="item_value"/>:</label>
<select id="itemType" name="itemType" > <select id="itemType" name="itemType" >
<option value="" selected="selected"><spring:message code="select"/></option> <option value="" selected="selected"><spring:message code="select"/></option>
@@ -88,7 +88,7 @@
</div> </div>
</form:form> </form:form>
<table id="treeTable" class="table table-striped table-bordered table-condensed"> <table id="treeTable" class="table table-striped table-bordered table-condensed">
<thead><tr><th><spring:message code="config_content"/></th><th><spring:message code="item_code"/></th><th><spring:message code="desc"/></th><th><spring:message code="item_type"/></th><th><spring:message code="is_leaf"/></th><th><spring:message code="creator"/></th><th><spring:message code="create_time"/></th><th><spring:message code="editor"/></th><th><spring:message code="edit_time"/></th><shiro:hasPermission name="sys:menu:edit"><th><spring:message code="operation"/></th></shiro:hasPermission></tr></thead> <thead><tr><th><spring:message code="item_code"/></th><th><spring:message code="config_content"/></th><th><spring:message code="desc"/></th><th><spring:message code="item_type"/></th><th><spring:message code="is_leaf"/></th><th>层级</th><th><spring:message code="creator"/></th><th><spring:message code="create_time"/></th><th><spring:message code="editor"/></th><th><spring:message code="edit_time"/></th><shiro:hasPermission name="sys:menu:edit"><th><spring:message code="operation"/></th></shiro:hasPermission></tr></thead>
<tbody><c:forEach items="${list}" var="sysDictInfo"> <tbody><c:forEach items="${list}" var="sysDictInfo">
<tr id="${sysDictInfo.sysDictId}" pId="${sysDictInfo.parent.sysDictId ne 0?sysDictInfo.parent.sysDictId:0}"> <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}/basics/sysDictInfo/form?sysDictId=${sysDictInfo.sysDictId}&doAction=0">${sysDictInfo.itemValue}</a></td> <td nowrap><i class="icon-icon-tablet"></i><a href="${ctx}/basics/sysDictInfo/form?sysDictId=${sysDictInfo.sysDictId}&doAction=0">${sysDictInfo.itemValue}</a></td>
@@ -96,6 +96,7 @@
<td title="${sysDictInfo.itemDesc}">${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_DICT_ITM_TYPE",sysDictInfo.itemType,"0")}</td>
<td>${fns:getDictLabel("SYS_YES_NO",sysDictInfo.isLeaf,"0")}</td> <td>${fns:getDictLabel("SYS_YES_NO",sysDictInfo.isLeaf,"0")}</td>
<td>${sysDictInfo.levelNo}</td>
<td><c:if test="${sysDictInfo.sysDictCreator != null}"> <td><c:if test="${sysDictInfo.sysDictCreator != null}">
${fns:getUserById(sysDictInfo.sysDictCreator.id).name} ${fns:getUserById(sysDictInfo.sysDictCreator.id).name}
</c:if></td> </c:if></td>