-- BUG修改

This commit is contained in:
yc13649764453
2023-09-20 16:22:50 +08:00
parent c39ce41ce9
commit a57aef3c54
5 changed files with 30 additions and 28 deletions

View File

@@ -278,7 +278,7 @@ public class BookChapterController {
for(Integer id : ids){ for(Integer id : ids){
BookChapterEntity chapter = bookChapterService.getBaseMapper().selectOne(new QueryWrapper<BookChapterEntity>() BookChapterEntity chapter = bookChapterService.getBaseMapper().selectOne(new QueryWrapper<BookChapterEntity>()
.eq("id", id) .eq("id", id)
); );

View File

@@ -671,29 +671,26 @@ public class BuyOrderController {
* 信息 * 信息
*/ */
@RequestMapping("/appGetOrderInfo/{type}") @RequestMapping("/appGetOrderInfo/{type}")
// @RequiresPermissions("book:buyorder:info") 就是这个
public R appGetOrderInfo(@PathVariable String type , @RequestParam("orderId") Integer orderId){ public R appGetOrderInfo(@PathVariable String type , @RequestParam("orderId") Integer orderId){
BuyOrderEntity buyOrder = buyOrderService.getById(orderId); BuyOrderEntity buyOrder = buyOrderService.getById(orderId);
List<BuyOrderDetailEntity> orderDetail = null; List<BuyOrderDetailEntity> orderDetail = null;
if("1".equals(type)){ if("1".equals(type)){
orderDetail = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetailEntity>() orderDetail = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetailEntity>()
.eq("order_id", orderId)); .eq("order_id", orderId));
}else{ }else{
orderDetail = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetailEntity>() orderDetail = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetailEntity>()
.eq("order_id", orderId).groupBy("shipping_sn")); .eq("order_id", orderId));
//TODO 根据shipping_sn快递单号分组订单下无快递单号我的订单同时无法显示暂时注释
//.groupBy("shipping_sn")
} }
for (BuyOrderDetailEntity buyOrderDetailEntity : orderDetail) { for (BuyOrderDetailEntity buyOrderDetailEntity : orderDetail) {
ShopProductEntity prod = shopProductService.getById(buyOrderDetailEntity.getProductId()); ShopProductEntity prod = shopProductService.getById(buyOrderDetailEntity.getProductId());
buyOrderDetailEntity.setImage(prod.getProductImages()); if (prod != null) {
buyOrderDetailEntity.setImage(prod.getProductImages());
}
} }
@@ -729,6 +726,9 @@ public class BuyOrderController {
buyOrder.setProducts(resultOrder); buyOrder.setProducts(resultOrder);
Date createDate = buyOrder.getCreateTime(); Date createDate = buyOrder.getCreateTime();
return R.ok().put("buyOrder", buyOrder).put("CreateTime",createDate).put("userRecordid",id); return R.ok().put("buyOrder", buyOrder).put("CreateTime",createDate).put("userRecordid",id);
} }

View File

@@ -251,7 +251,10 @@ public class ShopProductController {
*/ */
@RequestMapping("/info/{productId}") @RequestMapping("/info/{productId}")
public R info(@PathVariable("productId") Integer productId){ public R info(@PathVariable("productId") Integer productId){
ShopProductEntity shopProductEntity = shopProductService.getBaseMapper().selectOne(new QueryWrapper<ShopProductEntity>().eq("product_id", productId)); ShopProductEntity shopProductEntity = shopProductService.getBaseMapper().selectOne(new QueryWrapper<ShopProductEntity>().eq("product_id", productId).eq("del_flag",0));
if (shopProductEntity == null) {
return R.error("该商品已下架,看看其他商品吧");
}
ArrayList<Map<String, String>> imagesUrl = new ArrayList<Map<String,String>>(); ArrayList<Map<String, String>> imagesUrl = new ArrayList<Map<String,String>>();
Integer poid = shopProductEntity.getProductPid(); Integer poid = shopProductEntity.getProductPid();
@@ -338,16 +341,11 @@ public class ShopProductController {
/** /**
* 修改 * 修改
*/ */
//Todo 9.19 提交
@RequestMapping("/update") @RequestMapping("/update")
public R update(@RequestBody ShopProductEntity shopProduct) { public R update(@RequestBody ShopProductEntity shopProduct) {
//商品id //商品id
Integer productId = shopProduct.getProductId(); Integer productId = shopProduct.getProductId();
//多个图书id
ArrayList<String> bookId = shopProduct.getBookids();
shopProduct.setCreateTime(new Date()); shopProduct.setCreateTime(new Date());
//用list集合接收数组转String类型字符串 //用list集合接收数组转String类型字符串
String bkids = ""; String bkids = "";
@@ -363,13 +361,6 @@ public class ShopProductController {
//传过来的proudictid只有一个但是bookid可能有多个对应的一个proudictid一个bookid为一条数据一对多存储 //传过来的proudictid只有一个但是bookid可能有多个对应的一个proudictid一个bookid为一条数据一对多存储
List<ShopProudictBookEntity> bookyList = shopProudictBookService.getBaseMapper().selectList(new QueryWrapper<ShopProudictBookEntity>() List<ShopProudictBookEntity> bookyList = shopProudictBookService.getBaseMapper().selectList(new QueryWrapper<ShopProudictBookEntity>()
.eq("proudict_id", productId)); .eq("proudict_id", productId));
// List<Object> list = new ArrayList<>();
// for (ShopProudictBookEntity shopProudictBookEntity : bookyList) {
// Integer proudictBookbookId1 = shopProudictBookEntity.getBookId();
// list.add(proudictBookbookId1);
//
// }
Integer shop_book_ids [] = new Integer[bookyList.size()]; Integer shop_book_ids [] = new Integer[bookyList.size()];
for(int i=0; i<bookyList.size(); i++){ for(int i=0; i<bookyList.size(); i++){
shop_book_ids[i] = bookyList.get(i).getId(); shop_book_ids[i] = bookyList.get(i).getId();

View File

@@ -130,11 +130,21 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrderEntity
Integer orderId = buyOrderEntity.getOrderId(); Integer orderId = buyOrderEntity.getOrderId();
List<BuyOrderDetailEntity> entities = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetailEntity>() List<BuyOrderDetailEntity> entities = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetailEntity>()
.eq("order_id", orderId)); .eq("order_id", orderId));
for (BuyOrderDetailEntity entity : entities) { if (entities!=null) {
Integer productId = entity.getProductId(); for (BuyOrderDetailEntity entity : entities) {
ShopProductEntity shopPro = shopProductService.getById(productId); Integer productId = entity.getProductId();
entity.setImage(shopPro.getProductImages()); ShopProductEntity shopPro = shopProductService.getById(productId);
if (shopPro != null) {
String productImages = shopPro.getProductImages();
entity.setImage(productImages);
}
}
} }
buyOrderEntity.setProducts(entities); buyOrderEntity.setProducts(entities);
} }

View File

@@ -36,6 +36,7 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
IPage<ShopProductEntity> page = this.page( IPage<ShopProductEntity> page = this.page(
new Query<ShopProductEntity>().getPage(params), new Query<ShopProductEntity>().getPage(params),
new QueryWrapper<ShopProductEntity>().orderByDesc("create_time") new QueryWrapper<ShopProductEntity>().orderByDesc("create_time")
.like("product_name", params.get("key"))
); );
return new PageUtils(page); return new PageUtils(page);
} }