From f8034850cbcef1eb333e4f21fd8354b5e8ed8329 Mon Sep 17 00:00:00 2001 From: Diyu0904 <1819728964@qq.com> Date: Thu, 13 Feb 2025 10:36:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/resource/WorkFlowController.java | 2 +- .../mcwl/web/controller/system/SysUserController.java | 7 +++++-- .../main/java/com/mcwl/resource/domain/WorkFlow.java | 7 +++++++ .../resource/service/impl/WorkFlowServiceImpl.java | 11 ++++++++++- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/WorkFlowController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/WorkFlowController.java index 49462aa..0369134 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/WorkFlowController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/resource/WorkFlowController.java @@ -46,7 +46,7 @@ public class WorkFlowController extends BaseController { */ @ApiOperation(value = "设置工作流的置顶状态") @GetMapping("/{id}/top") - public AjaxResult setworkFlowTop(@PathVariable Long id, @RequestParam boolean isTop) { + public AjaxResult setWorkFlowTop(@PathVariable Long id, @RequestParam boolean isTop) { workFlowService.setworkFlowTop(id, isTop); return AjaxResult.success(); diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/system/SysUserController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/system/SysUserController.java index fead250..c7f1a86 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/system/SysUserController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/system/SysUserController.java @@ -262,8 +262,11 @@ public class SysUserController extends BaseController * @return */ @GetMapping("/selectUserById") - public AjaxResult selectUserById(){ - SysUser sysUser = userService.selectUserInfoById(SecurityUtils.getUserId()); + public AjaxResult selectUserById(@RequestParam Long id){ + if (id == null){ + id = SecurityUtils.getUserId(); + } + SysUser sysUser = userService.selectUserInfoById(id); return success(sysUser); } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/domain/WorkFlow.java b/mcwl-resource/src/main/java/com/mcwl/resource/domain/WorkFlow.java index 47a2aca..277192a 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/domain/WorkFlow.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/domain/WorkFlow.java @@ -169,4 +169,11 @@ public class WorkFlow { @TableField(exist = false) private List typeList; + /** + * 是否关注 0关注 1未关注 + */ + @ApiModelProperty(value = "是否关注 0关注 1未关注") + @TableField(exist = false) + private Integer isAttention; + } diff --git a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java index 2f82419..f407293 100644 --- a/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java +++ b/mcwl-resource/src/main/java/com/mcwl/resource/service/impl/WorkFlowServiceImpl.java @@ -17,6 +17,7 @@ import com.mcwl.common.core.page.TableDataInfo; import com.mcwl.common.utils.SecurityUtils; import com.mcwl.common.utils.StringUtils; import com.mcwl.common.utils.baidu.BaiduCensor; +import com.mcwl.resource.domain.SysUserAttention; import com.mcwl.resource.domain.WorkFlow; import com.mcwl.resource.domain.WorkFlowVersion; import com.mcwl.resource.domain.dto.AddRequestWorkFlow; @@ -24,6 +25,7 @@ import com.mcwl.resource.domain.dto.ModelImagePageRes; import com.mcwl.resource.domain.request.RequestWorkFlow; import com.mcwl.resource.domain.vo.PageVo; import com.mcwl.resource.domain.vo.WorkFlowVo; +import com.mcwl.resource.mapper.SysUserAttentionMapper; import com.mcwl.resource.mapper.WorkFlowMapper; import com.mcwl.resource.mapper.WorkFlowVersionMapper; import com.mcwl.resource.service.ToActivityService; @@ -61,6 +63,9 @@ public class WorkFlowServiceImpl extends ServiceImpl i @Autowired private ToActivityService toActivityService; + @Autowired + private SysUserAttentionMapper sysUserAttentionMapper; + @Autowired private ISysUserService sysUserService; @@ -383,7 +388,11 @@ public class WorkFlowServiceImpl extends ServiceImpl i } workFlow.setTypeList(strings); } - + workFlow.setIsAttention(0); + SysUserAttention sysUserAttention = sysUserAttentionMapper.selectAttention(SecurityUtils.getUserId(), workFlow.getUserId()); + if (sysUserAttention == null){ + workFlow.setIsAttention(1); + } return AjaxResult.success(workFlow); }