Merge remote-tracking branch 'origin/master'

This commit is contained in:
LiuY 2022-05-11 09:41:11 +08:00
commit 40864093a3
3 changed files with 15 additions and 8 deletions

View File

@ -53,12 +53,10 @@ public class MailAppController extends DefaultBaseController {
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get-app-user-unread-mail")
public SuccessResult getAppUserUnreadMail(@RequestHeader("token") String token){
public SuccessResultData getAppUserUnreadMail(@RequestHeader("token") String token){
Map<String, Object> params = requestParams();
Integer unreadCounts = mailService.getAppUserUnreadMail(token, params);
params.clear();
params.put("unreadCounts", unreadCounts);
return new SuccessResultData<>(params);
return new SuccessResultData<>(unreadCounts);
}
@ApiOperation(value = "批量发送内部邮件接口", notes = "批量发送内部邮件接口")

View File

@ -63,7 +63,15 @@ public class MailServiceImpl extends DefaultBaseService implements IMailService
params.clear();
params.put("userId", appTokenUser.getId());
List<MailInboxDTO> list = mailDao.listInboxMail(params);
return list == null ? 0 : list.size();
int unreadCount = 0;
for(MailInboxDTO item : list){
params.put("id", item.getId());
Map<String, Object> userMailReadTag = mailDao.getUserMailReadTag(params);
if(userMailReadTag == null){
unreadCount++;
}
}
return unreadCount;
}
@Override

View File

@ -80,6 +80,7 @@
WHERE
id = #{id}
AND user_id = #{userId}
ORDER BY read_time DESC
LIMIT 1
</select>
@ -138,10 +139,10 @@
<!-- 收件箱列表 -->
<select id="listInboxMail" parameterType="map" resultMap="mailInboxDTO">
SELECT
id, mail_id_link, recipient_ids, recipient_names, copy_for_ids, copy_for_names, secret_ids, secret_names,
title, mail_files, content_rich, content, creator, gmt_create
id, mail_id_link, recipient_ids, recipient_names, copy_for_ids, copy_for_names, secret_ids, secret_names,
title, mail_files, content_rich, content, creator, gmt_create
FROM
oa_mail_inbox
oa_mail_inbox
WHERE
(
FIND_IN_SET(#{userId}, recipient_ids)