|
@@ -2,7 +2,11 @@ package com.ruoyi.system.service.impl;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
+import com.ruoyi.system.domain.vo.CollectionsVo;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.ruoyi.system.mapper.PostCollectionsSystemMapper;
|
|
@@ -20,6 +24,7 @@ import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
|
|
@Service
|
|
|
public class PostCollectionsSystemServiceImpl implements IPostCollectionsSystemService
|
|
|
{
|
|
|
+
|
|
|
@Autowired
|
|
|
private PostCollectionsSystemMapper postCollectionsSystemMapper;
|
|
|
|
|
@@ -76,9 +81,9 @@ public class PostCollectionsSystemServiceImpl implements IPostCollectionsSystemS
|
|
|
}
|
|
|
|
|
|
//补充字段
|
|
|
- postCollectionsSystem.setCreateUser(getUsername());
|
|
|
+ postCollectionsSystem.setCreateBy(getUsername());
|
|
|
postCollectionsSystem.setCreateTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getTime()));
|
|
|
- postCollectionsSystem.setUpdateUser(getUsername());
|
|
|
+ postCollectionsSystem.setUpdateBy(getUsername());
|
|
|
postCollectionsSystem.setUpdateTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getTime()));
|
|
|
return postCollectionsSystemMapper.insertPostCollectionsSystem(postCollectionsSystem);
|
|
|
}
|
|
@@ -93,7 +98,7 @@ public class PostCollectionsSystemServiceImpl implements IPostCollectionsSystemS
|
|
|
public int updatePostCollectionsSystem(PostCollectionsSystem postCollectionsSystem)
|
|
|
{
|
|
|
//补充字段
|
|
|
- postCollectionsSystem.setUpdateUser(getUsername());
|
|
|
+ postCollectionsSystem.setUpdateBy(getUsername());
|
|
|
postCollectionsSystem.setUpdateTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,DateUtils.getTime()));
|
|
|
return postCollectionsSystemMapper.updatePostCollectionsSystem(postCollectionsSystem);
|
|
|
}
|
|
@@ -139,6 +144,7 @@ public class PostCollectionsSystemServiceImpl implements IPostCollectionsSystemS
|
|
|
}else {
|
|
|
//时间为空
|
|
|
return postCollectionsSystemMapper.selectPostListByTitleOrTime(title, TimeLeft, TimeRight);
|
|
|
+
|
|
|
}
|
|
|
} else {
|
|
|
//标题为空
|
|
@@ -167,8 +173,19 @@ public class PostCollectionsSystemServiceImpl implements IPostCollectionsSystemS
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int selectPostCollectionsSystemByName(PostCollectionsSystem postCollectionsSystem) {
|
|
|
- return postCollectionsSystemMapper.selectPostCollectionsSystemByName(postCollectionsSystem);
|
|
|
+ public List<CollectionsVo> selectPostCollectionsSystemListPage(PostCollectionsSystem postCollectionsSystem) {
|
|
|
+ List<PostCollectionsSystem> list = postCollectionsSystemMapper.selectPostCollectionsSystemList(postCollectionsSystem);
|
|
|
+ List<CollectionsVo> collectionsVos=list.stream().map((item)->{
|
|
|
+ List<Long> ids=postCollectionsSystemMapper.selectPostCollectionsSystemId(postCollectionsSystem);
|
|
|
+ CollectionsVo collectionsVo=new CollectionsVo();
|
|
|
+ BeanUtils.copyProperties(item,collectionsVo);
|
|
|
+ for (Long id: ids
|
|
|
+ ) {
|
|
|
+ Integer list1= postCollectionsSystemMapper.getCopiesById(id);
|
|
|
+ collectionsVo.setCopies(list1);
|
|
|
+ }
|
|
|
+ return collectionsVo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ return collectionsVos;
|
|
|
}
|
|
|
-
|
|
|
}
|