-- 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

@@ -671,29 +671,26 @@ public class BuyOrderController {
* 信息
*/
@RequestMapping("/appGetOrderInfo/{type}")
// @RequiresPermissions("book:buyorder:info") 就是这个
public R appGetOrderInfo(@PathVariable String type , @RequestParam("orderId") Integer orderId){
BuyOrderEntity buyOrder = buyOrderService.getById(orderId);
List<BuyOrderDetailEntity> orderDetail = null;
if("1".equals(type)){
orderDetail = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetailEntity>()
.eq("order_id", orderId));
}else{
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) {
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);
Date createDate = buyOrder.getCreateTime();
return R.ok().put("buyOrder", buyOrder).put("CreateTime",createDate).put("userRecordid",id);
}

View File

@@ -251,7 +251,10 @@ public class ShopProductController {
*/
@RequestMapping("/info/{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>>();
Integer poid = shopProductEntity.getProductPid();
@@ -338,16 +341,11 @@ public class ShopProductController {
/**
* 修改
*/
//Todo 9.19 提交
@RequestMapping("/update")
public R update(@RequestBody ShopProductEntity shopProduct) {
//商品id
Integer productId = shopProduct.getProductId();
//多个图书id
ArrayList<String> bookId = shopProduct.getBookids();
shopProduct.setCreateTime(new Date());
//用list集合接收数组转String类型字符串
String bkids = "";
@@ -363,13 +361,6 @@ public class ShopProductController {
//传过来的proudictid只有一个但是bookid可能有多个对应的一个proudictid一个bookid为一条数据一对多存储
List<ShopProudictBookEntity> bookyList = shopProudictBookService.getBaseMapper().selectList(new QueryWrapper<ShopProudictBookEntity>()
.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()];
for(int i=0; i<bookyList.size(); i++){
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();
List<BuyOrderDetailEntity> entities = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetailEntity>()
.eq("order_id", orderId));
for (BuyOrderDetailEntity entity : entities) {
Integer productId = entity.getProductId();
ShopProductEntity shopPro = shopProductService.getById(productId);
entity.setImage(shopPro.getProductImages());
if (entities!=null) {
for (BuyOrderDetailEntity entity : entities) {
Integer productId = entity.getProductId();
ShopProductEntity shopPro = shopProductService.getById(productId);
if (shopPro != null) {
String productImages = shopPro.getProductImages();
entity.setImage(productImages);
}
}
}
buyOrderEntity.setProducts(entities);
}

View File

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