This commit is contained in:
kuang.yife 2024-06-26 13:20:49 +08:00
parent 55f335d630
commit 7258bbafa4
11 changed files with 70 additions and 8 deletions

View File

@ -86,6 +86,12 @@ public class PlayletPublicDetailController extends BaseController
{ {
startPage(); startPage();
List<PlayletPublicDetail> list = playletPublicDetailService.selectPlayletPublicDetailList(playletPublicDetail); List<PlayletPublicDetail> list = playletPublicDetailService.selectPlayletPublicDetailList(playletPublicDetail);
list.forEach(model->{
PlayletPublicAccount account = playletPublicAccountService.getById(model.getPublicId());
if(account != null){
model.setPublicName(account.getName());
}
});
return getDataTable(list); return getDataTable(list);
} }

View File

@ -106,7 +106,7 @@ public class PublicCommentResponseController extends BaseController
} }
PublicDetailComment comment = publicDetailCommentService.getById(publicCommentResponse.getCommentId()); PublicDetailComment comment = publicDetailCommentService.getById(publicCommentResponse.getCommentId());
if(comment != null){ if(comment != null){
comment.setRemark("已回复,回复时间:" + DateUtil.format(new Date(), "yyyy-MM-dd HH:mm")); comment.setRemark(DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
publicDetailCommentService.updateById(comment); publicDetailCommentService.updateById(comment);
} }
return AjaxResult.success(); return AjaxResult.success();

View File

@ -71,6 +71,9 @@ public class PublicDetailCommentController extends BaseController
.eq(PublicCommentResponse::getCommentId, model.getId()).one(); .eq(PublicCommentResponse::getCommentId, model.getId()).one();
if(publicCommentResponse != null){ if(publicCommentResponse != null){
model.setCommentResponseContent(publicCommentResponse.getResponseContent()); model.setCommentResponseContent(publicCommentResponse.getResponseContent());
model.setIsResponse("02");
}else {
model.setIsResponse("01");
} }
}); });
return getDataTable(list); return getDataTable(list);

View File

@ -35,10 +35,23 @@ public class PublicDetailShareAppServiceImpl implements PublicDetailShareAppServ
if(userTwo != null){ if(userTwo != null){
publicDetailShare.setReaderTwoName(userTwo.getName()); publicDetailShare.setReaderTwoName(userTwo.getName());
} }
// 查询是否二次记录
long readCount = iPublicDetailShareService.lambdaQuery()
.eq(PublicDetailShare::getReaderOneId, publicDetailShare.getReaderOneId())
.eq(PublicDetailShare::getReaderTwoId, publicDetailShare.getReaderTwoId())
.count();
long beReadCount = iPublicDetailShareService.lambdaQuery()
.eq(PublicDetailShare::getReaderOneId, publicDetailShare.getReaderTwoId())
.eq(PublicDetailShare::getReaderTwoId, publicDetailShare.getReaderOneId())
.count();
// 已经阅读或者查看过了
boolean flag = readCount + beReadCount > 0;
iPublicDetailShareService.insertPublicDetailShare(publicDetailShare); iPublicDetailShareService.insertPublicDetailShare(publicDetailShare);
// 添加浏览记录时,同时需要增加一下文章表上面的阅读次数 // 添加浏览记录时,同时需要增加一下文章表上面的阅读次数
PlayletPublicDetail playletPublicDetail = iPlayletPublicDetailService.getById(publicDetailShare.getDetailId()); PlayletPublicDetail playletPublicDetail = iPlayletPublicDetailService.getById(publicDetailShare.getDetailId());
if(playletPublicDetail != null){ if(playletPublicDetail != null && !flag){
if(playletPublicDetail.getTransmitCount() == null){ if(playletPublicDetail.getTransmitCount() == null){
playletPublicDetail.setTransmitCount(1L); playletPublicDetail.setTransmitCount(1L);
}else { }else {

View File

@ -53,6 +53,13 @@ public class PublicStarRecordAppServiceImpl implements PublicStarRecordAppServic
.one(); .one();
if(record != null){ if(record != null){
iPublicStarRecordService.removeById(record.getId()); iPublicStarRecordService.removeById(record.getId());
// 增加文章点赞数量
PlayletPublicDetail detail = iPlayletPublicDetailService.getById(publicStarRecord.getDetailId());
if(detail != null){
detail.setStarCount(String.valueOf(Long.parseLong(detail.getStarCount()) - 1));
}
iPlayletPublicDetailService.updateById(detail);
} }
} }
} }

File diff suppressed because one or more lines are too long

View File

@ -70,11 +70,12 @@
}, },
{ {
field: 'publicId', field: 'publicId',
title: '公众号id' title: '公众号id',
visible: false
}, },
{ {
field: 'readCount', field: 'publicName',
title: '阅读人数' title: '公众号'
}, },
{ {
field: 'content', field: 'content',
@ -87,7 +88,11 @@
}, },
{ {
field: 'authorAlias', field: 'authorAlias',
title: '作者花名' title: '作者'
},
{
field: 'readCount',
title: '阅读人数'
}, },
{ {
field: 'starCount', field: 'starCount',

View File

@ -14,6 +14,12 @@
<label>用户昵称:</label> <label>用户昵称:</label>
<input type="text" name="userName"/> <input type="text" name="userName"/>
</li> </li>
<li>
是否回复:<select name="isResponse" th:with="type=${@dict.getType('sys_comment_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li> <li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a> <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
@ -46,6 +52,7 @@
<script th:inline="javascript"> <script th:inline="javascript">
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 prefix = ctx + "system/public/comment"; var prefix = ctx + "system/public/comment";
$(function() { $(function() {
@ -99,9 +106,17 @@
field: 'commentResponseContent', field: 'commentResponseContent',
title: "回复内容" title: "回复内容"
}, },
{
field: 'isResponse',
title: "是否回复",
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(commentDict, value);
}
},
{ {
field: 'remark', field: 'remark',
title: '回复状态' title: '回复时间'
}, },
{ {
title: '操作', title: '操作',

View File

@ -38,6 +38,9 @@ public class PlayletPublicDetail extends BaseEntity
@ApiModelProperty(value = "公众号id") @ApiModelProperty(value = "公众号id")
private Long publicId; private Long publicId;
@TableField(exist = false)
private String publicName;
/** 公众号id */ /** 公众号id */
@Excel(name = "短剧id") @Excel(name = "短剧id")
@ApiModelProperty(value = "短剧id") @ApiModelProperty(value = "短剧id")

View File

@ -70,4 +70,8 @@ public class PublicDetailComment extends BaseEntity
@TableField(exist = false) @TableField(exist = false)
private String commentResponseContent; private String commentResponseContent;
@TableField(exist = false)
@ApiModelProperty(value = "是否回复 01.未回复 02.已回复")
private String isResponse;
} }

View File

@ -31,6 +31,12 @@
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if> <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="content != null and content != ''"> and content = #{content}</if> <if test="content != null and content != ''"> and content = #{content}</if>
<if test="starCount != null "> and star_count = #{starCount}</if> <if test="starCount != null "> and star_count = #{starCount}</if>
<if test="isResponse == '02'">
and remark is not null
</if>
<if test="isResponse == '01'">
and remark is null
</if>
</where> </where>
</select> </select>