Authored by 张帅

Merge branch 'test6.9.5' of http://git.yoho.cn/yoho30/yoho-sns into test6.9.5

... ... @@ -8,6 +8,7 @@ import com.yohobuy.platform.model.grass.request.TblCrawlerInfoQueryReq;
import com.yohobuy.platform.model.grass.request.TbleCrawlerAddToGrassReq;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
... ... @@ -24,7 +25,7 @@ public class TblCrawlerArticleController {
ITblCrawlerInfoService tblCrawlerInfoService;
@RequestMapping("/publishCrawlerArticle")
public ApiResponse publishCrawlerArticle(TbleCrawlerAddToGrassReq req){
public ApiResponse publishCrawlerArticle(@RequestBody TbleCrawlerAddToGrassReq req){
logger.info("tblCrawlerArticle publishCrawlerArticle begin, req is {}", req);
try {
//默认审核通过
... ... @@ -37,7 +38,7 @@ public class TblCrawlerArticleController {
}
@RequestMapping("/tblTimerPublish")
public ApiResponse tblTimerPublish(TbleCrawlerAddToGrassReq req){
public ApiResponse tblTimerPublish(@RequestBody TbleCrawlerAddToGrassReq req){
logger.info("tblCrawlerArticle timerPublish begin, req is {}",req);
try {
tblCrawlerInfoService.timerPublishToGrass(req);
... ... @@ -48,7 +49,7 @@ public class TblCrawlerArticleController {
}
@RequestMapping("/saveTblArticleDraft")
public ApiResponse saveTblArticleDraft(TbleCrawlerAddToGrassReq req){
public ApiResponse saveTblArticleDraft(@RequestBody TbleCrawlerAddToGrassReq req){
logger.info("tblCrawlerArticle saveTblArticleDraft begin, req is {}", req);
try {
req.setAuthStatus(9);
... ...
... ... @@ -20,6 +20,7 @@ import com.yohobuy.platform.dal.pcms.model.TblCrawlerUidRelation;
import com.yohobuy.platform.grass.service.IGrassArticleService;
import com.yohobuy.platform.grass.service.ITblCrawlerInfoService;
import com.yohobuy.platform.model.common.PageResponseVO;
import com.yohobuy.platform.model.grass.request.GrassArticleReq;
import com.yohobuy.platform.model.grass.request.TblCrawlerInfoQueryReq;
import com.yohobuy.platform.model.grass.request.TbleCrawlerAddToGrassReq;
import com.yohobuy.platform.model.grass.response.TblCrawlerInfoQueryRsp;
... ... @@ -27,6 +28,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
... ... @@ -64,7 +66,7 @@ public class TblCrawlerInfoServiceImpl implements ITblCrawlerInfoService {
//根据种草文id查询
if(req.getArticleId() != null){
List<TblCrawlerArticleRelation> tblCrawlerArticleRelationList = tblCrawlerArticleRelationDao.
selectByRelateIdAndArticleType(req.getArticleId() , ArticleTypeEnum.NORMAL.getValue());
selectByRelateIdAndArticleType(req.getArticleId() , ArticleTypeEnum.TBLCRAWLER.getValue());
if(!tblCrawlerArticleRelationList.isEmpty()){
List<Integer> crawlerIds = tblCrawlerArticleRelationList.stream().map(TblCrawlerArticleRelation::getCrawlerId)
.collect(Collectors.toList());
... ... @@ -227,7 +229,9 @@ public class TblCrawlerInfoServiceImpl implements ITblCrawlerInfoService {
req.setArticleType(ArticleTypeEnum.TBLCRAWLER.getValue());
//文章版权类型为第三方授权
req.setCopyright(2);
Integer articleId = grassArticleService.publishArticle(req);
GrassArticleReq grassArticleReq = new GrassArticleReq();
BeanUtils.copyProperties(req, grassArticleReq);
Integer articleId = grassArticleService.publishArticle(grassArticleReq);
//维护爬虫数据和种草文章关联关系
TblCrawlerArticleRelation tblCrawlerArticleRelation = new TblCrawlerArticleRelation();
tblCrawlerArticleRelation.setRelateId(articleId);
... ... @@ -253,7 +257,9 @@ public class TblCrawlerInfoServiceImpl implements ITblCrawlerInfoService {
req.setArticleType(ArticleTypeEnum.TBLCRAWLER.getValue());
//文章版权类型为第三方授权
req.setCopyright(2);
Integer articleId = grassArticleService.timerPublish(req);
GrassArticleReq grassArticleReq = new GrassArticleReq();
BeanUtils.copyProperties(req, grassArticleReq);
Integer articleId = grassArticleService.timerPublish(grassArticleReq);
//维护爬虫数据和种草文章关联关系
TblCrawlerArticleRelation tblCrawlerArticleRelation = new TblCrawlerArticleRelation();
tblCrawlerArticleRelation.setRelateId(articleId);
... ...
... ... @@ -95,7 +95,7 @@
<td style="width:100% ">
<label style="font-size: 14px;">正文内容</label> <br>
<div style="float: left;width:700px;" >
<script id="content" name="content" type="text/plain" style="width:1024px;height:500px;"></script>
<textarea id="content" name="content" type="text/plain" style="width:1024px;height:500px;"></textarea>
</div>
</td>
</tr>
... ... @@ -175,17 +175,21 @@
initialFrameHeight: 200,
initialFrameWidth : "90%",
initialFrameHeight : 350,
removeFormatTags:'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var,h1,h2,h3,h4,h5',
toolbars: [[
'source', '|', 'undo', 'redo', '|',
'bold', 'italic', 'underline','strikethrough','horizontal','|','paragraph', 'rowspacingtop',
'source', '|', 'undo', 'redo', '|','formatmatch','removeformat',
'bold', 'italic', 'underline','strikethrough','horizontal','|','paragraph', 'rowspacingtop',
'rowspacingbottom', '|',
'insertorderedlist', 'insertunorderedlist', 'blockquote','|',
'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
'imagenone', 'imageleft', 'imageright', 'imagecenter', '|', 'simpleupload', 'insertimage', 'help','fullscreen'
]],
elementPathEnabled : false,
catchRemoteImageEnable:false,
enableAutoSave:false,
enableContextMenu: false,
retainOnlyLabelPasted:true,
maximumWords:100000,
autoFloatEnabled:false
});
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action) {
... ... @@ -659,7 +663,7 @@
});
$("#title").textbox("setValue",data.title);
$("#copyright").combobox("setValue",2);
$("#sort").val(1);
$("#sort").val(2);
var labelIds = [];
if(data.labelList!=null && data.labelList.length>0){
for (var i=0;i<data.labelList.length;i++){
... ...
... ... @@ -60,7 +60,7 @@
<table id="activityListTable" ></table>
</div>
<div region="center" id="articleEditer" style="margin-left: 20px" >
</div>
</body>
<script>
... ... @@ -197,7 +197,7 @@
str = str + ' <img style="width:60px; height: 60px;margin-left: 3px" src="'+ imgList[0]+'" >' ;
}
str = str + "<a href= "+sourceUrl+" style='margin-left:10px'>查看详情</a>";
str = str + "<a role='linkDetail' target='_blank' style='margin-left:10px' href="+sourceUrl+">查看详情</a>"
str =str + '</p>';
str = str + '</div>';
return str;
... ... @@ -329,6 +329,7 @@
$(this).datagrid("getPanel").find("a[role='updateStatus']").linkbutton({
iconCls : "icon-edit",
onClick: function () {
debugger;
var checkStatus = $(this).attr("dataAuthStatus");
var dataId = $(this).attr("dataId");
index = $(this).attr("index");
... ... @@ -367,10 +368,10 @@
}
});
}
});
function switchRecommend(id, status) {
$.post(serverContextPath + "/tblCrawlerArticle/modifyTblCrawlerArticleStatus?id=" + id + "&checkStatus=" + status, function (data) {
if(data.code != 200){
... ...