bug fix
This commit is contained in:
@@ -199,6 +199,15 @@ public class BuyOrderController {
|
|||||||
return R.ok().put("result", expressFee);
|
return R.ok().put("result", expressFee);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getMyOrderList")
|
||||||
|
public R getMyOrderList(@RequestParam Map<String, Object> params) {
|
||||||
|
PageUtils page = buyOrderService.queryPage1(params);
|
||||||
|
return R.ok().put("page", page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ public interface BuyOrderService extends IService<BuyOrder> {
|
|||||||
|
|
||||||
PageUtils queryPage(Map<String, Object> params) throws Exception;
|
PageUtils queryPage(Map<String, Object> params) throws Exception;
|
||||||
|
|
||||||
|
PageUtils queryPage1(Map<String, Object> params);
|
||||||
|
|
||||||
//更新订单状态
|
//更新订单状态
|
||||||
void updateOrderStatus(Integer userId, String orderSn, String type);
|
void updateOrderStatus(Integer userId, String orderSn, String type);
|
||||||
|
|
||||||
@@ -35,4 +37,6 @@ public interface BuyOrderService extends IService<BuyOrder> {
|
|||||||
* @param buyOrderDetailId 订单详情 ID 列表
|
* @param buyOrderDetailId 订单详情 ID 列表
|
||||||
*/
|
*/
|
||||||
void createSplitPackageOrder(String expressCompanyCode, List<Integer> buyOrderDetailId);
|
void createSplitPackageOrder(String expressCompanyCode, List<Integer> buyOrderDetailId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,7 @@ import com.peanut.modules.book.service.*;
|
|||||||
import com.peanut.modules.book.entity.ExpressCommodity;
|
import com.peanut.modules.book.entity.ExpressCommodity;
|
||||||
import com.peanut.modules.book.vo.ExpressOrderResponseVo;
|
import com.peanut.modules.book.vo.ExpressOrderResponseVo;
|
||||||
import com.peanut.modules.book.vo.UserOrderVo;
|
import com.peanut.modules.book.vo.UserOrderVo;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -43,6 +44,9 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
@Autowired
|
@Autowired
|
||||||
CountyService countyService;
|
CountyService countyService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ShopProductService shopProductService;
|
||||||
|
|
||||||
|
|
||||||
protected Logger logger = LoggerFactory.getLogger(BuyOrderServiceImpl.class);
|
protected Logger logger = LoggerFactory.getLogger(BuyOrderServiceImpl.class);
|
||||||
|
|
||||||
@@ -96,6 +100,49 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
return new PageUtils(page);
|
return new PageUtils(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageUtils queryPage1(Map<String, Object> params) {
|
||||||
|
|
||||||
|
String orderStatus = (String) params.get("orderStatus");
|
||||||
|
if (orderStatus.equals("9")) {
|
||||||
|
orderStatus = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String userId = (String) params.get("userId");
|
||||||
|
|
||||||
|
IPage<BuyOrder> page = this.page(
|
||||||
|
new Query<BuyOrder>().getPage(params),
|
||||||
|
new QueryWrapper<BuyOrder>()
|
||||||
|
.eq("user_id", userId)
|
||||||
|
.eq(StringUtils.isNotBlank(orderStatus), "order_status", orderStatus)
|
||||||
|
.orderByDesc("create_time")
|
||||||
|
);
|
||||||
|
List<BuyOrder> records = page.getRecords();
|
||||||
|
for (BuyOrder buyOrderEntity : records) {
|
||||||
|
Integer orderId = buyOrderEntity.getOrderId();
|
||||||
|
buyOrderEntity.setTimestamp(buyOrderEntity.getCreateTime().getTime() / 1000);
|
||||||
|
List<BuyOrderDetail> entities = buyOrderDetailService.getBaseMapper().selectList(new QueryWrapper<BuyOrderDetail>()
|
||||||
|
.eq("order_id", orderId));
|
||||||
|
if (entities != null) {
|
||||||
|
for (BuyOrderDetail entity : entities) {
|
||||||
|
Integer productId = entity.getProductId();
|
||||||
|
ShopProductEntity shopPro = shopProductService.getById(productId);
|
||||||
|
if (shopPro != null) {
|
||||||
|
String productImages = shopPro.getProductImages();
|
||||||
|
|
||||||
|
entity.setImage(productImages);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buyOrderEntity.setProducts(entities);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new PageUtils(page);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateOrderStatus(Integer userId, String orderSn, String type) {
|
public void updateOrderStatus(Integer userId, String orderSn, String type) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user