订单消息
This commit is contained in:
@@ -358,14 +358,17 @@ public class PrintConfig implements ApplicationRunner {
|
|||||||
|
|
||||||
private void sendOrderPrintMsg(Long shopId, Long orderId, Integer placeNum, String printType, List<OrderDetail> detailList, String operator) {
|
private void sendOrderPrintMsg(Long shopId, Long orderId, Integer placeNum, String printType, List<OrderDetail> detailList, String operator) {
|
||||||
FunUtils.safeRunVoid(() -> {
|
FunUtils.safeRunVoid(() -> {
|
||||||
List<OrderDetailPrintDTO> list2 = detailList.stream()
|
List<OrderDetailPrintDTO> list = new ArrayList<>();
|
||||||
|
if(CollUtil.isEmpty(detailList)){
|
||||||
|
list = detailList.stream()
|
||||||
.map(detail -> {
|
.map(detail -> {
|
||||||
OrderDetailPrintDTO printDTO = new OrderDetailPrintDTO();
|
OrderDetailPrintDTO printDTO = new OrderDetailPrintDTO();
|
||||||
// 自动拷贝相同名称的字段
|
// 自动拷贝相同名称的字段
|
||||||
BeanUtils.copyProperties(detail, printDTO);
|
BeanUtils.copyProperties(detail, printDTO);
|
||||||
return printDTO;
|
return printDTO;
|
||||||
}).toList();
|
}).toList();
|
||||||
rabbitPublisher.sendOrderPrintLocalMsg(shopId, orderId, placeNum, printType, JSONObject.toJSONString(list2), operator);
|
}
|
||||||
|
rabbitPublisher.sendOrderPrintLocalMsg(shopId, orderId, placeNum, printType, JSONObject.toJSONString(list), operator);
|
||||||
}, "订单{}消息发送失败,订单信息: {}", printType, orderId);
|
}, "订单{}消息发送失败,订单信息: {}", printType, orderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user