【同步】BOOT 和 CLOUD 的功能

This commit is contained in:
YunaiV
2025-07-15 21:54:41 +08:00
parent 031fa11e38
commit 08c31e889d
211 changed files with 9932 additions and 2671 deletions

View File

@@ -124,7 +124,7 @@ public class ProductSpuController {
return success(productSpuService.getTabsCount());
}
@GetMapping("/export")
@GetMapping("/export-excel")
@Operation(summary = "导出商品")
@PreAuthorize("@ss.hasPermission('product:spu:export')")
@ApiAccessLog(operateType = EXPORT)

View File

@@ -10,10 +10,10 @@ import cn.iocoder.yudao.module.product.convert.brand.ProductBrandConvert;
import cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO;
import cn.iocoder.yudao.module.product.dal.mysql.brand.ProductBrandMapper;
import com.google.common.annotations.VisibleForTesting;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import jakarta.annotation.Resource;
import java.util.Collection;
import java.util.List;
@@ -90,7 +90,7 @@ public class ProductBrandServiceImpl implements ProductBrandService {
@Override
public List<ProductBrandDO> getBrandList(Collection<Long> ids) {
return brandMapper.selectBatchIds(ids);
return brandMapper.selectByIds(ids);
}
@Override

View File

@@ -109,7 +109,7 @@ public class ProductCategoryServiceImpl implements ProductCategoryService {
return;
}
// 获得商品分类信息
List<ProductCategoryDO> list = productCategoryMapper.selectBatchIds(ids);
List<ProductCategoryDO> list = productCategoryMapper.selectByIds(ids);
Map<Long, ProductCategoryDO> categoryMap = CollectionUtils.convertMap(list, ProductCategoryDO::getId);
// 校验
ids.forEach(id -> {

View File

@@ -106,7 +106,7 @@ public class ProductPropertyServiceImpl implements ProductPropertyService {
@Override
public List<ProductPropertyDO> getPropertyList(Collection<Long> ids) {
return productPropertyMapper.selectBatchIds(ids);
return productPropertyMapper.selectByIds(ids);
}
@Override

View File

@@ -81,7 +81,7 @@ public class ProductSkuServiceImpl implements ProductSkuService {
if (CollUtil.isEmpty(ids)) {
return ListUtil.empty();
}
return productSkuMapper.selectBatchIds(ids);
return productSkuMapper.selectByIds(ids);
}
@Override
@@ -248,7 +248,7 @@ public class ProductSkuServiceImpl implements ProductSkuService {
updateSkus.forEach(sku -> productSkuMapper.updateById(sku));
}
if (CollUtil.isNotEmpty(existsSkuMap)) {
productSkuMapper.deleteBatchIds(existsSkuMap.values());
productSkuMapper.deleteByIds(existsSkuMap.values());
}
}
@@ -268,7 +268,7 @@ public class ProductSkuServiceImpl implements ProductSkuService {
});
// 更新 SPU 库存
List<ProductSkuDO> skus = productSkuMapper.selectBatchIds(
List<ProductSkuDO> skus = productSkuMapper.selectByIds(
convertSet(updateStockReqDTO.getItems(), ProductSkuUpdateStockReqDTO.Item::getId));
Map<Long, Integer> spuStockIncrCounts = ProductSkuConvert.INSTANCE.convertSpuStockMap(
updateStockReqDTO.getItems(), skus);

View File

@@ -137,7 +137,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
return Collections.emptyList();
}
// 获得商品信息
List<ProductSpuDO> list = productSpuMapper.selectBatchIds(ids);
List<ProductSpuDO> list = productSpuMapper.selectByIds(ids);
Map<Long, ProductSpuDO> spuMap = CollectionUtils.convertMap(list, ProductSpuDO::getId);
// 校验
ids.forEach(id -> {
@@ -202,7 +202,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
Map<Long, ProductSpuDO> spuMap = convertMap(productSpuMapper.selectBatchIds(ids), ProductSpuDO::getId);
Map<Long, ProductSpuDO> spuMap = convertMap(productSpuMapper.selectByIds(ids), ProductSpuDO::getId);
// 需要按照 ids 顺序返回。例如说:店铺装修选择了 [3, 1, 2] 三个商品,返回结果还是 [3, 1, 2] 这样的顺序
return convertList(ids, spuMap::get);
}

View File

@@ -122,10 +122,8 @@ public interface CombinationActivityConvert {
return convert(reqDTO).setVirtualGroup(false)
.setStatus(CombinationRecordStatusEnum.IN_PROGRESS.getStatus()) // 创建后默认状态为进行中
.setUserSize(activity.getUserSize()).setUserCount(1) // 默认就是 1 插入后会接着更新一次所有的拼团记录
// 用户信息
.setNickname(user.getNickname()).setAvatar(user.getAvatar())
// 商品信息
.setSpuName(spu.getName()).setPicUrl(sku.getPicUrl());
.setNickname(user.getNickname()).setAvatar(user.getAvatar()) // 用户信息
.setSpuName(spu.getName()).setPicUrl(ObjectUtil.defaultIfBlank(sku.getPicUrl(), spu.getPicUrl())); // 商品信息
}
default List<CombinationActivityRespVO> convertList(List<CombinationActivityDO> list,

View File

@@ -31,9 +31,13 @@ import java.util.List;
public class CouponTemplateDO extends BaseDO {
/**
* 不限制领取数量
* 领取数量 - 不限制
*/
public static final Integer TIME_LIMIT_COUNT_MAX = -1;
public static final Integer TAKE_LIMIT_COUNT_MAX = -1;
/**
* 发放数量 - 不限制
*/
public static final Integer TOTAL_COUNT_MAX = -1;
// ========== 基本信息 BEGIN ==========
/**

View File

@@ -40,10 +40,16 @@ public interface CouponTemplateMapper extends BaseMapperX<CouponTemplateDO> {
.orderByDesc(CouponTemplateDO::getId));
}
default void updateTakeCount(Long id, Integer incrCount) {
update(null, new LambdaUpdateWrapper<CouponTemplateDO>()
default int updateTakeCount(Long id, Integer incrCount) {
LambdaUpdateWrapper<CouponTemplateDO> updateWrapper = new LambdaUpdateWrapper<CouponTemplateDO>()
.eq(CouponTemplateDO::getId, id)
.setSql("take_count = take_count + " + incrCount));
.setSql("take_count = take_count + " + incrCount);
// 增加已领取的数量incrCount 为正数),需要考虑发放数量 totalCount 的限制
if (incrCount > 0) {
updateWrapper.and(i -> i.apply("take_count < total_count")
.or().eq(CouponTemplateDO::getTotalCount, CouponTemplateDO.TOTAL_COUNT_MAX));
}
return update(updateWrapper);
}
default List<CouponTemplateDO> selectListByTakeType(Integer takeType) {

View File

@@ -154,7 +154,7 @@ public class BargainActivityServiceImpl implements BargainActivityService {
@Override
public List<BargainActivityDO> getBargainActivityList(Set<Long> ids) {
return bargainActivityMapper.selectBatchIds(ids);
return bargainActivityMapper.selectByIds(ids);
}
@Override

View File

@@ -86,7 +86,7 @@ public class CombinationActivityServiceImpl implements CombinationActivityServic
activityList.removeIf(item -> ObjectUtil.equal(item.getId(), activityId));
}
// 查找是否有其它活动,选择了该产品
List<CombinationActivityDO> matchActivityList = filterList(activityList, activity -> ObjectUtil.equal(activity.getId(), spuId));
List<CombinationActivityDO> matchActivityList = filterList(activityList, activity -> ObjectUtil.equal(activity.getSpuId(), spuId));
if (CollUtil.isNotEmpty(matchActivityList)) {
throw exception(COMBINATION_ACTIVITY_SPU_CONFLICTS);
}
@@ -100,7 +100,7 @@ public class CombinationActivityServiceImpl implements CombinationActivityServic
*/
private void validateProductExists(Long spuId, List<CombinationProductBaseVO> products) {
// 1. 校验商品 spu 是否存在
ProductSpuRespDTO spu = productSpuApi.getSpu(spuId).getCheckedData();
ProductSpuRespDTO spu = productSpuApi.getSpu(spuId);
if (spu == null) {
throw exception(SPU_NOT_EXISTS);
}

View File

@@ -50,8 +50,6 @@ import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.bef
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.*;
import static cn.iocoder.yudao.module.promotion.enums.MessageTemplateConstants.COMBINATION_SUCCESS;
// TODO 芋艿:等拼团记录做完,完整 review 下
/**
* 拼团记录 Service 实现类
*
@@ -219,9 +217,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService {
// 3. 拼团成功发送订阅消息
if (updateSuccess && isFull) {
records.forEach(item -> {
getSelf().sendCombinationResultMessage(item);
});
records.forEach(item -> getSelf().sendCombinationResultMessage(item));
}
}

View File

@@ -137,7 +137,6 @@ public class CouponServiceImpl implements CouponService {
// 4. 增加优惠劵模板的领取数量
couponTemplateService.updateCouponTemplateTakeCount(template.getId(), userIds.size());
return convertMultiMap(couponList, CouponDO::getUserId, CouponDO::getId);
}
@@ -281,7 +280,7 @@ public class CouponServiceImpl implements CouponService {
}
// 校验发放数量不能过小(仅在 CouponTakeTypeEnum.USER 用户领取时)
if (CouponTakeTypeEnum.isUser(couponTemplate.getTakeType())
&& ObjUtil.notEqual(couponTemplate.getTakeLimitCount(), CouponTemplateDO.TIME_LIMIT_COUNT_MAX) // 非不限制
&& ObjUtil.notEqual(couponTemplate.getTakeLimitCount(), CouponTemplateDO.TAKE_LIMIT_COUNT_MAX) // 非不限制
&& couponTemplate.getTakeCount() + userIds.size() > couponTemplate.getTotalCount()) {
throw exception(COUPON_TEMPLATE_NOT_ENOUGH);
}

View File

@@ -22,8 +22,7 @@ import java.util.List;
import java.util.Objects;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.COUPON_TEMPLATE_NOT_EXISTS;
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.COUPON_TEMPLATE_TOTAL_COUNT_TOO_SMALL;
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.*;
/**
* 优惠劵模板 Service 实现类
@@ -60,7 +59,7 @@ public class CouponTemplateServiceImpl implements CouponTemplateService {
CouponTemplateDO couponTemplate = validateCouponTemplateExists(updateReqVO.getId());
// 校验发放数量不能过小(仅在 CouponTakeTypeEnum.USER 用户领取时)
if (CouponTakeTypeEnum.isUser(couponTemplate.getTakeType())
&& ObjUtil.notEqual(couponTemplate.getTakeLimitCount(), CouponTemplateDO.TIME_LIMIT_COUNT_MAX) // 非不限制
&& ObjUtil.notEqual(couponTemplate.getTakeLimitCount(), CouponTemplateDO.TAKE_LIMIT_COUNT_MAX) // 非不限制
&& updateReqVO.getTotalCount() < couponTemplate.getTakeCount()) {
throw exception(COUPON_TEMPLATE_TOTAL_COUNT_TOO_SMALL, couponTemplate.getTakeCount());
}
@@ -116,7 +115,10 @@ public class CouponTemplateServiceImpl implements CouponTemplateService {
@Override
public void updateCouponTemplateTakeCount(Long id, int incrCount) {
couponTemplateMapper.updateTakeCount(id, incrCount);
int updateCount = couponTemplateMapper.updateTakeCount(id, incrCount);
if (updateCount == 0) {
throw exception(COUPON_TEMPLATE_NOT_ENOUGH);
}
}
@Override
@@ -132,7 +134,7 @@ public class CouponTemplateServiceImpl implements CouponTemplateService {
@Override
public List<CouponTemplateDO> getCouponTemplateList(Collection<Long> ids) {
return couponTemplateMapper.selectBatchIds(ids);
return couponTemplateMapper.selectByIds(ids);
}
}

View File

@@ -11,10 +11,10 @@ import cn.iocoder.yudao.module.promotion.controller.admin.diy.vo.page.DiyPageUpd
import cn.iocoder.yudao.module.promotion.convert.diy.DiyPageConvert;
import cn.iocoder.yudao.module.promotion.dal.dataobject.diy.DiyPageDO;
import cn.iocoder.yudao.module.promotion.dal.mysql.diy.DiyPageMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import jakarta.annotation.Resource;
import java.util.Collection;
import java.util.List;
@@ -104,7 +104,7 @@ public class DiyPageServiceImpl implements DiyPageService {
if (CollUtil.isEmpty(ids)) {
return ListUtil.empty();
}
return diyPageMapper.selectBatchIds(ids);
return diyPageMapper.selectByIds(ids);
}
@Override

View File

@@ -11,10 +11,10 @@ import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.config.Seck
import cn.iocoder.yudao.module.promotion.convert.seckill.SeckillConfigConvert;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.SeckillConfigDO;
import cn.iocoder.yudao.module.promotion.dal.mysql.seckill.seckillconfig.SeckillConfigMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import jakarta.annotation.Resource;
import java.time.LocalTime;
import java.util.Collection;
import java.util.Comparator;
@@ -132,7 +132,7 @@ public class SeckillConfigServiceImpl implements SeckillConfigService {
return;
}
// 1. 如果有数量不匹配,说明有不存在的,则抛出 SECKILL_CONFIG_NOT_EXISTS 业务异常
List<SeckillConfigDO> configs = seckillConfigMapper.selectBatchIds(ids);
List<SeckillConfigDO> configs = seckillConfigMapper.selectByIds(ids);
if (configs.size() != ids.size()) {
throw exception(SECKILL_CONFIG_NOT_EXISTS);
}

View File

@@ -15,6 +15,8 @@ import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;
import java.util.List;
import static cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils.toUnderlineCase;
/**
* 商品统计 Mapper
*
@@ -49,16 +51,16 @@ public interface ProductStatisticsMapper extends BaseMapperX<ProductStatisticsDO
private static MPJLambdaWrapperX<ProductStatisticsDO> buildWrapper(ProductStatisticsReqVO reqVO) {
return new MPJLambdaWrapperX<ProductStatisticsDO>()
.betweenIfPresent(ProductStatisticsDO::getTime, reqVO.getTimes())
.selectSum(ProductStatisticsDO::getBrowseCount)
.selectSum(ProductStatisticsDO::getBrowseUserCount)
.selectSum(ProductStatisticsDO::getFavoriteCount)
.selectSum(ProductStatisticsDO::getCartCount)
.selectSum(ProductStatisticsDO::getOrderCount)
.selectSum(ProductStatisticsDO::getOrderPayCount)
.selectSum(ProductStatisticsDO::getOrderPayPrice)
.selectSum(ProductStatisticsDO::getAfterSaleCount)
.selectSum(ProductStatisticsDO::getAfterSaleRefundPrice)
.selectAvg(ProductStatisticsDO::getBrowseConvertPercent);
.selectSum(ProductStatisticsDO::getBrowseCount, toUnderlineCase(ProductStatisticsDO::getBrowseCount))
.selectSum(ProductStatisticsDO::getBrowseUserCount, toUnderlineCase(ProductStatisticsDO::getBrowseUserCount))
.selectSum(ProductStatisticsDO::getFavoriteCount, toUnderlineCase(ProductStatisticsDO::getFavoriteCount))
.selectSum(ProductStatisticsDO::getCartCount, toUnderlineCase(ProductStatisticsDO::getCartCount))
.selectSum(ProductStatisticsDO::getOrderCount, toUnderlineCase(ProductStatisticsDO::getOrderCount))
.selectSum(ProductStatisticsDO::getOrderPayCount, toUnderlineCase(ProductStatisticsDO::getOrderPayCount))
.selectSum(ProductStatisticsDO::getOrderPayPrice, toUnderlineCase(ProductStatisticsDO::getOrderPayPrice))
.selectSum(ProductStatisticsDO::getAfterSaleCount, toUnderlineCase(ProductStatisticsDO::getAfterSaleCount))
.selectSum(ProductStatisticsDO::getAfterSaleRefundPrice, toUnderlineCase(ProductStatisticsDO::getAfterSaleRefundPrice))
.selectAvg(ProductStatisticsDO::getBrowseConvertPercent, toUnderlineCase(ProductStatisticsDO::getBrowseConvertPercent));
}
/**

View File

@@ -76,8 +76,8 @@
<select id="selectListByPayTimeBetweenAndGroupByMonth"
resultType="cn.iocoder.yudao.module.statistics.controller.admin.trade.vo.TradeOrderTrendRespVO">
SELECT DATE_FORMAT(pay_time, '%Y-%m') AS date,
COUNT(1) AS orderPayCount,
SUM(pay_price) AS orderPayPrice
COUNT(1) AS order_pay_count,
SUM(pay_price) AS order_pay_price
FROM trade_order
WHERE pay_status = TRUE
AND create_time BETWEEN #{beginTime} AND #{endTime}
@@ -95,8 +95,8 @@
<select id="selectPaySummaryByPayStatusAndPayTimeBetween"
resultType="cn.iocoder.yudao.module.statistics.controller.admin.trade.vo.TradeOrderSummaryRespVO">
SELECT IFNULL(SUM(pay_price), 0) AS orderPayPrice,
COUNT(1) AS orderPayCount
SELECT IFNULL(SUM(pay_price), 0) AS order_pay_price,
COUNT(1) AS order_pay_count
FROM trade_order
WHERE pay_status = #{payStatus}
AND pay_time BETWEEN #{beginTime} AND #{endTime}

View File

@@ -39,7 +39,8 @@ public interface ErrorCodeConstants {
ErrorCode ORDER_UPDATE_PAID_ORDER_REFUNDED_FAIL_REFUND_NOT_FOUND = new ErrorCode(1_011_000_034, "交易订单更新支付订单退款状态失败,原因:退款单不存在");
ErrorCode ORDER_UPDATE_PAID_ORDER_REFUNDED_FAIL_REFUND_STATUS_NOT_SUCCESS = new ErrorCode(1_011_000_035, "交易订单更新支付订单退款状态失败,原因:退款单状态不是【退款成功】");
ErrorCode ORDER_PICK_UP_FAIL_NOT_VERIFY_USER = new ErrorCode(1_011_000_036, "交易订单自提失败,原因:你没有核销该门店订单的权限");
ErrorCode ORDER_CREATE_FAIL_INSUFFICIENT_USER_POINTS = new ErrorCode(1_011_000_037, "交易订单创建失败,原因:用户积分不足");
ErrorCode ORDER_PICK_UP_FAIL_COMBINATION_NOT_SUCCESS = new ErrorCode(1_011_000_037, "交易订单自提失败,原因:商品拼团记录不是【成功】状态");
ErrorCode ORDER_CREATE_FAIL_INSUFFICIENT_USER_POINTS = new ErrorCode(1_011_000_038, "交易订单创建失败,原因:用户积分不足");
// ========== After Sale 模块 1-011-000-100 ==========
ErrorCode AFTER_SALE_NOT_FOUND = new ErrorCode(1_011_000_100, "售后单不存在");

View File

@@ -21,7 +21,6 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -142,9 +141,8 @@ public class AfterSaleController {
public CommonResult<Boolean> updateAfterSaleRefunded(@RequestBody PayRefundNotifyReqDTO notifyReqDTO) {
log.info("[updateAfterRefund][notifyReqDTO({})]", notifyReqDTO);
if (StrUtil.startWithAny(notifyReqDTO.getMerchantRefundId(), "order-")) {
tradeOrderUpdateService.updatePaidOrderRefunded(
Long.parseLong(notifyReqDTO.getMerchantRefundId()),
notifyReqDTO.getPayRefundId());
Long orderId = Long.parseLong(StrUtil.subAfter(notifyReqDTO.getMerchantRefundId(), "order-", true));
tradeOrderUpdateService.updatePaidOrderRefunded(orderId, notifyReqDTO.getPayRefundId());
} else {
afterSaleService.updateAfterSaleRefunded(
Long.parseLong(notifyReqDTO.getMerchantRefundId()),

View File

@@ -98,7 +98,7 @@ public class DeliveryExpressTemplateServiceImpl implements DeliveryExpressTempla
expressTemplateFreeMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
expressTemplateFreeMapper.deleteBatchIds(convertList(diffList.get(2), DeliveryExpressTemplateFreeDO::getId));
expressTemplateFreeMapper.deleteByIds(convertList(diffList.get(2), DeliveryExpressTemplateFreeDO::getId));
}
}
@@ -122,7 +122,7 @@ public class DeliveryExpressTemplateServiceImpl implements DeliveryExpressTempla
expressTemplateChargeMapper.updateBatch(diffList.get(1));
}
if (CollUtil.isNotEmpty(diffList.get(2))) {
expressTemplateChargeMapper.deleteBatchIds(convertList(diffList.get(2), DeliveryExpressTemplateChargeDO::getId));
expressTemplateChargeMapper.deleteByIds(convertList(diffList.get(2), DeliveryExpressTemplateChargeDO::getId));
}
}
@@ -176,7 +176,7 @@ public class DeliveryExpressTemplateServiceImpl implements DeliveryExpressTempla
@Override
public List<DeliveryExpressTemplateDO> getDeliveryExpressTemplateList(Collection<Long> ids) {
return expressTemplateMapper.selectBatchIds(ids);
return expressTemplateMapper.selectByIds(ids);
}
@Override
@@ -205,7 +205,7 @@ public class DeliveryExpressTemplateServiceImpl implements DeliveryExpressTempla
if (CollUtil.isEmpty(ids)) {
return Collections.emptyMap();
}
List<DeliveryExpressTemplateDO> templateList = expressTemplateMapper.selectBatchIds(ids);
List<DeliveryExpressTemplateDO> templateList = expressTemplateMapper.selectByIds(ids);
// 查询 templateCharge 数组
List<DeliveryExpressTemplateChargeDO> chargeList = expressTemplateChargeMapper.selectByTemplateIds(ids);
// 查询 templateFree 数组

View File

@@ -75,7 +75,7 @@ public class DeliveryPickUpStoreServiceImpl implements DeliveryPickUpStoreServic
@Override
public List<DeliveryPickUpStoreDO> getDeliveryPickUpStoreList(Collection<Long> ids) {
return deliveryPickUpStoreMapper.selectBatchIds(ids);
return deliveryPickUpStoreMapper.selectByIds(ids);
}
@Override

View File

@@ -84,7 +84,7 @@ public class TradeOrderQueryServiceImpl implements TradeOrderQueryService {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
return tradeOrderMapper.selectBatchIds(ids);
return tradeOrderMapper.selectByIds(ids);
}
@Override

View File

@@ -25,6 +25,9 @@ import cn.iocoder.yudao.module.pay.enums.order.PayOrderStatusEnum;
import cn.iocoder.yudao.module.pay.enums.refund.PayRefundStatusEnum;
import cn.iocoder.yudao.module.product.api.comment.ProductCommentApi;
import cn.iocoder.yudao.module.product.api.comment.dto.ProductCommentCreateReqDTO;
import cn.iocoder.yudao.module.promotion.api.combination.CombinationRecordApi;
import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordRespDTO;
import cn.iocoder.yudao.module.promotion.enums.combination.CombinationRecordStatusEnum;
import cn.iocoder.yudao.module.system.api.social.SocialClientApi;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxaSubscribeMessageSendReqDTO;
import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderDeliveryReqVO;
@@ -121,6 +124,8 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
public SocialClientApi socialClientApi;
@Resource
public PayRefundApi payRefundApi;
@Resource
private CombinationRecordApi combinationRecordApi;
@Resource
private TradeOrderProperties tradeOrderProperties;
@@ -422,7 +427,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
.addMessage("phrase6", TradeOrderStatusEnum.DELIVERED.getName()) // 订单状态
.addMessage("date4", LocalDateTimeUtil.formatNormal(LocalDateTime.now()))// 发货时间
.addMessage("character_string5", StrUtil.blankToDefault(deliveryReqVO.getLogisticsNo(), "-")) // 快递单号
.addMessage("thing9", order.getReceiverDetailAddress())).getCheckedData(); // 收货地址
.addMessage("thing9", order.getReceiverDetailAddress())).checkError(); // 收货地址
}
/**
@@ -775,6 +780,14 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
if (ObjUtil.notEqual(DeliveryTypeEnum.PICK_UP.getType(), order.getDeliveryType())) {
throw exception(ORDER_RECEIVE_FAIL_DELIVERY_TYPE_NOT_PICK_UP);
}
// 情况一:如果是拼团订单,则校验拼团是否成功
if (TradeOrderTypeEnum.isCombination(order.getType())) {
CombinationRecordRespDTO combinationRecord = combinationRecordApi.getCombinationRecordByOrderId(
order.getUserId(), order.getId()).getCheckedData();
if (!CombinationRecordStatusEnum.isSuccess(combinationRecord.getStatus())) {
throw exception(ORDER_PICK_UP_FAIL_COMBINATION_NOT_SUCCESS);
}
}
DeliveryPickUpStoreDO deliveryPickUpStore = pickUpStoreService.getDeliveryPickUpStore(order.getPickUpStoreId());
if (deliveryPickUpStore == null
|| !CollUtil.contains(deliveryPickUpStore.getVerifyUserIds(), userId)) {