From ea6f32409226bf4b92c68ba2906e9727b07d1840 Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Mon, 10 Mar 2025 14:58:21 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E5=95=86=E6=88=B7?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/800pjcloudx_wallet.sql | 36 ++-- .../controller/SysUserFaceController.java | 2 - .../wallet/api/entity/MchManageEntity.java | 154 +++++++++--------- ...WalletRechargeApplyComposeServiceImpl.java | 38 +++-- .../WalletRechargeApplyServiceImpl.java | 17 +- .../main/resources/mapper/MchManageMapper.xml | 9 +- 6 files changed, 134 insertions(+), 122 deletions(-) diff --git a/db/800pjcloudx_wallet.sql b/db/800pjcloudx_wallet.sql index d6c3530fd..4b0156144 100644 --- a/db/800pjcloudx_wallet.sql +++ b/db/800pjcloudx_wallet.sql @@ -7,24 +7,24 @@ create database `pjcloudx_wallet` default character set utf8mb4 collate utf8mb4_ DROP TABLE IF EXISTS `mch_manage`; CREATE TABLE mch_manage ( - id bigint NOT NULL COMMENT '主键', - dept_id bigint NOT NULL COMMENT '绑定的部门id', - hard_group_id bigint COMMENT '设备分组id', - name varchar(64) NOT NULL COMMENT '商户名', - types varchar(64) NOT NULL COMMENT '店铺类型,逗号分隔', - logo_pic varchar(256) NOT NULL COMMENT '商户logo图片', - collection_code varchar(256) DEFAULT '' COMMENT '商户收款码,自动生成', - swiper_pic text DEFAULT NULL COMMENT '商户轮播图,逗号分隔', - phone varchar(128) DEFAULT '' COMMENT '商户手机号', - job_start_time time DEFAULT NULL COMMENT '商户开始营业时间', - job_end_time time DEFAULT NULL COMMENT '商户结束营业时间', - address_des varchar(256) DEFAULT NULL COMMENT '商户地址', - create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人', - create_time datetime DEFAULT NULL COMMENT '创建时间', - update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人', - update_time datetime DEFAULT NULL COMMENT '修改时间', - del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记', - tenant_id bigint DEFAULT NULL COMMENT '租户ID', + id bigint NOT NULL COMMENT '主键', + dept_id bigint NOT NULL COMMENT '绑定的部门id', + default_wallet_type_id bigint DEFAULT NULL COMMENT '商户默认使用的钱包类型', + hard_group_id bigint COMMENT '设备分组id', + name varchar(64) NOT NULL COMMENT '商户名', + types varchar(64) NOT NULL COMMENT '店铺类型,逗号分隔', + logo_pic varchar(256) NOT NULL COMMENT '商户logo图片', + collection_code varchar(256) DEFAULT '' COMMENT '商户收款码,自动生成', + swiper_pic text DEFAULT NULL COMMENT '商户轮播图,逗号分隔', + phone varchar(128) DEFAULT '' COMMENT '商户手机号', + job_time varchar(256) DEFAULT NULL COMMENT '商户营业时间', + address_des varchar(256) DEFAULT NULL COMMENT '商户地址', + create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人', + create_time datetime DEFAULT NULL COMMENT '创建时间', + update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人', + update_time datetime DEFAULT NULL COMMENT '修改时间', + del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记', + tenant_id bigint DEFAULT NULL COMMENT '租户ID', PRIMARY KEY (id) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 diff --git a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/controller/SysUserFaceController.java b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/controller/SysUserFaceController.java index 4388f5ed3..bb98b7853 100644 --- a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/controller/SysUserFaceController.java +++ b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/controller/SysUserFaceController.java @@ -10,8 +10,6 @@ import com.bsd.pjcloud.admin.api.entity.SysUserFaceEntity; import com.bsd.pjcloud.admin.api.vo.SysUserFaceVo; import com.bsd.pjcloud.admin.service.SysUserFaceService; import com.bsd.pjcloud.common.core.util.R; -import com.bsd.pjcloud.common.data.datascope.DataScope; -import com.bsd.pjcloud.common.data.datascope.DataScopeFuncEnum; import com.bsd.pjcloud.common.idempotent.annotation.Idempotent; import com.bsd.pjcloud.common.log.annotation.SysLog; import com.bsd.pjcloud.common.security.service.PjcloudUser; diff --git a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/entity/MchManageEntity.java b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/entity/MchManageEntity.java index eb00f4a3d..3401b983f 100644 --- a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/entity/MchManageEntity.java +++ b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/entity/MchManageEntity.java @@ -8,6 +8,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import com.bsd.pjcloud.common.core.util.TenantTable; + import java.time.LocalDateTime; import java.time.LocalTime; @@ -25,114 +26,113 @@ import java.time.LocalTime; public class MchManageEntity extends Model { - /** - * 主键 - */ + /** + * 主键 + */ @TableId(type = IdType.ASSIGN_ID) - @Schema(description="主键") + @Schema(description = "主键") private Long id; - /** - * 绑定的部门id - 商户的部门id - */ - @Schema(description="商户的部门id") + /** + * 绑定的部门id - 商户的部门id + */ + @Schema(description = "商户的部门id") private Long deptId; - /** - * 商户名 - */ - @Schema(description="商户名") + /** + * 默认使用的钱包类型 + */ + @Schema(description = "默认使用的钱包类型") + private Long defaultWalletTypeId; + + /** + * 商户名 + */ + @Schema(description = "商户名") private String name; - /** - * 店铺类型,逗号分隔 - */ - @Schema(description="店铺类型,逗号分隔") + /** + * 店铺类型,逗号分隔 + */ + @Schema(description = "店铺类型,逗号分隔") private String types; - /** - * 商户logo图片 - */ - @Schema(description="商户logo图片") + /** + * 商户logo图片 + */ + @Schema(description = "商户logo图片") private String logoPic; - /** - * 商户收款码,自动生成 - */ - @Schema(description="商户收款码,自动生成") + /** + * 商户收款码,自动生成 + */ + @Schema(description = "商户收款码,自动生成") private String collectionCode; - /** - * 商户轮播图,逗号分隔 - */ - @Schema(description="商户轮播图,逗号分隔") + /** + * 商户轮播图,逗号分隔 + */ + @Schema(description = "商户轮播图,逗号分隔") private String swiperPic; - /** - * 商户手机号 - */ - @Schema(description="商户手机号") + /** + * 商户手机号 + */ + @Schema(description = "商户手机号") private String phone; - /** - * 商户开始营业时间 - */ - @Schema(description="商户开始营业时间") - @JsonFormat(pattern = DatePattern.NORM_TIME_PATTERN) - private LocalTime jobStartTime; + /** + * 商户营业时间 + */ + @Schema(description = "商户营业时间") + private String jobTime; - /** - * 商户结束营业时间 - */ - @Schema(description="商户结束营业时间") - @JsonFormat(pattern = DatePattern.NORM_TIME_PATTERN) - private LocalTime jobEndTime; - /** - * 商户地址 - */ - @Schema(description="商户地址") + /** + * 商户地址 + */ + @Schema(description = "商户地址") private String addressDes; - /** - * 创建人 - */ - @TableField(fill = FieldFill.INSERT) - @Schema(description="创建人") + /** + * 创建人 + */ + @TableField(fill = FieldFill.INSERT) + @Schema(description = "创建人") private String createBy; - /** - * 创建时间 - */ - @TableField(fill = FieldFill.INSERT) - @Schema(description="创建时间") + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + @Schema(description = "创建时间") private LocalDateTime createTime; - /** - * 修改人 - */ - @TableField(fill = FieldFill.INSERT_UPDATE) - @Schema(description="修改人") + /** + * 修改人 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + @Schema(description = "修改人") private String updateBy; - /** - * 修改时间 - */ - @TableField(fill = FieldFill.INSERT_UPDATE) - @Schema(description="修改时间") + /** + * 修改时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + @Schema(description = "修改时间") private LocalDateTime updateTime; - /** - * 删除标记 - */ + /** + * 删除标记 + */ @TableLogic - @TableField(fill = FieldFill.INSERT) - @Schema(description="删除标记") + @TableField(fill = FieldFill.INSERT) + @Schema(description = "删除标记") private String delFlag; - /** - * 租户ID - */ - @Schema(description="租户ID") + /** + * 租户ID + */ + @Schema(description = "租户ID") private Long tenantId; } \ No newline at end of file diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyComposeServiceImpl.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyComposeServiceImpl.java index c32d96a46..01f46e362 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyComposeServiceImpl.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyComposeServiceImpl.java @@ -57,7 +57,7 @@ public class WalletRechargeApplyComposeServiceImpl implements WalletRechargeAppl Page resultVo = new Page<>(); List resultList = new ArrayList<>(); - // 刚刚倒入的数据 + // 刚刚导入的数据 String monthTimeStr = LocalDateTimeUtil.format(topUpApplyDetail.getImportTime(), DatePattern.NORM_MONTH_PATTERN); WalletRechargeImportDto importDto = new WalletRechargeImportDto(); importDto.setApplyId(dto.getId()); @@ -71,23 +71,25 @@ public class WalletRechargeApplyComposeServiceImpl implements WalletRechargeAppl // 本月 List monthList = walletTransactionMapper.selectCompare(dto.getBizType(), monthTimeStr, userIdList); List currentMonthList = new ArrayList<>(); - for (WalletRechargeImportVo v : userList) { - WalletRechargeApplySelectCompareVo item = new WalletRechargeApplySelectCompareVo(); - item.setUserId(v.getUserId()); - List targetList = monthList.stream().filter(i -> ObjectUtil.equals(i.getUserId(), v.getUserId())).toList(); - if (ObjectUtil.isNotEmpty(targetList)) { - WalletRechargeApplySelectCompareVo target = targetList.stream().findFirst().get(); - if (ObjectUtil.isNotEmpty(target)) { - item.setPrice(v.getPrice()); - Integer beforePrice = ObjectUtil.isEmpty(v.getBeforePrice()) ? 0 : v.getBeforePrice(); - item.setTotalPrice(v.getPrice() + beforePrice); + if (ObjectUtil.isNotEmpty(monthList)) { + for (WalletRechargeImportVo v : userList) { + WalletRechargeApplySelectCompareVo item = new WalletRechargeApplySelectCompareVo(); + item.setUserId(v.getUserId()); + List targetList = monthList.stream().filter(i -> ObjectUtil.equals(i.getUserId(), v.getUserId())).toList(); + if (ObjectUtil.isNotEmpty(targetList)) { + WalletRechargeApplySelectCompareVo target = targetList.stream().findFirst().get(); + if (ObjectUtil.isNotEmpty(target)) { + item.setPrice(v.getPrice()); + Integer beforePrice = ObjectUtil.isEmpty(v.getBeforePrice()) ? 0 : v.getBeforePrice(); + item.setTotalPrice(v.getPrice() + beforePrice); + } } + if (ObjectUtil.isAllEmpty(item.getPrice(), item.getTotalPrice())) { + item.setPrice(v.getPrice()); + item.setTotalPrice(v.getPrice()); + } + currentMonthList.add(item); } - if (ObjectUtil.isAllEmpty(item.getPrice(), item.getTotalPrice())) { - item.setPrice(v.getPrice()); - item.setTotalPrice(v.getPrice()); - } - currentMonthList.add(item); } compareMonthMap.put(monthTimeStr, currentMonthList); @@ -97,7 +99,9 @@ public class WalletRechargeApplyComposeServiceImpl implements WalletRechargeAppl List selectList = walletTransactionMapper.selectCompare(dto.getBizType(), v, userIdList); selectList.forEach(j -> { j.setMonthTimeStr(v); - WalletRechargeImportVo target = userList.stream().filter(i -> ObjectUtil.equals(i.getUserId(), j.getUserId())).findFirst().get(); + WalletRechargeImportVo target = userList.stream() + .filter(i -> ObjectUtil.equals(i.getUserId(), j.getUserId())) + .findFirst().get(); if (ObjectUtil.isNotEmpty(target) && ObjectUtil.isNotEmpty(target.getPrice())) { j.setTotalPrice(j.getPrice() + target.getPrice()); } else { diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyServiceImpl.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyServiceImpl.java index 6661d2c35..79f617fde 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyServiceImpl.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyServiceImpl.java @@ -176,7 +176,7 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl !ObjectUtil.isAllEmpty(v.getUsername(), v.getUserMobile(), v.getPrice())).toList(); if (ObjectUtil.isEmpty(list)) return R.failed(); List errorMessageList = (List) bindingResult.getTarget(); + List usernameList = list.stream().map(WalletRechargeExcelDto::getUsername).toList(); + List userPoneList = list.stream().map(WalletRechargeExcelDto::getUserMobile).toList(); for (WalletRechargeExcelDto v : list) { Set errors = new LinkedHashSet<>(); if (ObjectUtil.isEmpty(v.getPrice())) { @@ -255,6 +257,15 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl ObjectUtil.equals(i, v.getUsername())).count(); + if (userNameCount > 1) { + errors.add("用户名 <" + v.getUsername() + "> 重复"); + + } + long userPhone = userPoneList.stream().filter(i -> ObjectUtil.equals(i, v.getUserMobile())).count(); + if (userPhone > 1) { + errors.add("用手机号 <" + v.getUserMobile() + "> 重复"); + } if (ObjectUtil.isNotEmpty(errors)) { errorMessageList.add(new ErrorMessage(v.getLineNum(), errors)); } @@ -421,7 +432,7 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl 0; + return count >= 3; } private WalletRechargeApplyServiceImpl getSelf() { diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/MchManageMapper.xml b/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/MchManageMapper.xml index e4e66a181..ca14f6af0 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/MchManageMapper.xml +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/MchManageMapper.xml @@ -2,18 +2,17 @@ - - + + - - + @@ -21,5 +20,5 @@ - + \ No newline at end of file From 47fd0aec1db42b158a54906b639e3dc102db3410 Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Mon, 10 Mar 2025 15:12:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=E5=95=86=E5=AE=B6=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=BD=BF=E7=94=A8=E7=9A=84=E9=92=B1=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/order/HardOrderServiceImpl.java | 25 +++++++++---------- .../wallet/api/feign/RemoteWalletService.java | 4 +++ .../controller/WalletManageController.java | 10 ++++++++ 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/pjcloud-hardware/pjcloud-hardware-biz/src/main/java/com/bsd/pjcloud/hard/service/impl/order/HardOrderServiceImpl.java b/pjcloud-hardware/pjcloud-hardware-biz/src/main/java/com/bsd/pjcloud/hard/service/impl/order/HardOrderServiceImpl.java index ecd33ecee..a1fba4ab4 100644 --- a/pjcloud-hardware/pjcloud-hardware-biz/src/main/java/com/bsd/pjcloud/hard/service/impl/order/HardOrderServiceImpl.java +++ b/pjcloud-hardware/pjcloud-hardware-biz/src/main/java/com/bsd/pjcloud/hard/service/impl/order/HardOrderServiceImpl.java @@ -209,25 +209,24 @@ public class HardOrderServiceImpl extends ServiceImpl walletResult = remoteWalletService.getWalletById(dto.getWalletId()); - WalletManageVo walletVo = Optional.of(walletResult).map(R::getData).orElseThrow(() -> new RuntimeException("用户钱包不存在")); - if (!ObjectUtil.equals(walletVo.getWalletTypeUniqueCode(), WalletTypeEnum.EAT.getCode())) { - throw new RuntimeException("请使用钱包二维码支付"); - } - wallet = walletVo; - } else { + if (ObjectUtil.isNotEmpty(mch.getDefaultWalletTypeId())) { R walletResult = remoteWalletService.getWallet(dto.getUserId(), WalletTypeEnum.EAT); wallet = Optional.of(walletResult).map(R::getData).orElseThrow(() -> new RuntimeException("用户钱包不存在")); + } else { + R walletResult = remoteWalletService.getWalletByWalletTypeId(dto.getUserId(), mch.getDefaultWalletTypeId()); + wallet = Optional.of(walletResult).map(R::getData).orElseThrow(() -> new RuntimeException("用户钱包不存在")); + } + if (ObjectUtil.isEmpty(wallet)) { + throw new RuntimeException("用户钱包不存在"); } } int totalPrice = 0, extraPrice = 0, payPrice = 0; @@ -523,7 +522,7 @@ public class HardOrderServiceImpl extends ServiceImpl mch = remoteMchService.getById(dto.getMerchantId()); if (ObjectUtil.isEmpty(mch.getData())) { throw new RuntimeException("商户不存在"); @@ -533,7 +532,7 @@ public class HardOrderServiceImpl extends ServiceImpl getWallet(@RequestParam Long userId, @RequestParam WalletTypeEnum walletTypeCode); + @NoToken + @GetMapping("/wallet-manage/get-wallet-by-wallet-id") + R getWalletByWalletTypeId(@RequestParam Long userId, @RequestParam Long walletTypeId); + @NoToken @GetMapping("/wallet-manage/get-wallet-by-id") R getWalletById(@RequestParam Long walletId); diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletManageController.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletManageController.java index 56856302f..ad9b0fd29 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletManageController.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletManageController.java @@ -61,6 +61,16 @@ public class WalletManageController { return R.ok(wallet); } + @Inner + @GetMapping("/get-wallet-by-wallet-id") + public R getWalletByWalletTypeId(@RequestParam Long userId, @RequestParam Long walletTypeId) { + WalletManageEntity wallet = walletManageService.getWallet(userId, walletTypeId); + if (ObjectUtil.isEmpty(wallet)) { + return R.failed("用户钱包不存在"); + } + return R.ok(wallet); + } + @Inner @GetMapping("/create-wallet") public R getWallet(@RequestParam Long userId) { From 423275f0eb7368998bb66b48070344eb6e9042fa Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Mon, 10 Mar 2025 15:48:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=E5=95=86=E6=88=B7=E7=B1=BB=E8=A1=A8?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=92=B1=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pjcloud/wallet/api/vo/MchManageVo.java | 12 ++++++++++- .../service/impl/MchManageServiceImpl.java | 20 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/vo/MchManageVo.java b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/vo/MchManageVo.java index 2dfb00085..45ea670e6 100644 --- a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/vo/MchManageVo.java +++ b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/vo/MchManageVo.java @@ -2,11 +2,21 @@ package com.bsd.pjcloud.wallet.api.vo; import com.bsd.pjcloud.admin.api.vo.base.BaseDeptInterface; import com.bsd.pjcloud.wallet.api.entity.MchManageEntity; +import com.bsd.pjcloud.wallet.api.vo.base.BaseWalletTypeInterface; import lombok.Data; +import org.springframework.scheduling.config.ScheduledTaskRegistrar; @Data -public class MchManageVo extends MchManageEntity implements BaseDeptInterface { +public class MchManageVo extends MchManageEntity implements BaseDeptInterface, BaseWalletTypeInterface { private String deptName; + private Long walletTypeId; + + private String walletTypeName; + + private String walletTypeUniqueCode; + + private String walletTypeIcon; + } diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/MchManageServiceImpl.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/MchManageServiceImpl.java index 153f92bb6..1519f3f84 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/MchManageServiceImpl.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/MchManageServiceImpl.java @@ -15,15 +15,22 @@ import com.bsd.pjcloud.admin.api.feign.RemoteUserService; import com.bsd.pjcloud.admin.api.utils.DataUtil; import com.bsd.pjcloud.common.core.constant.CacheConstants; import com.bsd.pjcloud.common.core.util.BeanUtils; +import com.bsd.pjcloud.common.core.util.CollectionUtils; import com.bsd.pjcloud.common.core.util.QRCodeImageGenerator; import com.bsd.pjcloud.common.core.util.R; import com.bsd.pjcloud.wallet.api.dto.MchManageDto; +import com.bsd.pjcloud.wallet.api.dto.WalletTypeDto; import com.bsd.pjcloud.wallet.api.entity.MchManageEntity; +import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity; +import com.bsd.pjcloud.wallet.api.utils.WalletDataUtil; import com.bsd.pjcloud.wallet.api.vo.MchManageVo; +import com.bsd.pjcloud.wallet.api.vo.WalletActiveVo; import com.bsd.pjcloud.wallet.api.vo.code.MchCollectionCodeVo; import com.bsd.pjcloud.wallet.mapper.MchManageMapper; +import com.bsd.pjcloud.wallet.mapper.WalletTypeMapper; import com.bsd.pjcloud.wallet.service.MchManageService; import com.bsd.pjcloud.wallet.service.WalletThirdZyService; +import com.bsd.pjcloud.wallet.service.WalletTypeService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.cache.annotation.CacheEvict; @@ -58,8 +65,10 @@ public class MchManageServiceImpl extends ServiceImpl walletTypeIds = list.getRecords().stream().map(MchManageVo::getDefaultWalletTypeId).distinct().toList(); + if (ObjectUtil.isNotEmpty(walletTypeIds)) { + WalletTypeDto walletTypeDto = new WalletTypeDto(); + walletTypeDto.setWalletTypeIds(walletTypeIds); + List walletTypeList = walletTypeMapper.list(walletTypeDto); + if (ObjectUtil.isNotEmpty(walletTypeList)) { + list.getRecords().forEach(v -> v.setWalletTypeId(v.getDefaultWalletTypeId())); + WalletDataUtil.convertWalletTypeList(list.getRecords(), CollectionUtils.convertMap(walletTypeList, WalletTypeEntity::getId)); + } + } } return list; }