Commit 6a80d7c75f3ead3a3aa1f48f5ba99d7865bf3721

Authored by YunaiV
2 parents 7f70b1fe cd101ec7

Merge branch 'master-jdk17' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into develop

Showing 14 changed files with 79 additions and 14 deletions
sql/mysql/ruoyi-vue-pro.sql
@@ -1961,7 +1961,7 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i @@ -1961,7 +1961,7 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i
1961 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'); 1961 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');
1962 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'); 1962 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');
1963 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'); 1963 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');
1964 -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'); 1964 +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');
1965 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'); 1965 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');
1966 COMMIT; 1966 COMMIT;
1967 1967
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; @@ -17,7 +17,10 @@ import org.springframework.security.access.prepost.PreAuthorize;
17 import org.springframework.validation.annotation.Validated; 17 import org.springframework.validation.annotation.Validated;
18 import org.springframework.web.bind.annotation.*; 18 import org.springframework.web.bind.annotation.*;
19 19
  20 +import java.util.List;
  21 +
20 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; 22 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  23 +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
21 24
22 @Tag(name = "管理后台 - 商品属性项") 25 @Tag(name = "管理后台 - 商品属性项")
23 @RestController 26 @RestController
@@ -69,4 +72,12 @@ public class ProductPropertyController { @@ -69,4 +72,12 @@ public class ProductPropertyController {
69 return success(BeanUtils.toBean(pageResult, ProductPropertyRespVO.class)); 72 return success(BeanUtils.toBean(pageResult, ProductPropertyRespVO.class));
70 } 73 }
71 74
  75 + @GetMapping("/simple-list")
  76 + @Operation(summary = "获得属性项精简列表")
  77 + public CommonResult<List<ProductPropertyRespVO>> getPropertySimpleList() {
  78 + List<ProductPropertyDO> list = productPropertyService.getPropertyList();
  79 + return success(convertList(list, property -> new ProductPropertyRespVO() // 只返回 id、name 属性
  80 + .setId(property.getId()).setName(property.getName())));
  81 + }
  82 +
72 } 83 }
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; @@ -17,7 +17,11 @@ import org.springframework.security.access.prepost.PreAuthorize;
17 import org.springframework.validation.annotation.Validated; 17 import org.springframework.validation.annotation.Validated;
18 import org.springframework.web.bind.annotation.*; 18 import org.springframework.web.bind.annotation.*;
19 19
  20 +import java.util.List;
  21 +
20 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; 22 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  23 +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
  24 +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.singleton;
21 25
22 @Tag(name = "管理后台 - 商品属性值") 26 @Tag(name = "管理后台 - 商品属性值")
23 @RestController 27 @RestController
@@ -69,4 +73,13 @@ public class ProductPropertyValueController { @@ -69,4 +73,13 @@ public class ProductPropertyValueController {
69 return success(BeanUtils.toBean(pageResult, ProductPropertyValueRespVO.class)); 73 return success(BeanUtils.toBean(pageResult, ProductPropertyValueRespVO.class));
70 } 74 }
71 75
  76 + @GetMapping("/simple-list")
  77 + @Operation(summary = "获得属性值精简列表")
  78 + @Parameter(name = "propertyId", description = "属性项编号", required = true, example = "1024")
  79 + public CommonResult<List<ProductPropertyValueRespVO>> getPropertyValueSimpleList(@RequestParam("propertyId") Long propertyId) {
  80 + List<ProductPropertyValueDO> list = productPropertyValueService.getPropertyValueListByPropertyId(singleton(propertyId));
  81 + return success(convertList(list, value -> new ProductPropertyValueRespVO() // 只返回 id、name 属性
  82 + .setId(value.getId()).setName(value.getName())));
  83 + }
  84 +
