Authored by min.ling

update

... ... @@ -184,6 +184,7 @@ public class TopicServiceImpl implements ITopicService {
if(articleTopMap != null && articleTopMap.get(grassTopic.getId()) != null){
List<Integer> topArticleIds = articleTopMap.get(grassTopic.getId()).stream().map(GrassArticleTopic::getArticleId).collect(Collectors.toList());
bo.setTopArticles(StringUtils.join(topArticleIds,","));
bo.setTopStatus(1);
}
result.add(bo);
}
... ... @@ -220,7 +221,7 @@ public class TopicServiceImpl implements ITopicService {
articleTopicDao.updateTopByTopicId(req.getId(),updateTime);
//将指定文章写入 话题-文章关联表
int result = articleTopicDao.updateTopByArticles(articleList,1,updateTime);
int result = articleTopicDao.updateTopByArticles(validArticles,1,updateTime);
logger.info("end addArticlesTop,req:{},result:{}",req,result);
return new ApiResponse(result);
}
... ...
... ... @@ -530,7 +530,7 @@
window.self.paramObject.mkData = data;
$(labelList).myDialog({
title: title,
width: "50%",
width: "30%",
height: "50%",
resizable: false,
buttons: [{
... ... @@ -546,10 +546,23 @@
param.id = data.id;
}
//1)表单基本检查
//表单基本检查
if (!$("#setTopForm").form("validate")) {
return false;
}
//校验最多可填五个内容id
var articleStr = $("#setTopForm #topArticleIds").textbox("getValue");
var articleArray = articleStr.split(',');
for(var i = 0; i < articleArray.length; i++){
if(isNaN(articleArray[i])){
$.messager.alert("提示", "非数字字符不允许提交!", "");
return false;
}
}
if(articleArray.length > 5){
$.messager.alert("提示", "填写不可超过五个内容ID!", "");
return false;
}
$.messager.progress({
title: "正在执行",
... ... @@ -569,7 +582,7 @@
height: 120
});
} else {
$.messager.alert("失败", "操作失败", "error");
$.messager.alert("错误", data.message, "error");
}
}
});
... ...
... ... @@ -6,8 +6,8 @@
<tr style="height: 60px">
<td>
<span style="color:red">*</span><label>内容ID</label> <br>
<input id="topArticleIds" name="topArticleIds" class="easyui-textbox" style="width: 500px;"/>
<td><span style="color:red">注:至多填写5个,设置的内容必须关联该话题</span></td>
<input id="topArticleIds" name="topArticleIds" class="easyui-textbox" style="width: 500px;" /><br>
<span style="color:red">注:至多填写5个,设置的内容必须关联该话题</span>
</td>
</tr>
</table>
... ...