1.修改日志显示问题,后台打印请求路径2.增加页面标签显示code类
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
package com.nis.domain.dashboard.codedic;
|
||||
|
||||
public class CodeAppDic {
|
||||
private Integer id;
|
||||
|
||||
private String appName;
|
||||
|
||||
private String appNameZh;
|
||||
|
||||
private String viewCode;
|
||||
|
||||
private String icon;
|
||||
|
||||
private String behavior;
|
||||
|
||||
private Integer coreApp;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAppName() {
|
||||
return appName;
|
||||
}
|
||||
|
||||
public void setAppName(String appName) {
|
||||
this.appName = appName == null ? null : appName.trim();
|
||||
}
|
||||
|
||||
public String getAppNameZh() {
|
||||
return appNameZh;
|
||||
}
|
||||
|
||||
public void setAppNameZh(String appNameZh) {
|
||||
this.appNameZh = appNameZh == null ? null : appNameZh.trim();
|
||||
}
|
||||
|
||||
public String getViewCode() {
|
||||
return viewCode;
|
||||
}
|
||||
|
||||
public void setViewCode(String viewCode) {
|
||||
this.viewCode = viewCode == null ? null : viewCode.trim();
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon == null ? null : icon.trim();
|
||||
}
|
||||
|
||||
public String getBehavior() {
|
||||
return behavior;
|
||||
}
|
||||
|
||||
public void setBehavior(String behavior) {
|
||||
this.behavior = behavior == null ? null : behavior.trim();
|
||||
}
|
||||
|
||||
public Integer getCoreApp() {
|
||||
return coreApp;
|
||||
}
|
||||
|
||||
public void setCoreApp(Integer coreApp) {
|
||||
this.coreApp = coreApp;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.nis.domain.dashboard.codedic;
|
||||
|
||||
public class CodeBehaviorTypeDic {
|
||||
private Integer id;
|
||||
|
||||
private String behaviorType;
|
||||
|
||||
private String viewCode;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getBehaviorType() {
|
||||
return behaviorType;
|
||||
}
|
||||
|
||||
public void setBehaviorType(String behaviorType) {
|
||||
this.behaviorType = behaviorType == null ? null : behaviorType.trim();
|
||||
}
|
||||
|
||||
public String getViewCode() {
|
||||
return viewCode;
|
||||
}
|
||||
|
||||
public void setViewCode(String viewCode) {
|
||||
this.viewCode = viewCode == null ? null : viewCode.trim();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.nis.domain.dashboard.codedic;
|
||||
|
||||
public class CodeBrowserTypeDic {
|
||||
private Integer id;
|
||||
|
||||
private String browserType;
|
||||
|
||||
private String viewCode;
|
||||
|
||||
private String icon;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getBrowserType() {
|
||||
return browserType;
|
||||
}
|
||||
|
||||
public void setBrowserType(String browserType) {
|
||||
this.browserType = browserType == null ? null : browserType.trim();
|
||||
}
|
||||
|
||||
public String getViewCode() {
|
||||
return viewCode;
|
||||
}
|
||||
|
||||
public void setViewCode(String viewCode) {
|
||||
this.viewCode = viewCode == null ? null : viewCode.trim();
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon == null ? null : icon.trim();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.nis.domain.dashboard.codedic;
|
||||
|
||||
public class CodeOsTypeDic {
|
||||
private Integer id;
|
||||
|
||||
private String osType;
|
||||
|
||||
private String viewCode;
|
||||
|
||||
private String icon;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOsType() {
|
||||
return osType;
|
||||
}
|
||||
|
||||
public void setOsType(String osType) {
|
||||
this.osType = osType == null ? null : osType.trim();
|
||||
}
|
||||
|
||||
public String getViewCode() {
|
||||
return viewCode;
|
||||
}
|
||||
|
||||
public void setViewCode(String viewCode) {
|
||||
this.viewCode = viewCode == null ? null : viewCode.trim();
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon == null ? null : icon.trim();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.nis.domain.dashboard.codedic;
|
||||
|
||||
public class CodeProtocolTypeDic {
|
||||
private Integer id;
|
||||
|
||||
private String protocolType;
|
||||
|
||||
private String viewCode;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getProtocolType() {
|
||||
return protocolType;
|
||||
}
|
||||
|
||||
public void setProtocolType(String protocolType) {
|
||||
this.protocolType = protocolType == null ? null : protocolType.trim();
|
||||
}
|
||||
|
||||
public String getViewCode() {
|
||||
return viewCode;
|
||||
}
|
||||
|
||||
public void setViewCode(String viewCode) {
|
||||
this.viewCode = viewCode == null ? null : viewCode.trim();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.nis.domain.dashboard.codedic;
|
||||
|
||||
public class CodeServiceTypeDic {
|
||||
private Integer id;
|
||||
|
||||
private String serviceType;
|
||||
|
||||
private String viewCode;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getServiceType() {
|
||||
return serviceType;
|
||||
}
|
||||
|
||||
public void setServiceType(String serviceType) {
|
||||
this.serviceType = serviceType == null ? null : serviceType.trim();
|
||||
}
|
||||
|
||||
public String getViewCode() {
|
||||
return viewCode;
|
||||
}
|
||||
|
||||
public void setViewCode(String viewCode) {
|
||||
this.viewCode = viewCode == null ? null : viewCode.trim();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.nis.domain.dashboard.codedic;
|
||||
|
||||
public class CodeWebServiceDic {
|
||||
private Integer id;
|
||||
|
||||
private String website;
|
||||
|
||||
private String domainName;
|
||||
|
||||
private String viewCode;
|
||||
|
||||
private String icon;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getWebsite() {
|
||||
return website;
|
||||
}
|
||||
|
||||
public void setWebsite(String website) {
|
||||
this.website = website == null ? null : website.trim();
|
||||
}
|
||||
|
||||
public String getDomainName() {
|
||||
return domainName;
|
||||
}
|
||||
|
||||
public void setDomainName(String domainName) {
|
||||
this.domainName = domainName == null ? null : domainName.trim();
|
||||
}
|
||||
|
||||
public String getViewCode() {
|
||||
return viewCode;
|
||||
}
|
||||
|
||||
public void setViewCode(String viewCode) {
|
||||
this.viewCode = viewCode == null ? null : viewCode.trim();
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon == null ? null : icon.trim();
|
||||
}
|
||||
}
|
||||
163
src/main/java/com/nis/util/CodeDicUtils.java
Normal file
163
src/main/java/com/nis/util/CodeDicUtils.java
Normal file
@@ -0,0 +1,163 @@
|
||||
package com.nis.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.dashboard.codedic.CodeAppDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeBehaviorTypeDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeBrowserTypeDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeOsTypeDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeProtocolTypeDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeServiceTypeDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeWebServiceDic;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeAppDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeBehaviorTypeDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeBrowserTypeDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeOsTypeDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeProtocolTypeDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeResult;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeServiceTypeDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeWebServiceDicDao;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
@Service
|
||||
public class CodeDicUtils {
|
||||
private final static CodeAppDicDao codeAppDicDao = SpringContextHolder.getBean(CodeAppDicDao.class);
|
||||
private final static CodeBehaviorTypeDicDao codeBehaviorTypeDicDao = SpringContextHolder.getBean(CodeBehaviorTypeDicDao.class);
|
||||
private final static CodeBrowserTypeDicDao codeBrowserTypeDicDao = SpringContextHolder.getBean(CodeBrowserTypeDicDao.class);
|
||||
private final static CodeOsTypeDicDao codeOsTypeDicDao = SpringContextHolder.getBean(CodeOsTypeDicDao.class);
|
||||
private final static CodeProtocolTypeDicDao codeProtocolTypeDicDao = SpringContextHolder.getBean(CodeProtocolTypeDicDao.class);
|
||||
private final static CodeServiceTypeDicDao codeServiceTypeDicDao = SpringContextHolder.getBean(CodeServiceTypeDicDao.class);
|
||||
private final static CodeWebServiceDicDao codeWebServiceDicDao = SpringContextHolder.getBean(CodeWebServiceDicDao.class);
|
||||
|
||||
|
||||
private static final String APP_CODE="appCode";
|
||||
private static final String BEHAVIOR_CODE="behaviorCode";
|
||||
private static final String BROWSER_CODE="browserCode";
|
||||
private static final String OS_CODE="osCode";
|
||||
private static final String PROTOCOL_CODE="protocolCode";
|
||||
private static final String SERVICE_CODE="serviceCode";
|
||||
private static final String WEB_CODE="webCode";
|
||||
/**
|
||||
* 适用于大屏图表标签显示
|
||||
*/
|
||||
public static List<CodeResult> getCodeList(String name) {
|
||||
// List<SysMenu> menuList = (List<SysMenu>)getCache(CACHE_MENU_LIST);
|
||||
// if (menuList == null){
|
||||
// SysUser user = getUser();
|
||||
// if (user.isAdmin()){
|
||||
// menuList = sysMenuDao.findAllList(new SysMenu());
|
||||
// }else{
|
||||
// menuList = sysMenuDao.findSysMenuByUserId(user.getId());
|
||||
// }
|
||||
// putCache(CACHE_MENU_LIST, menuList);
|
||||
// }
|
||||
|
||||
List<CodeResult> result = new ArrayList<>();
|
||||
if (name.equals(APP_CODE)) {
|
||||
List<CodeAppDic> codeDicList = (List<CodeAppDic>) CacheUtils.get(APP_CODE);
|
||||
if(StringUtil.isEmpty(codeDicList)){
|
||||
codeDicList = codeAppDicDao.getCodeDicList();
|
||||
CacheUtils.put(APP_CODE,codeDicList);
|
||||
}
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
CodeResult codeResult = new CodeResult();
|
||||
codeResult.setItem(codeDicList.get(i).getAppName());
|
||||
codeResult.setCode(codeDicList.get(i).getViewCode());
|
||||
codeResult.setCoreApp(codeDicList.get(i).getCoreApp());
|
||||
result.add(codeResult);
|
||||
}
|
||||
return result;
|
||||
|
||||
} else if (name.equals(BEHAVIOR_CODE)) {
|
||||
List<CodeBehaviorTypeDic> codeDicList = (List<CodeBehaviorTypeDic>) CacheUtils.get(BEHAVIOR_CODE);
|
||||
if(StringUtil.isEmpty(codeDicList)){
|
||||
codeDicList = codeBehaviorTypeDicDao.getCodeDicList();
|
||||
CacheUtils.put(BEHAVIOR_CODE,codeDicList);
|
||||
}
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
CodeResult codeResult = new CodeResult();
|
||||
codeResult.setItem(codeDicList.get(i).getBehaviorType());
|
||||
codeResult.setCode(codeDicList.get(i).getViewCode());
|
||||
|
||||
result.add(codeResult);
|
||||
}
|
||||
return result;
|
||||
} else if (name.equals(BROWSER_CODE)) {
|
||||
List<CodeBrowserTypeDic> codeDicList = (List<CodeBrowserTypeDic>) CacheUtils.get(BROWSER_CODE);
|
||||
if(StringUtil.isEmpty(codeDicList)){
|
||||
codeDicList = codeBrowserTypeDicDao.getCodeDicList();
|
||||
CacheUtils.put(BROWSER_CODE, codeDicList);
|
||||
}
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
CodeResult codeResult = new CodeResult();
|
||||
codeResult.setItem(codeDicList.get(i).getBrowserType());
|
||||
codeResult.setCode(codeDicList.get(i).getViewCode());
|
||||
|
||||
result.add(codeResult);
|
||||
}
|
||||
return result;
|
||||
} else if (name.equals(OS_CODE)) {
|
||||
List<CodeOsTypeDic> codeDicList = (List<CodeOsTypeDic>) CacheUtils.get(OS_CODE);
|
||||
if(StringUtil.isEmpty(codeDicList)){
|
||||
codeDicList = codeOsTypeDicDao.getCodeDicList();
|
||||
CacheUtils.put(OS_CODE, codeDicList);
|
||||
}
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
CodeResult codeResult = new CodeResult();
|
||||
codeResult.setItem(codeDicList.get(i).getOsType());
|
||||
codeResult.setCode(codeDicList.get(i).getViewCode());
|
||||
|
||||
result.add(codeResult);
|
||||
}
|
||||
return result;
|
||||
} else if (name.equals(PROTOCOL_CODE)) {
|
||||
List<CodeProtocolTypeDic> codeDicList = (List<CodeProtocolTypeDic>) CacheUtils.get(PROTOCOL_CODE);
|
||||
if(StringUtil.isEmpty(codeDicList)){
|
||||
codeDicList = codeProtocolTypeDicDao.getCodeDicList();
|
||||
CacheUtils.put(PROTOCOL_CODE, codeDicList);
|
||||
}
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
CodeResult codeResult = new CodeResult();
|
||||
codeResult.setItem(codeDicList.get(i).getProtocolType());
|
||||
codeResult.setCode(codeDicList.get(i).getViewCode());
|
||||
|
||||
result.add(codeResult);
|
||||
}
|
||||
return result;
|
||||
} else if (name.equals(SERVICE_CODE)) {
|
||||
List<CodeServiceTypeDic> codeDicList = (List<CodeServiceTypeDic>) CacheUtils.get(SERVICE_CODE);
|
||||
if(StringUtil.isEmpty(codeDicList)){
|
||||
codeDicList = codeServiceTypeDicDao.getCodeDicList();
|
||||
CacheUtils.put(SERVICE_CODE, codeDicList);
|
||||
}
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
CodeResult codeResult = new CodeResult();
|
||||
codeResult.setItem(codeDicList.get(i).getServiceType());
|
||||
codeResult.setCode(codeDicList.get(i).getViewCode());
|
||||
|
||||
result.add(codeResult);
|
||||
}
|
||||
return result;
|
||||
} else if (name.equals(WEB_CODE)) {
|
||||
List<CodeWebServiceDic> codeDicList = (List<CodeWebServiceDic>) CacheUtils.get(WEB_CODE);
|
||||
if(StringUtil.isEmpty(codeDicList)){
|
||||
codeDicList = codeWebServiceDicDao.getCodeDicList();
|
||||
CacheUtils.put(WEB_CODE, codeDicList);
|
||||
}
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
CodeResult codeResult = new CodeResult();
|
||||
codeResult.setItem(codeDicList.get(i).getWebsite());
|
||||
codeResult.setCode(codeDicList.get(i).getViewCode());
|
||||
|
||||
result.add(codeResult);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
getCodeList(APP_CODE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,7 @@ package com.nis.util.httpclient;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -137,7 +138,9 @@ public class HttpClientUtil {
|
||||
}
|
||||
HttpGet request = new HttpGet(uriBuilder.build());
|
||||
request.setConfig(requestConfig);
|
||||
|
||||
URI uri = request.getURI();
|
||||
logger.info(uri);
|
||||
System.err.println(uri);
|
||||
response = getHttpClient().execute(request);
|
||||
int status = response.getStatusLine().getStatusCode();
|
||||
if (status == HttpStatus.SC_OK) {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.nis.web.dao.dashboard.codedic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.dashboard.codedic.CodeAppDic;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface CodeAppDicDao {
|
||||
List<CodeAppDic> getCodeDicList();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?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.dashboard.codedic.CodeAppDicDao">
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.dashboard.codedic.CodeAppDic">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="app_name" jdbcType="VARCHAR" property="appName" />
|
||||
<result column="app_name_zh" jdbcType="VARCHAR" property="appNameZh" />
|
||||
<result column="view_code" jdbcType="VARCHAR" property="viewCode" />
|
||||
<result column="icon" jdbcType="VARCHAR" property="icon" />
|
||||
<result column="behavior" jdbcType="VARCHAR" property="behavior" />
|
||||
<result column="core_app" jdbcType="INTEGER" property="coreApp" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, app_name, app_name_zh, view_code, icon, behavior, core_app
|
||||
</sql>
|
||||
<select id="getCodeDicList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from code_app_dic
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.nis.web.dao.dashboard.codedic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.dashboard.codedic.CodeBehaviorTypeDic;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface CodeBehaviorTypeDicDao {
|
||||
List<CodeBehaviorTypeDic> getCodeDicList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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.dashboard.codedic.CodeBehaviorTypeDicDao">
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.dashboard.codedic.CodeBehaviorTypeDic">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="behavior_type" jdbcType="VARCHAR" property="behaviorType" />
|
||||
<result column="view_code" jdbcType="VARCHAR" property="viewCode" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, behavior_type, view_code
|
||||
</sql>
|
||||
<select id="getCodeDicList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from code_behavior_type_dic
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.nis.web.dao.dashboard.codedic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.dashboard.codedic.CodeBrowserTypeDic;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface CodeBrowserTypeDicDao {
|
||||
List<CodeBrowserTypeDic> getCodeDicList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?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.dashboard.codedic.CodeBrowserTypeDicDao">
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.dashboard.codedic.CodeBrowserTypeDic">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="browser_type" jdbcType="VARCHAR" property="browserType" />
|
||||
<result column="view_code" jdbcType="VARCHAR" property="viewCode" />
|
||||
<result column="icon" jdbcType="VARCHAR" property="icon" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, browser_type, view_code, icon
|
||||
</sql>
|
||||
<select id="getCodeDicList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from code_browser_type_dic
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.nis.web.dao.dashboard.codedic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.dashboard.codedic.CodeOsTypeDic;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface CodeOsTypeDicDao {
|
||||
List<CodeOsTypeDic> getCodeDicList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?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.dashboard.codedic.CodeOsTypeDicDao">
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.dashboard.codedic.CodeOsTypeDic">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="os_type" jdbcType="VARCHAR" property="osType" />
|
||||
<result column="view_code" jdbcType="VARCHAR" property="viewCode" />
|
||||
<result column="icon" jdbcType="VARCHAR" property="icon" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, os_type, view_code, icon
|
||||
</sql>
|
||||
<select id="getCodeDicList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from code_os_type_dic
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.nis.web.dao.dashboard.codedic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.dashboard.codedic.CodeProtocolTypeDic;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface CodeProtocolTypeDicDao {
|
||||
List<CodeProtocolTypeDic> getCodeDicList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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.dashboard.codedic.CodeProtocolTypeDicDao">
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.dashboard.codedic.CodeProtocolTypeDic">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="protocol_type" jdbcType="VARCHAR" property="protocolType" />
|
||||
<result column="view_code" jdbcType="VARCHAR" property="viewCode" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, protocol_type, view_code
|
||||
</sql>
|
||||
<select id="getCodeDicList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from code_protocol_type_dic
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.nis.web.dao.dashboard.codedic;
|
||||
|
||||
public class CodeResult {
|
||||
|
||||
private String item;
|
||||
private String code;
|
||||
private Integer coreApp;
|
||||
|
||||
public String getItem() {
|
||||
return item;
|
||||
}
|
||||
public void setItem(String item) {
|
||||
this.item = item;
|
||||
}
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
public Integer getCoreApp() {
|
||||
return coreApp;
|
||||
}
|
||||
public void setCoreApp(Integer coreApp) {
|
||||
this.coreApp = coreApp;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.nis.web.dao.dashboard.codedic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.dashboard.codedic.CodeServiceTypeDic;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface CodeServiceTypeDicDao {
|
||||
List<CodeServiceTypeDic> getCodeDicList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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.dashboard.codedic.CodeServiceTypeDicDao">
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.dashboard.codedic.CodeServiceTypeDic">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="service_type" jdbcType="VARCHAR" property="serviceType" />
|
||||
<result column="view_code" jdbcType="VARCHAR" property="viewCode" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, service_type, view_code
|
||||
</sql>
|
||||
<select id="getCodeDicList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from code_service_type_dic
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.nis.web.dao.dashboard.codedic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.dashboard.codedic.CodeWebServiceDic;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface CodeWebServiceDicDao {
|
||||
List<CodeWebServiceDic> getCodeDicList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?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.dashboard.codedic.CodeWebServiceDicDao">
|
||||
<resultMap id="BaseResultMap" type="com.nis.domain.dashboard.codedic.CodeWebServiceDic">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="website" jdbcType="VARCHAR" property="website" />
|
||||
<result column="domain_name" jdbcType="VARCHAR" property="domainName" />
|
||||
<result column="view_code" jdbcType="VARCHAR" property="viewCode" />
|
||||
<result column="icon" jdbcType="VARCHAR" property="icon" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, website, domain_name, view_code, icon
|
||||
</sql>
|
||||
<select id="getCodeDicList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from code_web_service_dic
|
||||
</select>
|
||||
</mapper>
|
||||
130
src/main/java/com/nis/web/service/log/CodeDicService.java
Normal file
130
src/main/java/com/nis/web/service/log/CodeDicService.java
Normal file
@@ -0,0 +1,130 @@
|
||||
package com.nis.web.service.log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.dashboard.codedic.CodeAppDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeBehaviorTypeDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeBrowserTypeDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeOsTypeDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeProtocolTypeDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeServiceTypeDic;
|
||||
import com.nis.domain.dashboard.codedic.CodeWebServiceDic;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeAppDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeBehaviorTypeDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeBrowserTypeDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeOsTypeDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeProtocolTypeDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeResult;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeServiceTypeDicDao;
|
||||
import com.nis.web.dao.dashboard.codedic.CodeWebServiceDicDao;
|
||||
@Service
|
||||
public class CodeDicService {
|
||||
@Autowired
|
||||
private static CodeAppDicDao codeAppDicDao;
|
||||
@Autowired
|
||||
private static CodeBehaviorTypeDicDao codeBehaviorTypeDicDao;
|
||||
@Autowired
|
||||
private static CodeBrowserTypeDicDao codeBrowserTypeDicDao;
|
||||
@Autowired
|
||||
private static CodeOsTypeDicDao codeOsTypeDicDao;
|
||||
@Autowired
|
||||
private static CodeProtocolTypeDicDao codeProtocolTypeDicDao;
|
||||
@Autowired
|
||||
private static CodeServiceTypeDicDao codeServiceTypeDicDao;
|
||||
@Autowired
|
||||
private static CodeWebServiceDicDao codeWebServiceDicDao;
|
||||
|
||||
|
||||
private static final String APP_CODE="appCode";
|
||||
private static final String BEHAVIOR_CODE="behaviorCode";
|
||||
private static final String BROWSER_CODE="browserCode";
|
||||
private static final String OS_CODE="osCode";
|
||||
private static final String PROTOCOL_CODE="protocolCode";
|
||||
private static final String SERVICE_CODE="serviceCode";
|
||||
private static final String WEB_CODE="webCode";
|
||||
/**
|
||||
* 适用于大屏图表标签显示
|
||||
*/
|
||||
public static List<CodeResult> getCodeList(String name) {
|
||||
List<CodeResult> result = new ArrayList<>();
|
||||
if (name.equals(APP_CODE)) {
|
||||
List<CodeAppDic> codeDicList = codeAppDicDao.getCodeDicList();
|
||||
CodeResult codeResult = new CodeResult();
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
codeResult.setItem(codeDicList.get(i).getAppName());
|
||||
codeResult.setCode(codeDicList.get(i).getViewCode());
|
||||
codeResult.setCoreApp(codeDicList.get(i).getCoreApp());
|
||||
result.add(codeResult);
|
||||
}
|
||||
return result;
|
||||
|
||||
} else if (name.equals(BEHAVIOR_CODE)) {
|
||||
List<CodeBehaviorTypeDic> codeDicList = codeBehaviorTypeDicDao.getCodeDicList();
|
||||
CodeResult codeResult = new CodeResult();
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
codeResult.setItem(codeDicList.get(i).getBehaviorType());
|
||||
codeResult.setCode(codeDicList.get(i).getViewCode());
|
||||
|
||||
result.add(codeResult);
|
||||
}
|
||||
return result;
|
||||
} else if (name.equals(BROWSER_CODE)) {
|
||||
List<CodeBrowserTypeDic> codeDicList = codeBrowserTypeDicDao.getCodeDicList();
|
||||
CodeResult codeResult = new CodeResult();
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
codeResult.setItem(codeDicList.get(i).getBrowserType());
|
||||
codeResult.setCode(codeDicList.get(i).getViewCode());
|
||||
|
||||
result.add(codeResult);
|
||||
}
|
||||
return result;
|
||||
} else if (name.equals(OS_CODE)) {
|
||||
List<CodeOsTypeDic> codeDicList = codeOsTypeDicDao.getCodeDicList();
|
||||
CodeResult codeResult = new CodeResult();
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
codeResult.setItem(codeDicList.get(i).getOsType());
|
||||
codeResult.setCode(codeDicList.get(i).getViewCode());
|
||||
|
||||
result.add(codeResult);
|
||||
}
|
||||
return result;
|
||||
} else if (name.equals(PROTOCOL_CODE)) {
|
||||
List<CodeProtocolTypeDic> codeDicList = codeProtocolTypeDicDao.getCodeDicList();
|
||||
CodeResult codeResult = new CodeResult();
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
codeResult.setItem(codeDicList.get(i).getProtocolType());
|
||||
codeResult.setCode(codeDicList.get(i).getViewCode());
|
||||
|
||||
result.add(codeResult);
|
||||
}
|
||||
return result;
|
||||
} else if (name.equals(SERVICE_CODE)) {
|
||||
List<CodeServiceTypeDic> codeDicList = codeServiceTypeDicDao.getCodeDicList();
|
||||
CodeResult codeResult = new CodeResult();
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
codeResult.setItem(codeDicList.get(i).getServiceType());
|
||||
codeResult.setCode(codeDicList.get(i).getViewCode());
|
||||
|
||||
result.add(codeResult);
|
||||
}
|
||||
return result;
|
||||
} else if (name.equals(WEB_CODE)) {
|
||||
List<CodeWebServiceDic> codeDicList = codeWebServiceDicDao.getCodeDicList();
|
||||
CodeResult codeResult = new CodeResult();
|
||||
for (int i = 0; i < codeDicList.size(); i++) {
|
||||
codeResult.setItem(codeDicList.get(i).getWebsite());
|
||||
codeResult.setCode(codeDicList.get(i).getViewCode());
|
||||
|
||||
result.add(codeResult);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
getCodeList(APP_CODE);
|
||||
}
|
||||
}
|
||||
@@ -241,11 +241,7 @@
|
||||
<td>${_log.sPort }</td>
|
||||
<td>${_log.dIp }</td>
|
||||
<td>${_log.dPort }</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="logProtocol">
|
||||
<c:if test="${logProtocol.itemCode eq _log.transProto}">${logProtocol.itemValue}</c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>${_log.transProto }</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('ENTRANCE')}" var="entrance">
|
||||
<c:if test="${entrance.itemCode eq _log.entranceId}"><spring:message code="${entrance.itemValue}"/></c:if>
|
||||
|
||||
@@ -173,7 +173,7 @@ $(document).ready(function(){
|
||||
<th><spring:message code='recv_time'/></th>
|
||||
<th><spring:message code='protocol'/></th>
|
||||
<th><spring:message code='addr_type'/></th>
|
||||
<th><spring:message code='serverIp'/></th>
|
||||
<th><spring:message code='serverip'/></th>
|
||||
<th><spring:message code='clientip'/></th>
|
||||
<th><spring:message code='serverport'/></th>
|
||||
<th><spring:message code='clientport'/></th>
|
||||
@@ -202,11 +202,7 @@ $(document).ready(function(){
|
||||
</td>
|
||||
<td>${log.foundTime}</td>
|
||||
<td>${log.recvTime}</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="dic">
|
||||
<c:if test="${log.transProto==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>${log.transProto}</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="dic">
|
||||
<c:if test="${log.addrType==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||
|
||||
@@ -207,11 +207,7 @@
|
||||
<td>${_log.sPort }</td>
|
||||
<td>${_log.dIp }</td>
|
||||
<td>${_log.dPort }</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="logProtocol">
|
||||
<c:if test="${logProtocol.itemCode eq _log.transProto}">${logProtocol.itemValue}</c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>${_log.transProto }</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('ENTRANCE')}" var="entrance">
|
||||
<c:if test="${entrance.itemCode eq _log.entranceId}"><spring:message code="${entrance.itemValue}"/></c:if>
|
||||
|
||||
@@ -192,11 +192,7 @@
|
||||
<td>${_log.sPort }</td>
|
||||
<td>${_log.dIp }</td>
|
||||
<td>${_log.dPort }</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="logProtocol">
|
||||
<c:if test="${logProtocol.itemCode eq _log.transProto}">${logProtocol.itemValue}</c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>${_log.transProto }</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('ENTRANCE')}" var="entrance">
|
||||
<c:if test="${entrance.itemCode eq _log.entranceId}"><spring:message code="${entrance.itemValue}"/></c:if>
|
||||
|
||||
@@ -196,11 +196,7 @@ $(document).ready(function(){
|
||||
</td>
|
||||
<td>${log.foundTime}</td>
|
||||
<td>${log.recvTime}</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="dic">
|
||||
<c:if test="${log.transProto==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>${log.transProto}</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="dic">
|
||||
<c:if test="${log.addrType==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||
|
||||
@@ -204,11 +204,7 @@ $(document).ready(function(){
|
||||
</td>
|
||||
<td>${log.foundTime}</td>
|
||||
<td>${log.recvTime}</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="dic">
|
||||
<c:if test="${log.transProto==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>${log.transProto}</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="dic">
|
||||
<c:if test="${log.addrType==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||
|
||||
@@ -206,11 +206,7 @@ $(document).ready(function(){
|
||||
</td>
|
||||
<td>${log.foundTime}</td>
|
||||
<td>${log.recvTime}</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('LOG_PROTOCOL')}" var="dic">
|
||||
<c:if test="${log.transProto==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>${log.transProto}</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="dic">
|
||||
<c:if test="${log.addrType==dic.itemCode}"><spring:message code="${dic.itemValue }"/></c:if>
|
||||
|
||||
Reference in New Issue
Block a user