置顶、回复备注、文章删除的时候评论展示
This commit is contained in:
parent
341c082d8d
commit
e4ccc9a3df
|
|
@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Api(tags = "公众号*文章详情接口")
|
@Api(tags = "公众号*文章详情接口")
|
||||||
@RestController
|
@RestController
|
||||||
|
|
@ -30,9 +32,22 @@ public class PlayletPublicDetailAppController {
|
||||||
@RequestParam(value = "pageNum") Integer pageNum,
|
@RequestParam(value = "pageNum") Integer pageNum,
|
||||||
@RequestParam(value = "pageSize") Integer pageSize) {
|
@RequestParam(value = "pageSize") Integer pageSize) {
|
||||||
playletPublicDetail.setType("01");
|
playletPublicDetail.setType("01");
|
||||||
|
playletPublicDetail.setTopStatus("01");
|
||||||
return Result.success(playletPublicDetailAppService.getList(playletPublicDetail, pageNum, pageSize));
|
return Result.success(playletPublicDetailAppService.getList(playletPublicDetail, pageNum, pageSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询任务列表
|
||||||
|
*/
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping("/getTopList")
|
||||||
|
@ApiOperation(value = "查询置顶文章列表")
|
||||||
|
public Result<List<PlayletPublicDetail>> getTopList(@RequestBody PlayletPublicDetail playletPublicDetail) {
|
||||||
|
playletPublicDetail.setType("01");
|
||||||
|
playletPublicDetail.setTopStatus("02");
|
||||||
|
return Result.success(playletPublicDetailAppService.getTopList(playletPublicDetail));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务详情
|
* 任务详情
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,10 @@ public class PublicDetailCommentAppController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation(value = "新增用户评论")
|
@ApiOperation(value = "新增用户评论")
|
||||||
public Result<String> add(@RequestBody PublicDetailComment detailComment) {
|
public Result<PublicDetailComment> add(@RequestBody PublicDetailComment detailComment) {
|
||||||
detailComment.setCreateTime(new Date());
|
detailComment.setCreateTime(new Date());
|
||||||
detailCommentAppService.add(detailComment);
|
detailCommentAppService.add(detailComment);
|
||||||
return Result.success();
|
return Result.success(detailComment);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||||
|
|
||||||
import com.playlet.common.utils.StringUtils;
|
import com.playlet.common.utils.StringUtils;
|
||||||
import com.playlet.system.domain.PlayletPublicAccount;
|
import com.playlet.system.domain.PlayletPublicAccount;
|
||||||
|
import com.playlet.system.domain.PublicDetailComment;
|
||||||
import com.playlet.system.service.IPlayletItemService;
|
import com.playlet.system.service.IPlayletItemService;
|
||||||
import com.playlet.system.service.IPlayletPublicAccountService;
|
import com.playlet.system.service.IPlayletPublicAccountService;
|
||||||
import com.playlet.system.service.IPublicDetailShareService;
|
import com.playlet.system.service.IPublicDetailShareService;
|
||||||
|
|
@ -52,6 +53,17 @@ public class PlayletPublicDetailController extends BaseController
|
||||||
return prefix + "/wxQrcode";
|
return prefix + "/wxQrcode";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/changeStatus")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult changeStatus(PlayletPublicDetail playletPublicDetail)
|
||||||
|
{
|
||||||
|
// 查询文章
|
||||||
|
PlayletPublicDetail model = playletPublicDetailService.getById(playletPublicDetail.getId());
|
||||||
|
model.setTopStatus(playletPublicDetail.getTopStatus());
|
||||||
|
playletPublicDetailService.updateById(model);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/checkExist")
|
@PostMapping("/checkExist")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult checkExist(@RequestBody Long id) {
|
public AjaxResult checkExist(@RequestBody Long id) {
|
||||||
|
|
|
||||||
|
|
@ -154,6 +154,7 @@ public class PublicDetailCommentController extends BaseController
|
||||||
// 查询评论
|
// 查询评论
|
||||||
PublicDetailComment model = publicDetailCommentService.getById(publicDetailComment.getId());
|
PublicDetailComment model = publicDetailCommentService.getById(publicDetailComment.getId());
|
||||||
// 查询是否已经有置顶的评论
|
// 查询是否已经有置顶的评论
|
||||||
|
if("02".equals(publicDetailComment.getTopStatus())){
|
||||||
PublicDetailComment topModel = publicDetailCommentService.lambdaQuery()
|
PublicDetailComment topModel = publicDetailCommentService.lambdaQuery()
|
||||||
.eq(PublicDetailComment::getDetailId, model.getDetailId())
|
.eq(PublicDetailComment::getDetailId, model.getDetailId())
|
||||||
.eq(PublicDetailComment::getTopStatus, "02")
|
.eq(PublicDetailComment::getTopStatus, "02")
|
||||||
|
|
@ -162,7 +163,8 @@ public class PublicDetailCommentController extends BaseController
|
||||||
topModel.setTopStatus("01");
|
topModel.setTopStatus("01");
|
||||||
publicDetailCommentService.updateById(topModel);
|
publicDetailCommentService.updateById(topModel);
|
||||||
}
|
}
|
||||||
model.setTopStatus("02");
|
}
|
||||||
|
model.setTopStatus(publicDetailComment.getTopStatus());
|
||||||
publicDetailCommentService.updateById(model);
|
publicDetailCommentService.updateById(model);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,13 @@ public class WxController {
|
||||||
return Result.success(wxService.getOpenidByCode(code));
|
return Result.success(wxService.getOpenidByCode(code));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取企业openId", httpMethod = "POST")
|
||||||
|
@PostMapping("/getCompanyOpenidByCode")
|
||||||
|
@ResponseBody
|
||||||
|
public Result<String> getCompanyOpenidByCode(@RequestParam(value = "code") String code){
|
||||||
|
return Result.success(wxService.getCompanyOpenidByCode(code));
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "前端入参appid等信息,获取openId", httpMethod = "POST")
|
@ApiOperation(value = "前端入参appid等信息,获取openId", httpMethod = "POST")
|
||||||
@PostMapping("/getOpenidByCodeAndId")
|
@PostMapping("/getOpenidByCodeAndId")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
@ -48,6 +55,22 @@ public class WxController {
|
||||||
return Result.success(wxService.getWxInfo(openId, accessToken));
|
return Result.success(wxService.getWxInfo(openId, accessToken));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取非本企业用户信息", httpMethod = "POST")
|
||||||
|
@PostMapping("/getCompanyWxInfo")
|
||||||
|
@ResponseBody
|
||||||
|
public Result<String> getCompanyWxInfo(@RequestParam(value = "openId") String openId,
|
||||||
|
@RequestParam(value = "accessToken") String accessToken){
|
||||||
|
// todo 缺少企业获取用户信息的实现
|
||||||
|
return Result.success(wxService.getWxInfo(openId, accessToken));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取企业用户信息", httpMethod = "POST")
|
||||||
|
@PostMapping("/getCompanyByUserId")
|
||||||
|
@ResponseBody
|
||||||
|
public Result<String> getCompanyByUserId(@RequestParam(value = "userTicket") String userTicket){
|
||||||
|
return Result.success(wxService.getCompanyByUserId(userTicket));
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "获取jsapi_ticket", httpMethod = "GET")
|
@ApiOperation(value = "获取jsapi_ticket", httpMethod = "GET")
|
||||||
@GetMapping("/getWxTicket")
|
@GetMapping("/getWxTicket")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
|
||||||
|
|
@ -18,4 +18,8 @@ public interface WxService {
|
||||||
|
|
||||||
Map<String, String> getWxTicket(String requestUrl);
|
Map<String, String> getWxTicket(String requestUrl);
|
||||||
|
|
||||||
|
String getCompanyOpenidByCode(String code);
|
||||||
|
|
||||||
|
String getCompanyByUserId(String userTicket);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,13 @@ import com.github.pagehelper.PageInfo;
|
||||||
import com.playlet.system.domain.PlayletPublicAccount;
|
import com.playlet.system.domain.PlayletPublicAccount;
|
||||||
import com.playlet.system.domain.PlayletPublicDetail;
|
import com.playlet.system.domain.PlayletPublicDetail;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface PlayletPublicDetailAppService {
|
public interface PlayletPublicDetailAppService {
|
||||||
PageInfo<PlayletPublicDetail> getList(PlayletPublicDetail playletPublicDetail, Integer pageNum, Integer pageSize);
|
PageInfo<PlayletPublicDetail> getList(PlayletPublicDetail playletPublicDetail, Integer pageNum, Integer pageSize);
|
||||||
|
|
||||||
PlayletPublicDetail getById(Long id);
|
PlayletPublicDetail getById(Long id);
|
||||||
|
|
||||||
|
List<PlayletPublicDetail> getTopList(PlayletPublicDetail playletPublicDetail);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,15 @@ public class PlayletPublicDetailAppServiceImpl implements PlayletPublicDetailApp
|
||||||
return PageInfo.of(list);
|
return PageInfo.of(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PlayletPublicDetail> getTopList(PlayletPublicDetail playletPublicDetail) {
|
||||||
|
List<PlayletPublicDetail> list = iPlayletPublicDetailService.selectPlayletPublicDetailList(playletPublicDetail);
|
||||||
|
list.forEach(model->{
|
||||||
|
model.setPlayletPublicAccount(iPlayletPublicAccountService.selectPlayletPublicAccountById(model.getPublicId()));
|
||||||
|
});
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PlayletPublicDetail getById(Long id) {
|
public PlayletPublicDetail getById(Long id) {
|
||||||
PlayletPublicDetail model = iPlayletPublicDetailService.getById(id);
|
PlayletPublicDetail model = iPlayletPublicDetailService.getById(id);
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ public class PublicDetailCommentAppServiceImpl implements PublicDetailCommentApp
|
||||||
PageHelper.startPage(pageNum, pageSize);
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
List<PublicDetailComment> comments = iPublicDetailCommentService.lambdaQuery()
|
List<PublicDetailComment> comments = iPublicDetailCommentService.lambdaQuery()
|
||||||
.eq(PublicDetailComment::getDetailId, detailComment.getDetailId())
|
.eq(PublicDetailComment::getDetailId, detailComment.getDetailId())
|
||||||
|
.eq(PublicDetailComment::getTopStatus, "01")
|
||||||
.orderByDesc(PublicDetailComment::getStarCount)
|
.orderByDesc(PublicDetailComment::getStarCount)
|
||||||
.orderByDesc(PublicDetailComment::getCreateTime)
|
.orderByDesc(PublicDetailComment::getCreateTime)
|
||||||
.list();
|
.list();
|
||||||
|
|
@ -94,9 +95,22 @@ public class PublicDetailCommentAppServiceImpl implements PublicDetailCommentApp
|
||||||
@Override
|
@Override
|
||||||
public PublicDetailComment getTopComment(PublicDetailComment detailComment) {
|
public PublicDetailComment getTopComment(PublicDetailComment detailComment) {
|
||||||
// 查询是否已经有置顶的评论
|
// 查询是否已经有置顶的评论
|
||||||
return iPublicDetailCommentService.lambdaQuery()
|
PublicDetailComment model = iPublicDetailCommentService.lambdaQuery()
|
||||||
.eq(PublicDetailComment::getDetailId, detailComment.getDetailId())
|
.eq(PublicDetailComment::getDetailId, detailComment.getDetailId())
|
||||||
.eq(PublicDetailComment::getTopStatus, "02")
|
.eq(PublicDetailComment::getTopStatus, "02")
|
||||||
.one();
|
.one();
|
||||||
|
model.setCommentResponse(iPublicCommentResponseService.lambdaQuery().eq(PublicCommentResponse::getCommentId, model.getId()).one());
|
||||||
|
if(detailComment.getUserId() != null){
|
||||||
|
long star = iPublicCommentStarService.lambdaQuery()
|
||||||
|
.eq(PublicCommentStar::getCommentId, model.getId())
|
||||||
|
.eq(PublicCommentStar::getUserId, detailComment.getUserId())
|
||||||
|
.count();
|
||||||
|
if(star > 0){
|
||||||
|
model.setIsStar("02");
|
||||||
|
}else {
|
||||||
|
model.setIsStar("01");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return model;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,13 @@ public class PublicDetailShareAppServiceImpl implements PublicDetailShareAppServ
|
||||||
@Override
|
@Override
|
||||||
public void addRecord(PublicDetailShare publicDetailShare) {
|
public void addRecord(PublicDetailShare publicDetailShare) {
|
||||||
// 翻译
|
// 翻译
|
||||||
|
PlayletPublicUser share = iPlayletPublicUserService.selectPlayletPublicUserById(publicDetailShare.getAuthorId());
|
||||||
PlayletPublicUser userOne = iPlayletPublicUserService.selectPlayletPublicUserById(publicDetailShare.getReaderOneId());
|
PlayletPublicUser userOne = iPlayletPublicUserService.selectPlayletPublicUserById(publicDetailShare.getReaderOneId());
|
||||||
PlayletPublicUser userTwo = iPlayletPublicUserService.selectPlayletPublicUserById(publicDetailShare.getReaderTwoId());
|
PlayletPublicUser userTwo = iPlayletPublicUserService.selectPlayletPublicUserById(publicDetailShare.getReaderTwoId());
|
||||||
publicDetailShare.setCreateTime(new Date());
|
publicDetailShare.setCreateTime(new Date());
|
||||||
|
if(share != null){
|
||||||
|
publicDetailShare.setAuthorName(share.getName());
|
||||||
|
}
|
||||||
if(userOne != null){
|
if(userOne != null){
|
||||||
publicDetailShare.setReaderOneName(userOne.getName());
|
publicDetailShare.setReaderOneName(userOne.getName());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.playlet.web.service.impl;
|
package com.playlet.web.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.playlet.common.constant.PlayletConstants;
|
import com.playlet.common.constant.PlayletConstants;
|
||||||
import com.playlet.common.utils.http.HttpUtils;
|
import com.playlet.common.utils.http.HttpUtils;
|
||||||
|
|
@ -36,6 +38,18 @@ public class WxServiceImpl implements WxService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getCompanyAccessToken() {
|
||||||
|
String url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ww5bfaf714b2e57900&corpsecret=0JvbBfgkvbsm_fYdFI6e18-qR1sXn9wuCepHYb19d6w";
|
||||||
|
log.info("调用微信获取access_token,入参url:{}", url);
|
||||||
|
String result = HttpUtils.sendGet(url);
|
||||||
|
log.info("调用微信获取access_token,响应内容:{}", result);
|
||||||
|
JSONObject json = JSONObject.parseObject(result);
|
||||||
|
if(json.containsKey(PlayletConstants.ACCESS_TOKEN)){
|
||||||
|
return json.getString(PlayletConstants.ACCESS_TOKEN);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getOpenidByCode(String code) {
|
public String getOpenidByCode(String code) {
|
||||||
String url = "https://api.weixin.qq.com/sns/jscode2session?appid="+ wxConfig.getAppId() + "&secret=" + wxConfig.getSecret() + "&js_code=" + code + "&grant_type=authorization_code";
|
String url = "https://api.weixin.qq.com/sns/jscode2session?appid="+ wxConfig.getAppId() + "&secret=" + wxConfig.getSecret() + "&js_code=" + code + "&grant_type=authorization_code";
|
||||||
|
|
@ -49,6 +63,34 @@ public class WxServiceImpl implements WxService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCompanyOpenidByCode(String code) {
|
||||||
|
String accessToken = this.getCompanyAccessToken();
|
||||||
|
String url = "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=" + accessToken + "&code=" + code;
|
||||||
|
log.info("调用微信获取openId,入参url:{}", url);
|
||||||
|
String result = HttpUtils.sendGet(url);
|
||||||
|
log.info("调用微信获取openId,响应内容:{}", result);
|
||||||
|
JSONObject json = JSONObject.parseObject(result);
|
||||||
|
if(json.containsKey("errcode") && "0".equals(json.getString("errcode"))){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCompanyByUserId(String userTicket) {
|
||||||
|
String accessToken = this.getCompanyAccessToken();
|
||||||
|
String url = "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserdetail?access_token=" + accessToken;
|
||||||
|
Map<String, String> headerMap = new HashMap<>();
|
||||||
|
headerMap.put("Content-Type", "application/json");
|
||||||
|
JSONObject body = new JSONObject();
|
||||||
|
body.put("user_ticket", userTicket);
|
||||||
|
log.info("调用企业微信获取敏感信息,入参url:{}, 请求内容:{}", url, body);
|
||||||
|
HttpResponse result = HttpUtil.createPost(url).addHeaders(headerMap).body(JSONObject.toJSONString(body)).execute();
|
||||||
|
log.info("调用微信获取openId,响应内容:{}", result);
|
||||||
|
return result.body();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getOpenidByCode(String code, String appId, String secret) {
|
public String getOpenidByCode(String code, String appId, String secret) {
|
||||||
String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid="+ appId + "&secret=" + secret + "&code=" + code + "&grant_type=authorization_code";
|
String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid="+ appId + "&secret=" + secret + "&code=" + code + "&grant_type=authorization_code";
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">头部图:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="headUrl" type="text" hidden>
|
||||||
|
<div class="file-loading">
|
||||||
|
<input id="headUrlFile" name="file" type="file">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">文章类型:</label>
|
<label class="col-sm-3 control-label">文章类型:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
|
|
@ -187,6 +196,25 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// 详情页
|
||||||
|
$("#headUrlFile").fileinput({
|
||||||
|
uploadUrl: ctx + 'tool/oss/uploadFromPlaylet',
|
||||||
|
maxFileCount: 1,
|
||||||
|
dropZoneEnabled: false, //是否显示拖拽区域
|
||||||
|
showPreview: false,
|
||||||
|
autoReplace: true
|
||||||
|
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||||
|
console.log(data);
|
||||||
|
if(data.response.success){
|
||||||
|
$("input[name='headUrl']").val(data.response.msg)
|
||||||
|
}else {
|
||||||
|
alert("上传失败!");
|
||||||
|
}
|
||||||
|
}).on('fileremoved', function (event, id, index) {
|
||||||
|
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||||
|
$("input[name='headUrl']").val('')
|
||||||
|
})
|
||||||
|
|
||||||
// 详情页
|
// 详情页
|
||||||
$("#pdfUrlFile").fileinput({
|
$("#pdfUrlFile").fileinput({
|
||||||
uploadUrl: ctx + 'tool/oss/uploadFromPlaylet',
|
uploadUrl: ctx + 'tool/oss/uploadFromPlaylet',
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
var editFlag = [[${@permission.hasPermi('playlet:detail:edit')}]];
|
var editFlag = [[${@permission.hasPermi('playlet:detail:edit')}]];
|
||||||
var removeFlag = [[${@permission.hasPermi('playlet:detail:remove')}]];
|
var removeFlag = [[${@permission.hasPermi('playlet:detail:remove')}]];
|
||||||
|
var topStatusDict = [[${@dict.getType('sys_top_status')}]];
|
||||||
var prefix = ctx + "system/playlet/detail";
|
var prefix = ctx + "system/playlet/detail";
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
@ -98,6 +99,14 @@
|
||||||
field: 'starCount',
|
field: 'starCount',
|
||||||
title: '点赞数'
|
title: '点赞数'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'topStatus',
|
||||||
|
title: '是否精选',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
return $.table.selectDictLabel(topStatusDict, value);
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'imgUrl',
|
field: 'imgUrl',
|
||||||
title: '缩略图',
|
title: '缩略图',
|
||||||
|
|
@ -106,6 +115,14 @@
|
||||||
else {return '<a>无<a/>'}
|
else {return '<a>无<a/>'}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'headUrl',
|
||||||
|
title: '头部图',
|
||||||
|
formatter: function(value) {
|
||||||
|
if (value != null && value !== ''){return '<a target="_blank" href="' + value+ '" download="false">头部图<a/>';}
|
||||||
|
else {return '<a>无<a/>'}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'detailTag',
|
field: 'detailTag',
|
||||||
title: '文章标签'
|
title: '文章标签'
|
||||||
|
|
@ -120,6 +137,12 @@
|
||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: function(value, row, index) {
|
formatter: function(value, row, index) {
|
||||||
var actions = [];
|
var actions = [];
|
||||||
|
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||||
|
if(row.topStatus === '01'){
|
||||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="topComment(\'' + row.id + '\')"><i class="fa fa-edit"></i>设为精选</a> ');
|
||||||
|
}else {
|
||||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="unTopComment(\'' + row.id + '\')"><i class="fa fa-edit"></i>取消精选</a> ');
|
||||||
|
}
|
||||||
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="showQrcode(\'' + row.id + '\')"></i>微信二维码</a> ');
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="showQrcode(\'' + row.id + '\')"></i>微信二维码</a> ');
|
||||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||||
|
|
@ -130,6 +153,18 @@
|
||||||
$.table.init(options);
|
$.table.init(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function topComment(id) {
|
||||||
|
$.modal.confirm("确认要设为精选吗?", function() {
|
||||||
|
$.operate.post(prefix + "/changeStatus", { "id": id, "topStatus": "02" });
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function unTopComment(id) {
|
||||||
|
$.modal.confirm("确认要取消精选吗?", function() {
|
||||||
|
$.operate.post(prefix + "/changeStatus", { "id": id, "topStatus": "01" });
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function showQrcode(id) {
|
function showQrcode(id) {
|
||||||
var url = "detail/wxQrcode/" + id;
|
var url = "detail/wxQrcode/" + id;
|
||||||
<!-- $.modal.open("支付二维码", url, 290, 360);-->
|
<!-- $.modal.open("支付二维码", url, 290, 360);-->
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">头部图:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="headUrl" th:field="*{headUrl}" type="text" hidden="hidden">
|
||||||
|
<div class="file-loading">
|
||||||
|
<input id="headUrlFile" name="file" type="file">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">文章类型:</label>
|
<label class="col-sm-3 control-label">文章类型:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
|
|
@ -119,6 +128,24 @@
|
||||||
$("input[name='imgUrl']").val('')
|
$("input[name='imgUrl']").val('')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$("#headUrlFile").fileinput({
|
||||||
|
uploadUrl: ctx + 'tool/oss/uploadFromPlaylet',
|
||||||
|
maxFileCount: 1,
|
||||||
|
dropZoneEnabled: false, //是否显示拖拽区域
|
||||||
|
showPreview: false,
|
||||||
|
autoReplace: true
|
||||||
|
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||||
|
console.log(data);
|
||||||
|
if(data.response.success){
|
||||||
|
$("input[name='headUrl']").val(data.response.msg)
|
||||||
|
}else {
|
||||||
|
alert("上传失败!");
|
||||||
|
}
|
||||||
|
}).on('fileremoved', function (event, id, index) {
|
||||||
|
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||||
|
$("input[name='headUrl']").val('')
|
||||||
|
})
|
||||||
|
|
||||||
// 详情页
|
// 详情页
|
||||||
$("#pdfUrlFile").fileinput({
|
$("#pdfUrlFile").fileinput({
|
||||||
uploadUrl: ctx + 'tool/oss/uploadFromPlaylet',
|
uploadUrl: ctx + 'tool/oss/uploadFromPlaylet',
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@
|
||||||
var editFlag = [[${@permission.hasPermi('public:comment:edit')}]];
|
var editFlag = [[${@permission.hasPermi('public:comment:edit')}]];
|
||||||
var removeFlag = [[${@permission.hasPermi('public:comment:remove')}]];
|
var removeFlag = [[${@permission.hasPermi('public:comment:remove')}]];
|
||||||
var commentDict = [[${@dict.getType('sys_comment_status')}]];
|
var commentDict = [[${@dict.getType('sys_comment_status')}]];
|
||||||
|
var topStatusDict = [[${@dict.getType('sys_top_status')}]];
|
||||||
var prefix = ctx + "system/public/comment";
|
var prefix = ctx + "system/public/comment";
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
@ -106,6 +107,14 @@
|
||||||
field: 'commentResponseContent',
|
field: 'commentResponseContent',
|
||||||
title: "回复内容"
|
title: "回复内容"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'topStatus',
|
||||||
|
title: '是否置顶',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
return $.table.selectDictLabel(topStatusDict, value);
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'isResponse',
|
field: 'isResponse',
|
||||||
title: "是否回复",
|
title: "是否回复",
|
||||||
|
|
@ -124,7 +133,11 @@
|
||||||
formatter: function(value, row, index) {
|
formatter: function(value, row, index) {
|
||||||
var actions = [];
|
var actions = [];
|
||||||
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||||
|
if(row.topStatus === '01'){
|
||||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="topComment(\'' + row.id + '\')"><i class="fa fa-edit"></i>置顶评论</a> ');
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="topComment(\'' + row.id + '\')"><i class="fa fa-edit"></i>置顶评论</a> ');
|
||||||
|
}else {
|
||||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="unTopComment(\'' + row.id + '\')"><i class="fa fa-edit"></i>取消置顶</a> ');
|
||||||
|
}
|
||||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="responseComment(\'' + row.id + '\')"><i class="fa fa-edit"></i>回复评论</a> ');
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="responseComment(\'' + row.id + '\')"><i class="fa fa-edit"></i>回复评论</a> ');
|
||||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||||
return actions.join('');
|
return actions.join('');
|
||||||
|
|
@ -146,6 +159,12 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function unTopComment(id) {
|
||||||
|
$.modal.confirm("确认要取消置顶吗?", function() {
|
||||||
|
$.operate.post(prefix + "/changeStatus", { "id": id, "topStatus": "01" });
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -74,6 +74,12 @@ public class PlayletPublicDetail extends BaseEntity
|
||||||
@ApiModelProperty(value = "图片")
|
@ApiModelProperty(value = "图片")
|
||||||
private String imgUrl;
|
private String imgUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头部图片")
|
||||||
|
private String headUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "精选文章 01.普通 02.精选")
|
||||||
|
private String topStatus;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String pdfUrl;
|
private String pdfUrl;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@
|
||||||
<result property="title" column="title" />
|
<result property="title" column="title" />
|
||||||
<result property="authorAlias" column="author_alias"/>
|
<result property="authorAlias" column="author_alias"/>
|
||||||
<result property="imgUrl" column="img_url" />
|
<result property="imgUrl" column="img_url" />
|
||||||
|
<result property="headUrl" column="head_url" />
|
||||||
|
<result property="topStatus" column="top_status" />
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
|
|
@ -36,8 +38,8 @@
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectPlayletPublicDetailVo">
|
<sql id="selectPlayletPublicDetailVo">
|
||||||
select id, public_id, item_id, read_count,star_count,
|
select id, public_id, item_id, head_url, read_count,star_count,
|
||||||
item_one,item_two,item_three,item_four,item_five,
|
item_one,item_two,item_three,item_four,item_five,top_status,
|
||||||
item_six,item_seven,item_eight,item_nine,item_ten,
|
item_six,item_seven,item_eight,item_nine,item_ten,
|
||||||
title,type,author_alias,img_url, content, create_by, create_time,
|
title,type,author_alias,img_url, content, create_by, create_time,
|
||||||
update_by, update_time, detail_tag, remark, address, transmit_count from playlet_public_detail
|
update_by, update_time, detail_tag, remark, address, transmit_count from playlet_public_detail
|
||||||
|
|
@ -49,6 +51,7 @@
|
||||||
<if test="publicId != null "> and public_id = #{publicId}</if>
|
<if test="publicId != null "> and public_id = #{publicId}</if>
|
||||||
<if test="type != null "> and type = #{type}</if>
|
<if test="type != null "> and type = #{type}</if>
|
||||||
<if test="readCount != null "> and read_count = #{readCount}</if>
|
<if test="readCount != null "> and read_count = #{readCount}</if>
|
||||||
|
<if test="topStatus != null "> and top_status = #{topStatus}</if>
|
||||||
<if test="content != null and content != ''"> and content = #{content}</if>
|
<if test="content != null and content != ''"> and content = #{content}</if>
|
||||||
</where>
|
</where>
|
||||||
order by create_time desc
|
order by create_time desc
|
||||||
|
|
@ -83,6 +86,7 @@
|
||||||
<if test="itemNine != null">item_nine,</if>
|
<if test="itemNine != null">item_nine,</if>
|
||||||
<if test="itemTen != null">item_ten,</if>
|
<if test="itemTen != null">item_ten,</if>
|
||||||
<if test="imgUrl != null">img_url,</if>
|
<if test="imgUrl != null">img_url,</if>
|
||||||
|
<if test="headUrl != null">head_url,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
|
@ -112,6 +116,7 @@
|
||||||
<if test="itemNine != null">#{itemNine},</if>
|
<if test="itemNine != null">#{itemNine},</if>
|
||||||
<if test="itemTen != null">#{itemTen},</if>
|
<if test="itemTen != null">#{itemTen},</if>
|
||||||
<if test="imgUrl != null">#{imgUrl},</if>
|
<if test="imgUrl != null">#{imgUrl},</if>
|
||||||
|
<if test="headUrl != null">#{headUrl},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
|
@ -145,6 +150,7 @@
|
||||||
<if test="itemNine != null">item_nine = #{itemNine},</if>
|
<if test="itemNine != null">item_nine = #{itemNine},</if>
|
||||||
<if test="itemTen != null">item_ten = #{itemTen},</if>
|
<if test="itemTen != null">item_ten = #{itemTen},</if>
|
||||||
<if test="imgUrl != null">img_url = #{imgUrl},</if>
|
<if test="imgUrl != null">img_url = #{imgUrl},</if>
|
||||||
|
<if test="headUrl != null">head_url = #{headUrl},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue