You've already forked FrameTour-BE
feat(order): 添加打印纸张信息到订单项
- 在 OrderItemVO 中新增 printerPaper 字段 - 根据商品类型查询并设置打印任务的纸张信息 - 优化订单详情接口返回数据结构
This commit is contained in:
@@ -567,6 +567,16 @@ public class OrderServiceImpl implements OrderService {
|
||||
log.warn("获取景区名称失败: {}", orderAppRespVO.getScenicId(), e);
|
||||
}
|
||||
}
|
||||
if (orderAppRespVO != null && orderAppRespVO.getOrderItemList() != null && !orderAppRespVO.getOrderItemList().isEmpty()) {
|
||||
orderAppRespVO.getOrderItemList().forEach(orderItem -> {
|
||||
if (orderItem.getGoodsType() == 3) {
|
||||
PrintTaskResp printTaskResp = printerMapper.queryTaskByMpId(Math.toIntExact(orderItem.getGoodsId()));
|
||||
if (printTaskResp != null) {
|
||||
orderItem.setPrinterPaper(printTaskResp.getPaper());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return ApiResponse.success(orderAppRespVO);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user