72 } 85 }
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/property/ProductPropertyDO.java
@@ -40,10 +40,6 @@ public class ProductPropertyDO extends BaseDO { @@ -40,10 +40,6 @@ public class ProductPropertyDO extends BaseDO {
40 */ 40 */
41 private String name; 41 private String name;
42 /** 42 /**
43 - * 状态  
44 - */  
45 - private Integer status;  
46 - /**  
47 * 备注 43 * 备注
48 */ 44 */
49 private String remark; 45 private String remark;
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 { @@ -62,4 +62,11 @@ public interface ProductPropertyService {
62 */ 62 */
63 List<ProductPropertyDO> getPropertyList(Collection<Long> ids); 63 List<ProductPropertyDO> getPropertyList(Collection<Long> ids);
64 64
  65 + /**
  66 + * 获得指定状态的属性项列表
  67 + *
  68 + * @return 属性项列表
  69 + */
  70 + List<ProductPropertyDO> getPropertyList();
  71 +
65 } 72 }
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 { @@ -109,4 +109,9 @@ public class ProductPropertyServiceImpl implements ProductPropertyService {
109 return productPropertyMapper.selectBatchIds(ids); 109 return productPropertyMapper.selectBatchIds(ids);
110 } 110 }
111 111
  112 + @Override
  113 + public List<ProductPropertyDO> getPropertyList() {
  114 + return productPropertyMapper.selectList();
  115 + }
  116 +
112 } 117 }
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; @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.promotion.enums.coupon.CouponStatusEnum;
8 import cn.iocoder.yudao.module.promotion.enums.coupon.CouponTakeTypeEnum; 8 import cn.iocoder.yudao.module.promotion.enums.coupon.CouponTakeTypeEnum;
9 import com.baomidou.mybatisplus.annotation.KeySequence; 9 import com.baomidou.mybatisplus.annotation.KeySequence;
10 import com.baomidou.mybatisplus.annotation.TableField; 10 import com.baomidou.mybatisplus.annotation.TableField;
  11 +import com.baomidou.mybatisplus.annotation.TableId;
