隐藏isLeaf字段,修复insert没加businessType字段

This commit is contained in:
wangxin
2018-08-23 15:10:21 +08:00
parent 190b90099b
commit ac21f74043
3 changed files with 67 additions and 75 deletions

View File

@@ -195,7 +195,7 @@ public class SpecificServiceCfgController extends BaseController {
*/ */
@ResponseBody @ResponseBody
@RequestMapping(value = "treeData") @RequestMapping(value = "treeData")
public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, public List<Map<String, Object>> treeData(@RequestParam(required=false)Boolean specific,@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide,
@RequestParam(required=false)boolean isLeafShow,@RequestParam(required=true)Integer cfgType,HttpServletResponse response){ @RequestParam(required=false)boolean isLeafShow,@RequestParam(required=true)Integer cfgType,HttpServletResponse response){
List<Map<String, Object>> mapList = Lists.newArrayList(); List<Map<String, Object>> mapList = Lists.newArrayList();
Map<String, Object> map2 = Maps.newHashMap(); Map<String, Object> map2 = Maps.newHashMap();
@@ -206,6 +206,7 @@ public class SpecificServiceCfgController extends BaseController {
map2.put("name","root_node"); map2.put("name","root_node");
//map2.put("placeholder","0"); //map2.put("placeholder","0");
mapList.add(map2); mapList.add(map2);
if(specific==null||!specific) {
Properties props=this.getMsgProp(); Properties props=this.getMsgProp();
List<SysDataDictionaryItem> businessTypeList=Lists.newArrayList(); List<SysDataDictionaryItem> businessTypeList=Lists.newArrayList();
if(cfgType==1) { if(cfgType==1) {
@@ -221,7 +222,6 @@ public class SpecificServiceCfgController extends BaseController {
map.put("name",props.getProperty(dict.getItemValue(), dict.getItemValue())); map.put("name",props.getProperty(dict.getItemValue(), dict.getItemValue()));
map.put("serviceType",cfgType); map.put("serviceType",cfgType);
map.put("businessType","-1"); map.put("businessType","-1");
map.put("nodes", new ArrayList<Map<String, Object>>());
businessList.add(map); businessList.add(map);
} }
mapList.addAll(businessList); mapList.addAll(businessList);
@@ -257,33 +257,25 @@ public class SpecificServiceCfgController extends BaseController {
} }
} }
} }
}else {
// List<SpecificServiceCfg> list = specificServiceCfgService.findAllSpecificServiceCfg(new SpecificServiceCfg(),""); List<SpecificServiceCfg> list = specificServiceCfgService.findAllSpecificServiceCfg(new SpecificServiceCfg(),"");
// for (int i=0; i<list.size(); i++){
// for (int i=0; i<list.size(); i++){ SpecificServiceCfg specificServiceCfg = list.get(i);
// SpecificServiceCfg specificServiceCfg = list.get(i); if(StringUtils.isBlank(extId)||(extId!=null&&!extId.equals(specificServiceCfg.getSpecServiceId().toString()))){
// if(StringUtils.isBlank(extId)||(extId!=null&&!extId.equals(specificServiceCfg.getSpecServiceId().toString()))){ if(specificServiceCfg.getIsValid().equals(0)||
// if(specificServiceCfg.getIsValid().equals(0)|| (!isLeafShow && specificServiceCfg.getIsLeaf().equals(1))||
// (!isLeafShow && specificServiceCfg.getIsLeaf().equals(1))|| (cfgType.intValue()!=0&&specificServiceCfg.getCfgType().intValue()!=cfgType)){
// (cfgType.intValue()!=0&&specificServiceCfg.getCfgType().intValue()!=cfgType)){ continue;
// continue; }
// } Map<String, Object> map = Maps.newHashMap();
// for(Map<String, Object> business:businessList) { map.put("id", specificServiceCfg.getSpecServiceId());
// if(String.valueOf(business.get("id")).equals(specificServiceCfg.getBusinessType())) { map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
// Map<String, Object> map = Maps.newHashMap(); map.put("name",specificServiceCfg.getSpecServiceName());
// map.put("id", specificServiceCfg.getSpecServiceId()); map.put("type",specificServiceCfg.getCfgType());
// map.put("pId", specificServiceCfg.getParent().getSpecServiceId()); mapList.add(map);
// map.put("name",specificServiceCfg.getSpecServiceName()); }
// map.put("type",specificServiceCfg.getCfgType()); }
// map.put("business",specificServiceCfg.getBusinessType()); }
// ((List<Map<String, Object>>)business.get("nodes")).add(map);
// break;
// }
// }
//
//
// }
// }
// map2.put("nodes", businessList); // map2.put("nodes", businessList);
return mapList; return mapList;
} }

