|
@@ -10,11 +10,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.jeeplus.notify.domain.Notify;
|
|
|
-import com.jeeplus.notify.domain.NotifyRecord;
|
|
|
-import com.jeeplus.notify.domain.PluginNotifyOffices;
|
|
|
-import com.jeeplus.notify.domain.PluginNotifyUser;
|
|
|
+import com.jeeplus.notify.domain.*;
|
|
|
import com.jeeplus.notify.mapper.NotifyMapper;
|
|
|
+import com.jeeplus.notify.mapper.PluginNotifyCommentsMapper;
|
|
|
import com.jeeplus.notify.mapper.PluginNotifyOfficesMapper;
|
|
|
import com.jeeplus.notify.mapper.PluginNotifyUserMapper;
|
|
|
import com.jeeplus.notify.service.dto.NotifyDTO;
|
|
@@ -24,14 +22,17 @@ import com.jeeplus.notify.service.mapstruct.NotifyWrapper;
|
|
|
import com.jeeplus.sys.constant.CommonConstants;
|
|
|
import com.jeeplus.sys.domain.User;
|
|
|
import com.jeeplus.sys.mapper.UserMapper;
|
|
|
+import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
import com.jeeplus.sys.utils.StringUtils;
|
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
|
+import com.jeeplus.test.cw.common.CommonUtils;
|
|
|
import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientBase;
|
|
|
import com.jeeplus.test.cw.workClientInfo.service.dto.CwWorkClientBaseDTO;
|
|
|
import com.jeeplus.test.cw.workClientInfo.service.mapstruct.CwWorkClientBaseWrapper;
|
|
|
import com.jeeplus.test.editor.domain.EditorFiles;
|
|
|
import com.jeeplus.test.editor.service.EditorFilesService;
|
|
|
import com.jeeplus.test.editor.service.dto.EditorFilesDTO;
|
|
|
+import com.jeeplus.test.knowledge.domain.KnowledgeShareComment;
|
|
|
import com.jeeplus.test.oss.service.OssService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -42,6 +43,7 @@ import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.UUID;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -72,6 +74,9 @@ public class NotifyService extends ServiceImpl <NotifyMapper, Notify> {
|
|
|
@Resource
|
|
|
private UserMapper userMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private PluginNotifyCommentsMapper commentsMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 根据id获取通知
|
|
|
*/
|
|
@@ -119,6 +124,11 @@ public class NotifyService extends ServiceImpl <NotifyMapper, Notify> {
|
|
|
});
|
|
|
notifyDTO.setEditorFilesDTOList(editorFilesDTOList);
|
|
|
}
|
|
|
+ if (CollectionUtil.isNotEmpty(notifyDTO.getComments())){
|
|
|
+ notifyDTO.getComments().stream().forEach(item -> {
|
|
|
+ item.setDeff(CommonUtils.timeDef(item.getCreateDate()));
|
|
|
+ });
|
|
|
+ }
|
|
|
return notifyDTO;
|
|
|
} else {
|
|
|
return new NotifyDTO();
|
|
@@ -253,4 +263,14 @@ public class NotifyService extends ServiceImpl <NotifyMapper, Notify> {
|
|
|
.eq ( NotifyRecord::getUserId, UserUtils.getCurrentUserDTO ( ).getId ( ) ).ne ( NotifyRecord::getReadFlag, CommonConstants.YES )
|
|
|
.set ( NotifyRecord::getReadDate, new Date ( ) ).set ( NotifyRecord::getReadFlag, CommonConstants.YES ).update ( );
|
|
|
}
|
|
|
+
|
|
|
+ public String addComment(PluginNotifyComments comment) {
|
|
|
+ commentsMapper.insert(comment);
|
|
|
+ return "操作完成";
|
|
|
+ }
|
|
|
+
|
|
|
+ public String delComment(String id) {
|
|
|
+ commentsMapper.deleteById(id);
|
|
|
+ return "操作完成";
|
|
|
+ }
|
|
|
}
|