修正保护名单配置回车不提示、重复数据问题

Conflicts:
	src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js
	src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js
	src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js
This commit is contained in:
zhangwenqing
2019-04-19 17:44:12 +08:00
committed by duandongmei
parent aaa0028cbb
commit c982b506a4
7 changed files with 99 additions and 20 deletions

View File

@@ -77,4 +77,31 @@ public class InnerProtectionListController extends BaseController{
public Map<String,List<String>> ajaxGetAllInfo(HttpServletRequest request, HttpServletResponse response){
return innerProtectionListService.ajaxGetAllInfo();
}
/**
* 校验配置是否已存在
* @param cfg
* @param request
* @param response
* @return
*/
@ResponseBody
@RequestMapping(value = {"/checkKeywordExist"})
public boolean checkKeywordExist(ProtectionListInfo cfg, HttpServletRequest request, HttpServletResponse response){
if(!StringUtil.isEmpty(cfg.getProId())){ // 修改操作
ProtectionListInfo info = innerProtectionListService.getById(cfg.getProId());
if(info != null && info.getKeyword().equals(cfg.getKeyword()) && info.getTargetType().equals(cfg.getTargetType())){
return true;
}
}
Map<String, List<String>> map = innerProtectionListService.ajaxGetAllInfo();
List<String> list = map.get(cfg.getTargetType());
if(list != null) {
if(list.contains(cfg.getKeyword())) {
return false;
}
}
return true;
}
}