From 359dd64696b28ee1e3c94197193afdbecae8613a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E5=86=AC=E6=A2=85?= Date: Mon, 15 Apr 2019 17:02:42 +0800 Subject: [PATCH] =?UTF-8?q?ASN=E4=BF=AE=E6=94=B9=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E4=B8=8D=E9=80=9A=E8=BF=87BUG:=E5=AE=A1=E6=A0=B8=E4=B8=8D?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E4=B9=9F=E4=B8=8B=E5=8F=91=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E7=AB=AF=E4=BA=86=EF=BC=8C=E9=94=99=E8=AF=AF=E4=BD=BF=E7=94=A8?= =?UTF-8?q?isValid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/web/service/basics/AsnIpCfgService.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java b/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java index 833d9a4f2..4cf6f81ba 100644 --- a/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java +++ b/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java @@ -441,7 +441,7 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { * @since 1.0.0 */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void auditIpBatch(Map> data,Integer isValid) { + public void auditIpBatch(Map> data,Integer isAudit) { SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); final SqlSession batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); try{ @@ -471,7 +471,7 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { List digestRegionList = new ArrayList(); List areaIpRegionList = new ArrayList(); - if(isValid==Constants.VALID_YES) {//审核通过 + if(isAudit == Constants.AUDIT_YES) {//审核通过 if(asnGroupInfo.getIsValid()==0) {//ans组未下发过,下发编译配置 asnGroupInfo.setIsValid(1); asnGroupInfo.setEditorId(UserUtils.getUser().getId()); @@ -499,7 +499,7 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { maatCfg.setGroupRelationList(groupRelationList); maatCfg.setGroupNum(groupRelationList.size()); maatCfg.setAreaIpRegionList(areaIpRegionList); - maatCfg.setIsValid(isValid); + maatCfg.setIsValid(Constants.VALID_YES); // 设置ASN自定义域 String userRegion = "ASN_ID=AS" + asnIpCfgs.get(0).getUserRegion1(); maatCfg.setUserRegion(userRegion); @@ -518,11 +518,11 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { }else if(asnGroupInfo.getIsValid()==1){//已经下发过,走分组复用 asnGroupInfo.setIssuedIPs(issuedNum+0l); asnGroupInfoDao.update(asnGroupInfo); - asnIPRegionSendToMaat(asnIpCfgs,isValid); + asnIPRegionSendToMaat(asnIpCfgs,Constants.VALID_YES); }else { throw new RuntimeException("asnGroupInfo isValid value is "+asnGroupInfo.getIsValid()); } - }else if(isValid==Constants.VALID_NO) {//取消审核通过 + }else if(isAudit == Constants.AUDIT_NOT_YES) {//取消审核通过 asnGroupInfo.setIssuedIPs(0L-issuedNum); asnGroupInfoDao.update(asnGroupInfo); //已经下发过的,调用分组复用配置删除接口 @@ -545,7 +545,7 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { // //调用服务接口下发配置 // ToMaatResult result = ConfigServiceUtil.put(json,3); // logger.info("ASN IP域删除配置响应信息:"+result.getMsg()); - asnIPRegionSendToMaat(asnIpCfgs,isValid); + asnIPRegionSendToMaat(asnIpCfgs,Constants.VALID_NO); //如果一个asn组下没有IP了,修改有效状态 //if(hasValidAsnIp(asn)) { // asnGroupInfo.setIsValid(0); @@ -554,8 +554,6 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { // asnGroupInfoDao.updateValid(asnGroupInfo); //} - }else { - throw new RuntimeException("isValid value is "+isValid); } //}); }