(1)删除配置时级联删除配置相关的区域IP
(2)修复ip配置删除完成跳转到审核菜单的bug
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Constants;
|
||||
@@ -220,7 +222,7 @@ public class ComplexStringCfgController extends BaseController{
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@RequestMapping(value = {"deleteCfg"})
|
||||
public String deleteStringCfg(String tableName,int action,long cfgId,String cfgName,Integer serviceId,Model model) {
|
||||
public String deleteStringCfg(String tableName,int action,long cfgId,int compileId,String cfgName,Integer serviceId,Model model) {
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("action", action);
|
||||
@@ -233,19 +235,30 @@ public class ComplexStringCfgController extends BaseController{
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
}
|
||||
}
|
||||
List<AreaIpCfg> areaCfg=ipCfgService.getAreaCfgByCompileId(compileId);
|
||||
if(areaCfg!=null&&areaCfg.size()>0){
|
||||
for(AreaIpCfg c:areaCfg){
|
||||
c.setTableName(AreaIpCfg.getTablename());
|
||||
}
|
||||
}
|
||||
int audit=complexStringCfgService.getIsAudit(tableName,cfgId);
|
||||
//未审核时可删除
|
||||
if(audit!=Constants.AUDIT_YES){
|
||||
if(audit!=Constants.AUDIT_YES&&audit!=Constants.AUDIT_NOT_YES){
|
||||
ComplexkeywordCfg cfg=new ComplexkeywordCfg();
|
||||
cfg.setCfgId(cfgId);
|
||||
cfg.setTableName(tableName);
|
||||
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setEditTime(new Date());
|
||||
cfg.setIsValid(Constants.VALID_DEL);
|
||||
int result=complexStringCfgService.deleteStringCfg(cfg);
|
||||
addMessage(model,"delete_success");
|
||||
int result=complexStringCfgService.deleteStringCfg(cfg,areaCfg);
|
||||
if(result==0){
|
||||
addMessage(model,"delete_failed");
|
||||
}else{
|
||||
addMessage(model,"delete_success");
|
||||
}
|
||||
}else{
|
||||
logger.error("通过审核的配置不能删除!");
|
||||
logger.error("通过审核/取消审核通过的配置不能删除!");
|
||||
addMessage(model,"delete_failed");
|
||||
}
|
||||
|
||||
}catch(Exception e){
|
||||
|
||||
Reference in New Issue
Block a user