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

@@ -47,7 +47,7 @@ public class BookClockForumController {
*/ */
@RequestMapping(path = "/getPostingInfo", method = RequestMethod.GET) @RequestMapping(path = "/getPostingInfo", method = RequestMethod.GET)
public R getPostingInfo(@RequestParam("bookId") Integer bookId, public R getPostingInfo(@RequestParam("bookId") Integer bookId,
@RequestParam("day") Integer day) { @RequestParam(value = "day") Integer day) {
QueryWrapper<BookClockEntryEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<BookClockEntryEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("book_id", bookId); queryWrapper.eq("book_id", bookId);
queryWrapper.eq("day", day); queryWrapper.eq("day", day);
@@ -68,6 +68,7 @@ public class BookClockForumController {
@RequestParam(value = "userId", required = false) Integer userId) { @RequestParam(value = "userId", required = false) Integer userId) {
QueryWrapper<BookClockInChatEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<BookClockInChatEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("entry_id", entryId); queryWrapper.eq("entry_id", entryId);
queryWrapper.eq("fid", 0);
if (userId != null) { if (userId != null) {
queryWrapper.eq("user_id", userId); queryWrapper.eq("user_id", userId);
} }
@@ -83,6 +84,22 @@ public class BookClockForumController {
UserEntity user = userService.getById(entity.getUserId()); UserEntity user = userService.getById(entity.getUserId());
vo.setNickName(user.getNickname()); vo.setNickName(user.getNickname());
vo.setAvatar(user.getAvatar()); vo.setAvatar(user.getAvatar());
QueryWrapper<BookClockInChatEntity> subQueryWrapper = new QueryWrapper<>();
subQueryWrapper.eq("fid", entity.getId());
List<BookClockInChatEntity> subClockInChatList = bookClockEntryChatService.list(subQueryWrapper);
List<ClockInCommentVo> subCommentList = new ArrayList<>();
for (BookClockInChatEntity subChat : subClockInChatList) {
ClockInCommentVo subVo = new ClockInCommentVo();
BeanUtil.copyProperties(subChat, subVo);
UserEntity subChatUser = userService.getById(subChat.getUserId());
UserEntity pUser = userService.getById(subChat.getPuserId());
subVo.setPuserNickName(pUser.getNickname());
subVo.setPuserAvatar(pUser.getAvatar());
subVo.setAvatar(subChatUser.getAvatar());
subVo.setNickName(subChatUser.getNickname());
subCommentList.add(subVo);
}
vo.setSubCommentList(subCommentList);
resultList.add(vo); resultList.add(vo);
} }
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
@@ -96,11 +113,13 @@ public class BookClockForumController {
* @param chat * @param chat
* @return * @return
*/ */
@PostMapping(path = "/addChat") @RequestMapping(path = "/addChat", method = RequestMethod.POST)
public R addChat(@RequestBody BookClockInChatEntity chat) { public R addChat(@RequestBody BookClockInChatEntity chat) {
List<String> imageList = chat.getImageList(); List<String> imageList = chat.getImageList();
String images = JSON.toJSON(imageList).toString(); if (imageList != null) {
chat.setImages(images); String images = JSON.toJSON(imageList).toString();
chat.setImages(images);
}
bookClockEntryChatService.save(chat); bookClockEntryChatService.save(chat);
return R.ok(); return R.ok();
} }

View File

@@ -295,10 +295,10 @@ public class ShopProductController {
*/ */
@RequestMapping("/infobook/{productId}") @RequestMapping("/infobook/{productId}")
public R infobook(@PathVariable("productId") Integer productId) { public R infobook(@PathVariable("productId") Integer productId) {
List<ShopProductBookEntity> proudict = shopProductBookService.getBaseMapper().selectList(new QueryWrapper<ShopProductBookEntity>() List<ShopProductBookEntity> product = shopProductBookService.getBaseMapper().selectList(new QueryWrapper<ShopProductBookEntity>()
.eq("product_id", productId)); .eq("product_id", productId));
List<Object> list = new ArrayList<>(); List<Object> list = new ArrayList<>();
for (ShopProductBookEntity shopProductBookEntity : proudict) { for (ShopProductBookEntity shopProductBookEntity : product) {
Integer bookId = shopProductBookEntity.getBookId(); Integer bookId = shopProductBookEntity.getBookId();
List<ShopProductBookEntity> bookIds = shopProductBookService.getBaseMapper().selectList(new QueryWrapper<ShopProductBookEntity>() List<ShopProductBookEntity> bookIds = shopProductBookService.getBaseMapper().selectList(new QueryWrapper<ShopProductBookEntity>()
@@ -336,11 +336,11 @@ public class ShopProductController {
shopProductService.save(shopProduct); shopProductService.save(shopProduct);
ShopProductBookEntity shopProductBookEntity = new ShopProductBookEntity(); ShopProductBookEntity shopProductBookEntity = new ShopProductBookEntity();
for (String s : shopProduct.getBookids()) { for (String s : shopProduct.getBookids()) {
String bookidlist = s; String bookIdList = s;
if (bookidlist != null) { if (bookIdList != null) {
Integer proudict = shopProduct.getProductId(); Integer product = shopProduct.getProductId();
shopProductBookEntity.setProductId(proudict); shopProductBookEntity.setProductId(product);
shopProductBookEntity.setBookId(Integer.valueOf(bookidlist)); shopProductBookEntity.setBookId(Integer.valueOf(bookIdList));
shopProductBookService.save(shopProductBookEntity); shopProductBookService.save(shopProductBookEntity);
} }
} }

View File

@@ -1,4 +1,5 @@
package com.peanut.modules.book.controller; package com.peanut.modules.book.controller;
import cn.com.marsoft.tool.ToolObject; import cn.com.marsoft.tool.ToolObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.peanut.common.utils.PageUtils; import com.peanut.common.utils.PageUtils;
@@ -7,9 +8,11 @@ import com.peanut.modules.book.entity.*;
import com.peanut.modules.book.service.*; import com.peanut.modules.book.service.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
import static com.peanut.common.utils.R.error; import static com.peanut.common.utils.R.error;
@RestController @RestController
@RequestMapping("buy/record") @RequestMapping("buy/record")
public class UserRecordController { public class UserRecordController {
@@ -29,7 +32,7 @@ public class UserRecordController {
* 列表 * 列表
*/ */
@RequestMapping("/list") @RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params ){ public R list(@RequestParam Map<String, Object> params) {
PageUtils page = userRecordService.queryPage(params); PageUtils page = userRecordService.queryPage(params);
return R.ok().put("page", page); return R.ok().put("page", page);
@@ -37,22 +40,21 @@ public class UserRecordController {
} }
/** /**
* 查看我的评价 * 查看我的评价
*/ */
@RequestMapping("/Allevaluations") @RequestMapping("/Allevaluations")
public R Allevaluations(@RequestBody UserRecordEntity userRecordEntity){ public R Allevaluations(@RequestBody UserRecordEntity userRecordEntity) {
List<UserRecordEntity> userid = userRecordService.getBaseMapper().selectList(new QueryWrapper<UserRecordEntity>().eq("userid", userRecordEntity.getUserid()).orderByDesc("create_date")); List<UserRecordEntity> userid = userRecordService.getBaseMapper().selectList(new QueryWrapper<UserRecordEntity>().eq("userid", userRecordEntity.getUserid()).orderByDesc("create_date"));
return R.ok().put("Allevaluations",userid); return R.ok().put("Allevaluations", userid);
} }
/** /**
* 查看全部评价 * 查看全部评价
*/ */
@RequestMapping("/All") @RequestMapping("/All")
public R All(@RequestBody UserRecordEntity userRecordEntity) { public R All(@RequestBody UserRecordEntity userRecordEntity) {
List list = new ArrayList<>(); List list = new ArrayList<>();
//此处bookid实际传的是商品id //此处bookid实际传的是商品id
List<UserRecordEntity> bookid = userRecordService.getBaseMapper().selectList(new QueryWrapper<UserRecordEntity>().eq("bookid", userRecordEntity.getBookid()).orderByDesc("create_date")); List<UserRecordEntity> bookid = userRecordService.getBaseMapper().selectList(new QueryWrapper<UserRecordEntity>().eq("bookid", userRecordEntity.getBookid()).orderByDesc("create_date"));
@@ -99,21 +101,19 @@ public class UserRecordController {
list.add(map); list.add(map);
} }
return R.ok().put("list", list); return R.ok().put("list", list);
} }
return R.error("该商品暂无评论"); return R.error("该商品暂无评论");
} }
/** /**
* 信息 * 信息
*/ */
@RequestMapping("/info/{id}") @RequestMapping("/info/{id}")
public R info(@PathVariable("id") Integer id){ public R info(@PathVariable("id") Integer id) {
UserRecordEntity userRecordEntity = userRecordService.getById(id); UserRecordEntity userRecordEntity = userRecordService.getById(id);
return R.ok().put("bookChapterContent", userRecordEntity); return R.ok().put("bookChapterContent", userRecordEntity);
} }
@@ -122,7 +122,7 @@ public class UserRecordController {
* 保存 * 保存
*/ */
@RequestMapping("/save") @RequestMapping("/save")
public R save(@RequestBody UserRecordEntity userRecordEntity){ public R save(@RequestBody UserRecordEntity userRecordEntity) {
userRecordService.save(userRecordEntity); userRecordService.save(userRecordEntity);
return R.ok(); return R.ok();
} }
@@ -131,7 +131,7 @@ public class UserRecordController {
* 修改 * 修改
*/ */
@RequestMapping("/update") @RequestMapping("/update")
public R update(@RequestBody UserRecordEntity userRecordEntity){ public R update(@RequestBody UserRecordEntity userRecordEntity) {
userRecordService.updateById(userRecordEntity); userRecordService.updateById(userRecordEntity);
return R.ok(); return R.ok();
} }
@@ -140,7 +140,7 @@ public class UserRecordController {
* 删除 * 删除
*/ */
@RequestMapping("/delete") @RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){ public R delete(@RequestBody Integer[] ids) {
userRecordService.removeByIds(Arrays.asList(ids)); userRecordService.removeByIds(Arrays.asList(ids));
userRecordService.getBaseMapper().deleteBatchIds(Arrays.asList(ids)); userRecordService.getBaseMapper().deleteBatchIds(Arrays.asList(ids));
return R.ok(); return R.ok();
@@ -148,38 +148,34 @@ public class UserRecordController {
/* /*
* test * test
* */ * */
@RequestMapping("/commodityComment") @RequestMapping("/commodityComment")
public R commodityComment(String userid, String orderSn, String starLevel, String comment){ public R commodityComment(String userid, String orderSn, String starLevel, String comment) {
userRecordService.commodityComment(userid, orderSn, starLevel, comment); userRecordService.commodityComment(userid, orderSn, starLevel, comment);
return R.ok(); return R.ok();
} }
/* /*
* 生成评论 * 生成评论
* */ * */
@RequestMapping("/comment") @RequestMapping("/comment")
public Object commodityComments( Integer userid, String orderSn, Integer bookid, String comment) { public Object commodityComments(Integer userid, String orderSn, Integer bookid, String comment) {
BuyOrderEntity buyOrderEntity =buyOrderService.getBaseMapper().selectOne(new QueryWrapper<BuyOrderEntity>() BuyOrderEntity buyOrderEntity = buyOrderService.getBaseMapper().selectOne(new QueryWrapper<BuyOrderEntity>()
.eq("order_sn",orderSn).last("LIMIT 1").eq("order_status","3") .eq("order_sn", orderSn).last("LIMIT 1").eq("order_status", "3")
//状态3为已收货 //状态3为已收货
// .eq("order_status","3") // .eq("order_status","3")
); );
UserRecordEntity userRecordEntity = new UserRecordEntity(); UserRecordEntity userRecordEntity = new UserRecordEntity();
if (!ToolObject.isNullOrEmpty(buyOrderEntity)) if (!ToolObject.isNullOrEmpty(buyOrderEntity)) {
{
return error("您已评价过了,请勿重复评论"); return error("您已评价过了,请勿重复评论");
// //
}else { } else {
userRecordEntity.setId(buyOrderEntity.getOrderId()); userRecordEntity.setId(buyOrderEntity.getOrderId());
userRecordEntity.setContent(comment); userRecordEntity.setContent(comment);
//商品评价 //商品评价
@@ -187,38 +183,35 @@ public class UserRecordController {
userRecordEntity.setUserid(userid); userRecordEntity.setUserid(userid);
userRecordEntity.setOrderSn(orderSn); userRecordEntity.setOrderSn(orderSn);
userRecordEntity.setDelflag(0); userRecordEntity.setDelflag(0);
userRecordEntity.setProudictId(bookid); userRecordEntity.setProductId(bookid);
userRecordService.saveOrUpdate(userRecordEntity); userRecordService.saveOrUpdate(userRecordEntity);
return R.ok("成功").put("userRecordEntity",userRecordEntity); return R.ok("成功").put("userRecordEntity", userRecordEntity);
} }
} }
/** /**
*
* @param recordEntity * @param recordEntity
* @return 生成评论(上传图片,星级评价 * @return 生成评论(上传图片,星级评价
*
*/ */
@RequestMapping("/UserRecordcomment") @RequestMapping("/UserRecordcomment")
public R commodity(@RequestBody UserRecordEntity recordEntity ) { public R commodity(@RequestBody UserRecordEntity recordEntity) {
//todo 已收货限制字段,只可评价一次 //todo 已收货限制字段,只可评价一次
BuyOrderEntity buyOrderEntity =buyOrderService.getBaseMapper().selectOne(new QueryWrapper<BuyOrderEntity>() BuyOrderEntity buyOrderEntity = buyOrderService.getBaseMapper().selectOne(new QueryWrapper<BuyOrderEntity>()
.eq("order_sn",recordEntity.getOrderSn()) .eq("order_sn", recordEntity.getOrderSn())
); );
Integer orderId = buyOrderEntity.getOrderId(); Integer orderId = buyOrderEntity.getOrderId();
BuyOrderDetailEntity detailEntity = buyOrderDetailService.getBaseMapper().selectOne(new QueryWrapper<BuyOrderDetailEntity>().eq("Order_id", orderId).eq("product_id",recordEntity.getBookid())); BuyOrderDetailEntity detailEntity = buyOrderDetailService.getBaseMapper().selectOne(new QueryWrapper<BuyOrderDetailEntity>().eq("Order_id", orderId).eq("product_id", recordEntity.getBookid()));
Integer orderId1 = detailEntity.getOrderId(); Integer orderId1 = detailEntity.getOrderId();
UserRecordEntity userRecordEntity = userRecordService.getBaseMapper().selectOne(new QueryWrapper<UserRecordEntity>().eq("orderSn", recordEntity.getOrderSn()).eq("userid", recordEntity.getUserid()).eq("orderdid",orderId1).last("LIMIT 1")); UserRecordEntity userRecordEntity = userRecordService.getBaseMapper().selectOne(new QueryWrapper<UserRecordEntity>().eq("orderSn", recordEntity.getOrderSn()).eq("userid", recordEntity.getUserid()).eq("orderdid", orderId1).last("LIMIT 1"));
if (userRecordEntity != null) { if (userRecordEntity != null) {
return R.error("您已评价过"); return R.error("您已评价过");
} }
if (recordEntity.getImages()!=null) { if (recordEntity.getImages() != null) {
List<Map<String, String>> imageList = (ArrayList<Map<String, String>>) recordEntity.getImages(); List<Map<String, String>> imageList = (ArrayList<Map<String, String>>) recordEntity.getImages();
String imageStr = ""; String imageStr = "";
for (Map m : imageList) { for (Map m : imageList) {
@@ -227,19 +220,17 @@ public class UserRecordController {
} }
recordEntity.setImages(imageStr); recordEntity.setImages(imageStr);
} }
recordEntity.setDelflag(0); recordEntity.setDelflag(0);
recordEntity.setOrderdId(orderId1); recordEntity.setOrderdId(orderId1);
userRecordService.saveOrUpdate(recordEntity); userRecordService.saveOrUpdate(recordEntity);
detailEntity.setRecordId(1); detailEntity.setRecordId(1);
buyOrderDetailService.saveOrUpdate(detailEntity); buyOrderDetailService.saveOrUpdate(detailEntity);
return R.ok("成功").put("userRecordEntity", recordEntity);
return R.ok("成功").put("userRecordEntity",recordEntity); }
}
} }

View File

@@ -24,11 +24,13 @@ public class BookClockInChatEntity implements Serializable {
//子对话开启的层数 //子对话开启的层数
private Integer fid; private Integer fid;
//回复于某人id //回复于某人id
private Integer pUserId; @TableField("p_user_id")
private Integer puserId;
private String content; private String content;
private Integer pChatId; @TableField("p_chat_id")
private Integer pchatId;
private Date createTime; private Date createTime;

View File

@@ -35,7 +35,7 @@ public class OrderCartEntity implements Serializable {
/** /**
* 套装参数 * 套装参数
*/ */
private Integer proudictBook; private Integer productBook;
/** /**
* 商品数量 * 商品数量
*/ */

View File

@@ -6,8 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
@Data @Data
@@ -24,13 +22,13 @@ public class ShopProductToLabelEntity {
@TableField("del_flag") @TableField("del_flag")
@TableLogic @TableLogic
private Integer delFlag; private Integer delFlag;
/** /**
* 不存入数据库,返回商品详情 * 不存入数据库,返回商品详情
*/ */
@TableField(exist = false) @TableField(exist = false)
private List<ShopProductEntity> shopproudicts; private List<ShopProductEntity> shopProducts;
@TableField(exist = false) @TableField(exist = false)
private List<Object> shopp; private List<Object> shopp;

View File

@@ -33,8 +33,8 @@ public class UserRecordEntity {
@TableField("orderCode") @TableField("orderCode")
private String orderCode; private String orderCode;
@TableField("proudict_id") @TableField("product_id")
private Integer proudictId; private Integer productId;
//订单号 //订单号
@TableField("orderSn") @TableField("orderSn")
private String orderSn; private String orderSn;

View File

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

View File

@@ -79,7 +79,7 @@ public class ShopProductBookServiceImpl extends ServiceImpl<ShopProductBookDao,
@Override @Override
public List<Integer> getBookIdsByProductId(Integer productId) { 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(); List<Integer> ids = new ArrayList();
for (ShopProductBookEntity s : spbs) { for (ShopProductBookEntity s : spbs) {
ids.add(s.getBookId()); ids.add(s.getBookId());
@@ -93,9 +93,9 @@ public class ShopProductBookServiceImpl extends ServiceImpl<ShopProductBookDao,
wrapper.eq(ShopProductBookEntity::getBookId, bookId); wrapper.eq(ShopProductBookEntity::getBookId, bookId);
wrapper.eq(ShopProductBookEntity::getDelFlag, 0); wrapper.eq(ShopProductBookEntity::getDelFlag, 0);
wrapper.groupBy(ShopProductBookEntity::getProductId); wrapper.groupBy(ShopProductBookEntity::getProductId);
List<ShopProductBookEntity> shopProudictBookEntities = this.getBaseMapper().selectList(wrapper); List<ShopProductBookEntity> shopProductBookEntities = this.getBaseMapper().selectList(wrapper);
List ids = new ArrayList(); List ids = new ArrayList();
for (ShopProductBookEntity s : shopProudictBookEntities) { for (ShopProductBookEntity s : shopProductBookEntities) {
ids.add(s.getProductId()); ids.add(s.getProductId());
} }
if (ids.size() == 0) { 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.ExcludeEmptyQueryWrapper;
import com.peanut.common.utils.PageUtils; import com.peanut.common.utils.PageUtils;
import com.peanut.common.utils.Query; import com.peanut.common.utils.Query;
@@ -16,7 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -52,7 +50,7 @@ public class ShopProductToLabelServiceImpl extends ServiceImpl<ShopProductToLabe
.eq("product_id",ptlId) .eq("product_id",ptlId)
); );
shopProductToLabelEntity.setShopproudicts(ShopProduct); shopProductToLabelEntity.setShopProducts(ShopProduct);
} }
return new PageUtils(page); return new PageUtils(page);
} }

View File

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

View File

@@ -38,4 +38,10 @@ public class ClockInCommentVo {
private String avatar; private String avatar;
private String puserNickName;
private String puserAvatar;
private List<ClockInCommentVo> subCommentList;
} }

View File

@@ -1,7 +1,6 @@
package com.peanut.modules.book.vo; package com.peanut.modules.book.vo;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -36,7 +35,7 @@ public class ShopCartVo {
/** /**
* 商品活动单价 * 商品活动单价
*/ */
private Integer proudictBook; private Integer productBook;
private String image; private String image;
private String productName; private String productName;

View File

@@ -53,7 +53,7 @@ public class WeChatPayController {
private TransactionDetailsService transactionDetailsService; private TransactionDetailsService transactionDetailsService;
@Autowired @Autowired
private ShopProductBookService shopProudictBookService; private ShopProductBookService shopProductBookService;
@Autowired @Autowired
private UserEbookBuyService userEbookBuyService; private UserEbookBuyService userEbookBuyService;
@@ -127,7 +127,7 @@ public class WeChatPayController {
BuyOrderEntity orderEntity = buyOrderService.getBaseMapper().selectOne(new QueryWrapper<BuyOrderEntity>().eq("order_sn", orderNo)); BuyOrderEntity orderEntity = buyOrderService.getBaseMapper().selectOne(new QueryWrapper<BuyOrderEntity>().eq("order_sn", orderNo));
BigDecimal realMoney = orderEntity.getRealMoney(); BigDecimal realMoney = orderEntity.getRealMoney();
// 查询订单的所有 book_id // 查询订单的所有 book_id
List<Integer> orderBookIdList = shopProudictBookService.getOrderBookId(order.getOrderSn()); List<Integer> orderBookIdList = shopProductBookService.getOrderBookId(order.getOrderSn());
// 去重 // 去重
Set<Integer> set = new HashSet<>(orderBookIdList); Set<Integer> set = new HashSet<>(orderBookIdList);
orderBookIdList.clear(); orderBookIdList.clear();

View File

@@ -50,7 +50,7 @@ spring:
initSQL: SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci initSQL: SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci
rabbitmq: rabbitmq:
host: 59.110.212.44 host: 39.106.36.183
port: 5672 port: 5672
username: admin username: admin
password: 751019 password: 751019

View File

@@ -13,7 +13,7 @@
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/> <result property="delFlag" column="del_flag"/>
<result property="proudictBook" column="proudict_book"/> <result property="productBook" column="product_book"/>
</resultMap> </resultMap>

View File

@@ -14,7 +14,7 @@
<result property="orderCode" column="orderCode"/> <result property="orderCode" column="orderCode"/>
<result property="orderSn" column="orderSn"/> <result property="orderSn" column="orderSn"/>
<result property="starLevel" column="starLevel"/> <result property="starLevel" column="starLevel"/>
<result property="proudictId" column="proudict_id"/> <result property="productId" column="product_id"/>
</resultMap> </resultMap>