fix
This commit is contained in:
parent
7eb783fa02
commit
8444c592e8
|
|
@ -67,4 +67,20 @@ public class PlayletPublicDetailAppController {
|
||||||
return Result.success(detail);
|
return Result.success(detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/getByEncodeId")
|
||||||
|
@ApiOperation(value = "查询文章详情")
|
||||||
|
public Result<PlayletPublicDetail> getByEncodeId(@RequestParam(value = "id") Long id) {
|
||||||
|
return Result.success(playletPublicDetailAppService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@GetMapping("/getByEncodeIdNoContent")
|
||||||
|
@ApiOperation(value = "查询文章详情,不含详情")
|
||||||
|
public Result<PlayletPublicDetail> getByEncodeIdNoContent(@RequestParam(value = "id") Long id) {
|
||||||
|
PlayletPublicDetail detail = playletPublicDetailAppService.getById(id);
|
||||||
|
detail.setContent(null);
|
||||||
|
return Result.success(detail);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import com.playlet.common.core.domain.entity.SysDept;
|
import com.playlet.common.core.domain.entity.SysDept;
|
||||||
import com.playlet.common.utils.StringUtils;
|
import com.playlet.common.utils.StringUtils;
|
||||||
import com.playlet.system.domain.PlayletPublicAccount;
|
import com.playlet.system.domain.PlayletPublicAccount;
|
||||||
|
|
@ -79,9 +80,9 @@ public class PlayletPublicDetailController extends BaseController
|
||||||
if(detail!=null){
|
if(detail!=null){
|
||||||
String url;
|
String url;
|
||||||
if("01".equals(detail.getType())){
|
if("01".equals(detail.getType())){
|
||||||
url = "https://www.mungerfans.com/article/info/" + id;
|
url = "https://www.mungerfans.com/article/info/" + RandomUtil.randomString(8) + id + RandomUtil.randomString(12);
|
||||||
}else {
|
}else {
|
||||||
url = "https://www.mungerfans.com/article/file/" + id;
|
url = "https://www.mungerfans.com/article/file/" + RandomUtil.randomString(8) + id + RandomUtil.randomString(12);
|
||||||
}
|
}
|
||||||
return AjaxResult.success("操作成功", url);
|
return AjaxResult.success("操作成功", url);
|
||||||
}else {
|
}else {
|
||||||
|
|
@ -200,6 +201,16 @@ public class PlayletPublicDetailController extends BaseController
|
||||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||||
{
|
{
|
||||||
PlayletPublicDetail playletPublicDetail = playletPublicDetailService.selectPlayletPublicDetailById(id);
|
PlayletPublicDetail playletPublicDetail = playletPublicDetailService.selectPlayletPublicDetailById(id);
|
||||||
|
if(StringUtils.isNotEmpty(playletPublicDetail.getImgUrl())){
|
||||||
|
playletPublicDetail.setImgStatus(0);
|
||||||
|
}else {
|
||||||
|
playletPublicDetail.setImgStatus(1);
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotEmpty(playletPublicDetail.getHeadUrl())){
|
||||||
|
playletPublicDetail.setHeadStatus(0);
|
||||||
|
}else {
|
||||||
|
playletPublicDetail.setHeadStatus(1);
|
||||||
|
}
|
||||||
if(!this.getSysUser().isAdmin()){
|
if(!this.getSysUser().isAdmin()){
|
||||||
List<PlayletPublicAccount> accounts = playletPublicAccountService.lambdaQuery()
|
List<PlayletPublicAccount> accounts = playletPublicAccountService.lambdaQuery()
|
||||||
.eq(PlayletPublicAccount::getManagerId, this.getUserId())
|
.eq(PlayletPublicAccount::getManagerId, this.getUserId())
|
||||||
|
|
@ -245,6 +256,12 @@ public class PlayletPublicDetailController extends BaseController
|
||||||
if("02".equals(playletPublicDetail.getType()) && StringUtils.isNotEmpty(playletPublicDetail.getPdfUrl())){
|
if("02".equals(playletPublicDetail.getType()) && StringUtils.isNotEmpty(playletPublicDetail.getPdfUrl())){
|
||||||
playletPublicDetail.setContent(playletPublicDetail.getPdfUrl());
|
playletPublicDetail.setContent(playletPublicDetail.getPdfUrl());
|
||||||
}
|
}
|
||||||
|
if(playletPublicDetail.getImgStatus() == 1){
|
||||||
|
playletPublicDetail.setImgUrl("");
|
||||||
|
}
|
||||||
|
if(playletPublicDetail.getHeadStatus() == 1){
|
||||||
|
playletPublicDetail.setHeadUrl("");
|
||||||
|
}
|
||||||
return toAjax(playletPublicDetailService.updatePlayletPublicDetail(playletPublicDetail));
|
return toAjax(playletPublicDetailService.updatePlayletPublicDetail(playletPublicDetail));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
</div>
|
</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 is-required">公众号负责人:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<select id="managerId" name="managerId" class="form-control m-b" required>
|
<select id="managerId" name="managerId" class="form-control m-b" required>
|
||||||
<option th:each="user:${users}" th:value="${user.userId}" th:text="${user.userName}"></option>
|
<option th:each="user:${users}" th:value="${user.userId}" th:text="${user.userName}"></option>
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-xs-3 control-label">运营人员:</label>
|
<label class="col-xs-3 control-label is-required">运营人员:</label>
|
||||||
<div class="col-xs-8">
|
<div class="col-xs-8">
|
||||||
<select id="managerIds" class="form-control select2-multiple" multiple>
|
<select id="managerIds" class="form-control select2-multiple" multiple>
|
||||||
<option th:each="user:${users}" th:value="${user.userId}" th:text="${user.userName}" ></option>
|
<option th:each="user:${users}" th:value="${user.userId}" th:text="${user.userName}" ></option>
|
||||||
|
|
@ -58,6 +58,12 @@
|
||||||
<input name="authorAlias" class="form-control" type="text">
|
<input name="authorAlias" class="form-control" type="text">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">关注人数:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="followersCount" class="form-control" type="text">
|
||||||
|
</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">-->
|
||||||
|
|
@ -94,6 +100,7 @@
|
||||||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
var prefix = ctx + "system/playlet/account"
|
var prefix = ctx + "system/playlet/account"
|
||||||
|
var remark = [[${defaultRemark}]];
|
||||||
$("#form-account-add").validate({
|
$("#form-account-add").validate({
|
||||||
focusCleanup: true
|
focusCleanup: true
|
||||||
});
|
});
|
||||||
|
|
@ -134,6 +141,7 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
console.log(remark);
|
||||||
$('.summernote').summernote({
|
$('.summernote').summernote({
|
||||||
lang: 'zh-CN',
|
lang: 'zh-CN',
|
||||||
height: 300,
|
height: 300,
|
||||||
|
|
@ -168,6 +176,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$('#remark').summernote('code', remark);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -80,12 +80,12 @@
|
||||||
<input name="address" th:field="*{address}" class="form-control" type="text">
|
<input name="address" th:field="*{address}" class="form-control" type="text">
|
||||||
</div>
|
</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">-->
|
||||||
<input name="originalContentCount" th:field="*{originalContentCount}" class="form-control" type="text">
|
<!-- <input name="originalContentCount" th:field="*{originalContentCount}" class="form-control" type="text">-->
|
||||||
</div>
|
<!-- </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">
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">缩略图状态:</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<label class="toggle-switch switch-solid">
|
||||||
|
<input type="checkbox" id="imgStatus" th:checked="${playletPublicDetail.imgStatus == 0 ? true : false}">
|
||||||
|
<span></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label">头图:</label>
|
<label class="col-sm-2 control-label">头图:</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
|
|
@ -52,6 +61,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">头图状态:</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<label class="toggle-switch switch-solid">
|
||||||
|
<input type="checkbox" id="headStatus" th:checked="${playletPublicDetail.headStatus == 0 ? true : false}">
|
||||||
|
<span></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label">文章类型:</label>
|
<label class="col-sm-2 control-label">文章类型:</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
|
|
@ -85,7 +103,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label">运营人员:</label>
|
<label class="col-sm-2 control-label">文章标签:</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select id="detailTags" class="form-control select2-multiple" multiple>
|
<select id="detailTags" class="form-control select2-multiple" multiple>
|
||||||
<option th:each="tag:${tags}" th:value="${tag.tag}" th:text="${tag.tag}" th:selected="${tag.flag}"></option>
|
<option th:each="tag:${tags}" th:value="${tag.tag}" th:text="${tag.tag}" th:selected="${tag.flag}"></option>
|
||||||
|
|
@ -125,7 +143,9 @@
|
||||||
if ($.validate.form()) {
|
if ($.validate.form()) {
|
||||||
var content = tinymce.get('mytextarea').getContent();
|
var content = tinymce.get('mytextarea').getContent();
|
||||||
var detailTag = $.form.selectSelects("detailTags");
|
var detailTag = $.form.selectSelects("detailTags");
|
||||||
$.operate.save(prefix + "/edit", $('#form-detail-edit').serialize() + encodeURIComponent(content) + "&detailTag=" + detailTag);
|
var headStatus = $("input[id='headStatus']").is(':checked') === true ? 0 : 1;
|
||||||
|
var imgStatus = $("input[id='imgStatus']").is(':checked') === true ? 0 : 1;
|
||||||
|
$.operate.save(prefix + "/edit", $('#form-detail-edit').serialize() + encodeURIComponent(content) + "&detailTag=" + detailTag + "&headStatus=" + headStatus + "&imgStatus=" + imgStatus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -153,7 +173,9 @@
|
||||||
maxFileCount: 1,
|
maxFileCount: 1,
|
||||||
dropZoneEnabled: false, //是否显示拖拽区域
|
dropZoneEnabled: false, //是否显示拖拽区域
|
||||||
showPreview: false,
|
showPreview: false,
|
||||||
autoReplace: true
|
autoReplace: true,
|
||||||
|
showCaption: true,
|
||||||
|
showRemove: true
|
||||||
}).on('fileuploaded', function (event, data, previewId, index) {
|
}).on('fileuploaded', function (event, data, previewId, index) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
if (data.response.success) {
|
if (data.response.success) {
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,10 @@ public class PlayletPublicDetail extends BaseEntity
|
||||||
private String itemNineUrl;
|
private String itemNineUrl;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String itemTenUrl;
|
private String itemTenUrl;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer imgStatus;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer headStatus;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,11 +147,11 @@
|
||||||
<if test="itemId != null">#{itemId},</if>
|
<if test="itemId != null">#{itemId},</if>
|
||||||
<if test="readCount != null">read_count = #{readCount},</if>
|
<if test="readCount != null">read_count = #{readCount},</if>
|
||||||
<if test="transmitCount != null">transmit_count = #{transmitCount},</if>
|
<if test="transmitCount != null">transmit_count = #{transmitCount},</if>
|
||||||
<if test="content != null">content = #{content},</if>
|
<if test="content != null and content != ''">content = #{content},</if>
|
||||||
<if test="address != null">address = #{address},</if>
|
<if test="address != null and address != ''">address = #{address},</if>
|
||||||
<if test="title != null">title = #{title},</if>
|
<if test="title != null and title != ''">title = #{title},</if>
|
||||||
<if test="type != null">type = #{type},</if>
|
<if test="type != null and type != ''">type = #{type},</if>
|
||||||
<if test="authorAlias != null">author_alias = #{authorAlias},</if>
|
<if test="authorAlias != null and authorAlias !=''">author_alias = #{authorAlias},</if>
|
||||||
<if test="starCount != null">star_count = #{starCount},</if>
|
<if test="starCount != null">star_count = #{starCount},</if>
|
||||||
<if test="itemOne != null">item_one = #{itemOne},</if>
|
<if test="itemOne != null">item_one = #{itemOne},</if>
|
||||||
<if test="itemTwo != null">item_two = #{itemTwo},</if>
|
<if test="itemTwo != null">item_two = #{itemTwo},</if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue