超市优化

This commit is contained in:
zengtao01
2024-11-15 10:55:02 +08:00
parent f663fbf6b6
commit 23d10238a1
2 changed files with 5 additions and 1 deletions

View File

@ -464,7 +464,7 @@ public class StoreOrderServiceImpl implements StoreOrderService {
public AddReqVO cancel(Integer orderId) {
StoreOrderDO storeOrderDO;
synchronized (getStoreOrderLock("cancel")) {
storeOrderDO = storeOrderMapper.selectById(orderId);
storeOrderDO = storeOrderMapper.selectById(orderId);
if(ObjectUtil.isEmpty(storeOrderDO)){
throw exception(STORE_ORDER_NOT_EXISTS);
}
@ -472,6 +472,9 @@ public class StoreOrderServiceImpl implements StoreOrderService {
|| storeOrderDO.getStatus().equals(StoreOrderStatusEnum.REFUND.getCode())){
throw exception(STATUS_ERROR);
}
if(storeOrderDO.getStatus().equals(StoreOrderStatusEnum.CANCEL.getCode())){
throw exception(STATUS_ERROR_CANCEL);
}
}
//修改状态