11 import com.baomidou.mybatisplus.annotation.TableName; 12 import com.baomidou.mybatisplus.annotation.TableName;
12 import lombok.Data; 13 import lombok.Data;
13 import lombok.EqualsAndHashCode; 14 import lombok.EqualsAndHashCode;
@@ -30,6 +31,7 @@ public class CouponDO extends BaseDO { @@ -30,6 +31,7 @@ public class CouponDO extends BaseDO {
30 /** 31 /**
31 * 优惠劵编号 32 * 优惠劵编号
32 */ 33 */
  34 + @TableId
33 private Long id; 35 private Long id;
34 /** 36 /**
35 * 优惠劵模板编号 37 * 优惠劵模板编号
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; @@ -25,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
25 import org.springframework.validation.annotation.Validated; 25 import org.springframework.validation.annotation.Validated;
26 26
27 import jakarta.annotation.Resource; 27 import jakarta.annotation.Resource;
  28 +
28 import java.time.LocalDateTime; 29 import java.time.LocalDateTime;
29 import java.util.*; 30 import java.util.*;
30 import java.util.stream.Collectors; 31 import java.util.stream.Collectors;
@@ -132,7 +133,7 @@ public class CouponServiceImpl implements CouponService { @@ -132,7 +133,7 @@ public class CouponServiceImpl implements CouponService {
132 @Transactional 133 @Transactional
133 public void deleteCoupon(Long id) { 134 public void deleteCoupon(Long id) {
134 // 校验存在 135 // 校验存在
135 - validateCouponExists(id); 136 + CouponDO coupon = validateCouponExists(id);
136 137
137 // 更新优惠劵 138 // 更新优惠劵
138 int deleteCount = couponMapper.delete(id, 139 int deleteCount = couponMapper.delete(id,
@@ -140,8 +141,9 @@ public class CouponServiceImpl implements CouponService { @@ -140,8 +141,9 @@ public class CouponServiceImpl implements CouponService {
140 if (deleteCount == 0) { 141 if (deleteCount == 0) {
141 throw exception(COUPON_DELETE_FAIL_USED); 142 throw exception(COUPON_DELETE_FAIL_USED);
142 } 143 }
  144 +
143 // 减少优惠劵模板的领取数量 -1 145 // 减少优惠劵模板的领取数量 -1
144 - couponTemplateService.updateCouponTemplateTakeCount(id, -1); 146 + couponTemplateService.updateCouponTemplateTakeCount(coupon.getTemplateId(), -1);
145 } 147 }
146 148
147 @Override 149 @Override
@@ -149,10 +151,12 @@ public class CouponServiceImpl implements CouponService { @@ -149,10 +151,12 @@ public class CouponServiceImpl implements CouponService {
149 return couponMapper.selectListByUserIdAndStatus(userId, status); 151 return couponMapper.selectListByUserIdAndStatus(userId, status);
150 } 152 }
151 153
152 - private void validateCouponExists(Long id) {  
153 - if (couponMapper.selectById(id) == null) { 154 + private CouponDO validateCouponExists(Long id) {
  155 + CouponDO coupon = couponMapper.selectById(id);
  156 + if (coupon == null) {
154 throw exception(COUPON_NOT_EXISTS); 157 throw exception(COUPON_NOT_EXISTS);
155 } 158 }
  159 + return coupon;
156 } 160 }
157 161
158 @Override 162 @Override
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_ @@ -21,6 +21,9 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
21 @ToString(callSuper = true) 21 @ToString(callSuper = true)
22 public class AfterSalePageReqVO extends PageParam { 22 public class AfterSalePageReqVO extends PageParam {
23 23
  24 + @Schema(description = "用户编号", example = "1024")
  25 + private Long userId;
  26 +
24 @Schema(description = "售后流水号", example = "202211190847450020500077") 27 @Schema(description = "售后流水号", example = "202211190847450020500077")
25 private String no; 28 private String no;
26 29
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 { @@ -22,4 +22,7 @@ public class AppProductSpuBaseRespVO {
22 @Schema(description = "商品主图地址", example = "https://www.iocoder.cn/xx.png") 22 @Schema(description = "商品主图地址", example = "https://www.iocoder.cn/xx.png")
23 private String picUrl; 23 private String picUrl;
24 24
  25 + @Schema(description = "商品分类编号", example = "1")
  26 + private Long categoryId;
  27 +
25 } 28 }
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&lt;AfterSaleDO&gt; { @@ -16,6 +16,7 @@ public interface AfterSaleMapper extends BaseMapperX&lt;AfterSaleDO&gt; {
16 16
17 default PageResult<AfterSaleDO> selectPage(AfterSalePageReqVO reqVO) { 17 default PageResult<AfterSaleDO> selectPage(AfterSalePageReqVO reqVO) {
18 return selectPage(reqVO, new LambdaQueryWrapperX<AfterSaleDO>() 18 return selectPage(reqVO, new LambdaQueryWrapperX<AfterSaleDO>()
  19 + .eqIfPresent(AfterSaleDO::getUserId, reqVO.getUserId())
19 .likeIfPresent(AfterSaleDO::getNo, reqVO.getNo()) 20 .likeIfPresent(AfterSaleDO::getNo, reqVO.getNo())
20 .eqIfPresent(AfterSaleDO::getStatus, reqVO.getStatus()) 21 .eqIfPresent(AfterSaleDO::getStatus, reqVO.getStatus())
21 .eqIfPresent(AfterSaleDO::getType, reqVO.getType()) 22 .eqIfPresent(AfterSaleDO::getType, reqVO.getType())
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradePriceCalculatorHelper.java
1 package cn.iocoder.yudao.module.trade.service.price.calculator; 1 package cn.iocoder.yudao.module.trade.service.price.calculator;
2 2
3 import cn.hutool.core.lang.Assert; 3 import cn.hutool.core.lang.Assert;
  4 +import cn.hutool.core.util.StrUtil;
4 import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; 5 import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
5 import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuRespDTO; 6 import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuRespDTO;
6 import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; 7 import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO;
@@ -61,7 +62,7 @@ public class TradePriceCalculatorHelper { @@ -61,7 +62,7 @@ public class TradePriceCalculatorHelper {
61 orderItem.setSpuName(spu.getName()).setCategoryId(spu.getCategoryId()) 62 orderItem.setSpuName(spu.getName()).setCategoryId(spu.getCategoryId())
62 .setDeliveryTemplateId(spu.getDeliveryTemplateId()) 63 .setDeliveryTemplateId(spu.getDeliveryTemplateId())
63 .setGivePoint(spu.getGiveIntegral()).setUsePoint(0); 64 .setGivePoint(spu.getGiveIntegral()).setUsePoint(0);
64 - if (orderItem.getPicUrl() == null) { 65 + if (StrUtil.isBlank(orderItem.getPicUrl())) {
65 orderItem.setPicUrl(spu.getPicUrl()); 66 orderItem.setPicUrl(spu.getPicUrl());
66 } 67 }
67 }); 68 });
@@ -240,7 +241,7 @@ public class TradePriceCalculatorHelper { @@ -240,7 +241,7 @@ public class TradePriceCalculatorHelper {
240 * 241 *
241 * 和 {@link #dividePrice(List, Integer)} 逻辑一致,只是传入的是 TradeOrderItemDO 对象 242 * 和 {@link #dividePrice(List, Integer)} 逻辑一致,只是传入的是 TradeOrderItemDO 对象
242 * 243 *
243 - * @param items 订单项 244 + * @param items 订单项
244 * @param price 订单支付金额 245 * @param price 订单支付金额
245 * @return 分摊金额数组,和传入的 orderItems 一一对应 246 * @return 分摊金额数组,和传入的 orderItems 一一对应
246 */ 247 */
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/transaction/PayWalletTransactionPageReqVO.java
1 package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction; 1 package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction;
2 2
  3 +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
3 import cn.iocoder.yudao.framework.common.pojo.PageParam; 4 import cn.iocoder.yudao.framework.common.pojo.PageParam;
  5 +import cn.iocoder.yudao.framework.common.validation.InEnum;
4 import io.swagger.v3.oas.annotations.media.Schema; 6 import io.swagger.v3.oas.annotations.media.Schema;
5 import lombok.Data; 7 import lombok.Data;
6 8
@@ -8,7 +10,14 @@ import lombok.Data; @@ -8,7 +10,14 @@ import lombok.Data;
8 @Data 10 @Data
9 public class PayWalletTransactionPageReqVO extends PageParam { 11 public class PayWalletTransactionPageReqVO extends PageParam {
10 12
11 - @Schema(description = "钱包编号", example = "1") 13 + @Schema(description = "钱包编号", example = "888")
12 private Long walletId; 14 private Long walletId;
13 15
  16 + @Schema(description = "用户编号", example = "1024")
  17 + private Long userId;
  18 +
  19 + @Schema(description = "用户类型", example = "1")
  20 + @InEnum(UserTypeEnum.class)
  21 + private Integer userType;
  22 +
14 } 23 }
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletTransactionServiceImpl.java
1 package cn.iocoder.yudao.module.pay.service.wallet; 1 package cn.iocoder.yudao.module.pay.service.wallet;
2 2
  3 +import cn.hutool.core.util.ObjectUtil;
3 import cn.iocoder.yudao.framework.common.pojo.PageResult; 4 import cn.iocoder.yudao.framework.common.pojo.PageResult;
4 import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction.PayWalletTransactionPageReqVO; 5 import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.transaction.PayWalletTransactionPageReqVO;
5 import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO; 6 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; @@ -11,12 +12,11 @@ import cn.iocoder.yudao.module.pay.dal.mysql.wallet.PayWalletTransactionMapper;
11 import cn.iocoder.yudao.module.pay.dal.redis.no.PayNoRedisDAO; 12 import cn.iocoder.yudao.module.pay.dal.redis.no.PayNoRedisDAO;
12 import cn.iocoder.yudao.module.pay.enums.wallet.PayWalletBizTypeEnum; 13 import cn.iocoder.yudao.module.pay.enums.wallet.PayWalletBizTypeEnum;
13 import cn.iocoder.yudao.module.pay.service.wallet.bo.WalletTransactionCreateReqBO; 14 import cn.iocoder.yudao.module.pay.service.wallet.bo.WalletTransactionCreateReqBO;
  15 +import jakarta.annotation.Resource;
14 import lombok.extern.slf4j.Slf4j; 16 import lombok.extern.slf4j.Slf4j;
15 import org.springframework.stereotype.Service; 17 import org.springframework.stereotype.Service;
16 import org.springframework.validation.annotation.Validated; 18 import org.springframework.validation.annotation.Validated;
17 19
18 -import jakarta.annotation.Resource;  
19 -  
20 import java.time.LocalDateTime; 20 import java.time.LocalDateTime;
21 21
22 import static cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO.TYPE_EXPENSE; 22 import static cn.iocoder.yudao.module.pay.controller.app.wallet.vo.transaction.AppPayWalletTransactionPageReqVO.TYPE_EXPENSE;
@@ -53,6 +53,16 @@ public class PayWalletTransactionServiceImpl implements PayWalletTransactionServ @@ -53,6 +53,16 @@ public class PayWalletTransactionServiceImpl implements PayWalletTransactionServ
53 53
54 @Override 54 @Override
55 public PageResult<PayWalletTransactionDO> getWalletTransactionPage(PayWalletTransactionPageReqVO pageVO) { 55 public PageResult<PayWalletTransactionDO> getWalletTransactionPage(PayWalletTransactionPageReqVO pageVO) {
  56 + // 基于 userId + userType 查询钱包
  57 + if (pageVO.getWalletId() == null
  58 + && ObjectUtil.isAllNotEmpty(pageVO.getUserId(), pageVO.getUserType())) {
  59 + PayWalletDO wallet = payWalletService.getOrCreateWallet(pageVO.getUserId(), pageVO.getUserType());
  60 + if (wallet != null) {
  61 + pageVO.setWalletId(wallet.getId());
  62 + }
  63 + }
  64 +
  65 + // 查询分页
56 return payWalletTransactionMapper.selectPage(pageVO.getWalletId(), null, pageVO, null); 66 return payWalletTransactionMapper.selectPage(pageVO.getWalletId(), null, pageVO, null);
57 } 67 }
58 68