public ModelAndView deletePushRecordWithDocs(@RequestParam("pushRecordSelect")
String[] indexids, @RequestParam("topicid")
String topicid, @RequestParam(value = "pageNum", required = false)
int pageNum, @RequestParam(value = "type", required = false)
int type, HttpSession session) {
User user = getUserFromSession(session);
if (user == null) {
return errorMav;
}
int number = 0;
for (String indexid : indexids) {
PushRecord pushRecord = pushRecordService.getPushRecordById(indexid);
if (pushRecord.getType() == PushRecord.PUSH_RECORD_TYPE.doc.ordinal()) {//普通文章的推送记录
number = docService.deleteDoc(pushRecord.getDocid(), user.getUserName());
} else if (pushRecord.getType() == PushRecord.PUSH_RECORD_TYPE.emptyDoc.ordinal()) {//空文章
List<String> deleteIndexid = new ArrayList<String>();
deleteIndexid.add(indexid);
number = pushRecordService.deletePushRecords(deleteIndexid);
} else if (pushRecord.getType() == PushRecord.PUSH_RECORD_TYPE.model.ordinal()) {//模板
String modelName = pushRecord.getModelName();
List<String> deleteIndexid = new ArrayList<String>();
deleteIndexid.add(indexid);
number = pushRecordService.deletePushRecords(deleteIndexid);
modelService.deleteModel(modelName, user.getUserName());
}
}
if (number > 0) {
return this.topicPage(topicid, pageNum, 0, type);
}