Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop
This commit is contained in:
@@ -721,6 +721,7 @@ public class MultipleCfgController extends BaseController{
|
||||
model.addAttribute("action",cfg.getAction());
|
||||
try{
|
||||
List<ServiceConfigInfo> serviceConfigInfos=serviceConfigInfoService.findList(cfg.getServiceId());
|
||||
List<BaseCfg> deleteCfg=new ArrayList<>();
|
||||
Integer compileId=0;
|
||||
if(operator.equals("save")){
|
||||
compileId=new ConvertTool().getCompileId();
|
||||
@@ -746,6 +747,15 @@ public class MultipleCfgController extends BaseController{
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{//表单没有提交IP配置,但是根据编译ID却查到了IP配置,说明用户选择删除IP配置
|
||||
BaseIpCfg entity=new BaseIpCfg();
|
||||
entity.setTableName(info.getTableName());
|
||||
entity.setCompileId(compileId);
|
||||
BaseIpCfg resultIp=ipCfgService.get(entity);
|
||||
if(resultIp!=null){
|
||||
resultIp.setTableName(info.getTableName());
|
||||
deleteCfg.add(resultIp);
|
||||
}
|
||||
}
|
||||
}else if(Constants.TABLE_TYPE_STRING==info.getTableType()){
|
||||
if(cfg.getStringCfg()!=null){
|
||||
@@ -810,7 +820,7 @@ public class MultipleCfgController extends BaseController{
|
||||
if("save".equals(operator)){
|
||||
multipleCfgService.addCfg(cfg);
|
||||
}else if("update".equals(operator)){
|
||||
multipleCfgService.updateCfg(cfg);
|
||||
multipleCfgService.updateCfg(cfg,deleteCfg);
|
||||
}
|
||||
addMessage(model,"save_success");
|
||||
}catch (Exception e) {
|
||||
|
||||
@@ -417,6 +417,6 @@
|
||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<update id="deleteByCompileId" parameterType="com.nis.domain.configuration.ComplexkeywordCfg" >
|
||||
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
update ${tableName} set is_valid = -1, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -554,9 +554,9 @@
|
||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<update id="delete" parameterType="com.nis.domain.configuration.BaseIpCfg" >
|
||||
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
update ${tableName} set is_valid = -1, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="deleteByCompileId" parameterType="com.nis.domain.configuration.BaseIpCfg" >
|
||||
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
update ${tableName} set is_valid = -1, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -425,6 +425,6 @@
|
||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<update id="deleteByCompileId" parameterType="com.nis.domain.configuration.NumBoundaryCfg" >
|
||||
update NUM_BOUNDARY_CFG set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
update NUM_BOUNDARY_CFG set is_valid = -1, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -403,7 +403,7 @@
|
||||
<if test="isHexbin != null">
|
||||
is_hexbin=#{isHexbin,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null and areaEffectiveIds != ''" >
|
||||
<if test="areaEffectiveIds != null" >
|
||||
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
@@ -430,6 +430,6 @@
|
||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<update id="deleteByCompileId" parameterType="com.nis.domain.configuration.BaseStringCfg" >
|
||||
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
update ${tableName} set is_valid = -1, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -77,7 +77,7 @@ public class MultipleCfgService extends CrudService<MultipleCfgDao,MultipleSearc
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int updateCfg(MultipleCfg cfg){
|
||||
public int updateCfg(MultipleCfg cfg,List<BaseCfg> deleteCfg){
|
||||
if(cfg==null) return 0;
|
||||
if(cfg.getIpCfg()!=null){
|
||||
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
|
||||
@@ -104,6 +104,19 @@ public class MultipleCfgService extends CrudService<MultipleCfgDao,MultipleSearc
|
||||
complexStringCfgDao.updateByPrimaryKeySelective(_cfg);
|
||||
}
|
||||
}
|
||||
if(deleteCfg!=null&&deleteCfg.size()>0){
|
||||
for(BaseCfg _cfg:deleteCfg){
|
||||
if(_cfg instanceof BaseIpCfg){
|
||||
ipCfgDao.deleteByCompileId((BaseIpCfg)_cfg);
|
||||
}else if(_cfg instanceof BaseStringCfg){
|
||||
stringCfgDao.deleteByCompileId((BaseStringCfg)_cfg);
|
||||
}else if(_cfg instanceof NumBoundaryCfg){
|
||||
numCfgDao.deleteByCompileId((NumBoundaryCfg)_cfg);
|
||||
}else if(_cfg instanceof ComplexkeywordCfg){
|
||||
complexStringCfgDao.deleteByCompileId((ComplexkeywordCfg)_cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
|
||||
Reference in New Issue
Block a user