package com.nft.collection.service;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import com.nft.collection.domain.Collection;
import com.nft.collection.domain.CollectionStory;
import com.nft.collection.domain.Creator;
import com.nft.collection.domain.IssuedCollection;
import com.nft.collection.domain.IssuedCollectionActionLog;
import com.nft.collection.domain.MemberHoldCollection;
import com.nft.collection.domain.MemberResaleCollection;
import com.nft.collection.domain.MysteryBoxCommodity;
import com.nft.collection.param.AddCollectionParam;
import com.nft.collection.param.CollectionQueryCondParam;
import com.nft.collection.param.MemberHoldCollectionQueryCondParam;
import com.nft.collection.param.MysteryBoxCommodityParam;
import com.nft.collection.param.ResaleCollectionQueryCondParam;
import com.nft.collection.param.UpdateCollectionStoryParam;
import com.nft.collection.param.UpdateMysteryBoxCommodityParam;
import com.nft.collection.repo.CollectionRepo;
import com.nft.collection.repo.CollectionStoryRepo;
import com.nft.collection.repo.CreatorRepo;
import com.nft.collection.repo.IssuedCollectionActionLogRepo;
import com.nft.collection.repo.IssuedCollectionRepo;
import com.nft.collection.repo.MemberHoldCollectionRepo;
import com.nft.collection.repo.MemberResaleCollectionRepo;
import com.nft.collection.repo.MysteryBoxCommodityRepo;
import com.nft.collection.vo.CollectionStatisticDataVO;
import com.nft.collection.vo.CollectionVO;
import com.nft.collection.vo.ForSaleCollectionVO;
import com.nft.collection.vo.GroupByDateCollectionVO;
import com.nft.collection.vo.GroupByTimeCollectionVO;
import com.nft.collection.vo.IssuedCollectionActionLogVO;
import com.nft.collection.vo.IssuedCollectionVO;
import com.nft.collection.vo.LatestCollectionDetailVO;
import com.nft.collection.vo.LatestCollectionVO;
import com.nft.collection.vo.MemberHoldCollectionVO;
import com.nft.collection.vo.MemberResaleCollectionVO;
import com.nft.collection.vo.MyHoldCollectionDetailVO;
import com.nft.collection.vo.MyHoldCollectionVO;
import com.nft.collection.vo.MyHoldVO;
import com.nft.collection.vo.MyResaleCollectionDetailVO;
import com.nft.collection.vo.MyResaleCollectionVO;
import com.nft.collection.vo.MySoldCollectionVO;
import com.nft.collection.vo.MysteryBoxCommodityVO;
import com.nft.collection.vo.PublishedBrandDictVO;
import com.nft.collection.vo.PublishedCollectionDictVO;
import com.nft.collection.vo.ResaleCollectionDetailVO;
import com.nft.collection.vo.ResaleCollectionVO;
import com.nft.common.exception.BizException;
import com.nft.common.utils.IdUtils;
import com.nft.common.utils.ThreadPoolUtils;
import com.nft.common.vo.PageResult;
import com.nft.constants.Constant;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
@Validated
@Service
public class CollectionService {
@Autowired
private RedissonClient redissonClient;
@Autowired
private CollectionRepo collectionRepo;
@Autowired
private CollectionStoryRepo collectionStoryRepo;
@Autowired
private CreatorRepo creatorRepo;
@Autowired
private MemberHoldCollectionRepo memberHoldCollectionRepo;
@Autowired
private MemberResaleCollectionRepo memberResaleCollectionRepo;
@Autowired
private IssuedCollectionActionLogRepo issuedCollectionActionLogRepo;
@Autowired
private MysteryBoxCommodityRepo mysteryBoxCommodityRepo;
@Autowired
private IssuedCollectionRepo issuedCollectionRepo;
@Transactional(readOnly = true)
public CollectionStatisticDataVO getCollectionStatisticData() {
List<Collection> result = collectionRepo.findAll(new CollectionQueryCondParam().buildSpecification(),
Sort.by(Sort.Order.desc("createTime")));
CollectionStatisticDataVO vo = new CollectionStatisticDataVO();
for (Collection data : result) {
if (Constant.商品类型_藏品.equals(data.getCommodityType())) {
vo.setCollectionCount(vo.getCollectionCount() + 1);
} else if (Constant.商品类型_盲盒.equals(data.getCommodityType())) {
vo.setMysteryBoxCount(vo.getMysteryBoxCount() + 1);
}
}
return vo;
}
@Transactional(readOnly = true)
public List<PublishedBrandDictVO> findPublishedBrandAndCollectionDict() {
List<Creator> creators = creatorRepo.findByDeletedFlagFalseOrderByCreateTimeDesc();
List<Collection> collections = collectionRepo.findByDeletedFlagFalseOrderByCreateTimeDesc();
List<PublishedBrandDictVO> vos = PublishedBrandDictVO.convertFor(creators);
for (PublishedBrandDictVO vo : vos) {
for (Collection collection : collections) {
if (vo.getId().equals(collection.getCreatorId())) {
vo.getCollections().add(PublishedCollectionDictVO.convertFor(collection));
}
}
}
return vos;
}
@Transactional(readOnly = true)
public List<IssuedCollectionVO> findIssuedCollection(@NotBlank String collectionId) {
List<IssuedCollection> artworks = issuedCollectionRepo
.findByCollectionIdAndDeletedFlagFalseOrderByCollectionSerialNumberDesc(collectionId);
return IssuedCollectionVO.convertFor(artworks);
}
@Transactional(readOnly = true)
public List<IssuedCollectionActionLogVO> findIssuedCollectionActionLog(@NotBlank String issuedCollectionId) {
List<IssuedCollectionActionLog> logs = issuedCollectionActionLogRepo
.findByIssuedCollectionIdOrderByActionTimeDesc(issuedCollectionId);
return IssuedCollectionActionLogVO.convertFor(logs);
}
@Transactional(readOnly = true)
public PageResult<MemberHoldCollectionVO> findMemberHoldCollectionByPage(
@Valid MemberHoldCollectionQueryCondParam param) {
Page<MemberHoldCollection> result = memberHoldCollectionRepo.findAll(param.buildSpecification(),
PageRequest.of(param.getPageNum() - 1, param.getPageSize(), Sort.by(Sort.Order.desc("holdTime"))));
PageResult<MemberHoldCollectionVO> pageResult = new PageResult<>(
MemberHoldCollectionVO.convertFor(result.getContent()), param.getPageNum(), param.getPageSize(),
result.getTotalElements());
return pageResult;
}
@Transactional(readOnly = true)
public ResaleCollectionDetailVO findResaleCollectionDetail(@NotBlank String id) {
MemberResaleCollection memberResaleCollection = memberResaleCollectionRepo.getOne(id);
return ResaleCollectionDetailVO.convertFor(memberResaleCollection);
}
@Transactional(readOnly = true)
public MyResaleCollectionDetailVO findMyResaleCollectionDetail(@NotBlank String id, @NotBlank String memberId) {
MemberResaleCollection memberResaleCollection = memberResaleCollectionRepo.getOne(id);
if (!memberId.equals(memberResaleCollection.getMemberId())) {
throw new BizException("无权操作");
}
return MyResaleCollectionDetailVO.convertFor(memberResaleCollection);
}
@Transactional(readOnly = true)
public MyHoldCollectionDetailVO findMyHoldCollectionDetail(@NotBlank String id, @NotBlank String memberId) {
MemberHoldCollection memberHoldCollection = memberHoldCollectionRepo.getOne(id);
if (!memberId.equals(memberHoldCollection.getMemberId())) {
throw new BizException("无权操作");
}
return MyHoldCollectionDetailVO.convertFor(memberHoldCollection);
}
@Transactional(readOnly = true)
public PageResult<MySoldCollectionVO> findMySoldCollectionByPage(@Valid ResaleCollectionQueryCondParam param) {
param.setState(Constant.转售的藏品状态_已卖出);
Page<MemberResaleCollection> result = memberResaleCollectionR
没有合适的资源?快使用搜索试试~ 我知道了~
基于Java、JavaScript、HTML、CSS的NFT数字藏品艺术品交易平台设计源码
共401个文件
java:308个
js:27个
html:26个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 145 浏览量
2024-09-26
00:49:44
上传
评论
收藏 5.05MB ZIP 举报
温馨提示
该项目为全栈式NFT数字藏品艺术品交易平台设计源码,综合运用Java、JavaScript、HTML、CSS等编程语言,共计包含401个文件。其中,Java源文件308个,JavaScript文件27个,HTML文件26个,图像文件24个,XML文件4个,YML文件2个,CSS文件2个,Git忽略文件1个,Markdown文件1个。源码从0到1开发,为数字藏品交易平台提供完整的技术解决方案。
资源推荐
资源详情
资源评论
收起资源包目录
基于Java、JavaScript、HTML、CSS的NFT数字藏品艺术品交易平台设计源码 (401个子文件)
quasar.min.css 201KB
common.css 319B
.gitignore 81B
collection.html 12KB
compose-activity.html 8KB
member.html 8KB
statistic-data.html 6KB
dict-manage.html 5KB
member-hold-collection.html 5KB
notice.html 5KB
withdraw-record.html 5KB
background-account.html 4KB
menu-manage.html 4KB
member-resale-collection.html 4KB
creator.html 4KB
role-manage.html 3KB
login.html 3KB
pay-order.html 3KB
header.html 3KB
sms-send-record.html 3KB
member-balance-change-log.html 3KB
oper-log.html 2KB
setting.html 2KB
collection-give-record.html 2KB
login-log.html 2KB
google-auth.html 2KB
data-clean.html 2KB
super-admin.html 857B
permission-fail.html 289B
CollectionService.java 18KB
TransactionService.java 17KB
RbacService.java 13KB
MemberService.java 11KB
ComposeActivityService.java 10KB
RbacController.java 8KB
NoneChainService.java 6KB
WithdrawService.java 6KB
DictService.java 6KB
CollectionGiveService.java 5KB
PreSaleService.java 5KB
MemberBalanceChangeLog.java 5KB
SettlementAccountService.java 5KB
Constant.java 5KB
IssuedCollectionActionLog.java 5KB
TransactionController.java 4KB
MemberHoldCollection.java 4KB
CollectionController.java 4KB
ExchangeCodeService.java 4KB
GoogleAuthenticator.java 4KB
MemberController.java 4KB
Member.java 3KB
PayOrder.java 3KB
RestExceptionHandler.java 3KB
MemberController.java 3KB
PreSaleQualify.java 3KB
MyResaleCollectionDetailVO.java 3KB
ResaleCollectionDetailVO.java 3KB
MemberResaleCollection.java 3KB
CollectionController.java 3KB
StorageController.java 3KB
LoginRegisterController.java 3KB
OperLogAspect.java 3KB
MyArtworkController.java 3KB
ExchangeCode.java 3KB
MyHoldCollectionDetailVO.java 3KB
DictConfigController.java 3KB
PageController.java 3KB
ComposeActivityController.java 3KB
AirDropService.java 3KB
SettingService.java 3KB
NoticeService.java 3KB
Collection.java 3KB
MemberBalanceChangeLogQueryCondParam.java 2KB
ComposeRecord.java 2KB
MemberBalanceChangeLogService.java 2KB
CollectionGiveRecord.java 2KB
CreatorService.java 2KB
AirDropRecord.java 2KB
PayOrderVO.java 2KB
OperLogQueryCondParam.java 2KB
MemberResaleCollectionVO.java 2KB
LoginLogQueryCondParam.java 2KB
SaTokenConfig.java 2KB
CollectionQueryCondParam.java 2KB
SettingController.java 2KB
StorageService.java 2KB
PreSaleQualifyVO.java 2KB
ResaleCollectionQueryCondParam.java 2KB
MemberHoldCollectionVO.java 2KB
LoginController.java 2KB
MemberHoldCollectionQueryCondParam.java 2KB
RedisMqListener.java 2KB
SmsSendRecordQueryCondParam.java 2KB
TradeStatisticService.java 2KB
IssuedCollection.java 2KB
CollectionGiveRecordVO.java 2KB
StorageController.java 2KB
MemberHoldCollectionController.java 2KB
WithdrawRecord.java 2KB
SmsService.java 2KB
共 401 条
- 1
- 2
- 3
- 4
- 5
资源评论
wjs2024
- 粉丝: 2369
- 资源: 5538
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 手手势检测3-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- 学生成绩链表处理-C语言实现学生成绩链表处理技术解析与应用
- 手套手势检测7-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- CentOS bridge 工具包 bridge-utils-1.6-1.33.x86-64.rpm
- 手势检测7-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- 基于python flask实现某瓣数据可视化数据分析平台
- awewq1132323
- 手写流程图检测31-YOLO(v5至v8)、COCO、CreateML、Darknet、Paligemma、TFRecord数据集合集.rar
- frida拦截微信小程序云托管API
- 肝脏及其肿瘤分割的 CT 数据集,已经切片成jpg数据,约2w张数据和mask
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功