优化app topic domain界面,去掉domain重复性判断

This commit is contained in:
duandongmei
2018-09-03 13:52:06 +08:00
parent ba295706f3
commit d9d5e2be36
3 changed files with 283 additions and 275 deletions

View File

@@ -1083,17 +1083,14 @@ public class AppCfgController extends BaseController {
@RequestMapping(value = {"saveAppTopicDomainCfg"})
@RequiresPermissions(value={"app:topic:config"})
public String saveAppTopicDomainCfg(Model model,HttpServletRequest request,HttpServletResponse response,
AppTopicDomainCfg entity,@RequestParam("userDomain")String userDomain,RedirectAttributes redirectAttributes) {
AppTopicDomainCfg entity,RedirectAttributes redirectAttributes) {
try {
//验证域名的重复行
if(!StringUtil.isBlank(userDomain)){
if(!StringUtil.isBlank(entity.getDomain())){
WebsiteDomainTopic websiteDomainTopic = new WebsiteDomainTopic();
websiteDomainTopic.setDomain(userDomain);
websiteDomainTopic.setDomain(entity.getDomain());
List<WebsiteDomainTopic> domainDict = appCfgService.getDomainDict(websiteDomainTopic);
if((domainDict!=null&&domainDict.size()>0)){
addMessage(redirectAttributes,"domain_existed");
return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+entity.getFunctionId();
}else{
if((domainDict==null || domainDict.size()==0)){
//保存到域名关联表中
if(entity!=null&&entity.getWebsiteServiceId()!=null&&entity.getTopicId()!=null){
websiteDomainTopic.setWebsiteServiceId(entity.getWebsiteServiceId());
@@ -1108,8 +1105,8 @@ public class AppCfgController extends BaseController {
}
}
}
if(entity!=null&&StringUtil.isBlank(entity.getDomain())&&!StringUtil.isBlank(userDomain)){
entity.setDomain(userDomain);//自定义域名
if(entity!=null&&StringUtil.isBlank(entity.getDomain())&&!StringUtil.isBlank(entity.getDomain())){
entity.setDomain(entity.getDomain());
}
appCfgService.saveOrUpdateAppTopicDomainCfg(entity);
addMessage(redirectAttributes,"save_success");