From bcdae44440ee6adde32f26f2afd4a11bf9fe1803 Mon Sep 17 00:00:00 2001 From: "kuang.yife" Date: Wed, 14 Aug 2024 15:42:43 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=96=87=E6=A1=88=E8=B0=83=E6=95=B4(?= =?UTF-8?q?=E5=AE=8C=E6=88=90)=20=E5=BD=92=E5=B1=9E=E4=BA=BA=E5=91=98=20?= =?UTF-8?q?=E8=BF=99=E4=B8=AA=E7=A7=B0=E5=91=BC=E6=94=B9=E4=B8=BA=20?= =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=B7=E8=B4=9F=E8=B4=A3=E4=BA=BA=20?= =?UTF-8?q?=E4=BD=9C=E8=80=85=E8=8A=B1=E5=90=8D:=20=E8=BF=99=E4=B8=AA?= =?UTF-8?q?=E6=88=90=E4=B8=BA=E6=94=B9=E4=B8=BA=20=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=BD=9C=E8=80=85=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2.在创建文章的时候,没有填作者名,则将公众号作者名带入 (完成) 3.文章标签修改时增加默认示例,示例内容为:微信/淘系/视频号,且文本框调整为3行 (完成) 4.文章标签抽出来单独一个菜单 (完成) 5.用户阅读文章时,需要将文章标签存储到用户表 playlet_public_user --- .../PlayletPublicAccountController.java | 2 +- .../system/PlayletPublicDetailController.java | 49 ++++++- .../system/PublicDeptTagsController.java | 136 ++++++++++++++++++ .../system/PublicDetailCommentController.java | 2 +- .../com/playlet/web/req/PublicDetailTag.java | 13 ++ .../impl/PublicDetailShareAppServiceImpl.java | 10 ++ .../resources/templates/system/dept/add.html | 6 + .../resources/templates/system/dept/dept.html | 5 + .../resources/templates/system/dept/edit.html | 6 + .../system/playlet/account/account.html | 9 +- .../templates/system/playlet/account/add.html | 30 +++- .../system/playlet/account/edit.html | 30 +++- .../templates/system/playlet/detail/add.html | 7 +- .../templates/system/playlet/detail/edit.html | 7 +- .../resources/templates/system/tags/add.html | 31 ++++ .../resources/templates/system/tags/edit.html | 32 +++++ .../resources/templates/system/tags/tags.html | 93 ++++++++++++ .../common/core/domain/entity/SysDept.java | 13 ++ .../system/domain/PlayletPublicAccount.java | 3 + .../playlet/system/domain/PublicDeptTags.java | 33 +++++ .../system/mapper/PublicDeptTagsMapper.java | 62 ++++++++ .../service/IPublicDeptTagsService.java | 62 ++++++++ .../impl/PublicDeptTagsServiceImpl.java | 98 +++++++++++++ .../system/PlayletPublicAccountMapper.xml | 7 +- .../mapper/system/PublicDeptTagsMapper.xml | 82 +++++++++++ .../resources/mapper/system/SysDeptMapper.xml | 8 +- 26 files changed, 800 insertions(+), 36 deletions(-) create mode 100644 playlet-admin/src/main/java/com/playlet/web/controller/system/PublicDeptTagsController.java create mode 100644 playlet-admin/src/main/java/com/playlet/web/req/PublicDetailTag.java create mode 100644 playlet-admin/src/main/resources/templates/system/tags/add.html create mode 100644 playlet-admin/src/main/resources/templates/system/tags/edit.html create mode 100644 playlet-admin/src/main/resources/templates/system/tags/tags.html create mode 100644 playlet-system/src/main/java/com/playlet/system/domain/PublicDeptTags.java create mode 100644 playlet-system/src/main/java/com/playlet/system/mapper/PublicDeptTagsMapper.java create mode 100644 playlet-system/src/main/java/com/playlet/system/service/IPublicDeptTagsService.java create mode 100644 playlet-system/src/main/java/com/playlet/system/service/impl/PublicDeptTagsServiceImpl.java create mode 100644 playlet-system/src/main/resources/mapper/system/PublicDeptTagsMapper.xml diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicAccountController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicAccountController.java index 09d3a24..512c9cc 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicAccountController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicAccountController.java @@ -79,7 +79,7 @@ public class PlayletPublicAccountController extends BaseController { // 判断是否是管理员 if(!this.getSysUser().isAdmin()){ - playletPublicAccount.setManagerId(this.getUserId()); + playletPublicAccount.setManagerIds(this.getUserId().toString()); } startPage(); List list = playletPublicAccountService.selectPlayletPublicAccountList(playletPublicAccount); diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicDetailController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicDetailController.java index ab5589a..cfdde40 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicDetailController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletPublicDetailController.java @@ -5,12 +5,13 @@ import java.util.List; import java.util.stream.Collectors; import cn.hutool.core.collection.CollectionUtil; +import com.playlet.common.core.domain.entity.SysDept; import com.playlet.common.utils.StringUtils; import com.playlet.system.domain.PlayletPublicAccount; +import com.playlet.system.domain.PublicDeptTags; import com.playlet.system.domain.PublicDetailComment; -import com.playlet.system.service.IPlayletItemService; -import com.playlet.system.service.IPlayletPublicAccountService; -import com.playlet.system.service.IPublicDetailShareService; +import com.playlet.system.service.*; +import com.playlet.web.req.PublicDetailTag; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -19,7 +20,6 @@ import org.springframework.web.bind.annotation.*; import com.playlet.common.annotation.Log; import com.playlet.common.enums.BusinessType; import com.playlet.system.domain.PlayletPublicDetail; -import com.playlet.system.service.IPlayletPublicDetailService; import com.playlet.common.core.controller.BaseController; import com.playlet.common.core.domain.AjaxResult; import com.playlet.common.utils.poi.ExcelUtil; @@ -49,6 +49,11 @@ public class PlayletPublicDetailController extends BaseController @Autowired private IPublicDetailShareService publicDetailShareService; + @Autowired + private ISysDeptService deptService; + + @Autowired + private IPublicDeptTagsService deptTagsService; @GetMapping("/wxQrcode/{id}") public String wxQrcode(@PathVariable("id") String id, ModelMap mmap) { @@ -101,7 +106,7 @@ public class PlayletPublicDetailController extends BaseController { if(!this.getSysUser().isAdmin()){ List accounts = playletPublicAccountService.lambdaQuery().select(PlayletPublicAccount::getId) - .eq(PlayletPublicAccount::getManagerId, this.getUserId()) + .like(PlayletPublicAccount::getManagerIds, this.getUserId()) .list(); if(CollectionUtil.isEmpty(accounts)){ return getDataTable(new ArrayList<>()); @@ -149,6 +154,20 @@ public class PlayletPublicDetailController extends BaseController }else { modelMap.put("publicAccounts", playletPublicAccountService.selectPlayletPublicAccountList(new PlayletPublicAccount())); } + PublicDeptTags tagsList = deptTagsService.lambdaQuery().eq(PublicDeptTags::getDeptId, this.getSysUser().getDeptId()).one(); + if(tagsList != null){ + String detailTags = tagsList.getTags(); + if(StringUtils.isNotEmpty(detailTags)){ + List tags = new ArrayList<>(); + String [] arr = detailTags.split("/"); + for (String str : arr) { + PublicDetailTag tag = new PublicDetailTag(); + tag.setTag(str); + tags.add(tag); + } + modelMap.put("tags", tags); + } + } return prefix + "/add"; } @@ -164,6 +183,12 @@ public class PlayletPublicDetailController extends BaseController if("02".equals(playletPublicDetail.getType())){ playletPublicDetail.setContent(playletPublicDetail.getPdfUrl()); } + if(StringUtils.isEmpty(playletPublicDetail.getAuthorAlias()) && playletPublicDetail.getPublicId() != null){ + PlayletPublicAccount account = playletPublicAccountService.getById(playletPublicDetail.getPublicId()); + if(account != null){ + playletPublicDetail.setAuthorAlias(account.getAuthorAlias()); + } + } return toAjax(playletPublicDetailService.insertPlayletPublicDetail(playletPublicDetail)); } @@ -184,6 +209,20 @@ public class PlayletPublicDetailController extends BaseController mmap.put("publicAccounts", playletPublicAccountService.selectPlayletPublicAccountList(new PlayletPublicAccount())); } mmap.put("playletPublicDetail", playletPublicDetail); + PublicDeptTags tagsList = deptTagsService.lambdaQuery().eq(PublicDeptTags::getDeptId, this.getSysUser().getDeptId()).one(); + if(tagsList != null){ + String detailTags = tagsList.getTags(); + if(StringUtils.isNotEmpty(detailTags)){ + List tags = new ArrayList<>(); + String [] arr = detailTags.split("/"); + for (String str : arr) { + PublicDetailTag tag = new PublicDetailTag(); + tag.setTag(str); + tags.add(tag); + } + mmap.put("tags", tags); + } + } return prefix + "/edit"; } diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PublicDeptTagsController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PublicDeptTagsController.java new file mode 100644 index 0000000..2141325 --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PublicDeptTagsController.java @@ -0,0 +1,136 @@ +package com.playlet.web.controller.system; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.playlet.common.annotation.Log; +import com.playlet.common.enums.BusinessType; +import com.playlet.system.domain.PublicDeptTags; +import com.playlet.system.service.IPublicDeptTagsService; +import com.playlet.common.core.controller.BaseController; +import com.playlet.common.core.domain.AjaxResult; +import com.playlet.common.utils.poi.ExcelUtil; +import com.playlet.common.core.page.TableDataInfo; + +/** + * 文章标签Controller + * + * @author ruoyi + * @date 2024-08-14 + */ +@Controller +@RequestMapping("/system/tags") +public class PublicDeptTagsController extends BaseController +{ + private String prefix = "system/tags"; + + @Autowired + private IPublicDeptTagsService publicDeptTagsService; + +// @RequiresPermissions("system:tags:view") + @GetMapping() + public String tags() + { + return prefix + "/tags"; + } + + /** + * 查询文章标签列表 + */ +// @RequiresPermissions("system:tags:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(PublicDeptTags publicDeptTags) + { + if(!this.getSysUser().isAdmin()){ + publicDeptTags.setDeptId(this.getSysUser().getDeptId()); + } + startPage(); + List list = publicDeptTagsService.selectPublicDeptTagsList(publicDeptTags); + return getDataTable(list); + } + + /** + * 导出文章标签列表 + */ +// @RequiresPermissions("system:tags:export") + @Log(title = "文章标签", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(PublicDeptTags publicDeptTags) + { + List list = publicDeptTagsService.selectPublicDeptTagsList(publicDeptTags); + ExcelUtil util = new ExcelUtil(PublicDeptTags.class); + return util.exportExcel(list, "文章标签数据"); + } + + /** + * 新增文章标签 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存文章标签 + */ +// @RequiresPermissions("system:tags:add") + @Log(title = "文章标签", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(PublicDeptTags publicDeptTags) + { + long count = publicDeptTagsService.lambdaQuery().eq(PublicDeptTags::getDeptId, this.getSysUser().getDeptId()).count(); + if(count > 0){ + return AjaxResult.error("请在已存在标签上做修改!"); + } + publicDeptTags.setDeptId(this.getSysUser().getDeptId()); + return toAjax(publicDeptTagsService.insertPublicDeptTags(publicDeptTags)); + } + + /** + * 修改文章标签 + */ +// @RequiresPermissions("system:tags:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + PublicDeptTags publicDeptTags = publicDeptTagsService.selectPublicDeptTagsById(id); + mmap.put("publicDeptTags", publicDeptTags); + return prefix + "/edit"; + } + + /** + * 修改保存文章标签 + */ +// @RequiresPermissions("system:tags:edit") + @Log(title = "文章标签", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(PublicDeptTags publicDeptTags) + { + publicDeptTags.setDeptId(this.getSysUser().getDeptId()); + return toAjax(publicDeptTagsService.updatePublicDeptTags(publicDeptTags)); + } + + /** + * 删除文章标签 + */ +// @RequiresPermissions("system:tags:remove") + @Log(title = "文章标签", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(publicDeptTagsService.deletePublicDeptTagsByIds(ids)); + } +} diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PublicDetailCommentController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PublicDetailCommentController.java index c314196..1958f5c 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PublicDetailCommentController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PublicDetailCommentController.java @@ -66,7 +66,7 @@ public class PublicDetailCommentController extends BaseController if(!this.getSysUser().isAdmin()){ // 公众号 List accounts = playletPublicAccountService.lambdaQuery().select(PlayletPublicAccount::getId) - .eq(PlayletPublicAccount::getManagerId, this.getUserId()) + .like(PlayletPublicAccount::getManagerIds, this.getUserId()) .list(); if(CollectionUtil.isEmpty(accounts)){ return getDataTable(new ArrayList<>()); diff --git a/playlet-admin/src/main/java/com/playlet/web/req/PublicDetailTag.java b/playlet-admin/src/main/java/com/playlet/web/req/PublicDetailTag.java new file mode 100644 index 0000000..e675c32 --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/req/PublicDetailTag.java @@ -0,0 +1,13 @@ +package com.playlet.web.req; + +import lombok.Data; + +/** + * @author clunt + */ +@Data +public class PublicDetailTag { + + private String tag; + +} diff --git a/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PublicDetailShareAppServiceImpl.java b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PublicDetailShareAppServiceImpl.java index 90dbf9c..c57463b 100644 --- a/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PublicDetailShareAppServiceImpl.java +++ b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PublicDetailShareAppServiceImpl.java @@ -25,6 +25,8 @@ public class PublicDetailShareAppServiceImpl implements PublicDetailShareAppServ @Override public void addRecord(PublicDetailShare publicDetailShare) { + // 文章信息 + PlayletPublicDetail detail = iPlayletPublicDetailService.getById(publicDetailShare.getDetailId()); // 翻译 PlayletPublicUser share = iPlayletPublicUserService.selectPlayletPublicUserById(publicDetailShare.getAuthorId()); PlayletPublicUser userOne = iPlayletPublicUserService.selectPlayletPublicUserById(publicDetailShare.getReaderOneId()); @@ -35,9 +37,17 @@ public class PublicDetailShareAppServiceImpl implements PublicDetailShareAppServ } if(userOne != null){ publicDetailShare.setReaderOneName(userOne.getName()); + // 增加1的阅读标签 + if(!userOne.getRemark().contains(detail.getDetailTag())){ + userOne.setRemark(userOne.getRemark()+"|" + detail.getDetailTag()); + iPlayletPublicUserService.updateById(userOne); + } } if(userTwo != null){ publicDetailShare.setReaderTwoName(userTwo.getName()); + // 增加用户2的阅读标签 + userTwo.setRemark(userTwo.getRemark()+"|" + detail.getDetailTag()); + iPlayletPublicUserService.updateById(userTwo); } // 查询是否二次记录 long readCount = iPublicDetailShareService.lambdaQuery() diff --git a/playlet-admin/src/main/resources/templates/system/dept/add.html b/playlet-admin/src/main/resources/templates/system/dept/add.html index 21f728c..c6ed046 100644 --- a/playlet-admin/src/main/resources/templates/system/dept/add.html +++ b/playlet-admin/src/main/resources/templates/system/dept/add.html @@ -34,6 +34,12 @@ +
+ +
+ +
+
diff --git a/playlet-admin/src/main/resources/templates/system/dept/dept.html b/playlet-admin/src/main/resources/templates/system/dept/dept.html index 6f4286a..13dff7b 100644 --- a/playlet-admin/src/main/resources/templates/system/dept/dept.html +++ b/playlet-admin/src/main/resources/templates/system/dept/dept.html @@ -82,6 +82,11 @@ align: "left" }, { + field: 'detailTags', + title: '文章标签', + align: "left" + }, + { field: 'orderNum', title: '排序', align: "left" diff --git a/playlet-admin/src/main/resources/templates/system/dept/edit.html b/playlet-admin/src/main/resources/templates/system/dept/edit.html index 93d34fe..01078c2 100644 --- a/playlet-admin/src/main/resources/templates/system/dept/edit.html +++ b/playlet-admin/src/main/resources/templates/system/dept/edit.html @@ -35,6 +35,12 @@
+
+ +
+ +
+
diff --git a/playlet-admin/src/main/resources/templates/system/playlet/account/account.html b/playlet-admin/src/main/resources/templates/system/playlet/account/account.html index 72a50d6..5da6503 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/account/account.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/account/account.html @@ -72,10 +72,7 @@ { field: 'publicType', title: '内容方向', - align: 'center', - formatter: function(value, row, index) { - return $.table.selectDictLabel(typeDict, value); - } + align: 'center' }, { field: 'introduction', @@ -84,7 +81,7 @@ }, { field: 'authorAlias', - title: '作者花名' + title: '文章默认作者名' }, { field: 'logoUrl', @@ -108,7 +105,7 @@ }, { field: 'managerName', - title: '运营人员' + title: '公众号负责人' }, { field: 'remark', diff --git a/playlet-admin/src/main/resources/templates/system/playlet/account/add.html b/playlet-admin/src/main/resources/templates/system/playlet/account/add.html index a8fdb9d..d9ea636 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/account/add.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/account/add.html @@ -2,6 +2,7 @@ + @@ -17,9 +18,7 @@
- +
@@ -38,7 +37,7 @@
- +
+ + +
+
+
+
@@ -82,6 +89,7 @@
+ + + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/tags/edit.html b/playlet-admin/src/main/resources/templates/system/tags/edit.html new file mode 100644 index 0000000..d6e63eb --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/tags/edit.html @@ -0,0 +1,32 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/tags/tags.html b/playlet-admin/src/main/resources/templates/system/tags/tags.html new file mode 100644 index 0000000..349d118 --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/tags/tags.html @@ -0,0 +1,93 @@ + + + + + + +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/playlet-common/src/main/java/com/playlet/common/core/domain/entity/SysDept.java b/playlet-common/src/main/java/com/playlet/common/core/domain/entity/SysDept.java index ee74ac5..dd16bfb 100644 --- a/playlet-common/src/main/java/com/playlet/common/core/domain/entity/SysDept.java +++ b/playlet-common/src/main/java/com/playlet/common/core/domain/entity/SysDept.java @@ -58,6 +58,19 @@ public class SysDept extends BaseEntity private Integer publicAccountLimit; + /** + * + */ + private String detailTags; + + public String getDetailTags() { + return detailTags; + } + + public void setDetailTags(String detailTags) { + this.detailTags = detailTags; + } + public Integer getStaffLimit() { return staffLimit; } diff --git a/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicAccount.java b/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicAccount.java index 0e95f0b..a277b18 100644 --- a/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicAccount.java +++ b/playlet-system/src/main/java/com/playlet/system/domain/PlayletPublicAccount.java @@ -58,6 +58,9 @@ public class PlayletPublicAccount extends BaseEntity @ApiModelProperty(value = "运营人员id") private Long managerId; + @ApiModelProperty(value = "运营人员ids") + private String managerIds; + @TableField(exist = false) private String managerName; diff --git a/playlet-system/src/main/java/com/playlet/system/domain/PublicDeptTags.java b/playlet-system/src/main/java/com/playlet/system/domain/PublicDeptTags.java new file mode 100644 index 0000000..4647759 --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/domain/PublicDeptTags.java @@ -0,0 +1,33 @@ +package com.playlet.system.domain; + +import com.playlet.common.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.playlet.common.annotation.Excel; + +/** + * 文章标签对象 public_dept_tags + * + * @author ruoyi + * @date 2024-08-14 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName(value = "public_dept_tags") +public class PublicDeptTags extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 公司id */ + @Excel(name = "公司id") + private Long deptId; + + /** 文章标签 */ + @Excel(name = "文章标签") + private String tags; + +} diff --git a/playlet-system/src/main/java/com/playlet/system/mapper/PublicDeptTagsMapper.java b/playlet-system/src/main/java/com/playlet/system/mapper/PublicDeptTagsMapper.java new file mode 100644 index 0000000..684b531 --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/mapper/PublicDeptTagsMapper.java @@ -0,0 +1,62 @@ +package com.playlet.system.mapper; + +import java.util.List; +import com.playlet.system.domain.PublicDeptTags; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 文章标签Mapper接口 + * + * @author ruoyi + * @date 2024-08-14 + */ +public interface PublicDeptTagsMapper extends BaseMapper +{ + /** + * 查询文章标签 + * + * @param id 文章标签主键 + * @return 文章标签 + */ + public PublicDeptTags selectPublicDeptTagsById(Long id); + + /** + * 查询文章标签列表 + * + * @param publicDeptTags 文章标签 + * @return 文章标签集合 + */ + public List selectPublicDeptTagsList(PublicDeptTags publicDeptTags); + + /** + * 新增文章标签 + * + * @param publicDeptTags 文章标签 + * @return 结果 + */ + public int insertPublicDeptTags(PublicDeptTags publicDeptTags); + + /** + * 修改文章标签 + * + * @param publicDeptTags 文章标签 + * @return 结果 + */ + public int updatePublicDeptTags(PublicDeptTags publicDeptTags); + + /** + * 删除文章标签 + * + * @param id 文章标签主键 + * @return 结果 + */ + public int deletePublicDeptTagsById(Long id); + + /** + * 批量删除文章标签 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deletePublicDeptTagsByIds(String[] ids); +} diff --git a/playlet-system/src/main/java/com/playlet/system/service/IPublicDeptTagsService.java b/playlet-system/src/main/java/com/playlet/system/service/IPublicDeptTagsService.java new file mode 100644 index 0000000..e2d3651 --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/service/IPublicDeptTagsService.java @@ -0,0 +1,62 @@ +package com.playlet.system.service; + +import java.util.List; +import com.playlet.system.domain.PublicDeptTags; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 文章标签Service接口 + * + * @author ruoyi + * @date 2024-08-14 + */ +public interface IPublicDeptTagsService extends IService +{ + /** + * 查询文章标签 + * + * @param id 文章标签主键 + * @return 文章标签 + */ + public PublicDeptTags selectPublicDeptTagsById(Long id); + + /** + * 查询文章标签列表 + * + * @param publicDeptTags 文章标签 + * @return 文章标签集合 + */ + public List selectPublicDeptTagsList(PublicDeptTags publicDeptTags); + + /** + * 新增文章标签 + * + * @param publicDeptTags 文章标签 + * @return 结果 + */ + public int insertPublicDeptTags(PublicDeptTags publicDeptTags); + + /** + * 修改文章标签 + * + * @param publicDeptTags 文章标签 + * @return 结果 + */ + public int updatePublicDeptTags(PublicDeptTags publicDeptTags); + + /** + * 批量删除文章标签 + * + * @param ids 需要删除的文章标签主键集合 + * @return 结果 + */ + public int deletePublicDeptTagsByIds(String ids); + + /** + * 删除文章标签信息 + * + * @param id 文章标签主键 + * @return 结果 + */ + public int deletePublicDeptTagsById(Long id); +} diff --git a/playlet-system/src/main/java/com/playlet/system/service/impl/PublicDeptTagsServiceImpl.java b/playlet-system/src/main/java/com/playlet/system/service/impl/PublicDeptTagsServiceImpl.java new file mode 100644 index 0000000..6b118ee --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/service/impl/PublicDeptTagsServiceImpl.java @@ -0,0 +1,98 @@ +package com.playlet.system.service.impl; + +import java.util.List; +import com.playlet.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.playlet.system.mapper.PublicDeptTagsMapper; +import com.playlet.system.domain.PublicDeptTags; +import com.playlet.system.service.IPublicDeptTagsService; +import com.playlet.common.core.text.Convert; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 文章标签Service业务层处理 + * + * @author ruoyi + * @date 2024-08-14 + */ +@Service +public class PublicDeptTagsServiceImpl extends ServiceImpl implements IPublicDeptTagsService +{ + @Autowired + private PublicDeptTagsMapper publicDeptTagsMapper; + + /** + * 查询文章标签 + * + * @param id 文章标签主键 + * @return 文章标签 + */ + @Override + public PublicDeptTags selectPublicDeptTagsById(Long id) + { + return publicDeptTagsMapper.selectPublicDeptTagsById(id); + } + + /** + * 查询文章标签列表 + * + * @param publicDeptTags 文章标签 + * @return 文章标签 + */ + @Override + public List selectPublicDeptTagsList(PublicDeptTags publicDeptTags) + { + return publicDeptTagsMapper.selectPublicDeptTagsList(publicDeptTags); + } + + /** + * 新增文章标签 + * + * @param publicDeptTags 文章标签 + * @return 结果 + */ + @Override + public int insertPublicDeptTags(PublicDeptTags publicDeptTags) + { + publicDeptTags.setCreateTime(DateUtils.getNowDate()); + return publicDeptTagsMapper.insertPublicDeptTags(publicDeptTags); + } + + /** + * 修改文章标签 + * + * @param publicDeptTags 文章标签 + * @return 结果 + */ + @Override + public int updatePublicDeptTags(PublicDeptTags publicDeptTags) + { + publicDeptTags.setUpdateTime(DateUtils.getNowDate()); + return publicDeptTagsMapper.updatePublicDeptTags(publicDeptTags); + } + + /** + * 批量删除文章标签 + * + * @param ids 需要删除的文章标签主键 + * @return 结果 + */ + @Override + public int deletePublicDeptTagsByIds(String ids) + { + return publicDeptTagsMapper.deletePublicDeptTagsByIds(Convert.toStrArray(ids)); + } + + /** + * 删除文章标签信息 + * + * @param id 文章标签主键 + * @return 结果 + */ + @Override + public int deletePublicDeptTagsById(Long id) + { + return publicDeptTagsMapper.deletePublicDeptTagsById(id); + } +} diff --git a/playlet-system/src/main/resources/mapper/system/PlayletPublicAccountMapper.xml b/playlet-system/src/main/resources/mapper/system/PlayletPublicAccountMapper.xml index 80fe89a..3b6574e 100644 --- a/playlet-system/src/main/resources/mapper/system/PlayletPublicAccountMapper.xml +++ b/playlet-system/src/main/resources/mapper/system/PlayletPublicAccountMapper.xml @@ -13,6 +13,7 @@ + @@ -25,7 +26,7 @@ - select id, name, public_type, detail_type, detail_tags, introduction, author_alias, manager_id, logo_url, address, original_content_count, followers_count, create_by, create_time, update_by, update_time, remark from playlet_public_account + select id, name, public_type, detail_type, detail_tags, introduction, author_alias, manager_id, manager_ids, logo_url, address, original_content_count, followers_count, create_by, create_time, update_by, update_time, remark from playlet_public_account + + + and dept_id = #{deptId} + and tags = #{tags} + + + + + + + insert into public_dept_tags + + dept_id, + tags, + create_time, + create_by, + update_time, + update_by, + remark, + + + #{deptId}, + #{tags}, + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + #{remark}, + + + + + update public_dept_tags + + dept_id = #{deptId}, + tags = #{tags}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + remark = #{remark}, + + where id = #{id} + + + + delete from public_dept_tags where id = #{id} + + + + delete from public_dept_tags where id in + + #{id} + + + + \ No newline at end of file diff --git a/playlet-system/src/main/resources/mapper/system/SysDeptMapper.xml b/playlet-system/src/main/resources/mapper/system/SysDeptMapper.xml index 3e2c5c7..24b0086 100644 --- a/playlet-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/playlet-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -25,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select d.dept_id, d.staff_limit, d.public_account_limit, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time + select d.dept_id, d.staff_limit, d.detail_tags, d.public_account_limit, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time from sys_dept d @@ -74,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"