|
@@ -22,16 +22,14 @@ import com.jeeplus.business.knowledge.mapper.KnowledgeShareVisitMapper;
|
|
|
import com.jeeplus.business.knowledge.service.dto.KnowledgeShareInfoDto;
|
|
|
import com.jeeplus.business.knowledge.service.dto.KnowledgeShareListDto;
|
|
|
import com.jeeplus.business.workContractInfo.mapper.JyWorkContractInfoMapper;
|
|
|
+import com.jeeplus.common.TokenProvider;
|
|
|
import com.jeeplus.core.domain.BaseEntity;
|
|
|
-import com.jeeplus.core.service.dto.BaseDTO;
|
|
|
-import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
|
|
|
-import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
|
|
|
import com.jeeplus.sys.domain.WorkAttachmentInfo;
|
|
|
import com.jeeplus.sys.feign.IUserApi;
|
|
|
import com.jeeplus.sys.feign.IWorkAttachmentApi;
|
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
import com.jeeplus.sys.service.dto.WorkAttachmentInfoDTO;
|
|
|
-import com.jeeplus.sys.utils.UserUtils;
|
|
|
+
|
|
|
|
|
|
import io.swagger.models.auth.In;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -80,7 +78,7 @@ public class KnowledgeShareInfoService {
|
|
|
|
|
|
public String add(KnowledgeShareInfoDto dto) {
|
|
|
// 获取当前登录人信息
|
|
|
- UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
|
|
|
// 生成id
|
|
|
String id = UUID.randomUUID().toString().replace("-", "");
|
|
|
// 保存知识分享详情信息
|
|
@@ -129,7 +127,8 @@ public class KnowledgeShareInfoService {
|
|
|
|
|
|
public String update(KnowledgeShareInfoDto dto) {
|
|
|
// 获取当前登录人信息
|
|
|
- UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
|
|
|
+
|
|
|
// 保存知识分享详情信息
|
|
|
KnowledgeShareDetail detail = new KnowledgeShareDetail();
|
|
|
BeanUtils.copyProperties(dto, detail);
|
|
@@ -174,7 +173,7 @@ public class KnowledgeShareInfoService {
|
|
|
public KnowledgeShareInfoDto findById(String id, String method, Integer size) {
|
|
|
KnowledgeShareInfoDto dto = new KnowledgeShareInfoDto();
|
|
|
// 获取当前登录人信息
|
|
|
- UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
|
|
|
if ("view".equals(method)) {
|
|
|
// 保存访问信息
|
|
|
saveVisit(id, userDTO);
|
|
@@ -212,7 +211,7 @@ public class KnowledgeShareInfoService {
|
|
|
List<KnowledgeShareVisit> visits = visitMapper.selectByDetailId(size,id);
|
|
|
if (CollectionUtils.isNotEmpty(visits)) {
|
|
|
visits.stream().forEach(i -> {
|
|
|
- UserDTO visitUser = UserUtils.get(i.getUserId());
|
|
|
+ UserDTO visitUser = SpringUtil.getBean(IUserApi.class).getById(i.getUserId());
|
|
|
i.setUserId(visitUser.getName());
|
|
|
});
|
|
|
}
|
|
@@ -227,7 +226,7 @@ public class KnowledgeShareInfoService {
|
|
|
List<KnowledgeShareComment> comments = commentMapper.selectList(commentWrapper);
|
|
|
if (CollectionUtils.isNotEmpty(comments)) {
|
|
|
comments.stream().forEach(i -> {
|
|
|
- UserDTO commentUser = UserUtils.get(i.getUserId());
|
|
|
+ UserDTO commentUser = SpringUtil.getBean(IUserApi.class).getById(i.getUserId());
|
|
|
i.setUserId(commentUser.getName());
|
|
|
i.setDeff(timeDef(i.getCreateTime()));
|
|
|
});
|
|
@@ -262,7 +261,7 @@ public class KnowledgeShareInfoService {
|
|
|
|
|
|
public String addComment(KnowledgeShareComment comment) {
|
|
|
// 获取当前登录人
|
|
|
- UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
+ UserDTO userDTO = SpringUtil.getBean(IUserApi.class).getByToken(TokenProvider.getCurrentToken());
|
|
|
// 生成id
|
|
|
String id = UUID.randomUUID().toString().replace("-", "");
|
|
|
comment.setId(id);
|