This commit is contained in:
Cauchy
2023-10-12 16:38:30 +08:00
parent 9978724a5d
commit 5c2cc8529b
17 changed files with 106 additions and 99 deletions

View File

@@ -2,19 +2,16 @@ package com.peanut.modules.book.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.common.utils.PageUtils;
import com.peanut.modules.book.entity.BuyOrderEntity;
import com.peanut.modules.book.entity.UserRecordEntity;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;
public interface UserRecordService extends IService<UserRecordEntity> {
//todo 传参参数 用户id 购买订单id 星级评价 内容
public Object commodityComment(String userid, String orderSn, String starLevel, String comment);
void commodityComment(String userid, String orderSn, String starLevel, String comment);
PageUtils queryPage(Map<String, Object> params);

View File

@@ -79,7 +79,7 @@ public class ShopProductBookServiceImpl extends ServiceImpl<ShopProductBookDao,
@Override
public List<Integer> getBookIdsByProductId(Integer productId) {
List<ShopProductBookEntity> spbs = this.list(new QueryWrapper<ShopProductBookEntity>().eq("del_flag", 0).eq("proudict_id", productId));
List<ShopProductBookEntity> spbs = this.list(new QueryWrapper<ShopProductBookEntity>().eq("del_flag", 0).eq("product_id", productId));
List<Integer> ids = new ArrayList();
for (ShopProductBookEntity s : spbs) {
ids.add(s.getBookId());
@@ -93,9 +93,9 @@ public class ShopProductBookServiceImpl extends ServiceImpl<ShopProductBookDao,
wrapper.eq(ShopProductBookEntity::getBookId, bookId);
wrapper.eq(ShopProductBookEntity::getDelFlag, 0);
wrapper.groupBy(ShopProductBookEntity::getProductId);
List<ShopProductBookEntity> shopProudictBookEntities = this.getBaseMapper().selectList(wrapper);
List<ShopProductBookEntity> shopProductBookEntities = this.getBaseMapper().selectList(wrapper);
List ids = new ArrayList();
for (ShopProductBookEntity s : shopProudictBookEntities) {
for (ShopProductBookEntity s : shopProductBookEntities) {
ids.add(s.getProductId());
}
if (ids.size() == 0) {

View File

@@ -3,7 +3,6 @@ package com.peanut.modules.book.service.impl;
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.github.yulichang.base.MPJBaseServiceImpl;
import com.peanut.common.utils.ExcludeEmptyQueryWrapper;
import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.Query;
@@ -16,7 +15,6 @@ 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;
@@ -52,7 +50,7 @@ public class ShopProductToLabelServiceImpl extends ServiceImpl<ShopProductToLabe
.eq("product_id",ptlId)
);
shopProductToLabelEntity.setShopproudicts(ShopProduct);
shopProductToLabelEntity.setShopProducts(ShopProduct);
}
return new PageUtils(page);
}

View File

@@ -1,4 +1,5 @@
package com.peanut.modules.book.service.impl;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -6,7 +7,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.common.utils.*;
import com.peanut.modules.book.dao.UserRecordDao;
import com.peanut.modules.book.entity.BookEntity;
import com.peanut.modules.book.entity.MyUserEntity;
import com.peanut.modules.book.entity.UserRecordEntity;
import com.peanut.modules.book.service.MyUserService;
@@ -14,7 +14,6 @@ import com.peanut.modules.book.service.UserRecordService;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream;
@@ -22,28 +21,27 @@ import java.util.*;
@Service("UserRecordServiceImpl")
public class UserRecordServiceImpl extends ServiceImpl<UserRecordDao, UserRecordEntity> implements UserRecordService {
public class UserRecordServiceImpl extends ServiceImpl<UserRecordDao, UserRecordEntity> implements UserRecordService {
@Autowired
private MyUserService myUserService;
@Override
public Object commodityComment(String userid, String orderSn, String starLevel, String comment) {
public void commodityComment(String userid, String orderSn, String starLevel, String comment) {
return R.ok("成功");
R.ok("成功");
}
@Override
public PageUtils queryPage(Map<String, Object> params) {
String proudictid = (String) params.get("proudictId");
String productId = (String) params.get("proudictId");
IPage<UserRecordEntity> page = page(
new Query<UserRecordEntity>().getPage(params),
new QueryWrapper<UserRecordEntity>()
//订单号,开始时间
.eq("bookid", proudictid).orderByDesc("create_date")
.eq("bookid", productId).orderByDesc("create_date")
// .eq("")
);
@@ -61,6 +59,7 @@ public class UserRecordServiceImpl extends ServiceImpl<UserRecordDao, UserRecor
return new PageUtils(page);
}
@Override
public String uploadFile(MultipartFile file) {
@@ -91,8 +90,6 @@ public class UserRecordServiceImpl extends ServiceImpl<UserRecordDao, UserRecor
}
}