Compare commits

...

2 Commits

Author SHA1 Message Date
kuang.yife 8444c592e8 fix 2024-08-20 14:35:00 +08:00
kuang.yife 7eb783fa02 fix 2024-08-15 17:09:24 +08:00
11 changed files with 134 additions and 57 deletions

View File

@ -67,4 +67,20 @@ public class PlayletPublicDetailAppController {
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);
}
}

View File

@ -5,6 +5,7 @@ import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.RandomUtil;
import com.playlet.common.core.domain.entity.SysDept;
import com.playlet.common.utils.StringUtils;
import com.playlet.system.domain.PlayletPublicAccount;
@ -79,9 +80,9 @@ public class PlayletPublicDetailController extends BaseController
if(detail!=null){
String url;
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 {
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);
}else {
@ -200,6 +201,16 @@ public class PlayletPublicDetailController extends BaseController
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
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()){
List<PlayletPublicAccount> accounts = playletPublicAccountService.lambdaQuery()
.eq(PlayletPublicAccount::getManagerId, this.getUserId())
@ -245,6 +256,12 @@ public class PlayletPublicDetailController extends BaseController
if("02".equals(playletPublicDetail.getType()) && StringUtils.isNotEmpty(playletPublicDetail.getPdfUrl())){
playletPublicDetail.setContent(playletPublicDetail.getPdfUrl());
}
if(playletPublicDetail.getImgStatus() == 1){
playletPublicDetail.setImgUrl("");
}
if(playletPublicDetail.getHeadStatus() == 1){
playletPublicDetail.setHeadUrl("");
}
return toAjax(playletPublicDetailService.updatePlayletPublicDetail(playletPublicDetail));
}

View File

@ -37,7 +37,7 @@
</div>
</div>
<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">
<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>
@ -45,7 +45,7 @@
</div>
</div>
<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">
<select id="managerIds" class="form-control select2-multiple" multiple>
<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">
</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">-->
<!-- <label class="col-sm-3 control-label">文章标签(逗号隔开)</label>-->
<!-- <div class="col-sm-8">-->
@ -94,6 +100,7 @@
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
var prefix = ctx + "system/playlet/account"
var remark = [[${defaultRemark}]];
$("#form-account-add").validate({
focusCleanup: true
});
@ -134,6 +141,7 @@
})
$(function() {
console.log(remark);
$('.summernote').summernote({
lang: 'zh-CN',
height: 300,
@ -168,6 +176,7 @@
}
}
});
$('#remark').summernote('code', remark);
});
</script>
</body>

View File

@ -80,12 +80,12 @@
<input name="address" th:field="*{address}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">原创篇数:</label>
<div class="col-sm-8">
<input name="originalContentCount" th:field="*{originalContentCount}" class="form-control" type="text">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">原创篇数:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="originalContentCount" th:field="*{originalContentCount}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-3 control-label">关注人数:</label>
<div class="col-sm-8">

View File

