diff --git a/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java b/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java index 925097ea2..b4027380c 100644 --- a/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java +++ b/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java @@ -113,7 +113,7 @@ public class ServiceDictInfoController extends BaseController { * @param model * @return */ - @RequiresPermissions(value={"basics:classification:view","basics:attribute:view","basics:label:view"},logical=Logical.OR) + @RequiresPermissions(value={"basics:classification:view","basics:attribute:view","basics:label:view","basics:vpn_ip:view"},logical=Logical.OR) @RequestMapping(value = {"list", ""}) public String list(String itType, ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model) { //处理数据 @@ -183,7 +183,7 @@ public class ServiceDictInfoController extends BaseController { * @param model * @return */ - @RequiresPermissions(value={"basics:classification:add","basics:attribute:add","basics:label:add","basics:classification:edit","basics:attribute:edit","basics:label:edit","basics:classification:view","basics:attribute:view","basics:label:view"},logical=Logical.OR) + @RequiresPermissions(value={"basics:classification:add","basics:attribute:add","basics:vpn_ip:add","basics:label:add","basics:classification:edit","basics:attribute:edit","basics:vpn_ip:edit","basics:label:edit","basics:classification:view","basics:attribute:view","basics:label:view","basics:vpn_ip:view"},logical=Logical.OR) @RequestMapping(value={"form"}) public String form(ServiceDictInfo serviceDictInfo, Model model,String doAction,String itType) { if(doAction!=null&&doAction.equals("0")){ @@ -207,7 +207,7 @@ public class ServiceDictInfoController extends BaseController { * @param redirectAttributes * @return */ - @RequiresPermissions(value={"basics:classification:add","basics:attribute:add","basics:label:add","basics:classification:edit","basics:attribute:edit","basics:label:edit"},logical=Logical.OR) + @RequiresPermissions(value={"basics:classification:add","basics:attribute:add","basics:label:add","basics:vpn_ip:add","basics:classification:edit","basics:attribute:edit","basics:label:edit","basics:vpn_ip:edit"},logical=Logical.OR) @RequestMapping(value = "saveOrUpdate") public String saveOrUpdate(ServiceDictInfo serviceDictInfo,Model model, RedirectAttributes redirectAttributes,String itType) { @@ -231,7 +231,7 @@ public class ServiceDictInfoController extends BaseController { * @param model * @return */ - @RequiresPermissions(value={"basics:classification:del","basics:attribute:del","basics:label:del"},logical=Logical.OR) + @RequiresPermissions(value={"basics:classification:del","basics:attribute:del","basics:label:del","basics:vpn_ip:del"},logical=Logical.OR) @RequestMapping(value={"delete"}) public String delete(ServiceDictInfo serviceDictInfo, RedirectAttributes redirectAttributes, String itType, String mulitId) { try { diff --git a/src/main/java/com/nis/web/controller/configuration/maintenance/UserManageController.java b/src/main/java/com/nis/web/controller/configuration/maintenance/UserManageController.java index e984ec2c1..7359c6dbf 100644 --- a/src/main/java/com/nis/web/controller/configuration/maintenance/UserManageController.java +++ b/src/main/java/com/nis/web/controller/configuration/maintenance/UserManageController.java @@ -22,6 +22,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.nis.domain.Page; import com.nis.domain.basics.IpReuseIpCfg; +import com.nis.domain.basics.ServiceDictInfo; import com.nis.domain.configuration.UserManage; import com.nis.exceptions.MaatConvertException; import com.nis.util.Constants; @@ -82,11 +83,11 @@ public class UserManageController extends BaseController{ userManageService.delete(-1,user,ip,lastIp); deleteIpLenth++; } catch (MaatConvertException e) { - message=msgProp.getProperty("user")+" "+user.getUserName()+" "+ip+" "+msgProp.getProperty("vpn_ip")+" "+msgProp.getProperty("delete_failed"); + message=msgProp.getProperty("user")+" "+user.getUserName()+" "+ip+" "+msgProp.getProperty("cgi_failed")+" "+msgProp.getProperty("delete_failed"); logger.error("用户vpn新增失败",e); throw e; }catch (Exception e) { - message=msgProp.getProperty("user")+" "+user.getUserName()+" "+ip+" "+msgProp.getProperty("vpn_ip")+" "+msgProp.getProperty("delete_failed"); + message=msgProp.getProperty("user")+" "+user.getUserName()+" "+ip+" "+msgProp.getProperty("cgi_failed")+" "+msgProp.getProperty("delete_failed"); logger.error("用户vpn新增失败",e); throw e; } @@ -113,8 +114,6 @@ public class UserManageController extends BaseController{ ,String ids,UserManage entity ,RedirectAttributes redirectAttributes) { Date createTime=new Date(); - String errorIp=""; - String errorType=""; String addIp=""; String addSuccessIp=""; String deleteIp=""; @@ -145,11 +144,11 @@ public class UserManageController extends BaseController{ addSuccessIp+=addSuccessIp+","; } } catch (MaatConvertException e) { - message=msgProp.getProperty("user")+" "+entity.getUserName()+" "+ip+" "+msgProp.getProperty("vpn_ip")+" "+msgProp.getProperty("save_failed"); + message=msgProp.getProperty("user")+" "+entity.getUserName()+" "+ip+" "+msgProp.getProperty("cgi_failed")+" "+msgProp.getProperty("save_failed"); logger.error("用户vpn新增失败",e); throw e; }catch (Exception e) { - message=msgProp.getProperty("user")+" "+entity.getUserName()+" "+ip+" "+msgProp.getProperty("vpn_ip")+" "+msgProp.getProperty("save_failed"); + message=msgProp.getProperty("user")+" "+entity.getUserName()+" "+ip+" "+msgProp.getProperty("cgi_failed")+" "+msgProp.getProperty("save_failed"); logger.error("用户vpn新增失败",e); throw e; } @@ -171,11 +170,11 @@ public class UserManageController extends BaseController{ userManageService.updatePwd(entity,ip); } } catch (MaatConvertException e) { - message=msgProp.getProperty("user")+" "+entity.getUserName()+msgProp.getProperty("password")+msgProp.getProperty("update_failed"); + message=msgProp.getProperty("user")+" "+entity.getUserName()+msgProp.getProperty("password")+" "+msgProp.getProperty("cgi_failed")+" "+msgProp.getProperty("update_failed"); logger.error("用户vpn密码修改失败",e); throw e; }catch (Exception e) { - message=msgProp.getProperty("user")+" "+entity.getUserName()+msgProp.getProperty("password")+msgProp.getProperty("update_failed"); + message=msgProp.getProperty("user")+" "+entity.getUserName()+msgProp.getProperty("password")+" "+msgProp.getProperty("cgi_failed")+" "+msgProp.getProperty("update_failed"); logger.error("用户vpn密码修改失败",e); throw e; } @@ -206,11 +205,11 @@ public class UserManageController extends BaseController{ addSuccessIp+=addSuccessIp+","; } } catch (MaatConvertException e) { - message=msgProp.getProperty("user")+" "+entity.getUserName()+" "+ip+" "+msgProp.getProperty("vpn_ip")+" "+msgProp.getProperty("save_failed"); + message=msgProp.getProperty("user")+" "+entity.getUserName()+" "+ip+" "+msgProp.getProperty("cgi_failed")+" "+msgProp.getProperty("save_failed"); logger.error("用户vpn新增失败",e); throw e; }catch (Exception e) { - message=msgProp.getProperty("user")+" "+entity.getUserName()+" "+ip+" "+msgProp.getProperty("vpn_ip")+" "+msgProp.getProperty("save_failed"); + message=msgProp.getProperty("user")+" "+entity.getUserName()+" "+ip+" "+msgProp.getProperty("cgi_failed")+" "+msgProp.getProperty("save_failed"); logger.error("用户vpn新增失败",e); throw e; } @@ -226,11 +225,11 @@ public class UserManageController extends BaseController{ deleteSuccessIp+=deleteSuccessIp+","; } } catch (MaatConvertException e) { - message=msgProp.getProperty("user")+" "+entity.getUserName()+" "+ip+" "+msgProp.getProperty("vpn_ip")+" "+msgProp.getProperty("save_failed"); + message=msgProp.getProperty("user")+" "+entity.getUserName()+" "+ip+" "+msgProp.getProperty("cgi_failed")+" "+msgProp.getProperty("save_failed"); logger.error("用户vpn删除失败",e); throw e; }catch (Exception e) { - message=msgProp.getProperty("user")+" "+entity.getUserName()+" "+ip+" "+msgProp.getProperty("vpn_ip")+" "+msgProp.getProperty("save_failed"); + message=msgProp.getProperty("user")+" "+entity.getUserName()+" "+ip+" "+msgProp.getProperty("cgi_failed")+" "+msgProp.getProperty("save_failed"); logger.error("用户vpn删除失败",e); throw e; } @@ -288,13 +287,12 @@ public class UserManageController extends BaseController{ mapList.add(map2); IpReuseIpCfg ip=new IpReuseIpCfg(); ip.setFunctionId(636); - List list=ipReuseIpCfgService.findList(ip); - for (int i = 0; i < list.size(); i++) { - IpReuseIpCfg ipReuseIpCfg=list.get(i); + List allList = serviceDictInfoService.findAllNoLeafDictList("5"); + for (int i = 0; i < allList.size(); i++) { Map map = Maps.newHashMap(); - map.put("id", ipReuseIpCfg.getDestIpAddress()); + map.put("id", allList.get(i).getItemValue()); map.put("pId", 0); - map.put("name",ipReuseIpCfg.getDestIpAddress()); + map.put("name",allList.get(i).getItemValue()); mapList.add(map); } return mapList; @@ -309,16 +307,21 @@ public class UserManageController extends BaseController{ Map mess=new HashMap(); for(String ip :ipArray){ Map map=new HashMap(); - UserManage user=new UserManage(); - IpReuseIpCfg ipReuseIpCfg=ipReuseIpCfgService.getIpByIp(ip); + ServiceDictInfo sysDictInfo=serviceDictInfoService.getByItemValue(ip, 5); //根据ip调用接口获取数据 try{ String recv=userManageService.getUser(ip,userName); if (StringUtils.isNotBlank(recv)) { map=(Map)JSON.parse(recv); - if(ipReuseIpCfg!=null ){ - map.put("serverIp", ipReuseIpCfg.getDestIpAddress()); + if(sysDictInfo!=null ){ + map.put("serverIp", sysDictInfo.getItemValue()); userManageList.add(map); + }else{ + if(message==""){ + message=ip; + }else{ + message+=","+ip; + } } } } catch (Exception e) { diff --git a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java index 8e7e3ae07..924e2278e 100644 --- a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java +++ b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java @@ -79,7 +79,7 @@ public interface ServiceDictInfoDao extends CrudDao { void auditCancleRequestInfo(@Param("cancelRequestId")Integer cancelRequestId, @Param("indexTable")String indexTable,@Param("id") String id); Integer requestCancleInfoNumber(@Param("indexTable")String indexTable,@Param("id")Long id); - + ServiceDictInfo getByItemValue(@Param("itemValue")String itemValue,@Param("itemType")Integer itemType); diff --git a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml index 5a656754d..12cf5d6c0 100644 --- a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml +++ b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml @@ -313,5 +313,13 @@ - + \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java b/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java index 7605fdca9..9f2b29279 100644 --- a/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java +++ b/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java @@ -9,7 +9,6 @@ import org.springframework.transaction.annotation.Transactional; import com.google.common.collect.Lists; import com.nis.domain.Page; -import com.nis.domain.SysMenu; import com.nis.domain.SysUser; import com.nis.domain.basics.ServiceDictInfo; import com.nis.util.ConfigDictUtils; @@ -321,7 +320,15 @@ public class ServiceDictInfoService extends BaseService{ - + + /** + * 根据itemValue查出对象集合 + * @param itemCode + * @return + */ + public ServiceDictInfo getByItemValue(String itemValue,Integer itemType) { + return serviceDictInfoDao.getByItemValue(itemValue, itemType); + } diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 0ce19b1a3..4312e5113 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1333,8 +1333,10 @@ available_ip_total=Available IP Total address_pool_id=Address Pool ID log_to_cfg=Config address_pool_is_used=Address pool is used and cannot perform this operation! -cgi_service_failed=Request CGI server failed +cgi_service_failed=Request CGI Server Failed available_ip=Available IP config_sync=Configuration Synchronization info_failed=Information Acquisition Failure -address_pool_ip_configuration=Address Pool IP Configuration \ No newline at end of file +address_pool_ip_configuration=Address Pool IP Configuration +cgi_failed=CGI Server +ip_check=Please enter a correct IP address \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index f1a4397bb..2197f5a37 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1335,4 +1335,6 @@ cgi_service_failed=\u8BF7\u6C42CGI\u670D\u52A1\u63A5\u53E3\u5931\u8D25 available_ip=\u53EF\u7528IP\u5730\u5740 config_sync=\u914D\u7F6E\u540C\u6B65 info_failed=\u4FE1\u606F\u83B7\u53D6\u5931\u8D25 -address_pool_ip_configuration=\u5730\u5740\u6C60 IP\u914D\u7F6E \ No newline at end of file +address_pool_ip_configuration=\u5730\u5740\u6C60 IP\u914D\u7F6E +cgi_failed=CGI\u670D\u52A1 +ip_check=\u8BF7\u586B\u5199\u6B63\u786E\u7684IP\u5730\u5740 \ No newline at end of file diff --git a/src/main/resources/sql/20181120/add_data_dict.sql b/src/main/resources/sql/20181120/add_data_dict.sql index 1f0470e1b..7d7fb4b2c 100644 --- a/src/main/resources/sql/20181120/add_data_dict.sql +++ b/src/main/resources/sql/20181120/add_data_dict.sql @@ -1,5 +1,6 @@ #用户管理字典信息 INSERT INTO `sys_data_dictionary_name` (`id`, `module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`) VALUES ('145', '用户管理', 'USER_TYPE', '', 'user:管理员,2018-11-28 09:48:13edit|user:管理员,2018-11-27 17:50:11edit', '2018-11-27 17:38:36', '2018-11-28 09:48:13', '1'); -INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3146', '0', 'VPN', '', '0', '1', '1', '145'); -INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3147', '1', 'SIP', '', '0', '1', '1', '145'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3181', 'VPN', 'VPN', '', '0', '1', '1', '145'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3182', 'SIP', 'SIP', '', '0', '1', '1', '145'); + diff --git a/src/main/resources/sql/20181120/add_user_manage.sql b/src/main/resources/sql/20181120/add_user_manage.sql index 9f3d2e671..71cff0943 100644 --- a/src/main/resources/sql/20181120/add_user_manage.sql +++ b/src/main/resources/sql/20181120/add_user_manage.sql @@ -5,7 +5,7 @@ CREATE TABLE `user_manage` ( `user_name` varchar(255) NOT NULL, `user_pwd` varchar(255) NOT NULL, `server_ip` varchar(1000) NOT NULL, - `user_type` varchar(50) DEFAULT NULL, + `user_type` varchar(256) DEFAULT NULL, `is_valid` int(11) NOT NULL COMMENT '0无效,1有效,-1删除\r\n', `is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过\r\n1) 审核未通过,配置可修改\r\n2) 审核通过,配置不可删除,只能取消审核通过', `creator_id` int(11) NOT NULL COMMENT '取自sys_user.id', diff --git a/src/main/resources/sql/20181203/add_sys_data_dictionary_name.sql b/src/main/resources/sql/20181203/add_sys_data_dictionary_name.sql index c97a8c2bb..4d3deb20b 100644 --- a/src/main/resources/sql/20181203/add_sys_data_dictionary_name.sql +++ b/src/main/resources/sql/20181203/add_sys_data_dictionary_name.sql @@ -5,3 +5,8 @@ INSERT INTO `sys_data_dictionary_name` (`id`, `module_name`, `mark`, `remark`, ` #日志查询-出入口字典添加 INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3168', '1', 'astana', 'astana', '0', '1', '1', '81'); INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3169', '2', 'almaty', 'almaty', '0', '1', '1', '81'); + +#VPN服务地址-业务字典数据类型添加 +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('3163', '5', 'vpn_ip', '数据类型:VPN 服务器IP', '0', '1', '1', '37'); + + diff --git a/src/main/webapp/WEB-INF/views/basics/serviceDictForm.jsp b/src/main/webapp/WEB-INF/views/basics/serviceDictForm.jsp index 1cfc57e5d..407c786c9 100644 --- a/src/main/webapp/WEB-INF/views/basics/serviceDictForm.jsp +++ b/src/main/webapp/WEB-INF/views/basics/serviceDictForm.jsp @@ -104,6 +104,11 @@ label.errorShow { return flagLeafChange; },""); + jQuery.validator.addMethod("ipchecks",function(value,element){ + var tel=/^(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$/; + return this.optional(element) || (tel.test(value)); + },""); + $("#name").focus(); validateForm=$("#inputForm").validate({ rules: { @@ -166,6 +171,10 @@ label.errorShow { + + + +
@@ -191,7 +200,7 @@ label.errorShow { -
+
hidden " >
@@ -203,13 +212,16 @@ label.errorShow { + + +
-
+
hidden ">
+ + + +
-
+
hidden ">
diff --git a/src/main/webapp/WEB-INF/views/basics/serviceDictList.jsp b/src/main/webapp/WEB-INF/views/basics/serviceDictList.jsp index 58e047127..de1154b3c 100644 --- a/src/main/webapp/WEB-INF/views/basics/serviceDictList.jsp +++ b/src/main/webapp/WEB-INF/views/basics/serviceDictList.jsp @@ -7,9 +7,6 @@