系统业务类型管理列表展示(待完善)
This commit is contained in:
25
pom.xml
25
pom.xml
@@ -494,6 +494,12 @@
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxws</artifactId>
|
||||
<version>3.1.4</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>asm</artifactId>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -591,6 +597,18 @@
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>jsp-2.1</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>asm</artifactId>
|
||||
<groupId>asm</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>asm-tree</artifactId>
|
||||
<groupId>asm</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>asm-commons</artifactId>
|
||||
<groupId>asm</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -610,6 +628,13 @@
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cglib</groupId>
|
||||
<artifactId>cglib</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
||||
75
src/main/java/com/nis/domain/ServiceConfigInfo.java
Normal file
75
src/main/java/com/nis/domain/ServiceConfigInfo.java
Normal file
@@ -0,0 +1,75 @@
|
||||
package com.nis.domain;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
public class ServiceConfigInfo {
|
||||
|
||||
private Long id;
|
||||
private String tableName;//配置表名
|
||||
private String tableDesc;//表描述
|
||||
private Integer tableType;//表类型 1:ip类配置表;2:字符串类配置表;3:数值类配置表;4:增强字符串配置表;
|
||||
private String maatTable;//maat中对应的表名
|
||||
private Integer serviceId;//业务id,对应SystemServiceInfo.serviceId
|
||||
private Integer isValid;//有效标识 0:无效;1:有效;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
public String getTableDesc() {
|
||||
return tableDesc;
|
||||
}
|
||||
public void setTableDesc(String tableDesc) {
|
||||
this.tableDesc = tableDesc;
|
||||
}
|
||||
public Integer getTableType() {
|
||||
return tableType;
|
||||
}
|
||||
public void setTableType(Integer tableType) {
|
||||
this.tableType = tableType;
|
||||
}
|
||||
public String getMaatTable() {
|
||||
return maatTable;
|
||||
}
|
||||
public void setMaatTable(String maatTable) {
|
||||
this.maatTable = maatTable;
|
||||
}
|
||||
public Integer getServiceId() {
|
||||
return serviceId;
|
||||
}
|
||||
public void setServiceId(Integer serviceId) {
|
||||
this.serviceId = serviceId;
|
||||
}
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.toJson();
|
||||
}
|
||||
|
||||
public String toJson() {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
|
||||
try {
|
||||
return mapper.writeValueAsString(this);
|
||||
} catch (JsonProcessingException e) {
|
||||
return e.getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
108
src/main/java/com/nis/domain/SystemServiceInfo.java
Normal file
108
src/main/java/com/nis/domain/SystemServiceInfo.java
Normal file
@@ -0,0 +1,108 @@
|
||||
package com.nis.domain;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
public class SystemServiceInfo extends BaseEntity<SystemServiceInfo> {
|
||||
|
||||
private static final long serialVersionUID = -8919580011013718190L;
|
||||
|
||||
private Integer serviceId;//业务id
|
||||
private String serviceName;//业务名称
|
||||
private String serviceDesc;//业务描述
|
||||
private Integer action;//业务动作 1:阻断;2:监测;5:FD白名单;6:监测白名单;7:FD监测白名单;8:灰名单;
|
||||
private Integer isValid;//有效标识 0:无效;1:有效;
|
||||
private Integer serviceType;//业务类型 1:常规(单域)业务配置;2:多域业务配置;
|
||||
private SysUser creator;
|
||||
private Date createTime;
|
||||
private SysUser editor;
|
||||
private Date editTime;
|
||||
private List<ServiceConfigInfo> serviceConfigInfoList;//业务配置表
|
||||
|
||||
public Integer getServiceId() {
|
||||
return serviceId;
|
||||
}
|
||||
public void setServiceId(Integer serviceId) {
|
||||
this.serviceId = serviceId;
|
||||
}
|
||||
public String getServiceName() {
|
||||
return serviceName;
|
||||
}
|
||||
public void setServiceName(String serviceName) {
|
||||
this.serviceName = serviceName;
|
||||
}
|
||||
public String getServiceDesc() {
|
||||
return serviceDesc;
|
||||
}
|
||||
public void setServiceDesc(String serviceDesc) {
|
||||
this.serviceDesc = serviceDesc;
|
||||
}
|
||||
public Integer getAction() {
|
||||
return action;
|
||||
}
|
||||
public void setAction(Integer action) {
|
||||
this.action = action;
|
||||
}
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
public Integer getServiceType() {
|
||||
return serviceType;
|
||||
}
|
||||
public void setServiceType(Integer serviceType) {
|
||||
this.serviceType = serviceType;
|
||||
}
|
||||
public SysUser getCreator() {
|
||||
return creator;
|
||||
}
|
||||
public void setCreator(SysUser creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
public SysUser getEditor() {
|
||||
return editor;
|
||||
}
|
||||
public void setEditor(SysUser editor) {
|
||||
this.editor = editor;
|
||||
}
|
||||
public Date getEditTime() {
|
||||
return editTime;
|
||||
}
|
||||
public void setEditTime(Date editTime) {
|
||||
this.editTime = editTime;
|
||||
}
|
||||
|
||||
public List<ServiceConfigInfo> getServiceConfigInfoList() {
|
||||
return serviceConfigInfoList;
|
||||
}
|
||||
public void setServiceConfigInfoList(List<ServiceConfigInfo> serviceConfigInfoList) {
|
||||
this.serviceConfigInfoList = serviceConfigInfoList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.toJson();
|
||||
}
|
||||
|
||||
public String toJson() {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
|
||||
try {
|
||||
return mapper.writeValueAsString(this);
|
||||
} catch (JsonProcessingException e) {
|
||||
return e.getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,7 @@ import com.nis.web.service.configuration.MediaCfgService;
|
||||
import com.nis.web.service.configuration.SslCfgService;
|
||||
import com.nis.web.service.configuration.TunnelCfgService;
|
||||
import com.nis.web.service.configuration.WebCfgService;
|
||||
import com.nis.web.service.systemService.SystemServiceService;
|
||||
|
||||
public class BaseController {
|
||||
|
||||
@@ -88,6 +89,9 @@ public class BaseController {
|
||||
@Autowired
|
||||
protected AppCfgService appCfgService;
|
||||
|
||||
@Autowired
|
||||
protected SystemServiceService systemServiceService;
|
||||
|
||||
protected final Logger logger = Logger.getLogger(this.getClass());
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.nis.web.controller.systemService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SystemServiceInfo;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/sysService")
|
||||
public class SystemServiceController extends BaseController {
|
||||
|
||||
@RequestMapping(value = "list")
|
||||
public String list(Model model, SystemServiceInfo systemServiceInfo, HttpServletRequest request, HttpServletResponse response) {
|
||||
Page<SystemServiceInfo> page = systemServiceService.findPage(new Page<SystemServiceInfo>(request, response, 1), systemServiceInfo);
|
||||
model.addAttribute("page", page);
|
||||
return "/systemService/list";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "form")
|
||||
public String detail(Model model, SystemServiceInfo systemServiceInfo) {
|
||||
return "/sysService/form";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "save")
|
||||
public String save(Model model, SystemServiceInfo systemServiceInfo) {
|
||||
systemServiceInfo = systemServiceService.get(systemServiceInfo);
|
||||
model.addAttribute("systemServiceInfo", systemServiceInfo);
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?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" >
|
||||
<mapper namespace="com.nis.web.dao.systemService.ServiceConfigInfoDao" >
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.nis.web.dao.systemService;
|
||||
|
||||
public interface ServiceConfigInfoDao {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.nis.web.dao.systemService;
|
||||
|
||||
import com.nis.domain.SystemServiceInfo;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface SystemServiceInfoDao extends CrudDao<SystemServiceInfo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
<?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" >
|
||||
<mapper namespace="com.nis.web.dao.systemService.SystemServiceInfoDao">
|
||||
|
||||
<resultMap id="systemServiceInfoMap" type="com.nis.domain.SystemServiceInfo">
|
||||
<id column="id" property="id"/>
|
||||
<result column="service_id" property="serviceId"/>
|
||||
<result column="service_name" property="serviceName"/>
|
||||
<result column="service_desc" property="serviceDesc"/>
|
||||
<result column="action" property="action"/>
|
||||
<result column="is_valid" property="isValid"/>
|
||||
<result column="service_type" property="serviceType"/>
|
||||
<result column="creator_id" property="creator.id"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="editor_id" property="editor.id"/>
|
||||
<result column="edit_time" property="editTime"/>
|
||||
<collection property="serviceConfigInfoList" column="{service_id=service_id}" select="findSysServiceConfigInfo"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="findList" resultMap="systemServiceInfoMap" parameterType="systemServiceInfo">
|
||||
select
|
||||
ssi.id,
|
||||
ssi.service_id,
|
||||
ssi.service_name,
|
||||
ssi.service_desc,
|
||||
ssi.action,
|
||||
ssi.is_valid,
|
||||
ssi.service_type,
|
||||
ssi.creator_id as "creator.id",
|
||||
suc.login_id as "creator.loginId",
|
||||
suc.name as "creator.name",
|
||||
ssi.create_time,
|
||||
ssi.editor_id as "editor.id",
|
||||
sue.login_id as "editor.login_id",
|
||||
sue.name as "editor.name",
|
||||
ssi.edit_time
|
||||
from system_service_info ssi
|
||||
left join sys_user suc on suc.id=ssi.creator_id
|
||||
left join sys_user sue on sue.id=ssi.editor_id
|
||||
where 1=1
|
||||
<if test="serviceName != null and serviceName != ''">
|
||||
and ssi.service_name like CONCAT('%', #{serviceName}, '%')
|
||||
</if>
|
||||
<if test="action != null">
|
||||
and ssi.action=#{action}
|
||||
</if>
|
||||
<if test="serviceType != null">
|
||||
and ssi.service_type=#{serviceType}
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
and ssi.is_valid=#{isValid}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="get">
|
||||
select
|
||||
ssi.id,
|
||||
ssi.service_id,
|
||||
ssi.service_name,
|
||||
ssi.service_desc,
|
||||
ssi.action,
|
||||
ssi.is_valid,
|
||||
ssi.service_type,
|
||||
ssi.creator_id as "creator.id",
|
||||
suc.login_id as "creator.login_id",
|
||||
suc.name as "creator.name",
|
||||
ssi.create_time,
|
||||
ssi.editor_id as "editor.id",
|
||||
sue.login_id as "editor.login_id",
|
||||
sue.name as "editor.name",
|
||||
ssi.edit_time
|
||||
from system_service_info ssi
|
||||
left join sys_user suc on suc.id=ssi.creator_id
|
||||
left join sys_user sue on sue.id=ssi.editor_id
|
||||
where ssi.id=#{id}
|
||||
</select>
|
||||
|
||||
<select id="findSysServiceConfigInfo" resultType="serviceConfigInfo">
|
||||
select
|
||||
id,
|
||||
table_name,
|
||||
table_desc,
|
||||
table_type,
|
||||
maat_table,
|
||||
service_id,
|
||||
is_valid
|
||||
from
|
||||
service_config_info
|
||||
where
|
||||
service_id=#{service_id} and is_valid=1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.nis.web.service.systemService;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.SystemServiceInfo;
|
||||
import com.nis.web.dao.systemService.SystemServiceInfoDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
@Service
|
||||
public class SystemServiceService extends CrudService<SystemServiceInfoDao, SystemServiceInfo>{
|
||||
|
||||
}
|
||||
116
src/main/webapp/WEB-INF/views/systemService/list.jsp
Normal file
116
src/main/webapp/WEB-INF/views/systemService/list.jsp
Normal file
@@ -0,0 +1,116 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title>系统业务类型管理</title>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
function page(n,s){
|
||||
if(n) $("#pageNo").val(n);
|
||||
if(s) $("#pageSize").val(s);
|
||||
$("#searchForm").attr("action","${ctx}/sysService/list");
|
||||
$("#searchForm").submit();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<button type="button" class="btn btn-default" onclick="page()">刷新</button>
|
||||
<button type="button" class="btn btn-primary" onClick="javascript:window.location='${ctx}/sysService/form'">新增</button>
|
||||
</div>
|
||||
|
||||
<h3 class="page-title">
|
||||
业务管理
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-cogs"></i>业务列表
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<form:form id="searchForm" modelAttribute="systemServiceInfo" action="${ctx}/sysService/list" method="post">
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo }"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize }"/>
|
||||
<div class="row" >
|
||||
<div class="col-md-12">
|
||||
动作:
|
||||
<form:select path="action">
|
||||
<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>
|
||||
类型:
|
||||
<form:select path="serviceType">
|
||||
<form:option value="">请选择</form:option>
|
||||
<form:option value="1">单域</form:option>
|
||||
<form:option value="2">多域</form:option>
|
||||
</form:select>
|
||||
名称:<form:input path="serviceName" htmlEscape="false" class="input-small"/>
|
||||
<button type="submit" onclick="return page();" class="btn btn-default btn-sm">
|
||||
<i class="fa fa-edit"></i> 搜索
|
||||
</button>
|
||||
</div>
|
||||
</form:form>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>业务名称</th>
|
||||
<th style="width:8%">业务ID</th>
|
||||
<th>动作</th>
|
||||
<th>类型</th>
|
||||
<th>创建人</th>
|
||||
<th style="width:15%">创建时间</th>
|
||||
<th>描述</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list }" var="ssi">
|
||||
<tr>
|
||||
<td>${ssi.serviceName }</td>
|
||||
<td>${ssi.serviceId }</d>
|
||||
<td>
|
||||
<c:if test="${1 eq ssi.action }">阻断</c:if>
|
||||
<c:if test="${2 eq ssi.action }">监测</c:if>
|
||||
<c:if test="${5 eq ssi.action }">封堵白名单</c:if>
|
||||
<c:if test="${6 eq ssi.action }">监测白名单</c:if>
|
||||
<c:if test="${7 eq ssi.action }">封堵监测白名单</c:if>
|
||||
<c:if test="${8 eq ssi.action }">灰名单</c:if>
|
||||
</td>
|
||||
<td>
|
||||
<c:if test="${1 eq ssi.serviceType }">单域</c:if>
|
||||
<c:if test="${2 eq ssi.serviceType }">多域</c:if>
|
||||
</td>
|
||||
<td>${ssi.creator.loginId }</td>
|
||||
<td><fmt:formatDate value="${ssi.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${ssi.serviceDesc }</td>
|
||||
<td>
|
||||
<span><a>修改</a></span>
|
||||
<span><a>删除</a></span>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user