package com.yeeee.crowdfunding.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.yeeee.crowdfunding.convert.*;
import com.yeeee.crowdfunding.exception.BizException;
import com.yeeee.crowdfunding.mapper.*;
import com.yeeee.crowdfunding.model.entity.*;
import com.yeeee.crowdfunding.model.vo.*;
import com.yeeee.crowdfunding.service.ProjectService;
import com.yeeee.crowdfunding.utils.BusinessUtils;
import com.yeeee.crowdfunding.utils.DateConvertUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import vip.yeee.memo.integrate.common.websecurity.context.SecurityContext;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* description......
*
* @author yeeee
* @since 2022/4/29 21:38
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class ProjectServiceImpl implements ProjectService {
private final ProjectMapper projectMapper;
private final ProjectConvert projectConvert;
private final InitiatorInfoVOConvert initiatorInfoVOConvert;
private final ProjectDetailConvert projectDetailConvert;
private final ProjectRepayConvert projectRepayConvert;
private final CommentConvert commentConvert;
private final ProjectProgressConvert projectProgressConvert;
private final UserConvert userConvert;
private final OrderMapper orderMapper;
private final ProjectDetailMapper projectDetailMapper;
private final ProjectProgressMapper projectProgressMapper;
private final ProjectRepayMapper projectRepayMapper;
private final CommentMapper commentMapper;
private final UserMapper userMapper;
private final InitiatorPersonInfoMapper initiatorPersonInfoMapper;
private final InitiatorCompanyInfoMapper initiatorCompanyInfoMapper;
private final ProjectCategoryMapper projectCategoryMapper;
private final ReceiveInformationMapper receiveInformationMapper;
private final ReceiveInfoConvert receiveInfoConvert;
private final ProjectCategoryConvert projectCategoryConvert;
@Override
public IndexProjectListVO getIndexShowProject() {
IndexProjectListVO indexProjectListVO = new IndexProjectListVO();
// 热门
List<Project> hotList = projectMapper.getOrderLimitList(new Project().setHasIndex(1)
, ImmutableMap.of("orderField", "has_fund_raising", "orderSort", "desc", "limit", 3));
List<ProjectVO> hotVOList = Optional.ofNullable(hotList).orElseGet(Lists::newArrayList)
.stream()
.map(projectConvert::project2VO)
.collect(Collectors.toList());
indexProjectListVO.setHotList(hotVOList);
// 公益
List<Project> welfareList = projectMapper.getOrderLimitList(new Project().setCategoryId(1)
, ImmutableMap.of("orderField", "has_fund_raising", "orderSort", "desc", "limit", 3));
List<ProjectVO> welfareVOList = Optional.ofNullable(welfareList).orElseGet(Lists::newArrayList)
.stream()
.map(projectConvert::project2VO)
.collect(Collectors.toList());
indexProjectListVO.setWelfareList(welfareVOList);
// 农业
List<Project> agList = projectMapper.getOrderLimitList(new Project().setCategoryId(2)
, ImmutableMap.of("orderField", "has_fund_raising", "orderSort", "desc", "limit", 3));
List<ProjectVO> agVOList = Optional.ofNullable(agList).orElseGet(Lists::newArrayList)
.stream()
.map(projectConvert::project2VO)
.collect(Collectors.toList());
indexProjectListVO.setAgList(agVOList);
// 出版
List<Project> publishList = projectMapper.getOrderLimitList(new Project().setCategoryId(3)
, ImmutableMap.of("orderField", "has_fund_raising", "orderSort", "desc", "limit", 3));
List<ProjectVO> publishVOList = Optional.ofNullable(publishList).orElseGet(Lists::newArrayList)
.stream()
.map(projectConvert::project2VO)
.collect(Collectors.toList());
indexProjectListVO.setPublishList(publishVOList);
// 艺术
List<Project> artList = projectMapper.getOrderLimitList(new Project().setCategoryId(4)
, ImmutableMap.of("orderField", "has_fund_raising", "orderSort", "desc", "limit", 3));
List<ProjectVO> artVOList = Optional.ofNullable(artList).orElseGet(Lists::newArrayList)
.stream()
.map(projectConvert::project2VO)
.collect(Collectors.toList());
indexProjectListVO.setArtList(artVOList);
return indexProjectListVO;
}
@Override
public PageVO<ProjectVO> getProjectPageList(ProjectPageReqVO reqVO) {
Page<ProjectVO> page = PageHelper.startPage(reqVO.getPageNum(), reqVO.getPageSize());
Project query = new Project();
if (reqVO.getProjectVO() != null) {
query.setKeyword(reqVO.getProjectVO().getKeyword())
.setCategoryId(reqVO.getProjectVO().getProjectType());
}
query.setHasAudits(1);
List<Project> projectList = projectMapper.getList(query);
List<ProjectVO> result = Optional.ofNullable(projectList).orElseGet(Lists::newArrayList)
.stream()
.map(projectConvert::project2VO)
.collect(Collectors.toList());
return new PageVO<>(page.getPageNum(), page.getPageSize(), page.getPages(), page.getTotal(), result);
}
@Override
public PageVO<ProjectVO> getMyselfProjectList(ProjectPageReqVO reqVO) {
Page<ProjectVO> page = PageHelper.startPage(reqVO.getPageNum(), 5);
Project query = new Project();
query.setUserId(BusinessUtils.getCurUserId());
List<Project> projectList = projectMapper.getList(query);
List<ProjectVO> result = Optional.ofNullable(projectList).orElseGet(Lists::newArrayList)
.stream()
.map(projectConvert::project2VO)
.collect(Collectors.toList());
return new PageVO<>(page.getPageNum(), page.getPageSize(), page.getPages(), page.getTotal(), result);
}
@Override
public ProjectDetailVO getIndexProjectDetail(Integer id) {
if (id == null) {
throw new BizException("项目ID不能为空");
}
Project project = projectMapper.getOne(new Project().setId(id));
if (project == null) {
throw new BizException("项目不存在");
}
ProjectDetailVO projectDetailVO = projectConvert.project2DetailVO(project);
List<ProjectItemVO> projectItemVOS = Optional.ofNullable(projectDetailMapper.getList(new ProjectDetail().setProjectId(project.getId()))).orElseGet(Lists::newArrayList)
.stream()
.map(projectDetailConvert::detail2VO)
.collect(Collectors.toList());
projectDetailVO.setItemVOList(projectItemVOS);
List<ProjectRepayVO> repayVOList = Optional.ofNullable(projectRepayMapper.getList(new ProjectRepay().setProjectId(project.getId()))).orElseGet(Lists::newArrayList)
.stream()
.map(projectRepayConvert::projectRepay2VO)
.collect(Collectors.toList());
projectDetailVO.setRepayVOList(repayVOList);
List<CommentVO> commentVOList = Optional.ofNullable(commentMapper.getList(new Comment().setProject(project.getId()))).orElseGet(Lists::newArrayList)
.stream()
.map(commentConvert::comment2VO)
.collect(Collectors.toList());
projectDetailVO.setCommentVOList(co
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
毕业设计,基于SpringBoot+mybatis-plus+MySql开发的众筹系统项目,内含Java完整源代码,数据库脚本 【毕业设计】【众筹系统项目】发布众筹项目->审核->上线->支持项目,基于springboot+mybatis-plus+oauth2+vue开发众筹平台项目系统;本项目是一套基于springboot等主流的技术框架开发的众筹平台系统; 项目整体包含前、后台两大模块,功能上完整涵盖众筹平台所需要的核心功能, 如从前台用户注册-登录-发起众筹-支持项目-个人中心,再到后台的项目管理审核-用户管理-订单管理,实现了完整的功能流程闭环。 同时项目结构分层清晰易懂,程序基于轻量化的设计理念没有额外无关的依赖项,运行方便简单。 一、基本介绍 本项目是一套基于springboot等主流的技术框架开发的众筹平台系统; 项目整体包含前、后台两大模块,功能上完整涵盖众筹平台所需要的核心功能, 如从前台用户注册-登录-发起众筹-支持项目-个人中心,再到后台的项目管理审核-用户管理-订单管理,实现了完整的功能流程闭环。 同时项目结构分层清晰易懂,程序基于轻量化的设计理念没有额外
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计,基于SpringBoot+mybatis-plus+MySql开发的众筹系统项目,内含Java完整源代码,数据库脚本 (843个子文件)
app.css 199KB
ueditor.css 43KB
ueditor.min.css 34KB
video-js.css 21KB
project.css 19KB
image.css 18KB
sweetalert.css 18KB
video.css 15KB
attachment.css 14KB
layer.css 14KB
video-js.min.css 11KB
personal.css 10KB
common.css 9KB
jqtransform.css 8KB
faqi.css 8KB
shCoreDefault.css 7KB
login.css 6KB
layer.css 5KB
index.css 5KB
search.css 4KB
calender.css 4KB
scrawl.css 4KB
codemirror.css 3KB
datePicker.css 3KB
admin.css 3KB
charts.css 3KB
background.css 2KB
datePicker-min.css 2KB
emotion.css 2KB
dialogbase.css 2KB
music.css 2KB
style.css 1KB
edittable.css 1KB
template.css 1KB
wp-syntax.css 719B
uploadifive.css 694B
webuploader.css 515B
webuploader.css 483B
help.css 389B
shenhe.css 341B
iframe.css 41B
main.css 22B
vjs.eot 3KB
UEditorSnapscreen.exe 508KB
wface.gif 49KB
jxface2.gif 40KB
yface.gif 28KB
bface.gif 27KB
icons.gif 20KB
file-icons.gif 20KB
file-icons.gif 20KB
tface.gif 19KB
fface.gif 18KB
cface.gif 8KB
loading-0.gif 6KB
icons-all.gif 4KB
input_text_left.gif 3KB
loading-2.gif 2KB
videologo.gif 2KB
navbg.gif 2KB
select_left.gif 1KB
input_left-hover.gif 1KB
input_left-focus.gif 1KB
input_left.gif 1KB
btn_left.gif 1KB
cancelbutton.gif 1KB
button-bg.gif 1KB
arrow1.gif 1KB
lock.gif 1KB
alignicon.gif 1KB
word.gif 1019B
icon_doc.gif 1012B
icon_psd.gif 1009B
icon_rar.gif 1007B
icon_xls.gif 1005B
icon_ppt.gif 1001B
icon_mv.gif 1001B
icon_pdf.gif 996B
icon_mp3.gif 986B
icon_txt.gif 970B
icon_jpg.gif 950B
icon_exe.gif 949B
icon_chm.gif 923B
header-bg.gif 847B
onLoad.gif 781B
loading.gif 734B
loading-1.gif 701B
radio.gif 528B
input_text_right.gif 460B
icons.gif 453B
icons.gif 453B
icons.gif 453B
success.gif 445B
success.gif 445B
success.gif 445B
btn_right.gif 429B
cursor_v.gif 370B
select_right.gif 316B
cursor_h.gif 253B
input_right-focus.gif 236B
共 843 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
流华追梦
- 粉丝: 1w+
- 资源: 3853
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 【新增】-140 -医美医院-全岗位薪酬方案(实用篇).doc
- 【新增】-146 -制药公司薪酬制度.doc
- 【新增】-145 -证券薪酬管理制度.doc
- 【新增】-144 -证券薪酬管理手册.doc
- 【新增】-150 -中小公司薪资方案.doc
- 【新增】-147 -制药有限公司薪酬体系设计.doc
- 【新增】-148 -制造生产薪酬体系方案及对策.doc
- 【新增】-005 -餐饮店员工薪酬制度与考核方案.docx
- 【新增】-006 -餐饮公司薪酬管理体系.docx
- 【新增】-012 -传媒公司薪酬方案.docx
- 【新增】-021 -店铺人员薪酬方案.docx
- 【新增】-019 -电子商务公司薪资体系.docx
- 【新增】-017 -电商运营体系薪酬激励与绩效考核方案.docx
- 【新增】-022 -房产中介薪酬管理规定.docx
- 【新增】-029 -服装店门店薪酬绩效考核方案.docx
- 【新增】-034 -服装行业终端导购薪资方案.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功