From 9f8ead863579e807d20167960fbc75ab423dd5a8 Mon Sep 17 00:00:00 2001 From: wangxin Date: Wed, 28 Mar 2018 10:16:27 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug,DNS=E6=AC=BA=E9=AA=97?= =?UTF-8?q?ip=E5=88=A0=E9=99=A4=E4=BC=A0=E5=85=A5fake=20id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/domain/configuration/DnsIpCfg.java | 15 ++++++++++++ .../configuration/DnsIpCfgController.java | 6 ++--- .../web/dao/configuration/DnsIpCfgDao.java | 4 +++- .../nis/web/dao/configuration/DnsIpCfgDao.xml | 7 ++++++ .../configuration/DnsIpCfgService.java | 24 +++++++++---------- .../webapp/WEB-INF/views/cfg/dnsIpCfgList.jsp | 6 +++-- 6 files changed, 43 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/nis/domain/configuration/DnsIpCfg.java b/src/main/java/com/nis/domain/configuration/DnsIpCfg.java index 3219b0dde..75ebdae13 100644 --- a/src/main/java/com/nis/domain/configuration/DnsIpCfg.java +++ b/src/main/java/com/nis/domain/configuration/DnsIpCfg.java @@ -141,6 +141,7 @@ public class DnsIpCfg extends BaseEntity { private String lable; private String cfgIds; + private String fakeIds; public String getCfgIds() { return cfgIds; @@ -348,5 +349,19 @@ public class DnsIpCfg extends BaseEntity { public void setSearchAuditTimeEnd(Date searchAuditTimeEnd) { this.searchAuditTimeEnd = searchAuditTimeEnd; } + /** + * fakeIds + * @return fakeIds + */ + + public String getFakeIds() { + return fakeIds; + } + /** + * @param fakeIds the fakeIds to set + */ + public void setFakeIds(String fakeIds) { + this.fakeIds = fakeIds; + } } diff --git a/src/main/java/com/nis/web/controller/configuration/DnsIpCfgController.java b/src/main/java/com/nis/web/controller/configuration/DnsIpCfgController.java index 2c25787a5..bc5670b40 100644 --- a/src/main/java/com/nis/web/controller/configuration/DnsIpCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/DnsIpCfgController.java @@ -78,10 +78,10 @@ public class DnsIpCfgController extends BaseController { @RequestMapping("delete") public String delete(Model model, HttpServletRequest request, HttpServletResponse response, DnsIpCfg dnsIpCfg) { - String cfgIds = dnsIpCfg.getCfgIds(); - if (!StringUtils.isEmpty(cfgIds)) { + String fakeIds = dnsIpCfg.getFakeIds(); + if (!StringUtils.isEmpty(fakeIds)) { try { - dnsIpCfgService.delete(cfgIds); + dnsIpCfgService.delete(fakeIds); addMessage(model, "delete_success"); } catch (Exception e) { logger.error("删除失败", e); diff --git a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.java b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.java index 755228e15..62c9de453 100644 --- a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.java @@ -1,10 +1,12 @@ package com.nis.web.dao.configuration; +import org.apache.ibatis.annotations.Param; + import com.nis.domain.configuration.DnsIpCfg; import com.nis.web.dao.CrudDao; import com.nis.web.dao.MyBatisDao; @MyBatisDao public interface DnsIpCfgDao extends CrudDao { - + public int deleteByFakeId(@Param("fakeId") String fakeIds); } diff --git a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml index 8c43cc875..a3dfb045d 100644 --- a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml @@ -141,5 +141,12 @@ is_valid=0 where cfg_id=#{cfgId} + + update + dns_ip_cfg + set + is_valid=0 + where fake_id =#{fakeId} + \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java b/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java index 803f95feb..5afe0bcd5 100644 --- a/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -16,13 +17,13 @@ import com.nis.domain.maat.MaatDnsIpCfg; import com.nis.domain.maat.ToMaatDnsIpBean; import com.nis.main.ConvertTool; import com.nis.util.Collections3; -import com.nis.util.StringUtil; import com.nis.web.dao.configuration.DnsIpCfgDao; import com.nis.web.service.CrudService; @Service public class DnsIpCfgService extends CrudService{ - + @Autowired + private DnsIpCfgDao dnsIpCfgDao; @Override @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void save(DnsIpCfg dnsIpCfg) { @@ -72,27 +73,24 @@ public class DnsIpCfgService extends CrudService{ } } - public void delete(String cfgIds) { - if(cfgIds.endsWith(","))cfgIds=cfgIds.substring(0,cfgIds.lastIndexOf(",")); - String[] cfgIdsArr = cfgIds.split(","); - for (String cfgId : cfgIdsArr) { - DnsIpCfg d = new DnsIpCfg(); - d.setCfgId(Long.valueOf(cfgId)); - dao.delete(d); + public void delete(String fakeIds) { + if(fakeIds.endsWith(","))fakeIds=fakeIds.substring(0,fakeIds.lastIndexOf(",")); + String[] fakeIdsArr = fakeIds.split(","); + for (String fakeId : fakeIdsArr) { + dnsIpCfgDao.deleteByFakeId(fakeId); } - //给配置转换层发送、接收结果 - String sendJson = "{\"fakeId\":[" + cfgIds + "]}"; + String sendJson = "{\"fakeId\":[" + fakeIds + "]}"; logger.info("准备下发配置:" + sendJson); Boolean recv = true; try { recv = new ConvertTool().invalidDNSIPConfig(sendJson); } catch (Throwable e) { - logger.error("欺骗ip配置删除失败:通讯异常,cfgIds:" + cfgIds, e); + logger.error("欺骗ip配置删除失败:通讯异常,fakeIds:" + fakeIds, e); throw new RuntimeException("欺骗ip配置删除失败:通讯失败"); } if (!recv) { - logger.error("欺骗ip配置删除失败,收到结果 " + recv + " ,cfgIds:" + cfgIds); + logger.error("欺骗ip配置删除失败,收到结果 " + recv + " ,fakeIds:" + fakeIds); throw new RuntimeException("欺骗ip配置删除失败"); } } diff --git a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgList.jsp index dfc121724..46bf493fb 100644 --- a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgList.jsp @@ -69,8 +69,9 @@ checkboxes.each(function(){ ids = ids + $(this).attr("id") + ","; }); + console.log(ids); if (confirm("")) { - $("#cfgIds").val(ids); + $("#fakeIds").val(ids); $("#searchForm").attr("action","${ctx}/cfg/dnsIp/delete"); $("#searchForm").submit(); } @@ -105,6 +106,7 @@ +
@@ -270,7 +272,7 @@ - + ${dnsIpCfg.cfgDesc } V${dnsIpCfg.ipType } ${dnsIpCfg.srcIp } From 6409e2108d8ead6b7e673e813de08194f5148a82 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Wed, 28 Mar 2018 10:21:33 +0800 Subject: [PATCH 2/4] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E8=B7=9F=E9=94=99=E8=AF=AF=E7=9A=84=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/messages/message_en.properties | 11 +- .../messages/message_zh_CN.properties | 3 +- .../webapp/WEB-INF/tags/sys/treeselect.tag | 4 +- .../webapp/WEB-INF/views/sys/officeForm.jsp | 190 ++++++++++-------- .../webapp/WEB-INF/views/sys/officeIndex.jsp | 30 ++- .../webapp/WEB-INF/views/sys/officeList.jsp | 30 ++- 6 files changed, 160 insertions(+), 108 deletions(-) diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 8f6d43396..e1bfbed8d 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -19,6 +19,7 @@ show=show edit=edit hi=hi exit=exit +choose=choose #============menu begin====================== requestInfo=requestInfo @@ -40,16 +41,13 @@ sip_ip_control=sip ip control domain_control_white=domain control white ip_address_control=ip address control ip_control=ip control -ip_port_control=ip port control domain_control=domain control dns_control=dns control basic_configuration=basic configuration letter_from=letter from classification=classification classification_manage=classification manage -attribute_manage=attribute manage area_manage=area manage -isp_manage=isp manage feature_scope_manage=feature scope manage special_tasks=special tasks label_manage=label manage @@ -95,12 +93,9 @@ log_search=log search sysService_manage=system service manage service_manage=service type manage system_service_manage=system service type manage -specific_service_cfg=specific service cfg features_area=features area attribute_manage=attribute manage isp_manage=isp manage -feature_scope_manage=feature scope manage -plaintext_manage=plaintext manage ip_multiple_control=ip multiple control ip_port_control=ip port control website_multiple_control=website multiple control @@ -148,8 +143,7 @@ desc=description parent_id=parentid is_leaf=whether subnode is_valid=whether valid -create_time=createtime -edit_time=edittime +create_time=create time superior_config=superior configuration config_content=configuration content @@ -295,7 +289,6 @@ audit_time=audit time yes=yes no=no deleted=deleted -cancel_approved=cancel approved #==========youjianguankong end===================== diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index e0df9e022..af2294104 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -19,6 +19,7 @@ show=\u67e5\u770b edit=\u4fee\u6539 hi=\u4f60\u597d exit=\u9000\u51fa +choose=\u9009\u62e9 #==========menu begin===================== requestInfo=\u6765\u51fd\u4fe1\u606f @@ -139,7 +140,6 @@ parent_id=\u7236ID is_leaf=\u662f\u5426\u53f6\u5b50\u8282\u70b9 is_valid=\u6709\u6548\u6807\u5fd7 create_time=\u521b\u5efa\u65f6\u95f4 -edit_time=\u4fee\u6539\u65f6\u95f4 superior_config=\u4e0a\u7ea7\u914d\u7f6e config_content=\u914d\u7f6e\u5185\u5bb9 @@ -169,7 +169,6 @@ begin_date=\u5f00\u59cb\u65f6\u95f4 end_date=\u7ed3\u675f\u65f6\u95f4 delete=\u5220\u9664 special_task=\u4e13\u9879\u4efb\u52a1 -cancel_approved=\u914d\u7f6e\u53d6\u6d88 task_name=\u4e13\u9879\u540d\u79f0 task_org=\u62a5\u9001\u5355\u4f4d task_time=\u62a5\u9001\u65f6\u95f4 diff --git a/src/main/webapp/WEB-INF/tags/sys/treeselect.tag b/src/main/webapp/WEB-INF/tags/sys/treeselect.tag index c551f505b..83ac743de 100644 --- a/src/main/webapp/WEB-INF/tags/sys/treeselect.tag +++ b/src/main/webapp/WEB-INF/tags/sys/treeselect.tag @@ -43,8 +43,8 @@ return true; } // 正常打开 - top.$.jBox.open("iframe:${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}", "选择${title}", 320, 420, { - ajaxData:{selectIds: $("#${id}Id").val()},buttons:{"":"ok", ${allowClear?"\"\":\"clear\", ":""}"":true}, submit:function(v, h, f){ + top.$.jBox.open("iframe:${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}", "${title}", 320, 420, { + ajaxData:{selectIds: $("#${id}Id").val()},buttons:{"ok":"ok", ${allowClear?"\"clear\":\"clear\", ":""}"close":true}, submit:function(v, h, f){ if (v=="ok"){ var tree = h.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents(); var ids = [], names = [], nodes = []; diff --git a/src/main/webapp/WEB-INF/views/sys/officeForm.jsp b/src/main/webapp/WEB-INF/views/sys/officeForm.jsp index a87448237..9b979a9b2 100644 --- a/src/main/webapp/WEB-INF/views/sys/officeForm.jsp +++ b/src/main/webapp/WEB-INF/views/sys/officeForm.jsp @@ -29,142 +29,170 @@ -
+
+
+
+
+
+
+
+
+
+ + +<%--
  • 机构列表
  • --%> +<%--
  • 机构${not empty office.id?'修改':'添加'}查看
  • --%> + + + -
    - -
    +
    +
    + +
    + title="机构" url="/sys/office/treeData" extId="${office.id}" cssClass="form-control" allowClear="${office.currentUser.admin}"/>
    -
    - -
    +
    + +
    - * + title="区域" url="/sys/area/treeData" cssClass="required form-control" allowClear="${office.currentUser.admin}"/>
    + *
    -
    - -
    - +
    + +
    + +
    * +
    +
    + +
    +
    -
    - -
    - -
    -
    -
    - -
    - +
    + +
    +
    -
    - -
    - +
    + +
    +
    -
    - -
    - +
    + +
    +
    -
    - -
    - +
    + +
    + “是”代表此账号允许登陆,“否”则表示此账号不允许登陆
    -
    - -
    +
    + +
    + title="用户" url="/sys/office/treeData?type=6" allowClear="true" notAllowSelectParent="true" cssClass="form-control"/>
    -
    - -
    +
    + +
    + title="用户" url="/sys/office/treeData?type=6" allowClear="true" notAllowSelectParent="true" cssClass="form-control"/>
    -
    - -
    - +
    + +
    +
    -
    - -
    - +
    + +
    +
    -
    - -
    - +
    + +
    +
    -
    - -
    - +
    + +
    +
    -
    - -
    - +
    + +
    +
    -
    - -
    - +
    + +
    +
    -
    - -
    - +
    + +
    +
    +
    -
    - -
    + +
    +
    + +
    -
    +
    +
    -   - +
    +
    + + + + +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/sys/officeIndex.jsp b/src/main/webapp/WEB-INF/views/sys/officeIndex.jsp index ecb70e805..d0d798fc0 100644 --- a/src/main/webapp/WEB-INF/views/sys/officeIndex.jsp +++ b/src/main/webapp/WEB-INF/views/sys/officeIndex.jsp @@ -7,23 +7,40 @@ - - + + + +
    + + +

    + + +

    + +
    -
    +
     
    - + +
    +
    - + +<%-- --%> diff --git a/src/main/webapp/WEB-INF/views/sys/officeList.jsp b/src/main/webapp/WEB-INF/views/sys/officeList.jsp index a3b12b4d7..371bef470 100644 --- a/src/main/webapp/WEB-INF/views/sys/officeList.jsp +++ b/src/main/webapp/WEB-INF/views/sys/officeList.jsp @@ -5,8 +5,9 @@ 机构管理 - - + + + - +
    + +
    +
    +
    + +
    + +<%--
  • 机构列表
  • --%> +<%--
  • 机构添加
  • --%> + +
    机构名称归属区域机构编码所属级别机构类型机构职责分类备注操作
    +
    +
    +
    +
    +
    +