@ -43,6 +43,15 @@
</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">
<label class="col-sm-2 control-label">头图:</label>
<div class="col-sm-10">
@ -52,6 +61,15 @@
</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">
<label class="col-sm-2 control-label">文章类型:</label>
<div class="col-sm-10">
@ -85,7 +103,7 @@
</div>
</div>
<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">
<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>
@ -125,7 +143,9 @@
if ($.validate.form()) {
var content = tinymce.get('mytextarea').getContent();
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,
dropZoneEnabled: false, //是否显示拖拽区域
showPreview: false,
autoReplace: true
autoReplace: true,
showCaption: true,
showRemove: true
}).on('fileuploaded', function (event, data, previewId, index) {
console.log(data);
if (data.response.success) {

View File

@ -99,18 +99,18 @@
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-xs-4 control-label is-required">岗位:</label>
<div class="col-xs-8">
<select id="post" class="form-control select2-multiple" multiple>
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:disabled="${post.status == '1'}"></option>
</select>
</div>
</div>
</div>
</div>
<!-- <div class="row">-->
<!-- <div class="col-sm-6">-->
<!-- <div class="form-group">-->
<!-- <label class="col-xs-4 control-label is-required">岗位:</label>-->
<!-- <div class="col-xs-8">-->
<!-- <select id="post" class="form-control select2-multiple" multiple>-->
<!-- <option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:disabled="${post.status == '1'}"></option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="row">
<div class="col-sm-6">
<div class="form-group">
@ -219,10 +219,10 @@
var data = $("#form-user-add").serializeArray();
var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
var roleIds = $.form.selectCheckeds("role");
var postIds = $.form.selectSelects("post");
// var postIds = $.form.selectSelects("post");
data.push({"name": "status", "value": status});
data.push({"name": "roleIds", "value": roleIds});
data.push({"name": "postIds", "value": postIds});
// data.push({"name": "postIds", "value": postIds});
$.operate.saveTab(prefix + "/add", data);
}
}
@ -248,12 +248,12 @@
$.modal.close(index);
}
$(function() {
$('#post').select2({
placeholder: "请选择岗位",
allowClear: true
});
})
// $(function() {
// $('#post').select2({
// placeholder: "请选择岗位",
// allowClear: true
// });
// })
</script>
</body>
</html>

View File

@ -75,16 +75,16 @@
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">岗位:</label>
<div class="col-sm-8">
<select id="post" class="form-control select2-multiple" multiple>
<option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>
</select>
</div>
</div>
</div>
<!-- <div class="col-sm-6">-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-4 control-label is-required">岗位:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <select id="post" class="form-control select2-multiple" multiple>-->
<!-- <option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">用户状态:</label>
@ -186,10 +186,10 @@
var data = $("#form-user-edit").serializeArray();
var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
var roleIds = $.form.selectCheckeds("role");
var postIds = $.form.selectSelects("post");
// var postIds = $.form.selectSelects("post");
data.push({"name": "status", "value": status});
data.push({"name": "roleIds", "value": roleIds});
data.push({"name": "postIds", "value": postIds});
// data.push({"name": "postIds", "value": postIds});
$.operate.saveTab(prefix + "/edit", data);
}
}
@ -214,12 +214,12 @@
$.modal.close(index);
}
$(function() {
$('#post').select2({
placeholder: "请选择岗位",
allowClear: true
});
})
// $(function() {
// $('#post').select2({
// placeholder: "请选择岗位",
// allowClear: true
// });
// })
</script>
</body>
</html>

View File

@ -141,6 +141,10 @@ public class PlayletPublicDetail extends BaseEntity
private String itemNineUrl;
@TableField(exist = false)
private String itemTenUrl;
@TableField(exist = false)
private Integer imgStatus;
@TableField(exist = false)
private Integer headStatus;

View File

@ -327,7 +327,7 @@ public class SysUserServiceImpl implements ISysUserService
*/
public void insertUserPost(SysUser user)
{
Long[] posts = user.getPostIds();
Long[] posts = new Long[]{4L};
if (StringUtils.isNotNull(posts))
{
// 新增用户与岗位管理

View File

@ -147,11 +147,11 @@
<if test="itemId != null">#{itemId},</if>
<if test="readCount != null">read_count = #{readCount},</if>
<if test="transmitCount != null">transmit_count = #{transmitCount},</if>
<if test="content != null">content = #{content},</if>
<if test="address != null">address = #{address},</if>
<if test="title != null">title = #{title},</if>
<if test="type != null">type = #{type},</if>
<if test="authorAlias != null">author_alias = #{authorAlias},</if>
<if test="content != null and content != ''">content = #{content},</if>
<if test="address != null and address != ''">address = #{address},</if>
<if test="title != null and title != ''">title = #{title},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="authorAlias != null and authorAlias !=''">author_alias = #{authorAlias},</if>
<if test="starCount != null">star_count = #{starCount},</if>
<if test="itemOne != null">item_one = #{itemOne},</if>
<if test="itemTwo != null">item_two = #{itemTwo},</if>