diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/point/vo/product/PointProductPageReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/point/vo/product/PointProductPageReqVO.java deleted file mode 100644 index d94654e0e..000000000 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/point/vo/product/PointProductPageReqVO.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.iocoder.yudao.module.promotion.controller.admin.point.vo.product; - -import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.ToString; -import org.springframework.format.annotation.DateTimeFormat; - -import java.time.LocalDateTime; - -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -@Schema(description = "管理后台 - 积分商城商品分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class PointProductPageReqVO extends PageParam { - - @Schema(description = "积分商城活动 id", example = "29388") - private Long activityId; - - @Schema(description = "商品 SPU 编号", example = "8112") - private Long spuId; - - @Schema(description = "商品 SKU 编号", example = "2736") - private Long skuId; - - @Schema(description = "可兑换数量", example = "3926") - private Integer maxCount; - - @Schema(description = "兑换积分") - private Integer point; - - @Schema(description = "兑换金额,单位:分", example = "15860") - private Integer price; - - @Schema(description = "兑换类型", example = "2") - private Integer type; - - @Schema(description = "积分商城商品状态", example = "2") - private Integer activityStatus; - - @Schema(description = "创建时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] createTime; - -} \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/point/PointProductMapper.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/point/PointProductMapper.java index a0869b6da..cfa10a515 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/point/PointProductMapper.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/point/PointProductMapper.java @@ -1,9 +1,6 @@ package cn.iocoder.yudao.module.promotion.dal.mysql.point; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; -import cn.iocoder.yudao.module.promotion.controller.admin.point.vo.product.PointProductPageReqVO; import cn.iocoder.yudao.module.promotion.dal.dataobject.point.PointProductDO; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import org.apache.ibatis.annotations.Mapper; @@ -19,18 +16,6 @@ import java.util.List; @Mapper public interface PointProductMapper extends BaseMapperX { - default PageResult selectPage(PointProductPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(PointProductDO::getActivityId, reqVO.getActivityId()) - .eqIfPresent(PointProductDO::getSpuId, reqVO.getSpuId()) - .eqIfPresent(PointProductDO::getSkuId, reqVO.getSkuId()) - .eqIfPresent(PointProductDO::getPoint, reqVO.getPoint()) - .eqIfPresent(PointProductDO::getPrice, reqVO.getPrice()) - .eqIfPresent(PointProductDO::getActivityStatus, reqVO.getActivityStatus()) - .betweenIfPresent(PointProductDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(PointProductDO::getId)); - } - default List selectListByActivityId(Collection activityIds) { return selectList(PointProductDO::getActivityId, activityIds); } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/point/PointActivityServiceImpl.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/point/PointActivityServiceImpl.java index 54b017de6..bb7e88afb 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/point/PointActivityServiceImpl.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/point/PointActivityServiceImpl.java @@ -51,12 +51,6 @@ public class PointActivityServiceImpl implements PointActivityService { @Resource private ProductSkuApi productSkuApi; - private static List buildPointProductDO(PointActivityDO pointActivity, List products) { - return BeanUtils.toBean(products, PointProductDO.class, product -> { - product.setActivityId(pointActivity.getId()).setActivityStatus(pointActivity.getStatus()); - }); - } - @Override public Long createPointActivity(PointActivitySaveReqVO createReqVO) { // 1.1 校验商品是否存在 @@ -72,10 +66,14 @@ public class PointActivityServiceImpl implements PointActivityService { pointActivityMapper.insert(pointActivity); // 2.2 插入积分商城活动商品 pointProductMapper.insertBatch(buildPointProductDO(pointActivity, createReqVO.getProducts())); - // 返回 return pointActivity.getId(); } + private static List buildPointProductDO(PointActivityDO pointActivity, List products) { + return BeanUtils.toBean(products, PointProductDO.class, product -> + product.setActivityId(pointActivity.getId()).setActivityStatus(pointActivity.getStatus())); + } + @Override public void updatePointActivity(PointActivitySaveReqVO updateReqVO) { // 1.1 校验存在