Commit b0a74ad7 authored by shiyu's avatar shiyu

分享

parent 8e4df318
......@@ -137,6 +137,7 @@ public class DistributorShareRecordServiceImpl implements DistributorShareRecord
distributorShareRecord.setType(DistributionEnum.DistributionTypeEnum.AUCTION_PERFORMANCE.getCode());
distributorShareRecordDao.insert(distributorShareRecord);
SpecialPerformanceConfigRequestDto specialPerformanceConfigRequestDto = new SpecialPerformanceConfigRequestDto();
specialPerformanceConfigRequestDto.setSpecialPerformanceId(dto.getSpecialPerformanceId());
specialPerformanceConfigRequestDto.setLimit(7);
List<SpecialPerformanceConfig> list = specialPerformanceConfigDao.findList(specialPerformanceConfigRequestDto);
PageInfo pageInfo = new PageInfo(list);
......
......@@ -167,6 +167,22 @@ public class SelfPageServiceImpl implements SelfPageService {
s.setStateName(DistributionEnum.DistributionOrderStateEnum.getNameByCode(s.getState()));
});
selfPageInfoVo.setOrderNum(selfBuyNumList);
//查询4天内出价记录
Date now = new Date();
Instant instant = now.toInstant().minus(Duration.ofDays(4));
Date queryStartTime = Date.from(instant);
List<AuctionRecord> auctionRecords = auctionRecordDao.findRecordByUserId(dto.getUserId(), queryStartTime, now);
List<Long> itemIds = auctionRecords.stream().map(AuctionRecord::getItemId).distinct().collect(Collectors.toList());
int num = 0;
for (long itemId : itemIds) {
AuctionConfig auctionConfig = auctionConfigDao.findByItemId(itemId);
if (auctionConfig.getRealEndTime().after(now) && auctionConfig.getIsValid()) {
num = num + 1;
}
}
selfPageInfoVo.setUserOfferNum(num);
return Result.success(selfPageInfoVo);
} catch (Exception e) {
logger.error("查询藏家个人主页失败 error : {}", e);
......
......@@ -464,12 +464,12 @@ public class SupplierItemServiceImpl implements SupplierItemService {
try {
AuctionDetailVo auctionDetailVo = new AuctionDetailVo();
Date now = new Date();
long itemId = 0;
Long itemId;
String shareRecordId = dto.getShareRecordId();
DistributorShareRecord distributorShareRecord = null;
if (StringUtils.isEmpty(shareRecordId) && dto.getId() == null) {
return Result.failed("商品信息为空");
} else if (StringUtils.hasLength(shareRecordId)) {
} else if (StringUtils.hasLength(shareRecordId) && !shareRecordId.equals(CommConsts.DEFAULT_SHARE_ID)) {
distributorShareRecord = distributorShareRecordDao.findById(shareRecordId);
if (distributorShareRecord == null || !distributorShareRecord.getEnabled()) {
return Result.failed("该商品已下架");
......@@ -479,7 +479,10 @@ public class SupplierItemServiceImpl implements SupplierItemService {
} else {
itemId = dto.getId();
}
if (StringUtils.hasLength(shareRecordId)) {
if (itemId == null) {
return Result.failed("没有对应的商品id");
}
if (StringUtils.hasLength(shareRecordId) && !shareRecordId.equals(CommConsts.DEFAULT_SHARE_ID)) {
if (distributorShareRecord.getDistributorId().longValue() != dto.getUserId().longValue()) {
//做浏览记录
boolean flag = userRecentBrowseDao.isExisted(dto.getUserId(), distributorShareRecord.getDistributorId());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment