(1)config_group_info新增一列compile_id,用于存放app_ip_cfg的compile_id,防止app_ip_cfg的数据被误清的情况下获取不到正确的编译ID
(2)IP_TYPE去掉46,64,10三种类型
This commit is contained in:
@@ -10,6 +10,14 @@ public class ConfigGroupInfo {
|
|||||||
private Date insertTime;
|
private Date insertTime;
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
private Integer groupType;
|
private Integer groupType;
|
||||||
|
private Integer compileId;
|
||||||
|
|
||||||
|
public Integer getCompileId() {
|
||||||
|
return compileId;
|
||||||
|
}
|
||||||
|
public void setCompileId(Integer compileId) {
|
||||||
|
this.compileId = compileId;
|
||||||
|
}
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,7 +212,7 @@
|
|||||||
|
|
||||||
<!-- 根据groupId查出配置分组信息 -->
|
<!-- 根据groupId查出配置分组信息 -->
|
||||||
<select id="getConfigGroupInfoByGroupId" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Integer">
|
<select id="getConfigGroupInfoByGroupId" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Integer">
|
||||||
select id,group_id,group_name,is_issued,insert_time,update_time,group_type
|
select id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id
|
||||||
from config_group_info c where c.group_id= #{groupId}
|
from config_group_info c where c.group_id= #{groupId}
|
||||||
</select>
|
</select>
|
||||||
<select id="getIssuedConfigGroupInfoByGroupIds" resultType="java.lang.Integer" parameterType="java.lang.String">
|
<select id="getIssuedConfigGroupInfoByGroupIds" resultType="java.lang.Integer" parameterType="java.lang.String">
|
||||||
@@ -221,12 +221,16 @@
|
|||||||
|
|
||||||
<!-- 修改配置分组状态信息 -->
|
<!-- 修改配置分组状态信息 -->
|
||||||
<update id="updateConfigGroupInfobyGroupId" parameterType="com.nis.domain.specific.ConfigGroupInfo">
|
<update id="updateConfigGroupInfobyGroupId" parameterType="com.nis.domain.specific.ConfigGroupInfo">
|
||||||
UPDATE config_group_info set is_issued = #{isIssued},update_time=now() where group_id = #{groupId}
|
UPDATE config_group_info set is_issued = #{isIssued},update_time=now()
|
||||||
|
<if test="compileId != null and compileId !='' ">
|
||||||
|
,compile_id= #{compileId}
|
||||||
|
</if>
|
||||||
|
where group_id = #{groupId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<!-- 新增配置分组信息 -->
|
<!-- 新增配置分组信息 -->
|
||||||
<insert id="insertConfigGroupInfo" parameterType="com.nis.domain.specific.ConfigGroupInfo" useGeneratedKeys="true">
|
<insert id="insertConfigGroupInfo" parameterType="com.nis.domain.specific.ConfigGroupInfo" useGeneratedKeys="true">
|
||||||
insert into config_group_info (id,group_id,group_name,is_issued,insert_time,group_type)
|
insert into config_group_info (id,group_id,group_name,is_issued,insert_time,group_type,compile_id)
|
||||||
values(#{id},#{groupId},#{groupName},#{isIssued},now(),#{groupType})
|
values(#{id},#{groupId},#{groupName},#{isIssued},now(),#{groupType},#{compileId})
|
||||||
</insert>
|
</insert>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -335,11 +335,11 @@ public class AppCfgService extends BaseService {
|
|||||||
compileId=beforeCfg.get(0).getCompileId();
|
compileId=beforeCfg.get(0).getCompileId();
|
||||||
}
|
}
|
||||||
}else if(configGroupInfo.getIsIssued().intValue()==1){//下发过了
|
}else if(configGroupInfo.getIsIssued().intValue()==1){//下发过了
|
||||||
List<AppIpCfg> beforeCfg=appCfgDao.getAppIpCfgBySpecServiceId(entity.getSpecServiceId());
|
// List<AppIpCfg> beforeCfg=appCfgDao.getAppIpCfgBySpecServiceId(entity.getSpecServiceId());
|
||||||
if(beforeCfg==null||beforeCfg.size()==0) {
|
// if(beforeCfg==null||beforeCfg.size()==0) {
|
||||||
throw new RuntimeException("Can't get compileId, there is not app ip in an issued group");
|
// throw new RuntimeException("Can't get compileId, there is not app ip in an issued group");
|
||||||
}
|
// }
|
||||||
compileId=beforeCfg.get(0).getCompileId();
|
compileId=configGroupInfo.getCompileId();
|
||||||
}else {
|
}else {
|
||||||
throw new RuntimeException("Unknown configGroupInfo isIssued value");
|
throw new RuntimeException("Unknown configGroupInfo isIssued value");
|
||||||
}
|
}
|
||||||
@@ -350,6 +350,11 @@ public class AppCfgService extends BaseService {
|
|||||||
entity.setIsValid(0);
|
entity.setIsValid(0);
|
||||||
entity.setIsAudit(0);
|
entity.setIsAudit(0);
|
||||||
appCfgDao.insertAppIpCfg(entity);
|
appCfgDao.insertAppIpCfg(entity);
|
||||||
|
//app ip的编译ID存于configGroupInfo中
|
||||||
|
if((configGroupInfo.getCompileId()==null)||(compileId.intValue()!=configGroupInfo.getCompileId().intValue())) {
|
||||||
|
configGroupInfo.setCompileId(entity.getCompileId());
|
||||||
|
specificServiceCfgDao.updateConfigGroupInfobyGroupId(configGroupInfo);
|
||||||
|
}
|
||||||
// 保存区域IP信息
|
// 保存区域IP信息
|
||||||
if (entity.getAreaCfg() != null) {
|
if (entity.getAreaCfg() != null) {
|
||||||
for (AreaIpCfg cfg : entity.getAreaCfg()) {
|
for (AreaIpCfg cfg : entity.getAreaCfg()) {
|
||||||
@@ -1102,6 +1107,7 @@ public class AppCfgService extends BaseService {
|
|||||||
configGroupInfo.setGroupId(specificServiceCfg.getGroupId());
|
configGroupInfo.setGroupId(specificServiceCfg.getGroupId());
|
||||||
configGroupInfo.setGroupName(specificServiceCfg.getSpecServiceName());
|
configGroupInfo.setGroupName(specificServiceCfg.getSpecServiceName());
|
||||||
configGroupInfo.setIsIssued(0);
|
configGroupInfo.setIsIssued(0);
|
||||||
|
configGroupInfo.setCompileId(entitys.get(0).getCompileId());
|
||||||
configGroupInfo.setGroupType(1);
|
configGroupInfo.setGroupType(1);
|
||||||
specificServiceCfgDao.insertConfigGroupInfo(configGroupInfo);
|
specificServiceCfgDao.insertConfigGroupInfo(configGroupInfo);
|
||||||
//更新group_id
|
//更新group_id
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE config_group_info MODIFY COLUMN group_type INT(11) NULL COMMENT '1:app ip,2:内容,3:区域 ,4 asn';
|
||||||
|
ALTER TABLE config_group_info ADD COLUMN compile_id INT(11) NULL COMMENT 'app ip 对应的编译ID';
|
||||||
2
src/main/resources/sql/20180926/update_ip_type.sql
Normal file
2
src/main/resources/sql/20180926/update_ip_type.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
UPDATE function_region_dict SET config_ip_type='4,6' WHERE config_ip_type='4,6,46,64,10';
|
||||||
|
DELETE FROM sys_data_dictionary_item WHERE dictionary_id=(SELECT ID FROM sys_data_dictionary_name WHERE mark='IP_TYPE') AND item_code IN (46,64,10);
|
||||||
Reference in New Issue
Block a user