update:
1. 拆分接口
This commit is contained in:
@@ -98,7 +98,7 @@ public class APPMallController {
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "确认收货", description = "传入ConfirmOrderRequest")
|
||||
public R confirm(@Valid @RequestBody ConfirmOrderRequest request) {
|
||||
return R.status(orderService.confirm(request));
|
||||
return R.status(orderService.confirmMallOrder(request));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -83,7 +83,7 @@ public interface ICommonUserOrderService extends IService<CommonUserOrderEntity>
|
||||
|
||||
boolean fillExpress(Long id, String expressNo);
|
||||
|
||||
boolean confirm(ConfirmOrderRequest request);
|
||||
boolean confirmMallOrder(ConfirmOrderRequest request);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -165,8 +165,8 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
if (!request.getIsOfflinePayment()) {
|
||||
discount = BigDecimal.valueOf(new Random().nextInt(99) + 1, 2);
|
||||
}
|
||||
if (BusinessModule.fromCodeIgnoreCaseOrNull(orderType).equals(BusinessModule.SELF_OPERATED_MALL)){
|
||||
throw new ServiceException("无效订单");
|
||||
if (!BusinessModule.fromCodeIgnoreCaseOrNull(orderType).equals(BusinessModule.SELF_OPERATED_MALL)){
|
||||
throw new ServiceException("无效业务订单");
|
||||
}
|
||||
if (request.getConsigneePhone() == null){
|
||||
throw new ServiceException("请填写联系电话");
|
||||
@@ -424,11 +424,14 @@ public class CommonUserOrderServiceImpl extends ServiceImpl<CommonUserOrderMappe
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean confirm(ConfirmOrderRequest request) {
|
||||
public boolean confirmMallOrder(ConfirmOrderRequest request) {
|
||||
CommonUserOrderEntity order = getById(request.getId());
|
||||
if (order == null) {
|
||||
throw new ServiceException("无效订单");
|
||||
}
|
||||
if (!BusinessModule.fromCodeIgnoreCaseOrNull(order.getOrderType()).equals(BusinessModule.SELF_OPERATED_MALL)){
|
||||
throw new ServiceException("无效业务订单");
|
||||
}
|
||||
boolean updated = update(Wrappers.<CommonUserOrderEntity>lambdaUpdate()
|
||||
.set(CommonUserOrderEntity::getOrderStatus, OrderStatus.COMPLETED.getCode())
|
||||
.eq(CommonUserOrderEntity::getId, order.getId())
|
||||
|
||||
Reference in New Issue
Block a user