View File

@@ -164,8 +164,8 @@
<!-- 新增 --> <!-- 新增 -->
<insert id="insert" parameterType="com.nis.domain.specific.SpecificServiceCfg" useGeneratedKeys="true"> <insert id="insert" parameterType="com.nis.domain.specific.SpecificServiceCfg" useGeneratedKeys="true">
insert into specific_service_cfg (spec_service_code,spec_service_name,spec_service_desc,is_valid, op_time, parent_id,is_leaf,group_id,cfg_type) insert into specific_service_cfg (spec_service_code,spec_service_name,spec_service_desc,is_valid, op_time, parent_id,is_leaf,group_id,cfg_type,business_type)
values(#{specServiceCode},#{specServiceName},#{specServiceDesc},#{isValid},#{opTime},#{parent.specServiceId},#{isLeaf},#{groupId},#{cfgType}) values(#{specServiceCode},#{specServiceName},#{specServiceDesc},#{isValid},#{opTime},#{parent.specServiceId},#{isLeaf},#{groupId},#{cfgType},#{businessType})
</insert> </insert>
<!-- 修改 --> <!-- 修改 -->

View File

@@ -226,11 +226,11 @@
<div class="col-md-4"> <div class="col-md-4">
<c:if test="${empty specificServiceCfg.specServiceId}"> <c:if test="${empty specificServiceCfg.specServiceId}">
<sys:treeselect id="${'specificServiceCfg'.concat(dict.itemCode)}" name="parent.specServiceId" value="${specificServiceCfg.parent.specServiceId}" labelName="parent.specServiceName" labelValue="${fatherName}" title="${dict.itemValue}" <sys:treeselect id="${'specificServiceCfg'.concat(dict.itemCode)}" name="parent.specServiceId" value="${specificServiceCfg.parent.specServiceId}" labelName="parent.specServiceName" labelValue="${fatherName}" title="${dict.itemValue}"
url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${dict.itemCode}" extId="${specificServiceCfg.specServiceId}" cssClass="required form-control"/> url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${dict.itemCode}&specific=true" extId="${specificServiceCfg.specServiceId}" cssClass="required form-control"/>
</c:if> </c:if>
<c:if test="${not empty specificServiceCfg.specServiceId}"> <c:if test="${not empty specificServiceCfg.specServiceId}">
<sys:treeselect id="${'specificServiceCfg'.concat(dict.itemCode)}" name="parent.specServiceId" value="${specificServiceCfg.cfgType eq dict.itemCode?specificServiceCfg.parent.specServiceId:0}" labelName="parent.specServiceName" labelValue="${(specificServiceCfg.cfgType eq dict.itemCode and specificServiceCfg.parent.specServiceId ne '0')?fns:getBySpecServiceId(specificServiceCfg.parent.specServiceId).specServiceName:fatherName}" <sys:treeselect id="${'specificServiceCfg'.concat(dict.itemCode)}" name="parent.specServiceId" value="${specificServiceCfg.cfgType eq dict.itemCode?specificServiceCfg.parent.specServiceId:0}" labelName="parent.specServiceName" labelValue="${(specificServiceCfg.cfgType eq dict.itemCode and specificServiceCfg.parent.specServiceId ne '0')?fns:getBySpecServiceId(specificServiceCfg.parent.specServiceId).specServiceName:fatherName}"
title="${dict.itemValue}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${dict.itemCode}" extId="${specificServiceCfg.specServiceId}" cssClass="required form-control"/> title="${dict.itemValue}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${dict.itemCode}&specific=true" extId="${specificServiceCfg.specServiceId}" cssClass="required form-control"/>
</c:if> </c:if>
</div> </div>
<div for="parent.specServiceName"></div> <div for="parent.specServiceName"></div>
@@ -301,7 +301,7 @@
<div for="groupId"></div> <div for="groupId"></div>
</div> </div>
<div class="form-group"> <div class="form-group hidden">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="is_leaf"/>:</label> <label class="col-md-3 control-label"><font color="red">*</font><spring:message code="is_leaf"/>:</label>
<div class="col-md-4"> <div class="col-md-4">
<form:select path="isLeaf" class="form-control leafChange"> <form:select path="isLeaf" class="form-control leafChange">