From 17fa59249b8cd71ce8ceac2699c8b928af929db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Thu, 8 Aug 2024 09:33:07 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=B7=BB=E5=8A=A0=E8=BF=94=E5=9B=9E=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=B1=BB=E5=88=ABID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trade/controller/app/base/spu/AppProductSpuBaseRespVO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/spu/AppProductSpuBaseRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/spu/AppProductSpuBaseRespVO.java index a0e1bc670..d30417818 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/spu/AppProductSpuBaseRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/spu/AppProductSpuBaseRespVO.java @@ -22,4 +22,7 @@ public class AppProductSpuBaseRespVO { @Schema(description = "商品主图地址", example = "https://www.iocoder.cn/xx.png") private String picUrl; + @Schema(description = "商品分类编号", example = "1") + private Long categoryId; + } From 04fdc70f582bc869495c07d8178c8732eaa64dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Thu, 8 Aug 2024 14:13:09 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E5=9B=9E=E6=94=B6=E5=90=8E=EF=BC=8C=E9=A2=86=E5=8F=96?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E5=92=8C=E5=89=A9=E4=BD=99=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E4=B8=8D=E6=9B=B4=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/promotion/service/coupon/CouponServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java index 1ce9d6959..82402d3f4 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java @@ -140,8 +140,8 @@ public class CouponServiceImpl implements CouponService { if (deleteCount == 0) { throw exception(COUPON_DELETE_FAIL_USED); } - // 减少优惠劵模板的领取数量 -1 - couponTemplateService.updateCouponTemplateTakeCount(id, -1); + // 传入优惠券模板ID,减少优惠劵模板的领取数量 -1 + couponTemplateService.updateCouponTemplateTakeCount(couponMapper.selectById(id).getTemplateId(), -1); } @Override From 960668787845afeebabf97378ea0835a08d0225f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Thu, 8 Aug 2024 15:17:35 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E5=9B=9E=E6=94=B6=E5=90=8E=EF=BC=8C=E9=A2=86=E5=8F=96?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E5=92=8C=E5=89=A9=E4=BD=99=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E4=B8=8D=E6=9B=B4=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/promotion/dal/dataobject/coupon/CouponDO.java | 2 ++ .../module/promotion/service/coupon/CouponServiceImpl.java | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/coupon/CouponDO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/coupon/CouponDO.java index 31cef2e78..296d2a2fd 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/coupon/CouponDO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/coupon/CouponDO.java @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.promotion.enums.coupon.CouponStatusEnum; import cn.iocoder.yudao.module.promotion.enums.coupon.CouponTakeTypeEnum; import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -30,6 +31,7 @@ public class CouponDO extends BaseDO { /** * 优惠劵编号 */ + @TableId private Long id; /** * 优惠劵模板编号 diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java index 82402d3f4..6b1b0b64d 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java @@ -25,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import jakarta.annotation.Resource; + import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; @@ -134,6 +135,8 @@ public class CouponServiceImpl implements CouponService { // 校验存在 validateCouponExists(id); + // 查询优惠券信息 + CouponDO couponDO = couponMapper.selectById(id); // 更新优惠劵 int deleteCount = couponMapper.delete(id, asList(CouponStatusEnum.UNUSED.getStatus(), CouponStatusEnum.EXPIRE.getStatus())); @@ -141,7 +144,7 @@ public class CouponServiceImpl implements CouponService { throw exception(COUPON_DELETE_FAIL_USED); } // 传入优惠券模板ID,减少优惠劵模板的领取数量 -1 - couponTemplateService.updateCouponTemplateTakeCount(couponMapper.selectById(id).getTemplateId(), -1); + couponTemplateService.updateCouponTemplateTakeCount(couponDO.getTemplateId(), -1); } @Override From a86ce73542c2bdc5af8817afbcf6c901ab90af70 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 8 Aug 2024 23:35:20 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91=E5=95=86=E5=9F=8E=EF=BC=9A=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E5=9B=9E=E6=94=B6=E4=B9=8B=E5=90=8E=EF=BC=8C=E9=A2=86?= =?UTF-8?q?=E5=8F=96=E6=95=B0=E9=87=8F=E5=92=8C=E5=89=A9=E4=BD=99=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E7=9A=84=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/coupon/CouponServiceImpl.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java index 6b1b0b64d..abf933d83 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/coupon/CouponServiceImpl.java @@ -133,18 +133,17 @@ public class CouponServiceImpl implements CouponService { @Transactional public void deleteCoupon(Long id) { // 校验存在 - validateCouponExists(id); + CouponDO coupon = validateCouponExists(id); - // 查询优惠券信息 - CouponDO couponDO = couponMapper.selectById(id); // 更新优惠劵 int deleteCount = couponMapper.delete(id, asList(CouponStatusEnum.UNUSED.getStatus(), CouponStatusEnum.EXPIRE.getStatus())); if (deleteCount == 0) { throw exception(COUPON_DELETE_FAIL_USED); } - // 传入优惠券模板ID,减少优惠劵模板的领取数量 -1 - couponTemplateService.updateCouponTemplateTakeCount(couponDO.getTemplateId(), -1); + + // 减少优惠劵模板的领取数量 -1 + couponTemplateService.updateCouponTemplateTakeCount(coupon.getTemplateId(), -1); } @Override @@ -152,10 +151,12 @@ public class CouponServiceImpl implements CouponService { return couponMapper.selectListByUserIdAndStatus(userId, status); } - private void validateCouponExists(Long id) { - if (couponMapper.selectById(id) == null) { + private CouponDO validateCouponExists(Long id) { + CouponDO coupon = couponMapper.selectById(id); + if (coupon == null) { throw exception(COUPON_NOT_EXISTS); } + return coupon; } @Override From 664abe70626acf5a0e23439f6e900c1803427784 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 14 Aug 2024 00:44:14 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E6=97=B6=E5=85=81=E8=AE=B8=E9=80=89=E6=8B=A9=E5=B7=B2?= =?UTF-8?q?=E6=9C=89=E7=9A=84=E5=B1=9E=E6=80=A7=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/property/ProductPropertyController.java | 11 +++++++++++ .../property/ProductPropertyValueController.java | 13 +++++++++++++ .../dal/dataobject/property/ProductPropertyDO.java | 4 ---- .../service/property/ProductPropertyService.java | 7 +++++++ .../property/ProductPropertyServiceImpl.java | 5 +++++ 5 files changed, 36 insertions(+), 4 deletions(-) diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java index fed5d8d69..1ff2d9c4b 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java @@ -17,7 +17,10 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; @Tag(name = "管理后台 - 商品属性项") @RestController @@ -69,4 +72,12 @@ public class ProductPropertyController { return success(BeanUtils.toBean(pageResult, ProductPropertyRespVO.class)); } + @GetMapping("/simple-list") + @Operation(summary = "获得属性项精简列表") + public CommonResult> getPropertySimpleList() { + List list = productPropertyService.getPropertyList(); + return success(convertList(list, property -> new ProductPropertyRespVO() // 只返回 id、name 属性 + .setId(property.getId()).setName(property.getName()))); + } + } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyValueController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyValueController.java index 4a613fb1f..647df87a4 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyValueController.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyValueController.java @@ -17,7 +17,11 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.List; + import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.singleton; @Tag(name = "管理后台 - 商品属性值") @RestController @@ -69,4 +73,13 @@ public class ProductPropertyValueController { return success(BeanUtils.toBean(pageResult, ProductPropertyValueRespVO.class)); } + @GetMapping("/simple-list") + @Operation(summary = "获得属性值精简列表") + @Parameter(name = "propertyId", description = "属性项编号", required = true, example = "1024") + public CommonResult> getPropertyValueSimpleList(@RequestParam("propertyId") Long propertyId) { + List list = productPropertyValueService.getPropertyValueListByPropertyId(singleton(propertyId)); + return success(convertList(list, value -> new ProductPropertyValueRespVO() // 只返回 id、name 属性 + .setId(value.getId()).setName(value.getName()))); + } + } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/property/ProductPropertyDO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/property/ProductPropertyDO.java index 8cc646bd5..d23a828ea 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/property/ProductPropertyDO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/property/ProductPropertyDO.java @@ -39,10 +39,6 @@ public class ProductPropertyDO extends BaseDO { * 名称 */ private String name; - /** - * 状态 - */ - private Integer status; /** * 备注 */ diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyService.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyService.java index fe14cd7a7..087213618 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyService.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyService.java @@ -62,4 +62,11 @@ public interface ProductPropertyService { */ List getPropertyList(Collection ids); + /** + * 获得指定状态的属性项列表 + * + * @return 属性项列表 + */ + List getPropertyList(); + } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyServiceImpl.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyServiceImpl.java index 4747b1703..6c1d32815 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyServiceImpl.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyServiceImpl.java @@ -109,4 +109,9 @@ public class ProductPropertyServiceImpl implements ProductPropertyService { return productPropertyMapper.selectBatchIds(ids); } + @Override + public List getPropertyList() { + return productPropertyMapper.selectList(); + } + } From 5d5d5c33f56479e45fc5cff5b87afacab53b5951 Mon Sep 17 00:00:00 2001 From: Cyrix66 <120878696@qq.com> Date: Tue, 13 Aug 2024 17:00:19 +0000 Subject: [PATCH 6/9] =?UTF-8?q?update=20sql/mysql/ruoyi-vue-pro.sql.=20?= =?UTF-8?q?=E6=AD=A4PR=E5=90=8C=E6=88=91=E4=B9=8B=E5=89=8D=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E7=9A=84#1029=E5=8F=B7PR=EF=BC=8C=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E3=80=90system=5Fmenu=E3=80=91=E8=8F=9C=E5=8D=95=E7=9A=84=20AI?= =?UTF-8?q?=20=E9=9F=B3=E4=B9=90=E7=9A=84=E7=BB=84=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=91=BD=E5=90=8D=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://gitee.com/zhijiantianya/ruoyi-vue-pro/pulls/1029 Signed-off-by: Cyrix66 <120878696@qq.com> --- sql/mysql/ruoyi-vue-pro.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mysql/ruoyi-vue-pro.sql b/sql/mysql/ruoyi-vue-pro.sql index ccc8dfcde..274e17a5e 100644 --- a/sql/mysql/ruoyi-vue-pro.sql +++ b/sql/mysql/ruoyi-vue-pro.sql @@ -1961,7 +1961,7 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2793, '写作管理', '', 2, 13, 2760, 'write', 'fa:bookmark-o', 'ai/write/manager/index.vue', 'AiWriteManager', 0, b'1', b'1', b'1', '', '2024-07-10 13:24:34', '1', '2024-07-10 21:31:59', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2794, 'AI 写作查询', 'ai:write:query', 3, 1, 2793, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2024-07-10 13:24:34', '', '2024-07-10 13:24:34', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2795, 'AI 写作删除', 'ai:write:delete', 3, 4, 2793, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2024-07-10 13:24:34', '', '2024-07-10 13:24:34', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2796, 'AI 音乐', '', 2, 4, 2758, 'music', 'fa:music', 'ai/music/index/index.vue', 'AiWrite', 0, b'1', b'1', b'1', '1', '2024-07-17 09:21:12', '1', '2024-07-17 09:36:12', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2796, 'AI 音乐', '', 2, 4, 2758, 'music', 'fa:music', 'ai/music/index/index.vue', 'AiMusic', 0, b'1', b'1', b'1', '1', '2024-07-17 09:21:12', '1', '2024-07-17 09:36:12', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2797, '客服中心', '', 2, 100, 2362, 'kefu', 'fa-solid:user-alt', 'mall/promotion/kefu/index', 'KeFu', 0, b'1', b'1', b'1', '1', '2024-07-17 23:49:05', '1', '2024-07-17 23:49:16', b'0'); COMMIT; From 9af286693f995fb80704ab9156f0bdc620491bd6 Mon Sep 17 00:00:00 2001 From: Ordinary Date: Sun, 11 Aug 2024 00:11:49 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E3=80=91=E5=95=86=E5=9F=8E=EF=BC=9A=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=95=86=E5=93=81=E9=A1=B9=E5=9B=BE=E7=89=87=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E4=B8=B2=E6=97=B6=EF=BC=8C=E8=AE=A2=E5=8D=95=E9=A1=B9=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E4=BD=BF=E7=94=A8SPU=E5=9B=BE=E7=89=87=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/price/calculator/TradePriceCalculatorHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradePriceCalculatorHelper.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradePriceCalculatorHelper.java index 2862012af..891f1e0dc 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradePriceCalculatorHelper.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradePriceCalculatorHelper.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.trade.service.price.calculator; import cn.hutool.core.lang.Assert; +import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuRespDTO; import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; @@ -61,7 +62,7 @@ public class TradePriceCalculatorHelper { orderItem.setSpuName(spu.getName()).setCategoryId(spu.getCategoryId()) .setDeliveryTemplateId(spu.getDeliveryTemplateId()) .setGivePoint(spu.getGiveIntegral()).setUsePoint(0); - if (orderItem.getPicUrl() == null) { + if (StrUtil.isBlank(orderItem.getPicUrl())) { orderItem.setPicUrl(spu.getPicUrl()); } }); @@ -240,7 +241,7 @@ public class TradePriceCalculatorHelper { * * 和 {@link #dividePrice(List, Integer)} 逻辑一致,只是传入的是 TradeOrderItemDO 对象 * - * @param items 订单项 + * @param items 订单项 * @param price 订单支付金额 * @return 分摊金额数组,和传入的 orderItems 一一对应 */ From d2c7ec24459d25382aa61726e02f3ad007792173 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 18 Aug 2024 13:02:14 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E3=80=91=E5=95=86=E5=9F=8E=EF=BC=9A=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E6=9F=A5=E8=AF=A2=EF=BC=8C=E6=94=AF=E6=8C=81?= =?UTF-8?q?=20userId=20=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/aftersale/vo/AfterSalePageReqVO.java | 3 +++ .../module/trade/dal/mysql/aftersale/AfterSaleMapper.java | 1 + 2 files changed, 4 insertions(+) diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/AfterSalePageReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/AfterSalePageReqVO.java index f74c84b8f..4b8756c7b 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/AfterSalePageReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/AfterSalePageReqVO.java @@ -21,6 +21,9 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @ToString(callSuper = true) public class AfterSalePageReqVO extends PageParam { + @Schema(description = "用户编号", example = "1024") + private Long userId; + @Schema(description = "售后流水号", example = "202211190847450020500077") private String no; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/aftersale/AfterSaleMapper.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/aftersale/AfterSaleMapper.java index 68a09a82a..341dabc45 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/aftersale/AfterSaleMapper.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/aftersale/AfterSaleMapper.java @@ -16,6 +16,7 @@ public interface AfterSaleMapper extends BaseMapperX { default PageResult selectPage(AfterSalePageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(AfterSaleDO::getUserId, reqVO.getUserId()) .likeIfPresent(AfterSaleDO::getNo, reqVO.getNo()) .eqIfPresent(AfterSaleDO::getStatus, reqVO.getStatus()) .eqIfPresent(AfterSaleDO::getType, reqVO.getType()) From cd101ec7fc876e6b62b289b9603d260896ef9bd6 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 18 Aug 2024 13:07:30 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E3=80=91=E6=94=AF=E4=BB=98=EF=BC=9A=E9=92=B1=E5=8C=85?= =?UTF-8?q?=E4=BD=99=E9=A2=9D=EF=BC=8C=E6=94=AF=E6=8C=81=20userId=20?= =?UTF-8?q?=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transaction/PayWalletTransactionPageReqVO.java | 11 ++++++++++- .../wallet/PayWalletTransactionServiceImpl.java | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/transaction/PayWalletTransactionPageReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/transaction/PayWalletTransactionPageReqVO.java index 678649ce0..7491b9e50 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/transaction/PayWalletTransactionPageReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/transaction/PayWalletTransactionPageReqVO.java @@ -1,6 +1,8 @@ package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction; +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.validation.InEnum; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -8,7 +10,14 @@ import lombok.Data; @Data public class PayWalletTransactionPageReqVO extends PageParam { - @Schema(description = "钱包编号", example = "1") + @Schema(description = "钱包编号", example = "888") private Long walletId; + @Schema(description = "用户编号", example = "1024") + private Long userId; + + @Schema(description = "用户类型", example = "1") + @InEnum(UserTypeEnum.class) + private Integer userType; + } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletTransactionServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletTransactionServiceImpl.java index 76450c501..a2f3d92d6 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletTransactionServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletTransactionServiceImpl.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.pay.service.wallet; +import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction.PayWalletTransactionPageReqVO; import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO; @@ -11,12 +12,11 @@ import cn.iocoder.yudao.module.pay.dal.mysql.wallet.PayWalletTransactionMapper; import cn.iocoder.yudao.module.pay.dal.redis.no.PayNoRedisDAO; import cn.iocoder.yudao.module.pay.enums.wallet.PayWalletBizTypeEnum; import cn.iocoder.yudao.module.pay.service.wallet.bo.WalletTransactionCreateReqBO; +import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; -import jakarta.annotation.Resource; - import java.time.LocalDateTime; import static cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO.TYPE_EXPENSE; @@ -53,6 +53,16 @@ public class PayWalletTransactionServiceImpl implements PayWalletTransactionServ @Override public PageResult getWalletTransactionPage(PayWalletTransactionPageReqVO pageVO) { + // 基于 userId + userType 查询钱包 + if (pageVO.getWalletId() == null + && ObjectUtil.isAllNotEmpty(pageVO.getUserId(), pageVO.getUserType())) { + PayWalletDO wallet = payWalletService.getOrCreateWallet(pageVO.getUserId(), pageVO.getUserType()); + if (wallet != null) { + pageVO.setWalletId(wallet.getId()); + } + } + + // 查询分页 return payWalletTransactionMapper.selectPage(pageVO.getWalletId(), null, pageVO, null); }