系统业务管理功能
This commit is contained in:
@@ -1,20 +1,44 @@
|
|||||||
package com.nis.web.controller.systemService;
|
package com.nis.web.controller.systemService;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
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.RequestMapping;
|
||||||
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.ServiceConfigInfo;
|
||||||
import com.nis.domain.SystemServiceInfo;
|
import com.nis.domain.SystemServiceInfo;
|
||||||
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
|
import com.nis.web.security.UserUtils;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/sysService")
|
@RequestMapping("${adminPath}/systemService")
|
||||||
public class SystemServiceController extends BaseController {
|
public class SystemServiceController extends BaseController {
|
||||||
|
|
||||||
|
//TODO 异常处理
|
||||||
|
|
||||||
|
@ModelAttribute
|
||||||
|
public SystemServiceInfo get(Long id) {
|
||||||
|
if (!StringUtil.isEmpty(id)){
|
||||||
|
// SystemServiceInfo systemServiceInfo = new SystemServiceInfo();
|
||||||
|
// systemServiceInfo.setId(id);
|
||||||
|
return systemServiceService.get(id);
|
||||||
|
}else{
|
||||||
|
return new SystemServiceInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("system:service:view")
|
||||||
@RequestMapping(value = "list")
|
@RequestMapping(value = "list")
|
||||||
public String list(Model model, SystemServiceInfo systemServiceInfo, HttpServletRequest request, HttpServletResponse response) {
|
public String list(Model model, SystemServiceInfo systemServiceInfo, HttpServletRequest request, HttpServletResponse response) {
|
||||||
Page<SystemServiceInfo> page = systemServiceService.findPage(new Page<SystemServiceInfo>(request, response, 1), systemServiceInfo);
|
Page<SystemServiceInfo> page = systemServiceService.findPage(new Page<SystemServiceInfo>(request, response, 1), systemServiceInfo);
|
||||||
@@ -22,16 +46,81 @@ public class SystemServiceController extends BaseController {
|
|||||||
return "/systemService/list";
|
return "/systemService/list";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "form")
|
@RequiresPermissions("system:service:edit")
|
||||||
|
@RequestMapping(value = "systemServiceform")
|
||||||
public String detail(Model model, SystemServiceInfo systemServiceInfo) {
|
public String detail(Model model, SystemServiceInfo systemServiceInfo) {
|
||||||
return "/sysService/form";
|
return "/systemService/form";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("system:service:edit")
|
||||||
@RequestMapping(value = "save")
|
@RequestMapping(value = "save")
|
||||||
public String save(Model model, SystemServiceInfo systemServiceInfo) {
|
public String save(Model model, SystemServiceInfo systemServiceInfo, HttpServletRequest request, RedirectAttributes redirectAttributes) {
|
||||||
systemServiceInfo = systemServiceService.get(systemServiceInfo);
|
Date now = new Date();
|
||||||
model.addAttribute("systemServiceInfo", systemServiceInfo);
|
|
||||||
return "";
|
//新增
|
||||||
|
if (systemServiceInfo.getId() == null) {
|
||||||
|
systemServiceInfo.setCreateTime(now);
|
||||||
|
systemServiceInfo.setCreator(UserUtils.getUser());
|
||||||
|
systemServiceInfo.setIsValid(1);
|
||||||
|
}
|
||||||
|
//更新
|
||||||
|
else {
|
||||||
|
systemServiceInfo.setEditTime(now);
|
||||||
|
systemServiceInfo.setEditor(UserUtils.getUser());
|
||||||
|
}
|
||||||
|
|
||||||
|
//接收serviceConfigInfo
|
||||||
|
String[] reqSciIds = request.getParameterValues("sciId");
|
||||||
|
String[] sciIsValids = request.getParameterValues("sciIsValid");
|
||||||
|
String[] reqTableNames = request.getParameterValues("tableName");
|
||||||
|
String[] reqTableTypes = request.getParameterValues("tableType");
|
||||||
|
String[] reqTableDescs = request.getParameterValues("tableDesc");
|
||||||
|
String[] reqMaatTables = request.getParameterValues("maatTable");
|
||||||
|
|
||||||
|
//新增的serviceConfigInfo
|
||||||
|
List<ServiceConfigInfo> insertServiceConfigInfoList = new ArrayList<ServiceConfigInfo>();
|
||||||
|
//更新的serviceConfigInfo
|
||||||
|
List<ServiceConfigInfo> updateServiceConfigInfoList = new ArrayList<ServiceConfigInfo>();
|
||||||
|
|
||||||
|
if (reqSciIds != null && reqSciIds.length > 0) {
|
||||||
|
for (int i = 0; i < reqSciIds.length; i++) {
|
||||||
|
ServiceConfigInfo sci = new ServiceConfigInfo();
|
||||||
|
sci.setId(Long.valueOf(reqSciIds[i]));
|
||||||
|
sci.setTableName(reqTableNames[i]);
|
||||||
|
sci.setIsValid(Integer.valueOf(sciIsValids[i]));
|
||||||
|
sci.setTableType(Integer.valueOf(reqTableTypes[i]));
|
||||||
|
sci.setTableDesc(reqTableDescs[i]);
|
||||||
|
sci.setMaatTable(reqMaatTables[i]);
|
||||||
|
sci.setServiceId(systemServiceInfo.getServiceId());
|
||||||
|
|
||||||
|
if (sci.getId() == 0) {
|
||||||
|
insertServiceConfigInfoList.add(sci);
|
||||||
|
} else {
|
||||||
|
updateServiceConfigInfoList.add(sci);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
systemServiceService.save(systemServiceInfo, insertServiceConfigInfoList, updateServiceConfigInfoList);
|
||||||
|
addMessage(redirectAttributes, "保存成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
addMessage(redirectAttributes, "保存失败:" + e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return "redirect:" + adminPath + "/systemService/list";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("system:service:edit")
|
||||||
|
@RequestMapping(value = "delete")
|
||||||
|
public String delete(Model model, SystemServiceInfo systemServiceInfo, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
systemServiceService.deleteService(systemServiceInfo);
|
||||||
|
Page<SystemServiceInfo> page = systemServiceService.findPage(new Page<SystemServiceInfo>(request, response, 1), systemServiceInfo);
|
||||||
|
model.addAttribute("page", page);
|
||||||
|
addMessage(model, "删除成功");
|
||||||
|
return "/systemService/list";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.nis.web.dao.systemService.ServiceConfigInfoDao" >
|
<mapper namespace="com.nis.web.dao.systemService.ServiceConfigInfoDao" >
|
||||||
|
|
||||||
<resultMap id="serviceConfigInfo" type="com.nis.domain.ServiceConfigInfo">
|
<resultMap id="serviceConfigInfo" type="com.nis.domain.ServiceConfigInfo">
|
||||||
<id column="id" property="id"/>
|
<id column="id" property="id"/>
|
||||||
<result column="table_name" property="tableName"/>
|
<result column="table_name" property="tableName"/>
|
||||||
@@ -10,6 +11,7 @@
|
|||||||
<result column="service_id" property="serviceId"/>
|
<result column="service_id" property="serviceId"/>
|
||||||
<result column="is_valid" property="isValid"/>
|
<result column="is_valid" property="isValid"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="findSysServiceConfigInfo" resultType="serviceConfigInfo">
|
<select id="findSysServiceConfigInfo" resultType="serviceConfigInfo">
|
||||||
select
|
select
|
||||||
id,
|
id,
|
||||||
@@ -24,4 +26,26 @@
|
|||||||
where
|
where
|
||||||
service_id=#{service_id} and is_valid=1
|
service_id=#{service_id} and is_valid=1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert">
|
||||||
|
insert into service_config_info (
|
||||||
|
table_name, table_desc, table_type, maat_table, service_id, is_valid
|
||||||
|
) values (
|
||||||
|
#{tableName}, #{tableDesc}, #{tableType}, #{maatTable}, #{serviceId}, #{isValid}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update">
|
||||||
|
update
|
||||||
|
service_config_info
|
||||||
|
set
|
||||||
|
table_name=#{tableName},
|
||||||
|
table_desc=#{tableDesc},
|
||||||
|
table_type=#{tableType},
|
||||||
|
maat_table=#{maatTable},
|
||||||
|
service_id=#{serviceId},
|
||||||
|
is_valid=#{isValid}
|
||||||
|
where id=#{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="get">
|
<select id="get" resultMap="systemServiceInfoMap">
|
||||||
select
|
select
|
||||||
ssi.id,
|
ssi.id,
|
||||||
ssi.service_id,
|
ssi.service_id,
|
||||||
@@ -87,4 +87,36 @@
|
|||||||
service_id=#{service_id} and is_valid=1
|
service_id=#{service_id} and is_valid=1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert">
|
||||||
|
insert into system_service_info (
|
||||||
|
service_id, service_name, service_desc, action, is_valid, service_type,
|
||||||
|
creator_id, create_time
|
||||||
|
) values(
|
||||||
|
#{serviceId}, #{serviceName}, #{serviceDesc}, #{action}, #{isValid}, #{serviceType},
|
||||||
|
#{creator.id}, #{createTime}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update">
|
||||||
|
update
|
||||||
|
system_service_info
|
||||||
|
set
|
||||||
|
service_id=#{serviceId},
|
||||||
|
service_name=#{serviceName},
|
||||||
|
service_desc=#{serviceDesc},
|
||||||
|
action=#{action},
|
||||||
|
service_type=#{serviceType},
|
||||||
|
editor_id=#{editor.id},
|
||||||
|
edit_time=#{editTime}
|
||||||
|
where id=#{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="delete">
|
||||||
|
update
|
||||||
|
system_service_info
|
||||||
|
set
|
||||||
|
is_valid=0
|
||||||
|
where id=#{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,12 +1,61 @@
|
|||||||
package com.nis.web.service.systemService;
|
package com.nis.web.service.systemService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.nis.domain.ServiceConfigInfo;
|
||||||
import com.nis.domain.SystemServiceInfo;
|
import com.nis.domain.SystemServiceInfo;
|
||||||
|
import com.nis.util.Collections3;
|
||||||
|
import com.nis.web.dao.systemService.ServiceConfigInfoDao;
|
||||||
import com.nis.web.dao.systemService.SystemServiceInfoDao;
|
import com.nis.web.dao.systemService.SystemServiceInfoDao;
|
||||||
import com.nis.web.service.CrudService;
|
import com.nis.web.service.CrudService;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class SystemServiceService extends CrudService<SystemServiceInfoDao, SystemServiceInfo>{
|
public class SystemServiceService extends CrudService<SystemServiceInfoDao, SystemServiceInfo>{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ServiceConfigInfoDao serviceConfigInfoDao;
|
||||||
|
|
||||||
|
public void deleteService(SystemServiceInfo systemServiceInfo) {
|
||||||
|
List<ServiceConfigInfo> serviceConfigInfoList = dao.get(systemServiceInfo).getServiceConfigInfoList();
|
||||||
|
for (ServiceConfigInfo sci : serviceConfigInfoList) {
|
||||||
|
sci.setIsValid(0);
|
||||||
|
serviceConfigInfoDao.update(sci);
|
||||||
|
}
|
||||||
|
|
||||||
|
dao.delete(systemServiceInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void save(SystemServiceInfo systemServiceInfo, List<ServiceConfigInfo> insertServiceConfigInfoList,
|
||||||
|
List<ServiceConfigInfo> updateServiceConfigInfoList) {
|
||||||
|
//新增
|
||||||
|
if (systemServiceInfo.getId() == null) {
|
||||||
|
dao.insert(systemServiceInfo);
|
||||||
|
|
||||||
|
if (!Collections3.isEmpty(insertServiceConfigInfoList)) {
|
||||||
|
for (ServiceConfigInfo sci : insertServiceConfigInfoList) {
|
||||||
|
serviceConfigInfoDao.insert(sci);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//更新
|
||||||
|
else {
|
||||||
|
dao.update(systemServiceInfo);
|
||||||
|
|
||||||
|
if (!Collections3.isEmpty(insertServiceConfigInfoList)) {
|
||||||
|
for (ServiceConfigInfo sci : insertServiceConfigInfoList) {
|
||||||
|
serviceConfigInfoDao.insert(sci);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!Collections3.isEmpty(updateServiceConfigInfoList)) {
|
||||||
|
for (ServiceConfigInfo sci : updateServiceConfigInfoList) {
|
||||||
|
serviceConfigInfoDao.update(sci);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
<script type="text/javascript">top.$.jBox.closeTip();</script>
|
<script type="text/javascript">top.$.jBox.closeTip();</script>
|
||||||
<c:if test="${not empty content}">
|
<c:if test="${not empty content}">
|
||||||
<c:if test="${not empty type}"><c:set var="ctype" value="${type}"/></c:if><c:if test="${empty type}"><c:set var="ctype" value="${fn:indexOf(content,'失败') eq -1?'success':'error'}"/></c:if>
|
<c:if test="${not empty type}"><c:set var="ctype" value="${type}"/></c:if><c:if test="${empty type}"><c:set var="ctype" value="${fn:indexOf(content,'失败') eq -1?'success':'error'}"/></c:if>
|
||||||
<div id="messageBox" class="alert alert-${ctype} hide"><button data-dismiss="alert" class="close">×</button>${content}</div>
|
<div id="messageBox" class="alert alert-${ctype}"><button data-dismiss="alert" class="close">×</button>${content}</div>
|
||||||
<script type="text/javascript">/* if(!top.$.jBox.tip.mess) */{top.$.jBox.tip.mess=1;top.$.jBox.tip("${content}","${ctype}",{persistent:true,opacity:0});$("#messageBox").show();} </script>
|
<script type="text/javascript">/* if(!top.$.jBox.tip.mess) */{top.$.jBox.tip.mess=1;top.$.jBox.tip("${content}","${ctype}",{persistent:true,opacity:0});$("#messageBox").show();} </script>
|
||||||
</c:if>
|
</c:if>
|
||||||
255
src/main/webapp/WEB-INF/views/systemService/form.jsp
Normal file
255
src/main/webapp/WEB-INF/views/systemService/form.jsp
Normal file
@@ -0,0 +1,255 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8" %>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>系统业务管理表单</title>
|
||||||
|
<link href="${pageContext.request.contextPath}/static/pages/css/systemService.css" rel="stylesheet" type="text/css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
$("#inputForm").validate({
|
||||||
|
rules: {
|
||||||
|
'serviceName':{
|
||||||
|
required:true
|
||||||
|
},
|
||||||
|
'serviceId':{
|
||||||
|
required:true
|
||||||
|
},
|
||||||
|
'action':{
|
||||||
|
required:true
|
||||||
|
},
|
||||||
|
'serviceType':{
|
||||||
|
required:true
|
||||||
|
},
|
||||||
|
'serviceDesc':{
|
||||||
|
required:true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
'serviceName':{
|
||||||
|
required:'必填项'
|
||||||
|
},
|
||||||
|
'serviceId':{
|
||||||
|
required:'必填项'
|
||||||
|
},
|
||||||
|
'action':{
|
||||||
|
required:'必填项'
|
||||||
|
},
|
||||||
|
'serviceType':{
|
||||||
|
required:'必填项'
|
||||||
|
},
|
||||||
|
'serviceDesc':{
|
||||||
|
required:'必填项'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitHandler: function(form){
|
||||||
|
$("[for=childTableFlag]").css("display", "none");
|
||||||
|
var flag = true;
|
||||||
|
var tables = document.getElementsByClassName("child-required");
|
||||||
|
for (var i = 0; i < tables.length; i++) {
|
||||||
|
if (!tables[i].value || tables[i].value == '') {
|
||||||
|
$("[for=childTableFlag]").css("display", "inline");
|
||||||
|
flag = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
|
loading('正在提交,请稍等...');
|
||||||
|
form.submit();
|
||||||
|
} else {
|
||||||
|
flag = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function addDatatable() {
|
||||||
|
$("#datatables").append(
|
||||||
|
'<div class="table-list col-md-10">' +
|
||||||
|
'<div>' +
|
||||||
|
'<input type="hidden" name="sciId" value="0"/>' +
|
||||||
|
'<input type="hidden" name="sciIsValid" value="1"/>' +
|
||||||
|
'<span class="child-label"><font color="red">*</font>表名:</span> ' +
|
||||||
|
'<span><input class="child-required form-control child-input" name="tableName"/></span> ' +
|
||||||
|
'<span class="child-label"><font color="red">*</font>表类型:</span> ' +
|
||||||
|
'<span> ' +
|
||||||
|
'<select class="child-required" name="tableType"> ' +
|
||||||
|
'<option value="">请选择</option>' +
|
||||||
|
'<option value="1">IP</option>' +
|
||||||
|
'<option value="2">字符串</option>' +
|
||||||
|
'<option value="3">数值</option>' +
|
||||||
|
'<option value="4">增强字符串</option>' +
|
||||||
|
'</select>' +
|
||||||
|
'</span> ' +
|
||||||
|
'<span class="child-label"><font color="red">*</font>MAAT表名:</span> ' +
|
||||||
|
'<span><input class="child-required form-control child-input" name="maatTable"/></span>' +
|
||||||
|
'</div>' +
|
||||||
|
'<div>' +
|
||||||
|
'<span class="child-label"><font color="red">*</font>表描述:</span> ' +
|
||||||
|
'<span><input class="child-required form-control child-input-desc" name="tableDesc"/></span>' +
|
||||||
|
'<button type="button" class="btn btn-danger del-button" onclick="del2(this)">删除</button>' +
|
||||||
|
'</div>' +
|
||||||
|
'</div>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function del(obj) {
|
||||||
|
$(obj).parent().parent().find("[name=sciIsValid]").val("0");
|
||||||
|
$(obj).parent().parent().css("display", "none");
|
||||||
|
}
|
||||||
|
|
||||||
|
function del2(obj) {
|
||||||
|
$(obj).parent().parent().remove();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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="systemServiceInfo" action="${ctx}/systemService/save" method="post" class="form-horizontal">
|
||||||
|
<form:hidden path="id"/>
|
||||||
|
<sys:message content="${message}"/>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-3 control-label"><font color="red">*</font>业务名称:</label>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<form:input path="serviceName" htmlEscape="false" maxlength="30" class="required form-control"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-3 control-label"><font color="red">*</font>业务ID:</label>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<form:input path="serviceId" htmlEscape="false" maxlength="30" class="required 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:select path="action" class="required form-control">
|
||||||
|
<form:option value="">请选择</form:option>
|
||||||
|
<form:option value="1">阻断</form:option>
|
||||||
|
<form:option value="2">监测</form:option>
|
||||||
|
<form:option value="5">封堵白名单</form:option>
|
||||||
|
<form:option value="6">监测白名单</form:option>
|
||||||
|
<form:option value="7">封堵监测白名单</form:option>
|
||||||
|
<form:option value="8">灰名单</form:option>
|
||||||
|
</form: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:select path="serviceType" class="required form-control">
|
||||||
|
<form:option value="">请选择</form:option>
|
||||||
|
<form:option value="1">单域</form:option>
|
||||||
|
<form:option value="2">多域</form:option>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-3 control-label">数据库表:</label>
|
||||||
|
<div class="col-md-8" id="datatables">
|
||||||
|
<shiro:hasPermission name="system:service:edit">
|
||||||
|
<div>
|
||||||
|
<button type="button" class="btn btn-default" onclick="addDatatable()">增加</button>
|
||||||
|
<label for="childTableFlag" class="error" style="display:none">有未填项</label>
|
||||||
|
</div>
|
||||||
|
</shiro:hasPermission>
|
||||||
|
<c:forEach items="${systemServiceInfo.serviceConfigInfoList }" var="serviceConfigInfo">
|
||||||
|
<div class="table-list col-md-10">
|
||||||
|
<div>
|
||||||
|
<input type="hidden" name="sciId" value="${serviceConfigInfo.id }"/>
|
||||||
|
<input type="hidden" name="sciIsValid" value="1"/>
|
||||||
|
|
||||||
|
<span class="child-label"><font color="red">*</font>表名:</span>
|
||||||
|
<span><input class="child-required form-control child-input" name="tableName" value="${serviceConfigInfo.tableName }"/></span>
|
||||||
|
|
||||||
|
<span class="child-label"><font color="red">*</font>表类型:</span>
|
||||||
|
<span>
|
||||||
|
<select class="child-required" name="tableType">
|
||||||
|
<option value="">请选择</option>
|
||||||
|
<option value="1" <c:if test="${serviceConfigInfo.tableType eq 1}">selected="selected"</c:if>>IP</option>
|
||||||
|
<option value="2" <c:if test="${serviceConfigInfo.tableType eq 2}">selected="selected"</c:if>>字符串</option>
|
||||||
|
<option value="3" <c:if test="${serviceConfigInfo.tableType eq 3}">selected="selected"</c:if>>数值</option>
|
||||||
|
<option value="4" <c:if test="${serviceConfigInfo.tableType eq 4}">selected="selected"</c:if>>增强字符串</option>
|
||||||
|
</select>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span class="child-label"><font color="red">*</font>MAAT表名:</span>
|
||||||
|
<span><input class="child-required form-control child-input" name="maatTable" value="${serviceConfigInfo.maatTable }"/></span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="child-label"><font color="red">*</font>表描述:</span>
|
||||||
|
<span><input class="child-required form-control child-input-desc" name="tableDesc" value="${serviceConfigInfo.tableDesc }"/></span>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-danger del-button" onclick="del(this)">删除</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</c:forEach>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-3 control-label"><font color="red">*</font>描述:</label>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<form:textarea path="serviceDesc" htmlEscape="false" class="required form-control"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-actions">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-offset-3 col-md-9">
|
||||||
|
<shiro:hasPermission name="system:service:edit"><input type="submit" class="btn btn-circle blue" value="保存"/></shiro:hasPermission>
|
||||||
|
<%-- <shiro:hasPermission name="system:service: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)">取消</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form:form>
|
||||||
|
<!-- END FORM-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -2,22 +2,36 @@
|
|||||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>系统业务类型管理</title>
|
<title>系统业务类型管理列表</title>
|
||||||
|
<link href="${pageContext.request.contextPath}/static/pages/css/systemService.css" rel="stylesheet" type="text/css"/>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<script>
|
<script>
|
||||||
function page(n,s){
|
function page(n,s){
|
||||||
if(n) $("#pageNo").val(n);
|
if(n) $("#pageNo").val(n);
|
||||||
if(s) $("#pageSize").val(s);
|
if(s) $("#pageSize").val(s);
|
||||||
$("#searchForm").attr("action","${ctx}/sysService/list");
|
$("#searchForm").attr("action","${ctx}/systemService/list");
|
||||||
$("#searchForm").submit();
|
$("#searchForm").submit();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deleteService(id) {
|
||||||
|
if (id) {
|
||||||
|
if (confirm("确认删除?")) {
|
||||||
|
$("#serviceId").val(id);
|
||||||
|
$("#searchForm").attr("action","${ctx}/systemService/delete");
|
||||||
|
$("#searchForm").submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
<div class="theme-panel hidden-xs hidden-sm">
|
<div class="theme-panel hidden-xs hidden-sm">
|
||||||
<button type="button" class="btn btn-default" onclick="page()">刷新</button>
|
<button type="button" class="btn btn-default" onclick="javascript:window.location='${ctx}/systemService/list'">刷新</button>
|
||||||
<button type="button" class="btn btn-primary" onClick="javascript:window.location='${ctx}/sysService/form'">新增</button>
|
<shiro:hasPermission name="system:service:view">
|
||||||
|
<button type="button" class="btn btn-primary" onClick="javascript:window.location='${ctx}/systemService/systemServiceform'">新增</button>
|
||||||
|
</shiro:hasPermission>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 class="page-title">
|
<h3 class="page-title">
|
||||||
@@ -33,33 +47,46 @@ function page(n,s){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="portlet-body">
|
<div class="portlet-body"">
|
||||||
<form:form id="searchForm" modelAttribute="systemServiceInfo" action="${ctx}/sysService/list" method="post">
|
<sys:message content="${message}"/>
|
||||||
|
<form:form id="searchForm" modelAttribute="systemServiceInfo" method="post">
|
||||||
<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="row" >
|
<input id="serviceId" name="id" type="hidden"/>
|
||||||
|
<div class="row search-table">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<span>动作 :</span>
|
<span class="search-item" class="input-small">
|
||||||
<form:select path="action">
|
<span>动作 :</span>
|
||||||
<form:option value="">请选择</form:option>
|
<form:select path="action">
|
||||||
<form:option value="1">阻断</form:option>
|
<form:option value="">请选择</form:option>
|
||||||
<form:option value="2">监测</form:option>
|
<form:option value="1">阻断</form:option>
|
||||||
<form:option value="5">封堵白名单</form:option>
|
<form:option value="2">监测</form:option>
|
||||||
<form:option value="6">监测白名单</form:option>
|
<form:option value="5">封堵白名单</form:option>
|
||||||
<form:option value="7">封堵监测白名单</form:option>
|
<form:option value="6">监测白名单</form:option>
|
||||||
<form:option value="8">灰名单</form:option>
|
<form:option value="7">封堵监测白名单</form:option>
|
||||||
</form:select>
|
<form:option value="8">灰名单</form:option>
|
||||||
<span>类型 :</span>
|
</form:select>
|
||||||
<form:select path="serviceType">
|
</span>
|
||||||
<form:option value="">请选择</form:option>
|
|
||||||
<form:option value="1">单域</form:option>
|
<span class="search-item" class="input-small">
|
||||||
<form:option value="2">多域</form:option>
|
<span>类型 :</span>
|
||||||
</form:select>
|
<form:select path="serviceType">
|
||||||
<span>名称 :</span>
|
<form:option value="">请选择</form:option>
|
||||||
<form:input path="serviceName" htmlEscape="false" class="input-small"/>
|
<form:option value="1">单域</form:option>
|
||||||
<button type="submit" onclick="return page();" class="btn btn-default btn-sm">
|
<form:option value="2">多域</form:option>
|
||||||
<i class="fa fa-edit"></i> 搜索
|
</form:select>
|
||||||
</button>
|
</span>
|
||||||
|
|
||||||
|
<span class="search-item">
|
||||||
|
<span>名称 :</span>
|
||||||
|
<form:input path="serviceName" htmlEscape="false" class="input-small"/>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span class="search-item">
|
||||||
|
<button type="submit" onclick="return page();" class="btn btn-default btn-sm">
|
||||||
|
<i class="fa fa-edit"></i> 搜索
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</form:form>
|
</form:form>
|
||||||
</div>
|
</div>
|
||||||
@@ -99,8 +126,10 @@ function page(n,s){
|
|||||||
<td><fmt:formatDate value="${ssi.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
<td><fmt:formatDate value="${ssi.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||||
<td>${ssi.serviceDesc }</td>
|
<td>${ssi.serviceDesc }</td>
|
||||||
<td>
|
<td>
|
||||||
<span><a>修改</a></span>
|
<shiro:hasPermission name="system:service:edit">
|
||||||
<span><a>删除</a></span>
|
<span><a href="${ctx }/systemService/systemServiceform?id=${ssi.id }">修改</a></span>
|
||||||
|
<span><a href="javascript:void(0)" onclick="deleteService('${ssi.id }')">删除</a></span>
|
||||||
|
</shiro:hasPermission>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|||||||
57
src/main/webapp/static/pages/css/systemService.css
Normal file
57
src/main/webapp/static/pages/css/systemService.css
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
/* global */
|
||||||
|
select, input {
|
||||||
|
border: 1px solid #c2cad8;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* list */
|
||||||
|
.search-table {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
.search-item {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
.search-item input, .search-item select {
|
||||||
|
height: 30px !important;
|
||||||
|
}
|
||||||
|
.search-item button {
|
||||||
|
margin-bottom:4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* form */
|
||||||
|
.child-input {
|
||||||
|
width: 160px !important;
|
||||||
|
display: inline !important;
|
||||||
|
margin: 6px 5px 6px 5px;
|
||||||
|
}
|
||||||
|
.child-input-desc {
|
||||||
|
width: 320px !important;
|
||||||
|
display: inline !important;
|
||||||
|
margin: 6px 5px 6px 5px;
|
||||||
|
}
|
||||||
|
.child-label {
|
||||||
|
text-align: right;
|
||||||
|
padding-top: 7px;
|
||||||
|
margin: 6px 5px 6px 5px;
|
||||||
|
}
|
||||||
|
.child-required {
|
||||||
|
color: #e02222;
|
||||||
|
font-size: 12px;
|
||||||
|
padding-left: 6px;
|
||||||
|
}
|
||||||
|
.datatable-index {
|
||||||
|
width: 14px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
#datatables select {
|
||||||
|
height: 34px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.del-button {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.table-list {
|
||||||
|
margin-top: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
background-color: #F8F8FF;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user