no message

This commit is contained in:
cb 2025-06-14 21:37:33 +08:00
parent e38126d341
commit cedc78e76e
4 changed files with 20 additions and 8 deletions

View File

@ -235,4 +235,6 @@ public class OrderMaster extends BaseEntity {
private String countryName;
private String streetName;
private Integer withdrawn;
}

View File

@ -351,8 +351,9 @@ public class OrderMasterServiceImpl implements OrderMasterService {
logger.error("自动发起提现失败: orderMasterId={}, memberId={}, cashAmt={}", orderMasterId, memberId, amount, e);
}
}));
// //主订单提现成功 修改主订单状态为已完成
updateStatus(orderMasterId, OrderStatus.Pending.code());
// //主订单提现成功 修改主订单状态为提现中
orderMaster.setWithdrawn(1);
updateOrderMaster(orderMaster);
}
/**

View File

@ -50,6 +50,7 @@
<result property="cityName" column="city_name"/>
<result property="countryName" column="country_name"/>
<result property="streetName" column="street_name"/>
<result property="withdrawn" column="withdrawn"/>
</resultMap>
@ -97,7 +98,8 @@
country_name ,
street_name ,
phone,
has_dispatched_all
has_dispatched_all,
withdrawn
FROM order_master
</sql>
@ -145,7 +147,8 @@
om.country_name ,
om.street_name ,
om.phone,
om.has_dispatched_all
om.has_dispatched_all,
om.withdrawn
FROM order_master om
LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id
LEFT JOIN goods g ON g.goods_id = om.goods_id

View File

@ -130,15 +130,21 @@ public class OrderServiceImpl implements OrderService {
return;
}
List<Integer> list=new ArrayList<>();
list.add(OrderStatus.Pending.code());
List<OrderMaster> orderMasterFinish = orderMasterService.selectByStatus(list);
list.add(OrderStatus.FINISH_CHECK.code());
OrderMaster orderMasterFinishCheck = new OrderMaster();
orderMasterFinishCheck.setOrderStatus(OrderStatus.FINISH_CHECK.code());
orderMasterFinishCheck.setWithdrawn(1);
List<OrderMaster> orderMasterFinish = orderMasterService.selectOrderMasterList(orderMasterFinishCheck);
for (OrderMaster orderMaster:orderMasterFinish){
log.info("满足完成条件的主订单{}",orderMaster);
List<OrderDetail> orderDetailList=orderDetailService.selectByOrderMasterId(orderMaster.getId());
boolean allDrawCashStatusIs2 = orderDetailList != null
&& orderDetailList.stream()
.allMatch(detail -> detail.getDrawCashStatus() == 2);
if (allDrawCashStatusIs2){
orderMasterService.updateStatus(orderMaster.getId(),OrderStatus.FINISH.code());
orderMaster.setWithdrawn(2);
orderMaster.setOrderStatus(OrderStatus.FINISH.code());
orderMasterService.updateOrderMaster(orderMaster);
}
}
@ -692,7 +698,7 @@ public class OrderServiceImpl implements OrderService {
}
}
// 如果已经不存在"已完成""已取消"以外的子订单 就把主订单也改为完成
if (allFinish) {
if (allFinish&&om.getWithdrawn()==null) {
log.info("主订单自动完成[id={} code={}]", om.getId(), om.getCode());
orderMasterService.finish(om.getId());
}