pay notify

This commit is contained in:
Cauchy
2023-10-08 14:56:26 +08:00
parent b18fc6cff9
commit 059f5f8fe8
16 changed files with 810 additions and 834 deletions

View File

@@ -9,6 +9,5 @@ import java.util.List;
@Mapper
public interface ShopProudictBookDao extends BaseMapper<ShopProudictBookEntity> {
List<Integer> getOrderBookId(String orderSn);
}

View File

@@ -5,14 +5,17 @@ import com.peanut.modules.book.entity.UserEbookBuyEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 用户购买书籍表
*
*
* @author yl
* @email yl328572838@163.com
* @date 2022-10-18 16:28:20
*/
@Mapper
public interface UserEbookBuyDao extends MPJBaseMapper<UserEbookBuyEntity> {
List<Integer> getUserBookId(Integer userId);
}

View File

@@ -19,4 +19,6 @@ public interface ShopProudictBookService extends IService<ShopProudictBookEntity
Integer getProductByBookId(Integer bookId);
List<Integer> getOrderBookId(String orderSn);
}

View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.common.utils.PageUtils;
import com.peanut.modules.book.entity.UserEbookBuyEntity;
import java.util.List;
import java.util.Map;
/**
@@ -19,6 +20,8 @@ public interface UserEbookBuyService extends IService<UserEbookBuyEntity> {
PageUtils queryPages(Map<String, Object> params);
List<Integer> getUserBookId(Integer userId);
}

View File

@@ -4,37 +4,36 @@ import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.OSSException;
import com.aliyun.oss.model.OSSObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.base.Joiner;
import com.peanut.common.utils.*;
import com.peanut.common.utils.ConstantPropertiesUtils;
import com.peanut.common.utils.FileDownloadUtil;
import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.Query;
import com.peanut.modules.book.dao.BookDao;
import com.peanut.modules.book.entity.*;
import com.peanut.modules.book.entity.SysDictDataEntity;
import com.peanut.modules.book.service.*;
import com.peanut.modules.book.vo.BookIndexVo;
import com.peanut.modules.book.service.BookChapterService;
import com.peanut.modules.book.service.BookForumArticlesService;
import com.peanut.modules.book.service.BookService;
import com.peanut.modules.book.service.PublisherService;
import com.peanut.modules.sys.service.SysDictDataService;
import com.spire.doc.Document;
import com.spire.doc.Section;
import com.spire.doc.documents.Paragraph;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URLDecoder;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.book.dao.BookDao;
import org.springframework.util.CollectionUtils;
@Service("bookService")
public class BookServiceImpl extends ServiceImpl<BookDao, BookEntity> implements BookService {

View File

@@ -1,4 +1,5 @@
package com.peanut.modules.book.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -15,17 +16,20 @@ import com.peanut.modules.book.service.ShopProudictBookService;
import com.peanut.modules.book.vo.ProudictBookqueryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("shopProudictBookService")
public class ShopProudictBookServiceImpl extends ServiceImpl<ShopProudictBookDao,ShopProudictBookEntity> implements ShopProudictBookService {
public class ShopProudictBookServiceImpl extends ServiceImpl<ShopProudictBookDao, ShopProudictBookEntity> implements ShopProudictBookService {
@Autowired
private ShopProductService shopProductService;
@Autowired
private BookService bookService;
@Autowired
private ShopProudictBookDao shopProudictBookDao;
@Override
public PageUtils queryPage(Map<String, Object> params) {
@@ -42,7 +46,7 @@ public class ShopProudictBookServiceImpl extends ServiceImpl<ShopProudictBookDa
Object proudictId = params.get("proudictId");
IPage<ShopProudictBookEntity> page = this.page(
new Query<ShopProudictBookEntity>().getPage(params),
new QueryWrapper<ShopProudictBookEntity>().eq("proudict_id",proudictId)
new QueryWrapper<ShopProudictBookEntity>().eq("proudict_id", proudictId)
);
List<ShopProudictBookEntity> records = page.getRecords();
return new PageUtils(page);
@@ -66,7 +70,7 @@ public class ShopProudictBookServiceImpl extends ServiceImpl<ShopProudictBookDa
BookEntity bookbyId = bookService.getById(bookId1);
prList.add(bookbyId);
ShopProductEntity shopProductbyId = shopProductService.getById(proudictId1);
shopProductbyId.setBookidsimages(prList);
shopProductbyId.setBookidsimages(prList);
}
}
shopProductEntity.setBookidsimages(prList);
@@ -75,9 +79,9 @@ public class ShopProudictBookServiceImpl extends ServiceImpl<ShopProudictBookDa
@Override
public List<Integer> getBookidsByProductId(Integer productId) {
List<ShopProudictBookEntity> spbs = this.list(new QueryWrapper<ShopProudictBookEntity>().eq("del_flag",0).eq("proudict_id",productId));
List<ShopProudictBookEntity> spbs = this.list(new QueryWrapper<ShopProudictBookEntity>().eq("del_flag", 0).eq("proudict_id", productId));
List<Integer> ids = new ArrayList();
for (ShopProudictBookEntity s : spbs){
for (ShopProudictBookEntity s : spbs) {
ids.add(s.getBookId());
}
return ids;
@@ -86,21 +90,21 @@ public class ShopProudictBookServiceImpl extends ServiceImpl<ShopProudictBookDa
@Override
public Integer getProductByBookId(Integer bookId) {
LambdaQueryWrapper<ShopProudictBookEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ShopProudictBookEntity::getBookId,bookId);
wrapper.eq(ShopProudictBookEntity::getDelFlag,0);
wrapper.eq(ShopProudictBookEntity::getBookId, bookId);
wrapper.eq(ShopProudictBookEntity::getDelFlag, 0);
wrapper.groupBy(ShopProudictBookEntity::getProudictId);
List<ShopProudictBookEntity> shopProudictBookEntities = this.getBaseMapper().selectList(wrapper);
List ids = new ArrayList();
for (ShopProudictBookEntity s : shopProudictBookEntities){
for (ShopProudictBookEntity s : shopProudictBookEntities) {
ids.add(s.getProudictId());
}
if(ids.size()==0){
if (ids.size() == 0) {
return null;
}
LambdaQueryWrapper<ShopProductEntity> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(ShopProductEntity::getDelFlag,0);
wrapper1.in(ShopProductEntity::getProductId,ids);
wrapper1.eq(ShopProductEntity::getDelFlag, 0);
wrapper1.in(ShopProductEntity::getProductId, ids);
wrapper1.orderByAsc(ShopProductEntity::getPrice);
wrapper1.last("limit 1");
List<ShopProductEntity> shopProductEntities = shopProductService.getBaseMapper().selectList(wrapper1);
@@ -108,5 +112,10 @@ public class ShopProudictBookServiceImpl extends ServiceImpl<ShopProudictBookDa
return shopProductEntity.getProductId();
}
@Override
public List<Integer> getOrderBookId(String orderSn) {
return shopProudictBookDao.getOrderBookId(orderSn);
}
}

View File

@@ -1,30 +1,32 @@
package com.peanut.modules.book.service.impl;
import com.peanut.modules.book.entity.BuyOrderEntity;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.Query;
import com.peanut.modules.book.dao.UserEbookBuyDao;
import com.peanut.modules.book.entity.UserEbookBuyEntity;
import com.peanut.modules.book.service.UserEbookBuyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service("userEbookBuyService")
public class UserEbookBuyServiceImpl extends ServiceImpl<UserEbookBuyDao, UserEbookBuyEntity> implements UserEbookBuyService {
@Autowired
private UserEbookBuyDao userEbookBuyDao;
@Override
public PageUtils queryPage(Map<String, Object> params) {
String userId = (String) params.get("userId");
IPage<UserEbookBuyEntity> page = this.page(
new Query<UserEbookBuyEntity>().getPage(params),
new QueryWrapper<UserEbookBuyEntity>().eq("user_id",userId)
new QueryWrapper<UserEbookBuyEntity>().eq("user_id", userId)
);
return new PageUtils(page);
@@ -36,7 +38,7 @@ public class UserEbookBuyServiceImpl extends ServiceImpl<UserEbookBuyDao, UserEb
IPage<UserEbookBuyEntity> page = this.page(
new Query<UserEbookBuyEntity>().getPage(params),
new QueryWrapper<UserEbookBuyEntity>()
.eq("user_id",userid)
.eq("user_id", userid)
);
@@ -44,24 +46,10 @@ public class UserEbookBuyServiceImpl extends ServiceImpl<UserEbookBuyDao, UserEb
return new PageUtils(page);
}
@Override
public List<Integer> getUserBookId(Integer userId) {
return userEbookBuyDao.getUserBookId(userId);
}
}