feat: 增加抄送标记未读功能

This commit is contained in:
2026-04-22 18:00:41 +08:00
parent 8b3e016568
commit e0e31c765b
5 changed files with 45 additions and 3 deletions

View File

@@ -66,7 +66,14 @@ public class HrmFlowCcController extends BaseController {
Long userId = LoginHelper.getUserId();
return toAjax(service.markRead(ccId, userId));
}
/**
* 标记抄送未读(新增)
*/
@PostMapping("/{ccId}/unread")
public R<Void> unread(@PathVariable Long ccId) {
Long userId = LoginHelper.getUserId();
return toAjax(service.markUnread(ccId, userId));
}
@GetMapping("/ping")
public R<String> ping(@RequestParam @NotNull String x) {
return R.ok(x);

View File

@@ -27,5 +27,9 @@ public interface IHrmFlowCcService {
* 标记已读
*/
Boolean markRead(Long ccId, Long userId);
/**
* 标记未读
*/
Boolean markUnread(Long ccId, Long userId);
}

View File

@@ -99,6 +99,23 @@ public class HrmFlowCcServiceImpl implements IHrmFlowCcService {
.eq(HrmFlowCc::getDelFlag, 0)
) > 0;
}
/**
* 标记未读
*/
@Override
public Boolean markUnread(Long ccId, Long userId) {
if (ccId == null || userId == null) {
return false;
}
return baseMapper.update(
null,
Wrappers.<HrmFlowCc>lambdaUpdate()
.set(HrmFlowCc::getReadFlag, 0)
.eq(HrmFlowCc::getCcId, ccId)
.eq(HrmFlowCc::getCcUserId, userId)
.eq(HrmFlowCc::getDelFlag, 0)
) > 0;
}
private LambdaQueryWrapper<HrmFlowCc> buildQueryWrapper(HrmFlowCcBo bo) {
LambdaQueryWrapper<HrmFlowCc> lqw = Wrappers.lambdaQuery();