Compare commits

..

No commits in common. "e12f4f0a6286fafc114f96936527aeb7b811f9a9" and "2189f6a3f0688bc70a69a63194c492abcadb8882" have entirely different histories.

2 changed files with 3 additions and 19 deletions

View File

@ -17,15 +17,11 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Arrays;
import java.util.Map;
@ -38,7 +34,6 @@ import java.util.Map;
@RequestMapping("sys/notice")
@Api(tags = "通知管理")
public class SysNoticeController {
private static Logger logger = LoggerFactory.getLogger(SysNoticeController.class);
@Autowired
private SysNoticeService sysNoticeService;
@Autowired
@ -94,19 +89,9 @@ public class SysNoticeController {
@PutMapping("mynotice/read/{noticeId}")
@ApiOperation("标记我的通知为已读")
public Result read(@PathVariable("noticeId") String noticeId) {
if (StringUtils.isNotEmpty(noticeId) && noticeId.contains(";")) {
String[] noticeIds = noticeId.split(";");
Arrays.asList(noticeIds).stream().distinct().forEach(index -> {
try {
sysNoticeUserService.updateReadStatus(SecurityUser.getUserId(), Long.valueOf(index));
} catch (Exception exception) {
logger.error("标识已读失败", exception);
}
});
} else {
sysNoticeUserService.updateReadStatus(SecurityUser.getUserId(), Long.valueOf(noticeId));
}
public Result read(@PathVariable("noticeId") Long noticeId) {
sysNoticeUserService.updateReadStatus(SecurityUser.getUserId(), noticeId);
return new Result();
}

View File

@ -86,7 +86,6 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
@Transactional(rollbackFor = Exception.class)
public void save(SysNoticeDTO dto) {
SysNoticeEntity entity = ConvertUtils.sourceToTarget(dto, SysNoticeEntity.class);
entity.setFrom("其它"); // 站内信通知来源 (通知评论其它)
//更新发送者信息
if (dto.getStatus() == NoticeStatusEnum.SEND.value() && StringUtils.isEmpty(dto.getSenderName())) {