修改snat策略下发的用户信息.
This commit is contained in:
@@ -15,8 +15,8 @@ public class IpReusePolicyCfg extends BaseCfg<IpReusePolicyCfg>{
|
||||
private Integer addrPoolId; // 地址池ID
|
||||
private String translateParam; // 地址翻译参数
|
||||
|
||||
private String userName; // 仅用于列表条件检索
|
||||
private String addrPoolName;
|
||||
private String userName;
|
||||
private String addrPoolName; // 仅用于列表条件检索
|
||||
|
||||
public Integer getUserId() {
|
||||
return userId;
|
||||
|
||||
@@ -20,6 +20,6 @@ public interface IpMultiplexDao extends CrudDao<IpMultiplexDao>{
|
||||
|
||||
void updatePolicyCfg(IpReusePolicyCfg entity);
|
||||
|
||||
String getUserType(@Param("userId")Integer userId);
|
||||
String getUserType(@Param("userName")String userName);
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT"/>
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR"/>
|
||||
<result column="addr_pool_id" property="addrPoolId" jdbcType="INTEGER"/>
|
||||
<result column="user_id" property="userId" jdbcType="INTEGER"/>
|
||||
<result column="user_name" property="userName" jdbcType="VARCHAR"/>
|
||||
<result column="user_type" property="userType" jdbcType="VARCHAR"/>
|
||||
|
||||
<result column="do_log" property="doLog" jdbcType="INTEGER" />
|
||||
@@ -38,7 +38,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="policyColumns">
|
||||
r.CFG_ID,r.CFG_DESC,r.ADDR_POOL_ID,r.USER_ID,r.USER_TYPE,
|
||||
r.CFG_ID,r.CFG_DESC,r.ADDR_POOL_ID,r.USER_NAME,r.USER_TYPE,
|
||||
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,
|
||||
@@ -171,7 +171,7 @@
|
||||
INSERT INTO ip_reuse_policy_cfg (
|
||||
cfg_desc,
|
||||
addr_pool_id,
|
||||
user_id,
|
||||
user_name,
|
||||
user_type,
|
||||
action,
|
||||
do_log,
|
||||
@@ -202,7 +202,7 @@
|
||||
)VALUES (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{addrPoolId,jdbcType=INTEGER},
|
||||
#{userId,jdbcType=INTEGER},
|
||||
#{userName,jdbcType=VARCHAR},
|
||||
#{userType,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
#{doLog,jdbcType=INTEGER},
|
||||
@@ -239,15 +239,15 @@
|
||||
FROM
|
||||
user_manage
|
||||
WHERE
|
||||
id = #{userId}
|
||||
user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<update id="updatePolicyCfg" parameterType="com.nis.domain.configuration.IpReusePolicyCfg">
|
||||
update ip_reuse_policy_cfg
|
||||
<set>
|
||||
<trim suffixOverrides=",">
|
||||
<if test="userId != null" >
|
||||
user_id = #{userId,jdbcType=INTEGER},
|
||||
<if test="userName != null and userName != ''" >
|
||||
user_name = #{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userType != null and userType != ''" >
|
||||
user_type = #{userType,jdbcType=VARCHAR},
|
||||
@@ -261,9 +261,6 @@
|
||||
<if test="translateParam != null and translateParam != ''" >
|
||||
translate_param = #{translateParam,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null" >
|
||||
user_id = #{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="doLog != null" >
|
||||
do_log = #{doLog,jdbcType=INTEGER},
|
||||
</if>
|
||||
|
||||
@@ -15,10 +15,12 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.IpReusePolicyCfg;
|
||||
import com.nis.domain.configuration.UserManage;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.dao.configuration.IpMultiplexDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
@@ -56,8 +58,8 @@ public class IpMultiplexService extends BaseService{
|
||||
setAreaEffectiveIds(entity);
|
||||
|
||||
// 获取用户/账号类型
|
||||
if(entity.getUserId() != null){
|
||||
String userType = ipMultiplexDao.getUserType(entity.getUserId());
|
||||
if(StringUtils.isNotBlank(entity.getUserName())){
|
||||
String userType = ipMultiplexDao.getUserType(entity.getUserName());
|
||||
entity.setUserType(userType);
|
||||
}
|
||||
|
||||
@@ -119,7 +121,7 @@ public class IpMultiplexService extends BaseService{
|
||||
cfg.setIsAudit(isAudit);
|
||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
cfg.setAuditTime(auditTime);
|
||||
cfg.setDoLog(null);;
|
||||
cfg.setDoLog(null);
|
||||
ipMultiplexDao.updatePolicyCfg(cfg);
|
||||
|
||||
SysDictInfoService sysDictInfoService = SpringContextHolder.getBean(SysDictInfoService.class);
|
||||
@@ -132,7 +134,7 @@ public class IpMultiplexService extends BaseService{
|
||||
params.put("configId", cfg.getCompileId());
|
||||
params.put("addrPoolId", cfg.getAddrPoolId());
|
||||
params.put("userType", cfg.getUserType());
|
||||
params.put("userId", cfg.getUserId());
|
||||
params.put("userId", keywordsEscape(cfg.getUserName()));
|
||||
params.put("doLog", cfg.getDoLog());
|
||||
params.put("action", cfg.getAction());
|
||||
params.put("service", cfg.getServiceId());
|
||||
@@ -163,7 +165,7 @@ public class IpMultiplexService extends BaseService{
|
||||
params.put("configId", cfg.getCompileId());
|
||||
params.put("addrPoolId", cfg.getAddrPoolId());
|
||||
params.put("userType", cfg.getUserType());
|
||||
params.put("userId", cfg.getUserId());
|
||||
params.put("userId", keywordsEscape(cfg.getUserName()));
|
||||
params.put("doLog", cfg.getDoLog());
|
||||
params.put("action", cfg.getAction());
|
||||
params.put("service", cfg.getServiceId());
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE ip_reuse_policy_cfg CHANGE user_id user_name VARCHAR(255) NOT NULL COMMENT '用户标识';
|
||||
@@ -134,14 +134,14 @@ $(function(){
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="user"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="userId" class="selectpicker show-tick form-control required" data-live-search="true" data-live-search-placeholder="search">
|
||||
<select name="userName" class="selectpicker show-tick form-control required" data-live-search="true" data-live-search-placeholder="search">
|
||||
<option value="" ><spring:message code="select"/></option>
|
||||
<c:forEach items="${users }" var="user">
|
||||
<option value="${user.id}" <c:if test="${_cfg.userId eq user.id }">selected</c:if>><spring:message code="${user.userName}"/></option>
|
||||
<option value="${user.userName}" <c:if test="${_cfg.userName eq user.userName }">selected</c:if>><spring:message code="${user.userName}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="userId"></div>
|
||||
<div for="userName"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -317,7 +317,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<c:forEach items="${users }" var="user">
|
||||
<c:if test="${indexCfg.userId eq user.id }">
|
||||
<c:if test="${indexCfg.userName eq user.userName }">
|
||||
<spring:message code="${user.userName }"/>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
|
||||
Reference in New Issue
Block a user