用户管理模块
1、数据新增事务回滚提交处理 2、页面必填样式错位优化 3、cgi接口相关国际化添加 app协议导出字段调整
This commit is contained in:
@@ -49,7 +49,6 @@ public class AppPolicyCfg extends BaseCfg<AppPolicyCfg> {
|
|||||||
@ExcelField(title="ratelimit",dictType="APP_RATE_LIMIT",sort=3)
|
@ExcelField(title="ratelimit",dictType="APP_RATE_LIMIT",sort=3)
|
||||||
private String userRegion2;
|
private String userRegion2;
|
||||||
private String userRegion3;
|
private String userRegion3;
|
||||||
@ExcelField(title="block_by_app_server_ip",dictType="SYS_YES_NO",sort=4)
|
|
||||||
private String userRegion4;
|
private String userRegion4;
|
||||||
private String userRegion5;
|
private String userRegion5;
|
||||||
private String configType;
|
private String configType;
|
||||||
|
|||||||
@@ -50,9 +50,22 @@ public class UserManage extends BaseEntity<UserManage>{
|
|||||||
private String seltype;
|
private String seltype;
|
||||||
private Integer functionId;
|
private Integer functionId;
|
||||||
private String isAudit;
|
private String isAudit;
|
||||||
|
private String cgiError;
|
||||||
|
private String errorType;
|
||||||
|
|
||||||
|
|
||||||
|
public String getErrorType() {
|
||||||
|
return errorType;
|
||||||
|
}
|
||||||
|
public void setErrorType(String errorType) {
|
||||||
|
this.errorType = errorType;
|
||||||
|
}
|
||||||
|
public String getCgiError() {
|
||||||
|
return cgiError;
|
||||||
|
}
|
||||||
|
public void setCgiError(String cgiError) {
|
||||||
|
this.cgiError = cgiError;
|
||||||
|
}
|
||||||
public String getUserType() {
|
public String getUserType() {
|
||||||
return userType;
|
return userType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -400,14 +400,14 @@ public class HttpClientUtil {
|
|||||||
//获取响应结果
|
//获取响应结果
|
||||||
Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON);
|
Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON);
|
||||||
response= header.get();
|
response= header.get();
|
||||||
int status = response.getStatus();
|
|
||||||
result= response.readEntity(String.class);
|
result= response.readEntity(String.class);
|
||||||
|
//调用处理数据方法
|
||||||
logger.info("获取消息成功,相应内容如下: " + result);
|
logger.info("获取消息成功,相应内容如下: " + result);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("获取消息失败,相应内容如下: " + result);
|
logger.error("获取消息失败,相应内容如下: " + result);
|
||||||
logger.error("获取消息失败 ", e);
|
logger.error("获取消息失败 ", e);
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:");
|
throw new MaatConvertException("<spring:message code=\"cgi_service_failed\"/>:");
|
||||||
}finally {
|
}finally {
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
response.close();
|
response.close();
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ public class BasicProtocolController extends BaseController {
|
|||||||
classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class);
|
classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class);
|
||||||
classMap.put("NTC_IP", IpPortCfg.class);
|
classMap.put("NTC_IP", IpPortCfg.class);
|
||||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||||
String cfgIndexInfoNoExport=",ratelimit,block_by_app_server_ip,encrypted_tunnel_behavior,behaviour_type,social_app,behaviour_type,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
String cfgIndexInfoNoExport=",encrypted_tunnel_behavior,behaviour_type,social_app,behaviour_type,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
+",letter,whether_area_block,classification,attribute,label"
|
+",letter,whether_area_block,classification,attribute,label"
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class);
|
classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class);
|
||||||
classMap.put("NTC_IP", IpPortCfg.class);
|
classMap.put("NTC_IP", IpPortCfg.class);
|
||||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||||
String cfgIndexInfoNoExport=",ratelimit,block_by_app_server_ip,social_app,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
String cfgIndexInfoNoExport=",social_app,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
+",letter,whether_area_block,classification,attribute,label"
|
+",letter,whether_area_block,classification,attribute,label"
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
package com.nis.web.controller.configuration.maintenance;
|
package com.nis.web.controller.configuration.maintenance;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
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.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
@@ -20,6 +23,8 @@ import com.nis.domain.Page;
|
|||||||
import com.nis.domain.basics.IpReuseIpCfg;
|
import com.nis.domain.basics.IpReuseIpCfg;
|
||||||
import com.nis.domain.configuration.UserManage;
|
import com.nis.domain.configuration.UserManage;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.util.StringUtils;
|
import com.nis.util.StringUtils;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
|
|
||||||
@@ -30,11 +35,16 @@ public class UserManageController extends BaseController{
|
|||||||
@RequestMapping(value = {"/list"})
|
@RequestMapping(value = {"/list"})
|
||||||
@RequiresPermissions(value={"user:manage:view"})
|
@RequiresPermissions(value={"user:manage:view"})
|
||||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response
|
public String list(Model model,HttpServletRequest request,HttpServletResponse response
|
||||||
,@ModelAttribute("cfg")UserManage entity
|
,@ModelAttribute("cfg")UserManage entity){
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
Page<UserManage> page = userManageService.findPage(new Page<UserManage>(request, response,"r"), entity);
|
Page<UserManage> page = userManageService.findPage(new Page<UserManage>(request, response,"r"), entity);
|
||||||
|
if(!StringUtil.isEmpty(entity.getErrorType())){
|
||||||
|
if("create".equals(entity.getErrorType())){
|
||||||
|
Properties msgProp = getMsgProp();
|
||||||
|
String error=msgProp.getProperty("user")+" "+entity.getCgiError()+" "+msgProp.getProperty("vpn_ip")+" "+msgProp.getProperty("save_failed");
|
||||||
|
model.addAttribute("message", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
// initPageCondition(model,entity);
|
|
||||||
return "/cfg/maintenance/userManage/list";
|
return "/cfg/maintenance/userManage/list";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,18 +90,49 @@ public class UserManageController extends BaseController{
|
|||||||
public String save(Model model,HttpServletRequest request,HttpServletResponse response
|
public String save(Model model,HttpServletRequest request,HttpServletResponse response
|
||||||
,String ids,UserManage entity
|
,String ids,UserManage entity
|
||||||
,RedirectAttributes redirectAttributes) {
|
,RedirectAttributes redirectAttributes) {
|
||||||
try{
|
Date createTime=new Date();
|
||||||
userManageService.save(entity,model,request);
|
String errorIp="";
|
||||||
addMessage(redirectAttributes,"save_success");
|
String errorType="";
|
||||||
}catch(Exception e){
|
if(entity.getId()==null){
|
||||||
logger.error("信息保存失败",e);
|
entity.setCreateTime(createTime);
|
||||||
e.printStackTrace();
|
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||||
addMessage(redirectAttributes,"save_failed");
|
entity.setIsValid(Constants.VALID_NO);
|
||||||
}
|
String[] ipArray =entity.getServerIp().split(",");
|
||||||
return "redirect:" + adminPath +"/maintenance/userManage/list";
|
for (String ip : ipArray) {
|
||||||
|
userManageService.saveip(entity,ip,model,request);
|
||||||
|
}
|
||||||
|
UserManage oldUser=userManageService.getUserByLoginName(entity.getUserName());
|
||||||
|
if(oldUser!=null){
|
||||||
|
String[] ips=oldUser.getServerIp().split(",");
|
||||||
|
String erorIp =userManageService.getMessageIp(ipArray, ips);
|
||||||
|
if(!StringUtil.isEmpty(erorIp)){
|
||||||
|
errorType="create";
|
||||||
|
errorIp=entity.getUserName()+" "+erorIp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
entity.setEditTime(createTime);
|
||||||
|
entity.setEditorId(entity.getCurrentUser().getId());
|
||||||
|
String[] ipArray =entity.getServerIp().split(",");
|
||||||
|
UserManage oldUser=userManageService.getUserById(String.valueOf(entity.getId()));
|
||||||
|
int num=0;
|
||||||
|
for (String ip : ipArray) {
|
||||||
|
userManageService.updateip(entity,ip,num,model,request);
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
UserManage user=userManageService.getUserById(String.valueOf(entity.getId()));
|
||||||
|
if(user!=null){
|
||||||
|
String[] ips=user.getServerIp().split(",");
|
||||||
|
String erorIp =userManageService.getMessageIp(ipArray, ips);
|
||||||
|
if(!StringUtil.isEmpty(erorIp)){
|
||||||
|
errorType="create";
|
||||||
|
errorIp=user.getUserName()+" "+erorIp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "redirect:" + adminPath +"/maintenance/userManage/list?cgiError="+errorIp+"&errorType="+errorType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证登录名是否有效
|
* 验证登录名是否有效
|
||||||
* @param oldLoginName
|
* @param oldLoginName
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.nis.web.service.configuration;
|
package com.nis.web.service.configuration;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -9,20 +11,28 @@ import java.util.Map;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.ibatis.session.ExecutorType;
|
||||||
|
import org.apache.ibatis.session.SqlSession;
|
||||||
|
import org.apache.ibatis.session.SqlSessionFactory;
|
||||||
import org.eclipse.jetty.util.ajax.JSON;
|
import org.eclipse.jetty.util.ajax.JSON;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.configuration.AppPolicyCfg;
|
||||||
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
import com.nis.domain.configuration.UserManage;
|
import com.nis.domain.configuration.UserManage;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.util.httpclient.HttpClientUtil;
|
import com.nis.util.httpclient.HttpClientUtil;
|
||||||
|
import com.nis.web.dao.configuration.AppCfgDao;
|
||||||
|
import com.nis.web.dao.configuration.IpCfgDao;
|
||||||
import com.nis.web.dao.configuration.UserManageDao;
|
import com.nis.web.dao.configuration.UserManageDao;
|
||||||
import com.nis.web.security.UserUtils;
|
import com.nis.web.security.UserUtils;
|
||||||
import com.nis.web.service.BaseService;
|
import com.nis.web.service.BaseService;
|
||||||
|
import com.nis.web.service.SpringContextHolder;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class UserManageService extends BaseService{
|
public class UserManageService extends BaseService{
|
||||||
@@ -45,77 +55,128 @@ public class UserManageService extends BaseService{
|
|||||||
return userManageDao.getUserById(id);
|
return userManageDao.getUserById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save(UserManage entity,Model model, HttpServletRequest request){
|
public static String getMessageIp(String[] oldIp,String[] ip){
|
||||||
Date createTime=new Date();
|
String ips=null;
|
||||||
if(entity.getId()==null){
|
for (int i = 0; i < oldIp.length; i++) {
|
||||||
|
boolean flag=true;
|
||||||
|
for (int j = 0; j < ip.length; j++) {
|
||||||
|
if(oldIp[i].equals(ip[j])){
|
||||||
|
flag=false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(flag){
|
||||||
|
if(ips==null){
|
||||||
|
ips=oldIp[i];
|
||||||
|
}else{
|
||||||
|
ips=ips+","+oldIp[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ips;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void saveip(UserManage entity,String ips,Model model, HttpServletRequest request){
|
||||||
|
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||||
|
SqlSession batchSqlSession = null;
|
||||||
try {
|
try {
|
||||||
entity.setCreateTime(createTime);
|
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
UserManage user=userManageDao.getUserByLoginName(entity.getUserName());
|
||||||
entity.setIsValid(Constants.VALID_NO);
|
if(user==null){
|
||||||
userManageDao.insert(entity);
|
entity.setServerIp(ips);
|
||||||
//cgi接口添加
|
((UserManageDao) batchSqlSession.getMapper(UserManageDao.class)).insert(entity);
|
||||||
String[] ipArray = entity.getServerIp().split(",");
|
}else{
|
||||||
for(String ip :ipArray){
|
user.setServerIp(user.getServerIp()+","+ips);
|
||||||
|
((UserManageDao) batchSqlSession.getMapper(UserManageDao.class)).update(user);
|
||||||
|
}
|
||||||
|
//cgi接口添加
|
||||||
//循环调用接口增加
|
//循环调用接口增加
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
params.put("server_ip", ip);
|
params.put("server_ip", ips);
|
||||||
params.put("user_name", entity.getUserName());
|
params.put("user_name", entity.getUserName());
|
||||||
params.put("user_pwd", entity.getUserPwd());
|
params.put("user_pwd", entity.getUserPwd());
|
||||||
Map<String,String> map=getUrl(params,Constants.NTC_IP_REUSE_USER_CREATE,request);
|
String url =Constants.IP_REUSE_CALL_CGI_URL+ Constants.NTC_IP_REUSE_USER_CREATE ;
|
||||||
//返回处理
|
String recv = HttpClientUtil.getCGI(url, params, request);
|
||||||
}
|
if (StringUtils.isNotBlank(recv)) {
|
||||||
} catch (MaatConvertException e) {
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
map = (Map<String, String>) JSON.parse(recv);
|
||||||
|
String error = map.get("error");
|
||||||
|
if (!StringUtil.isEmpty(error)) {
|
||||||
|
batchSqlSession.rollback();
|
||||||
|
} else {
|
||||||
|
batchSqlSession.commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("获取编译ID出错");
|
} finally {
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
if (batchSqlSession != null) {
|
||||||
}
|
batchSqlSession.close();
|
||||||
}else{
|
|
||||||
try {
|
|
||||||
entity.setEditTime(createTime);
|
|
||||||
entity.setEditorId(entity.getCurrentUser().getId());
|
|
||||||
//获取修改之前数据
|
|
||||||
UserManage olduser=userManageDao.getUserById(String.valueOf(entity.getId()));
|
|
||||||
userManageDao.update(entity);
|
|
||||||
//cgi接口删除旧数据
|
|
||||||
String[] ipArray = olduser.getServerIp().split(",");
|
|
||||||
for(String ip :ipArray){
|
|
||||||
//循环调用接口删除
|
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
|
||||||
params.put("server_ip", ip);
|
|
||||||
params.put("user_name", olduser.getUserName());
|
|
||||||
Map<String,String> map=getUrl(params,Constants.NTC_IP_REUSE_USER_DELETE,request);
|
|
||||||
//返回处理
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(StringUtil.isEmpty(entity.getUserName())){
|
}
|
||||||
entity.setUserName(olduser.getUserName());
|
|
||||||
}
|
|
||||||
if(StringUtil.isEmpty(entity.getUserPwd())){
|
|
||||||
entity.setUserPwd(olduser.getUserPwd());
|
|
||||||
}
|
|
||||||
String[] newIpArray = entity.getServerIp().split(",");
|
|
||||||
for(String newIp :newIpArray){
|
|
||||||
//循环调用接口添加
|
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
|
||||||
params.put("server_ip", newIp);
|
|
||||||
params.put("user_name", entity.getUserName());
|
|
||||||
params.put("user_pwd", entity.getUserPwd());
|
|
||||||
Map<String,String> map=getUrl(params,Constants.NTC_IP_REUSE_USER_CREATE,request);
|
|
||||||
//返回处理
|
|
||||||
}
|
|
||||||
}catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.info("获取编译ID出错");
|
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void updateip(UserManage entity,String ips,int num,Model model, HttpServletRequest request){
|
||||||
|
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||||
|
SqlSession batchSqlSession = null;
|
||||||
|
try {
|
||||||
|
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||||
|
if(num==0){
|
||||||
|
UserManage olduser=userManageDao.getUserById(String.valueOf(entity.getId()));
|
||||||
|
//接口旧数据删除
|
||||||
|
//cgi接口删除旧数据
|
||||||
|
String[] ipArray = olduser.getServerIp().split(",");
|
||||||
|
for(String ip :ipArray){
|
||||||
|
//循环调用接口删除
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("server_ip", ip);
|
||||||
|
params.put("user_name", olduser.getUserName());
|
||||||
|
Map<String,String> map=getUrl(params,Constants.NTC_IP_REUSE_USER_DELETE,request);
|
||||||
|
//返回处理
|
||||||
|
}
|
||||||
|
entity.setServerIp(ips);
|
||||||
|
((UserManageDao) batchSqlSession.getMapper(UserManageDao.class)).update(entity);
|
||||||
|
}else{
|
||||||
|
UserManage user=userManageDao.getUserById(String.valueOf(entity.getId()));
|
||||||
|
user.setServerIp(user.getServerIp()+","+ips);
|
||||||
|
((UserManageDao) batchSqlSession.getMapper(UserManageDao.class)).update(user);
|
||||||
|
}
|
||||||
|
// cgi接口添加
|
||||||
|
// 循环调用接口增加
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("server_ip", ips);
|
||||||
|
params.put("user_name", entity.getUserName());
|
||||||
|
params.put("user_pwd", entity.getUserPwd());
|
||||||
|
String url = Constants.IP_REUSE_CALL_CGI_URL + Constants.NTC_IP_REUSE_USER_CREATE;
|
||||||
|
String recv = HttpClientUtil.getCGI(url, params, request);
|
||||||
|
if (StringUtils.isNotBlank(recv)) {
|
||||||
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
map = (Map<String, String>) JSON.parse(recv);
|
||||||
|
String error = map.get("error");
|
||||||
|
if (!StringUtil.isEmpty(error)) {
|
||||||
|
batchSqlSession.rollback();
|
||||||
|
} else {
|
||||||
|
batchSqlSession.commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
if (batchSqlSession != null) {
|
||||||
|
batchSqlSession.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Map<String,String> getUrl(Map<String, Object> params,String urlType,HttpServletRequest request){
|
public Map<String,String> getUrl(Map<String, Object> params,String urlType,HttpServletRequest request){
|
||||||
Map<String,String> map=new HashMap<String,String>();
|
Map<String,String> map=new HashMap<String,String>();
|
||||||
try{
|
try{
|
||||||
String url =Constants.IP_REUSE_CALL_CGI_URL+ urlType ;
|
String url =Constants.IP_REUSE_CALL_CGI_URL+ urlType ;
|
||||||
String recv = HttpClientUtil.getCGI(url, params, request);
|
String recv = HttpClientUtil.getCGI(url, params, request);
|
||||||
logger.info("查询结果:" + recv);
|
|
||||||
if (StringUtils.isNotBlank(recv)) {
|
if (StringUtils.isNotBlank(recv)) {
|
||||||
map=(Map<String,String>)JSON.parse(recv);
|
map=(Map<String,String>)JSON.parse(recv);
|
||||||
}
|
}
|
||||||
@@ -134,7 +195,6 @@ public class UserManageService extends BaseService{
|
|||||||
try{
|
try{
|
||||||
String url =Constants.IP_REUSE_CALL_CGI_URL+ Constants.NTC_IP_REUSE_USER_GET ;
|
String url =Constants.IP_REUSE_CALL_CGI_URL+ Constants.NTC_IP_REUSE_USER_GET ;
|
||||||
String recv = HttpClientUtil.getCGI(url, params, request);
|
String recv = HttpClientUtil.getCGI(url, params, request);
|
||||||
logger.info("查询结果:" + recv);
|
|
||||||
if (StringUtils.isNotBlank(recv)) {
|
if (StringUtils.isNotBlank(recv)) {
|
||||||
map=(Map<String,String>)JSON.parse(recv);
|
map=(Map<String,String>)JSON.parse(recv);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1337,3 +1337,4 @@ available_ip_total=Available IP Total
|
|||||||
address_pool_id=Address Pool ID
|
address_pool_id=Address Pool ID
|
||||||
log_to_cfg=Config
|
log_to_cfg=Config
|
||||||
address_pool_is_used=Address pool is used and cannot perform this operation!
|
address_pool_is_used=Address pool is used and cannot perform this operation!
|
||||||
|
cgi_service_failed=Request CGI server failed
|
||||||
@@ -1322,16 +1322,17 @@ user_info=\u7528\u6237\u4FE1\u606F
|
|||||||
user_list=\u7528\u6237\u5217\u8868
|
user_list=\u7528\u6237\u5217\u8868
|
||||||
equal_password=\u5BC6\u7801\u4E0D\u4E00\u81F4\uFF01
|
equal_password=\u5BC6\u7801\u4E0D\u4E00\u81F4\uFF01
|
||||||
outgoing_unicast_packets=\u4E0A\u4F20\u6570\u636E\u5305\u6570
|
outgoing_unicast_packets=\u4E0A\u4F20\u6570\u636E\u5305\u6570
|
||||||
outgoing_unicast_total_size=\u4E0A\u4F20\u6570\u636E\u5305\u6570\u603B\u91CF
|
outgoing_unicast_total_size=\u4E0A\u4F20\u5B57\u8282\u6570
|
||||||
outgoing_broadcast_packets=\u4E0A\u4F20\u5B57\u8282\u6570
|
outgoing_broadcast_packets=outgoing_broadcast_packets
|
||||||
outgoing_broadcast_total_size=\u4E0A\u4F20\u5B57\u8282\u6570\u603B\u91CF
|
outgoing_broadcast_total_size=outgoing_broadcast_total_size
|
||||||
incoming_unicast_packets=\u4E0B\u8F7D\u6570\u636E\u5305\u6570
|
incoming_unicast_packets=\u4E0B\u8F7D\u6570\u636E\u5305\u6570
|
||||||
incoming_unicast_total_size=\u4E0B\u8F7D\u6570\u636E\u5305\u6570\u603B\u91CF
|
incoming_unicast_total_size=\u4E0B\u8F7D\u6570\u636E\u5B57\u8282\u6570
|
||||||
incoming_broadcast_packets=\u4E0B\u8F7D\u5B57\u8282\u6570
|
incoming_broadcast_packets=incoming_broadcast_packets
|
||||||
incoming_broadcast_total_size=\u4E0B\u8F7D\u5B57\u8282\u6570\u603B\u91CF
|
incoming_broadcast_total_size=incoming_broadcast_total_size
|
||||||
address_pool=\u5730\u5740\u6C60
|
address_pool=\u5730\u5740\u6C60
|
||||||
ip_total=IP\u603B\u6570
|
ip_total=IP\u603B\u6570
|
||||||
available_ip_total=\u53EF\u7528IP\u6570
|
available_ip_total=\u53EF\u7528IP\u6570
|
||||||
address_pool_id=\u5730\u5740\u6C60ID
|
address_pool_id=\u5730\u5740\u6C60ID
|
||||||
log_to_cfg=\u914D\u7F6E
|
log_to_cfg=\u914D\u7F6E
|
||||||
address_pool_is_used=\u5730\u5740\u6C60\u5DF2\u88AB\u4F7F\u7528\uFF0C\u65E0\u6CD5\u6267\u884C\u8BE5\u64CD\u4F5C\uFF01
|
address_pool_is_used=\u5730\u5740\u6C60\u5DF2\u88AB\u4F7F\u7528\uFF0C\u65E0\u6CD5\u6267\u884C\u8BE5\u64CD\u4F5C\uFF01
|
||||||
|
cgi_service_failed=\u8BF7\u6C42CGI\u670D\u52A1\u63A5\u53E3\u5931\u8D25
|
||||||
@@ -61,9 +61,10 @@
|
|||||||
html+="<table class='table table-bordered table-condensed text-nowrap' style='width: 100%;'>";
|
html+="<table class='table table-bordered table-condensed text-nowrap' style='width: 100%;'>";
|
||||||
html+="<thead>";
|
html+="<thead>";
|
||||||
html+="<th><spring:message code="user_name"/></th><th><spring:message code="vpn_ip"/></th><th><spring:message code="create_time"/></th><th><spring:message code="last_login"/></th><th><spring:message code="num_logins"/></th>";
|
html+="<th><spring:message code="user_name"/></th><th><spring:message code="vpn_ip"/></th><th><spring:message code="create_time"/></th><th><spring:message code="last_login"/></th><th><spring:message code="num_logins"/></th>";
|
||||||
html+="<th><spring:message code="outgoing_unicast_packets"/></th><th><spring:message code="outgoing_unicast_total_size"/></th><th><spring:message code="outgoing_broadcast_packets"/></th>";
|
html+="<th><spring:message code="outgoing_unicast_packets"/></th><th><spring:message code="outgoing_unicast_total_size"/></th>";
|
||||||
html+="<th><spring:message code="outgoing_broadcast_total_size"/></th><th><spring:message code="incoming_unicast_packets"/></th><th><spring:message code="incoming_unicast_total_size"/></th>";
|
/* html+="<th><spring:message code="outgoing_broadcast_packets"/></th><th><spring:message code="outgoing_broadcast_total_size"/></th>"; */
|
||||||
html+="<th><spring:message code="incoming_broadcast_packets"/></th><th><spring:message code="incoming_broadcast_total_size"/></th>";
|
html+="<th><spring:message code="incoming_unicast_packets"/></th><th><spring:message code="incoming_unicast_total_size"/></th>";
|
||||||
|
/* html+="<th><spring:message code="incoming_broadcast_packets"/></th><th><spring:message code="incoming_broadcast_total_size"/></th>"; */
|
||||||
html+="</thead>";
|
html+="</thead>";
|
||||||
html+="<tbody>";
|
html+="<tbody>";
|
||||||
for(i=0;i<data.length;i++){
|
for(i=0;i<data.length;i++){
|
||||||
@@ -83,18 +84,18 @@
|
|||||||
html+="</td>";
|
html+="</td>";
|
||||||
html+="<td class='taskStatus'>"+(data[i].Outgoing_Unicast_Total_Size==null?"":data[i].Outgoing_Unicast_Total_Size);
|
html+="<td class='taskStatus'>"+(data[i].Outgoing_Unicast_Total_Size==null?"":data[i].Outgoing_Unicast_Total_Size);
|
||||||
html+="</td>";
|
html+="</td>";
|
||||||
html+="<td class='taskStatus'>"+(data[i].Outgoing_Broadcast_Packets==null?"":data[i].Outgoing_Broadcast_Packets);
|
/* html+="<td class='taskStatus'>"+(data[i].Outgoing_Broadcast_Packets==null?"":data[i].Outgoing_Broadcast_Packets);
|
||||||
html+="</td>";
|
html+="</td>";
|
||||||
html+="<td class='taskStatus'>"+(data[i].Outgoing_Broadcast_Total_Size==null?"":data[i].Outgoing_Broadcast_Total_Size);
|
html+="<td class='taskStatus'>"+(data[i].Outgoing_Broadcast_Total_Size==null?"":data[i].Outgoing_Broadcast_Total_Size);
|
||||||
html+="</td>";
|
html+="</td>"; */
|
||||||
html+="<td class='taskStatus'>"+(data[i].Incoming_Unicast_Packets==null?"":data[i].Incoming_Unicast_Packets);
|
html+="<td class='taskStatus'>"+(data[i].Incoming_Unicast_Packets==null?"":data[i].Incoming_Unicast_Packets);
|
||||||
html+="</td>";
|
html+="</td>";
|
||||||
html+="<td class='taskStatus'>"+(data[i].Incoming_Unicast_Total_Size==null?"":data[i].Incoming_Unicast_Total_Size);
|
html+="<td class='taskStatus'>"+(data[i].Incoming_Unicast_Total_Size==null?"":data[i].Incoming_Unicast_Total_Size);
|
||||||
html+="</td>";
|
html+="</td>";
|
||||||
html+="<td class='taskStatus'>"+(data[i].Incoming_Broadcast_Packets==null?"":data[i].Incoming_Broadcast_Packets);
|
/* html+="<td class='taskStatus'>"+(data[i].Incoming_Broadcast_Packets==null?"":data[i].Incoming_Broadcast_Packets);
|
||||||
html+="</td>";
|
html+="</td>";
|
||||||
html+="<td class='taskStatus'>"+(data[i].Incoming_Broadcast_Total_Size==null?"":data[i].Incoming_Broadcast_Total_Size);
|
html+="<td class='taskStatus'>"+(data[i].Incoming_Broadcast_Total_Size==null?"":data[i].Incoming_Broadcast_Total_Size);
|
||||||
html+="</td>";
|
html+="</td>"; */
|
||||||
html+="</tr>";
|
html+="</tr>";
|
||||||
}
|
}
|
||||||
html+="</tbody>";
|
html+="</tbody>";
|
||||||
|
|||||||
@@ -14,14 +14,15 @@
|
|||||||
return this.optional(element) || (tel.test(value));
|
return this.optional(element) || (tel.test(value));
|
||||||
}, "用户名仅支持英文大小写、数字");
|
}, "用户名仅支持英文大小写、数字");
|
||||||
$("#no").focus();
|
$("#no").focus();
|
||||||
$("#inputForm")
|
|
||||||
|
$("#inputForm")
|
||||||
.validate(
|
.validate(
|
||||||
{
|
{
|
||||||
rules : {
|
rules : {
|
||||||
userName : {
|
userName : {
|
||||||
remote : "${ctx}/maintenance/userManage/checkLoginName?oldUserName="
|
remote : "${ctx}/maintenance/userManage/checkLoginName?oldUserName="
|
||||||
+ encodeURIComponent('${user.userName}'),
|
+ encodeURIComponent('${user.userName}'),
|
||||||
userCheck:true
|
userCheck : true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
messages : {
|
messages : {
|
||||||
@@ -32,31 +33,23 @@
|
|||||||
equalTo : "<spring:message code='equal_password'/>"
|
equalTo : "<spring:message code='equal_password'/>"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
errorPlacement : function(error,element) {
|
||||||
|
/* $("#messageBox").text("<spring:message code='enter_error'/>");
|
||||||
|
if (element.is(":checkbox")|| element.is(":radio")|| element.parent().is(".input-append")) {
|
||||||
|
error.appendTo(element.parent().parent());
|
||||||
|
} else {
|
||||||
|
error.insertAfter(element);
|
||||||
|
} */
|
||||||
|
$(element).parents(".form-group").find("div[for='"+ element.attr("name")+ "']").append(error);
|
||||||
|
},
|
||||||
submitHandler : function(form) {
|
submitHandler : function(form) {
|
||||||
loading('onloading...');
|
loading('onloading...');
|
||||||
form.submit();
|
form.submit();
|
||||||
},
|
},
|
||||||
errorContainer : "#messageBox",
|
errorContainer : "#messageBox"
|
||||||
errorPlacement : function(error,
|
|
||||||
element) {
|
|
||||||
$("#messageBox")
|
|
||||||
.text(
|
|
||||||
"<spring:message code='enter_error'/>");
|
|
||||||
if (element.is(":checkbox")
|
|
||||||
|| element.is(":radio")
|
|
||||||
|| element
|
|
||||||
.parent()
|
|
||||||
.is(
|
|
||||||
".input-append")) {
|
|
||||||
error.appendTo(element
|
|
||||||
.parent().parent());
|
|
||||||
} else {
|
|
||||||
error.insertAfter(element);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -93,6 +86,7 @@
|
|||||||
</c:set>
|
</c:set>
|
||||||
<label class="control-label col-md-3"><spring:message
|
<label class="control-label col-md-3"><spring:message
|
||||||
code="vpn_ip" /></label>
|
code="vpn_ip" /></label>
|
||||||
|
<span class="help-inline"><font color="red">*</font> </span>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<sys:treeselect id="serverIp" name="serverIp"
|
<sys:treeselect id="serverIp" name="serverIp"
|
||||||
value="${user.serverIp}" labelName="user.serverIp"
|
value="${user.serverIp}" labelName="user.serverIp"
|
||||||
@@ -102,13 +96,13 @@
|
|||||||
url="/maintenance/userManage/treeData?isLeafShow=false&cfgType=3&specific=true" extId="0"
|
url="/maintenance/userManage/treeData?isLeafShow=false&cfgType=3&specific=true" extId="0"
|
||||||
checked="true" cssClass="form-control required" />
|
checked="true" cssClass="form-control required" />
|
||||||
</div>
|
</div>
|
||||||
<span class="help-inline"><font color="red">*</font> </span>
|
<div for="user.serverIp"></div>
|
||||||
<div for="user.serverIp"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group hidden">
|
<div class="form-group hidden">
|
||||||
<label class="col-md-3 control-label"><spring:message
|
<label class="col-md-3 control-label"><spring:message
|
||||||
code="user_name" /></label>
|
code="user_name" /></label>
|
||||||
|
<span class="help-inline"><font color="red">*</font> </span>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<select name="userType" data-live-search="true" class="selectpicker form-control required">
|
<select name="userType" data-live-search="true" class="selectpicker form-control required">
|
||||||
<c:forEach items="${fns:getDictList('USER_TYPE')}" var="userTypes">
|
<c:forEach items="${fns:getDictList('USER_TYPE')}" var="userTypes">
|
||||||
@@ -116,12 +110,12 @@
|
|||||||
</c:forEach>
|
</c:forEach>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<span class="help-inline"><font color="red">*</font> </span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-3 control-label"><spring:message
|
<label class="col-md-3 control-label"><spring:message
|
||||||
code="user_name" /></label>
|
code="user_name" /></label>
|
||||||
|
<span class="help-inline"><font color="red">*</font> </span>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<input id="oldUserName" name="oldUserName" type="hidden"
|
<input id="oldUserName" name="oldUserName" type="hidden"
|
||||||
value="${user.userName}">
|
value="${user.userName}">
|
||||||
@@ -133,35 +127,37 @@
|
|||||||
<form:input path="userName" htmlEscape="false" maxlength="50"
|
<form:input path="userName" htmlEscape="false" maxlength="50"
|
||||||
class="required form-control" />
|
class="required form-control" />
|
||||||
</div>
|
</div>
|
||||||
<span class="help-inline"><font color="red">*</font> </span>
|
<div for="userName"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-3 control-label"><spring:message
|
<label class="col-md-3 control-label"><spring:message
|
||||||
code="password" /></label>
|
code="password" /></label>
|
||||||
|
<c:if test="${empty user.id}">
|
||||||
|
<span class="help-inline"><font color="red">*</font> </span>
|
||||||
|
</c:if>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<input id="userPwd" name="userPwd" type="password" value=""
|
<input id="userPwd" name="userPwd" type="password" value=""
|
||||||
maxlength="50" minlength="3"
|
maxlength="50" minlength="3"
|
||||||
class="${empty user.id?'required':''} form-control" />
|
class="${empty user.id?'required':''} form-control" />
|
||||||
</div>
|
</div>
|
||||||
<c:if test="${empty user.id}">
|
|
||||||
<span class="help-inline"><font color="red">*</font> </span>
|
|
||||||
</c:if>
|
|
||||||
<c:if test="${not empty user.id}">
|
<c:if test="${not empty user.id}">
|
||||||
<span class="help-inline"><spring:message
|
<span class="help-inline"><spring:message
|
||||||
code="nochange_blank" /></span>
|
code="nochange_blank" /></span>
|
||||||
</c:if>
|
</c:if>
|
||||||
|
<div for="userPwd"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-3 control-label"><spring:message
|
<label class="col-md-3 control-label"><spring:message
|
||||||
code="confirm_password"></spring:message></label>
|
code="confirm_password"></spring:message></label>
|
||||||
|
<span class="help-inline"><font color="red">*</font> </span>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<input id="newUserPwd" name="newUserPwd" type="password"
|
<input id="newUserPwd" name="newUserPwd" type="password"
|
||||||
value="" maxlength="50" minlength="3" equalTo="#userPwd"
|
value="" maxlength="50" minlength="3" equalTo="#userPwd"
|
||||||
class="form-control" />
|
class="form-control" />
|
||||||
<c:if test="${empty user.id}"></c:if>
|
<c:if test="${empty user.id}"></c:if>
|
||||||
</div>
|
</div>
|
||||||
<span class="help-inline"><font color="red">*</font> </span>
|
<div for="newUserPwd"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-3 control-label"><spring:message
|
<label class="col-md-3 control-label"><spring:message
|
||||||
|
|||||||
Reference in New Issue
Block a user