pull/1121/head
liujiang 2025-12-03 16:31:17 +08:00
commit bfa14a2c1d
3 changed files with 20 additions and 5 deletions

View File

@ -21,7 +21,14 @@ public interface IExpressService {
*
* @param expressId
*/
void checkExpress(Long expressId);
void checkExpressSystemDeliverAccess(Long expressId);
/**
*
*
* @param expressId
*/
void checkExpressUserRefundAccess(Long expressId);
/**
*

View File

@ -63,13 +63,21 @@ public class ExpressServiceImpl implements IExpressService {
private List<ExpressManager> expressManagers;
@Override
public void checkExpress(Long expressId) {
public void checkExpressSystemDeliverAccess(Long expressId) {
Assert.notNull(expressId);
Express express = expressMapper.selectById(expressId);
Assert.isTrue(BeanValidators.exists(express), "快递不存在");
Assert.isTrue(express.getSystemDeliverAccess(), "快递不可用");
}
@Override
public void checkExpressUserRefundAccess(Long expressId) {
Assert.notNull(expressId);
Express express = expressMapper.selectById(expressId);
Assert.isTrue(BeanValidators.exists(express), "快递不存在");
Assert.isTrue(express.getUserRefundAccess(), "快递不可用");
}
@Override
public Express getById(Long expressId) {
return expressMapper.selectById(expressId);

View File

@ -101,7 +101,7 @@ public class StoreOrderServiceImpl implements IStoreOrderService {
//校验
Assert.notNull(orderUserId);
Assert.notNull(payChannel);
expressService.checkExpress(expressId);
expressService.checkExpressSystemDeliverAccess(expressId);
checkDelivery(storeOrderAddDTO.getDeliveryType(), storeOrderAddDTO.getDeliveryEndTime());
OrderDetailCheckRtn detailCheckRtn = checkOrderDetailThenRtnUsedMap(storeId, storeOrderAddDTO.getDetailList());
Map<Long, StoreProductColorSize> spcsMap = detailCheckRtn.getSpcsMap();
@ -244,7 +244,7 @@ public class StoreOrderServiceImpl implements IStoreOrderService {
throw new ServiceException(CharSequenceUtil.format("订单[{}]已完成支付,无法修改",
storeOrderUpdateDTO.getId()));
}
expressService.checkExpress(expressId);
expressService.checkExpressSystemDeliverAccess(expressId);
checkDelivery(storeOrderUpdateDTO.getDeliveryType(), storeOrderUpdateDTO.getDeliveryEndTime());
OrderDetailCheckRtn detailCheckRtn = checkOrderDetailThenRtnUsedMap(storeId,
storeOrderUpdateDTO.getDetailList());
@ -1257,7 +1257,7 @@ public class StoreOrderServiceImpl implements IStoreOrderService {
public AfterSaleApplyResultDTO createAfterSaleOrder(StoreOrderAfterSaleDTO afterSaleDTO) {
Assert.notEmpty(afterSaleDTO.getStoreOrderDetailIds());
if (afterSaleDTO.getExpressId() != null) {
expressService.checkExpress(afterSaleDTO.getExpressId());
expressService.checkExpressUserRefundAccess(afterSaleDTO.getExpressId());
}
//获取原订单
StoreOrder originOrder = getAndBaseCheck(afterSaleDTO.getStoreOrderId());