列表查询子配置处理

This commit is contained in:
zhangwei
2018-05-25 16:24:30 +08:00
parent cf244187e5
commit 3f52339f8f
4 changed files with 521 additions and 290 deletions

View File

@@ -14,6 +14,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.nis.domain.Page;
import com.nis.domain.configuration.BaseIpCfg;
@@ -58,6 +59,24 @@ public class WebsiteController extends BaseController{
public String httpForm(Model model,String ids,CfgIndexInfo entity) {
if(StringUtils.isNotBlank(ids)){
entity = websiteCfgService.getHttpCfg(Long.parseLong(ids));
if(entity.getIpPortList().size()==0){
entity.getIpPortList().add(new IpPortCfg());
}
if(entity.getHttpUrlList().size()==0){
entity.getHttpUrlList().add(new HttpUrlCfg());
}
if(entity.getHttpReqHdrList().size()==0){
entity.getHttpReqHdrList().add(new HttpReqHeadCfg());
}
if(entity.getHttpResHdrList().size()==0){
entity.getHttpResHdrList().add(new HttpResHeadCfg());
}
if(entity.getHttpReqBodyList().size()==0){
entity.getHttpReqBodyList().add(new HttpBodyCfg());
}
if(entity.getHttpResBodyList().size()==0){
entity.getHttpResBodyList().add(new HttpBodyCfg());
}
}else{
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
ipList.add(new IpPortCfg());
@@ -88,4 +107,11 @@ public class WebsiteController extends BaseController{
websiteCfgService.saveHttpCfg(entity);
return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId();
}
@RequestMapping(value = {"ajaxHttpSubList"})
public String ajaxHttpSubList(Model model,Long cfgId,Integer index) {
CfgIndexInfo cfg = websiteCfgService.getHttpCfg(cfgId);
model.addAttribute("_cfg", cfg);
model.addAttribute("index", index);
return "/cfg/website/httpSubList";
}
}

View File

@@ -48,24 +48,6 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
List<HttpResHeadCfg> httpResHdrList = websiteCfgDao.getHttpResHdrList(entity);
List<HttpBodyCfg> httpReqBodyList = websiteCfgDao.getHttpReqBodyList(entity);
List<HttpBodyCfg> httpResBodyList = websiteCfgDao.getHttpResBodyList(entity);
if(ipPortList.size()==0){
ipPortList.add(new IpPortCfg());
}
if(httpUrlList.size()==0){
httpUrlList.add(new HttpUrlCfg());
}
if(httpReqHdrList.size()==0){
httpReqHdrList.add(new HttpReqHeadCfg());
}
if(httpResHdrList.size()==0){
httpResHdrList.add(new HttpResHeadCfg());
}
if(httpReqBodyList.size()==0){
httpReqBodyList.add(new HttpBodyCfg());
}
if(httpResBodyList.size()==0){
httpResBodyList.add(new HttpBodyCfg());
}
entity.setIpPortList(ipPortList);
entity.setHttpReqBodyList(httpReqBodyList);
entity.setHttpReqHdrList(httpReqHdrList);