Authored by chenly5

草稿箱筛选渠道

... ... @@ -57,7 +57,7 @@ public class GrassArticleController {
@RequestMapping("/updateArticle")
public ApiResponse updateArticle(@RequestBody GrassArticleReq req){
logger.info("grassArticle grassArticleList begin, req is {}");
logger.info("grassArticle updateArticle begin, req is {}");
try {
grassArticleService.updateArticle(req);
} catch (PlatformException e) {
... ... @@ -189,4 +189,11 @@ public class GrassArticleController {
}
@RequestMapping("/backToDraft")
public ApiResponse backToDraft(@RequestBody GrassArticleReq req) {
logger.info("grassArticle backToDraft begin, req is {}");
grassArticleService.backToDraft(req);
return new ApiResponse.ApiResponseBuilder().build();
}
}
... ...
... ... @@ -43,4 +43,6 @@ public interface IGrassArticleService {
List<GrassFindgoodsRspBO> buildFindgoodsRsp(List<GrassFindGoods> grassFindGoods);
void backToDraft(GrassArticleReq req) ;
}
... ...
... ... @@ -1258,11 +1258,11 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
int page = req.getPage();
int size = req.getSize();
logger.info("begin grassArticleDao.selectDraftArticleCount");
int total = grassArticleDao.selectDraftArticleCount(articleId, authorUids, isPublished, System.currentTimeMillis(), startTimeInt, endTimeInt, isExclude, userType,sort,req.getDispatchChannel());
int total = grassArticleDao.selectDraftArticleCount(articleId, authorUids, isPublished, System.currentTimeMillis(), startTimeInt, endTimeInt, isExclude, userType,sort,req.getChannelId());
logger.info("end grassArticleDao.selectDraftArticleCount: total is {}", total);
int offset = (page - 1) * size;
logger.info("begin grassArticleDao.selectDraftArticleList,offset is {}, limit is {} ", offset, size);
List<GrassArticle> articleList = grassArticleDao.selectDraftArticleList(articleId, authorUids, isPublished, System.currentTimeMillis(), startTimeInt, endTimeInt, offset, size, isExclude, userType,sort,req.getDispatchChannel());
List<GrassArticle> articleList = grassArticleDao.selectDraftArticleList(articleId, authorUids, isPublished, System.currentTimeMillis(), startTimeInt, endTimeInt, offset, size, isExclude, userType,sort,req.getChannelId());
logger.info("end grassArticleDao.selectDraftArticleCount: offset is {}, limit is {} ", offset, size);
PageResponseVO rsp = new PageResponseVO();
rsp.setList(buildArticleDetail(articleList, true));
... ... @@ -2743,4 +2743,14 @@ public class GrassArticleServiceImpl implements IGrassArticleService {
}
return rspBoList;
}
@Override
public void backToDraft(GrassArticleReq req) {
logger.debug("enter backToDraft articleId is {}" , req.getArticleId());
GrassArticle article = new GrassArticle();
article.setId(req.getArticleId());
article.setAuthStatus(9);
article.setUpdateTime(System.currentTimeMillis());
grassArticleDao.updateByPrimaryKeySelective(article);
}
}
... ...
... ... @@ -58,6 +58,7 @@
<!--</input>-->
<input class="easyui-combobox" id="sortParam">
</input>
<input class="easyui-textbox" id="channelIdReq"/>
<a id="searchBtn1" class="btn-info">筛选</a>
<!--<a id="addActivityBtn" class="btn-success">新增</a>-->
<a id="allBtn" class="btn-info">全部 </a>
... ... @@ -89,6 +90,7 @@
$("#isPublished").combobox("setValue","");
$("#authorId").textbox("setValue","");
$("#userType").combobox("setValue","");
$("#channelIdReq").combobox("setValue","");
$("#activityListTable").datagrid("load", {
});
... ... @@ -126,6 +128,18 @@
data:[{text:"全部",value:"8"},{text:"待发布",value:"0"},{text:"未发布",value:"1"}]
});
$("#channelIdReq").combobox({
valueField : "id",
textField : "channelName",
required:false,
prompt: "渠道类型",
url : serverContextPath + "/grassChannelManage/getAllGrassChannelInfo",
loadFilter: function (data) {
var data = defaultLoadFilter(data);
return data;
}
});
... ... @@ -170,7 +184,8 @@
userType: $("#userType").combobox("getValue"),
isPublished: $("#isPublished").combobox("getValue"),
authorUid: $("#authorId").textbox("getValue"),
sort:$("#sortParam").combobox("getValue")
sort:$("#sortParam").combobox("getValue"),
channelId: $("#channelIdReq").combobox("getValue")
});
}
});
... ... @@ -184,6 +199,7 @@
queryParams: {
publisher: $("#publisher").textbox("getValue"),
articleId: $("#articleId").textbox("getValue"),
channelId: $("#channelIdReq").combobox("getValue"),
},
url: serverContextPath + "/grassArticle/draftArticleList",
method: 'POST',
... ...
... ... @@ -600,6 +600,8 @@
}
str += "<a role='markR' class='btn-success' dataId='"+rowData.articleId+ "' index='"+ rowIndex + "' style='margin-left:10px'>标记</a>";
str += "<a role='backToDraft' class='btn-success' dataId='"+rowData.articleId+ "' index='"+ rowIndex + "' style='margin-left:10px'>回退</a>";
//str += "<a role='preview' class='btn-info' dataId='" + rowData.previewUrl + "' index='"+ rowIndex + "' style='margin-left:10px'>预览</a>";
... ... @@ -666,6 +668,22 @@
}
});
$(this).datagrid("getPanel").find("a[role='backToDraft']").linkbutton({
iconCls : "icon-edit",
onClick: function () {
var dataId = $(this).attr("dataId");
index = $(this).attr("index");
var message = "回退";
$.messager.confirm("确认", "确认"+message+"该文章吗?", function (flag) {
if(flag){
backToDraft(dataId);
}
});
}
});
$(this).datagrid("getPanel").find("a[role='markR']").linkbutton({
iconCls: "icon-edit",
onClick: function () {
... ... @@ -881,6 +899,16 @@
}, "json");
}
function backToDraft(id) {
$.post(serverContextPath + "/grassArticle/backToDraft?articleId=" + id , function (data) {
if(data.code != 200){
alert(data.message);
}else{
$("#activityListTable").datagrid("reload");
}
}, "json");
}
/*function switchMark(id, markFlag) {
var switchMark = markFlag == 1 ? 0 : 1;
$.post(serverContextPath + "/grassArticle/updateMarkFlag.do?articleId=" + id + "&markFlag=" + switchMark, function (data) {
... ...