Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into develop
This commit is contained in:
@@ -7,7 +7,7 @@ public class IpAddrPool extends InlineIp{
|
||||
@Expose
|
||||
private Integer regionId;
|
||||
@Expose
|
||||
private Integer groupId;
|
||||
private Long groupId;
|
||||
@Expose
|
||||
private Long addrPoolId;
|
||||
|
||||
@@ -19,11 +19,11 @@ public class IpAddrPool extends InlineIp{
|
||||
this.regionId = regionId;
|
||||
}
|
||||
|
||||
public Integer getGroupId() {
|
||||
public Long getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(Integer groupId) {
|
||||
public void setGroupId(Long groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.SysDataDictionaryName;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.CacheUtils;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
@@ -85,7 +86,7 @@ public class ConfigSynchronizationController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value = {"send"})
|
||||
public void send(Model model,HttpServletRequest request,HttpServletResponse response){
|
||||
int status = 0;
|
||||
int status = -2;
|
||||
try {
|
||||
configSynchronizationService.send(request,response,null);
|
||||
status = 1;
|
||||
@@ -99,10 +100,13 @@ public class ConfigSynchronizationController extends BaseController {
|
||||
e.printStackTrace();
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}catch(MaatConvertException e){
|
||||
e.printStackTrace();
|
||||
status = -1;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
if(status==0){
|
||||
if(status!=1){
|
||||
SysDataDictionaryName sysDictName = new SysDataDictionaryName();
|
||||
sysDictName.setMark("currrent_sync_status");
|
||||
List<SysDataDictionaryName> dictList = dictService.findDicByName(sysDictName);
|
||||
@@ -112,14 +116,14 @@ public class ConfigSynchronizationController extends BaseController {
|
||||
if(!StringUtil.isEmpty(itemList)){
|
||||
SysDataDictionaryItem item = itemList.get(0);
|
||||
item.setDictionaryId(dict.getId().intValue());
|
||||
item.setItemValue("-2");//界面组织数据失败
|
||||
item.setItemValue(String.valueOf(status));//-2界面组织数据失败,-1服务端返回的失败
|
||||
dictService.updateDictItem(item);
|
||||
//删除字典缓存
|
||||
CacheUtils.remove(Constants.CACHE_DICT_MAP);
|
||||
}
|
||||
}
|
||||
Map<String,Integer> map = new HashMap();
|
||||
map.put("syncStatus", 1);
|
||||
map.put("syncStatus", 0);
|
||||
JSONObject result = ConfigServiceUtil.configSyncCmd(BaseService.gsonToJson(map));//取消同步
|
||||
}else{
|
||||
|
||||
|
||||
@@ -73,8 +73,8 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
inoctetsNum = (Double) map.get("inoctets");
|
||||
outoctetsNum = (Double) map.get("outoctets");
|
||||
//单位换算 byte->bit/s
|
||||
inoctetsNum=(inoctetsNum*8)/(5*60*60);
|
||||
outoctetsNum=(outoctetsNum*8)/(5*60*60);
|
||||
inoctetsNum=(inoctetsNum*8)/(5*60);
|
||||
outoctetsNum=(outoctetsNum*8)/(5*60);
|
||||
|
||||
}
|
||||
bandwidth=inoctetsNum+outoctetsNum;
|
||||
|
||||
@@ -14,7 +14,6 @@ public interface IpMultiplexDao extends CrudDao<IpMultiplexDao>{
|
||||
List<IpReusePolicyCfg> findPage(IpReusePolicyCfg entity);
|
||||
|
||||
List<IpReusePolicyCfg> findList(@Param("cfgId")Long cfgId
|
||||
,@Param("isAudit")Integer isAudit
|
||||
,@Param("isValid")Integer isValid);
|
||||
|
||||
void savePolicyCfg(IpReusePolicyCfg entity);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<result column="user_id" property="userId" jdbcType="INTEGER"/>
|
||||
<result column="user_type" property="userType" jdbcType="VARCHAR"/>
|
||||
|
||||
<result column="do_log" property="doLog" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
@@ -38,7 +39,7 @@
|
||||
|
||||
<sql id="policyColumns">
|
||||
r.CFG_ID,r.CFG_DESC,r.ADDR_POOL_ID,r.USER_ID,r.USER_TYPE,
|
||||
r.ACTION,r.IS_VALID,r.IS_AUDIT,r.CFG_REGION_CODE,r.CFG_TYPE,r.FUNCTION_ID,
|
||||
r.ACTION,r.DO_LOG,r.IS_VALID,r.IS_AUDIT,r.CFG_REGION_CODE,r.CFG_TYPE,r.FUNCTION_ID,
|
||||
r.SERVICE_ID,r.COMPILE_ID,r.REQUEST_ID,r.CLASSIFY,r.ATTRIBUTE,r.LABLE,
|
||||
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
|
||||
r.CANCEL_REQUEST_ID,r.IS_AREA_EFFECTIVE,r.AREA_EFFECTIVE_IDS,
|
||||
@@ -162,9 +163,6 @@
|
||||
<if test="isValid ==null">
|
||||
AND r.is_valid != -1
|
||||
</if>
|
||||
<if test="isAudit !=null">
|
||||
AND r.is_audit = #{isAudit,jdbcType=INTEGER}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY r.cfg_id
|
||||
</select>
|
||||
@@ -176,6 +174,7 @@
|
||||
user_id,
|
||||
user_type,
|
||||
action,
|
||||
do_log,
|
||||
is_valid,
|
||||
is_audit,
|
||||
cfg_type,
|
||||
@@ -206,6 +205,7 @@
|
||||
#{userId,jdbcType=INTEGER},
|
||||
#{userType,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
#{doLog,jdbcType=INTEGER},
|
||||
0,
|
||||
0,
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
@@ -261,6 +261,9 @@
|
||||
<if test="userId != null" >
|
||||
user_id = #{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="doLog != null" >
|
||||
do_log = #{doLog,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
|
||||
@@ -176,9 +176,9 @@ public class IpAddrPoolCfgService extends BaseService{
|
||||
}
|
||||
IpCfg c = cfgs.get(0);
|
||||
ip.setRegionId(ipcfg.getCompileId());
|
||||
//ip.setGroupId(ipcfg.getCompileId());
|
||||
|
||||
ip.setGroupId(cfg.getCfgId());
|
||||
ip.setAddrType(ipcfg.getIpType());
|
||||
|
||||
ip.setSrcIp(c.getSrcIp());
|
||||
ip.setMaskSrcIp(c.getSrcIpMask());
|
||||
ip.setSrcPort(c.getSrcPort());
|
||||
@@ -190,13 +190,12 @@ public class IpAddrPoolCfgService extends BaseService{
|
||||
ip.setProtocol(ipcfg.getProtocol());
|
||||
ip.setDirection(ipcfg.getDirection());
|
||||
|
||||
ip.setAddrPoolId(cfg.getCfgId());
|
||||
ip.setIsValid(cfg.getIsValid());
|
||||
ip.setAction(ipcfg.getAction());
|
||||
ip.setService(ipcfg.getServiceId());
|
||||
ip.setAddrPoolId(cfg.getCfgId());
|
||||
ip.setAreaEffectiveIds(cfg.getAreaEffectiveIds());//添加区域管控
|
||||
ip.setOpTime(auditTime);
|
||||
//ip.setAreaEffectiveIds(cfg.getAreaEffectiveIds());//添加区域管控
|
||||
|
||||
resStrategyList.add(ip);
|
||||
}
|
||||
//调用服务接口下发配置数据
|
||||
@@ -224,7 +223,9 @@ public class IpAddrPoolCfgService extends BaseService{
|
||||
}
|
||||
IpCfg c = cfgs.get(0);
|
||||
ip.setRegionId(ipcfg.getCompileId());
|
||||
ip.setGroupId(cfg.getCfgId());
|
||||
ip.setAddrType(ipcfg.getIpType());
|
||||
|
||||
ip.setSrcIp(c.getSrcIp());
|
||||
ip.setMaskSrcIp(c.getSrcIpMask());
|
||||
ip.setSrcPort(c.getSrcPort());
|
||||
@@ -235,12 +236,13 @@ public class IpAddrPoolCfgService extends BaseService{
|
||||
ip.setMaskDstPort(c.getDstPortMask());
|
||||
ip.setProtocol(ipcfg.getProtocol());
|
||||
ip.setDirection(ipcfg.getDirection());
|
||||
|
||||
ip.setAddrPoolId(cfg.getCfgId());
|
||||
ip.setIsValid(cfg.getIsValid());
|
||||
ip.setAction(ipcfg.getAction());
|
||||
ip.setService(ipcfg.getServiceId());
|
||||
ip.setAddrPoolId(cfg.getCfgId());
|
||||
ip.setAreaEffectiveIds(cfg.getAreaEffectiveIds());
|
||||
ip.setOpTime(auditTime);
|
||||
//ip.setAreaEffectiveIds(cfg.getAreaEffectiveIds());
|
||||
resStrategyList.add(ip);
|
||||
}
|
||||
//调用服务接口取消配置
|
||||
|
||||
@@ -40,7 +40,7 @@ public class IpMultiplexService extends BaseService{
|
||||
}
|
||||
|
||||
public IpReusePolicyCfg getPolicyCfg(Long cfgId, Integer isValid) {
|
||||
List<IpReusePolicyCfg> list=ipMultiplexDao.findList(cfgId,isValid,null);
|
||||
List<IpReusePolicyCfg> list=ipMultiplexDao.findList(cfgId,isValid);
|
||||
IpReusePolicyCfg policyCfg=null;
|
||||
if(list != null && list.size()>0){
|
||||
policyCfg=list.get(0);
|
||||
@@ -119,6 +119,7 @@ public class IpMultiplexService extends BaseService{
|
||||
cfg.setIsAudit(isAudit);
|
||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
cfg.setAuditTime(auditTime);
|
||||
cfg.setDoLog(null);;
|
||||
ipMultiplexDao.updatePolicyCfg(cfg);
|
||||
|
||||
SysDictInfoService sysDictInfoService = SpringContextHolder.getBean(SysDictInfoService.class);
|
||||
@@ -126,16 +127,20 @@ public class IpMultiplexService extends BaseService{
|
||||
cfg = this.getPolicyCfg(cfg.getCfgId(), null);
|
||||
String json="";
|
||||
if(cfg.getIsAudit() == Constants.AUDIT_YES){
|
||||
String areaEffectiveIds = cfg.getIsAreaEffective() == 1?sysDictInfoService.setEffectiveRange(cfg.getAreaEffectiveIds()):"0";
|
||||
Map<String, Object> params = new HashMap<String,Object>();
|
||||
params.put("configId", cfg.getCompileId());
|
||||
params.put("addrPoolId", cfg.getAddrPoolId());
|
||||
params.put("userType", cfg.getUserType());
|
||||
params.put("userId", cfg.getUserId());
|
||||
params.put("doLog", cfg.getDoLog());
|
||||
params.put("action", cfg.getAction());
|
||||
params.put("service", cfg.getServiceId());
|
||||
params.put("isValid", 1);
|
||||
params.put("opTime", auditTime);
|
||||
if(cfg.getIsAreaEffective() == 1){
|
||||
params.put("effectiveRange", sysDictInfoService.setEffectiveRange(cfg.getAreaEffectiveIds()));
|
||||
}
|
||||
params.put("translateParam", "byconn=10");
|
||||
params.put("effectiveRange", areaEffectiveIds);
|
||||
|
||||
List list = Lists.newArrayList();
|
||||
list.add(params);
|
||||
//调用服务接口下发配置数据
|
||||
@@ -153,16 +158,20 @@ public class IpMultiplexService extends BaseService{
|
||||
}
|
||||
|
||||
}else if(cfg.getIsAudit() == Constants.AUDIT_NOT_YES){
|
||||
String areaEffectiveIds = cfg.getIsAreaEffective() == 1?sysDictInfoService.setEffectiveRange(cfg.getAreaEffectiveIds()):"0";
|
||||
Map<String, Object> params = new HashMap<String,Object>();
|
||||
params.put("configId", cfg.getCompileId());
|
||||
params.put("addrPoolId", cfg.getAddrPoolId());
|
||||
params.put("userType", cfg.getUserType());
|
||||
params.put("userId", cfg.getUserId());
|
||||
params.put("doLog", cfg.getDoLog());
|
||||
params.put("action", cfg.getAction());
|
||||
params.put("service", cfg.getServiceId());
|
||||
params.put("isValid", 0);
|
||||
params.put("opTime", auditTime);
|
||||
if(cfg.getIsAreaEffective() == 1){
|
||||
params.put("effectiveRange", sysDictInfoService.setEffectiveRange(cfg.getAreaEffectiveIds()));
|
||||
}
|
||||
params.put("translateParam", "byconn=10");
|
||||
params.put("effectiveRange", areaEffectiveIds);
|
||||
|
||||
List list = Lists.newArrayList();
|
||||
list.add(params);
|
||||
//调用服务接口取消配置
|
||||
|
||||
Reference in New Issue
Block a user