From 10e2bd322ebc94f6334e9d4ea050c239d8a5a61a Mon Sep 17 00:00:00 2001 From: yang <2119157836@qq.com> Date: Mon, 28 Apr 2025 15:06:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(myInvitation):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=87=91=E5=B8=81=E8=AE=B0=E5=BD=95=E7=9B=B8=E5=85=B3=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PersonalCenterController.java | 4 +-- .../main/resources/cert/dev/appPublicCert.crt | 26 +++++++++---------- .../service/impl/CommunityServiceImpl.java | 11 ++++++-- .../impl/QuestionCommentServiceImpl.java | 12 +++++++++ .../service/impl/QuestionServiceImpl.java | 21 ++++++++++++++- .../communityCenter/QuestionCommentMapper.xml | 3 ++- .../com/mcwl/myInvitation/domain/Consume.java | 7 +++-- .../myInvitation/domain/vo/ConsumeVo.java | 2 +- .../service/impl/ConsumeServiceImpl.java | 11 +++++++- .../pay/service/impl/AliPayServiceImpl.java | 12 +++++++++ .../service/impl/OrderTradeServiceImpl.java | 12 ++++++++- 11 files changed, 95 insertions(+), 26 deletions(-) diff --git a/mcwl-admin/src/main/java/com/mcwl/web/controller/personalCenter/PersonalCenterController.java b/mcwl-admin/src/main/java/com/mcwl/web/controller/personalCenter/PersonalCenterController.java index 497432d..3e4d566 100644 --- a/mcwl-admin/src/main/java/com/mcwl/web/controller/personalCenter/PersonalCenterController.java +++ b/mcwl-admin/src/main/java/com/mcwl/web/controller/personalCenter/PersonalCenterController.java @@ -145,9 +145,9 @@ public class PersonalCenterController { /** - * 获取金币消费记录 + * 获取金币收入支出消费记录 */ - @ApiOperation(value = "获取金币消费记录") + @ApiOperation(value = "获取金币收入支出消费记录") @PostMapping("/getWalletRecord") public TableDataInfo getWalletRecord(@Valid @RequestBody PageDomain pageDomain) { return consumeService.getWalletRecord(pageDomain); diff --git a/mcwl-admin/src/main/resources/cert/dev/appPublicCert.crt b/mcwl-admin/src/main/resources/cert/dev/appPublicCert.crt index 01f2a99..318b8ef 100644 --- a/mcwl-admin/src/main/resources/cert/dev/appPublicCert.crt +++ b/mcwl-admin/src/main/resources/cert/dev/appPublicCert.crt @@ -1,19 +1,19 @@ -----BEGIN CERTIFICATE----- -MIIDmTCCAoGgAwIBAgIQICQEAub4U5TMozibHLcg8zANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UE +MIIDmTCCAoGgAwIBAgIQICUEKLy77ndlVg3UfaV5GDANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UE BhMCQ04xGzAZBgNVBAoMEkFudCBGaW5hbmNpYWwgdGVzdDElMCMGA1UECwwcQ2VydGlmaWNhdGlv biBBdXRob3JpdHkgdGVzdDE+MDwGA1UEAww1QW50IEZpbmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1 -dGhvcml0eSBDbGFzcyAyIFIxIHRlc3QwHhcNMjQwNDAyMDUzMjU2WhcNMjUwNDA3MDUzMjU2WjBr +dGhvcml0eSBDbGFzcyAyIFIxIHRlc3QwHhcNMjUwNDI4MDY1NjQ2WhcNMjYwNTAzMDY1NjQ2WjBr MQswCQYDVQQGEwJDTjEfMB0GA1UECgwWZGJwbGZ1MTI5NEBzYW5kYm94LmNvbTEPMA0GA1UECwwG QWxpcGF5MSowKAYDVQQDDCEyMDg4NzIxMDMyOTcxMTQzLTkwMjEwMDAxMzU2ODI2MTQwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCQxmQGcaiKjOhayWi+zNTvpp8B5YT8jFFkjLzrD+W+ -T2Dwf2GfFR4p95zsCJxYeoLWdghMPA6/GMFrLbuVFpaEjuTm4icqA9N8n5d3W0j7gh+wMjZoqyJc -lAIeb09ut7rY6mWzilA9kWmZnUG7MOWIU70RVRYrfJectCFw/odM9lG4XIVe13X2h+1ecTQyQzLW -mnvKFCfo7dQjE7fIYiWfud1ZGUneNs3u73pNWMB6Th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U3ckb+eP2FgJbVJnjoy4Fq7VRpjO/asxoYSoWsnCC6b0aUkLs+QlQ4O6SKC3d +rTHGeyK1D4fTlk3Dmuf6dA6Q0SgkG91sNzHscw3FtE47+GtvHtM4Qr6LHqKlYPV8VZ09zvherpih +tSTr035sJezP9VYtKQwTXyUTCVVC6WQQdT/040WvMqkPVGtDEWzStZWflXK1IeAXnOLXyCYEBBG6 +aE08iD5MOCZmldDOFg== -----END CERTIFICATE----- \ No newline at end of file diff --git a/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/CommunityServiceImpl.java b/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/CommunityServiceImpl.java index 6e1cd65..c066343 100644 --- a/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/CommunityServiceImpl.java +++ b/mcwl-communityCenter/src/main/java/com/mcwl/communityCenter/service/impl/CommunityServiceImpl.java @@ -175,11 +175,18 @@ public class CommunityServiceImpl extends ServiceImpl comment(QuestionCommentRes questionCommentRes) { @@ -162,6 +166,14 @@ public class QuestionCommentServiceImpl extends ServiceImpl i private final QuestionCommentService questionCommentService; + private final ConsumeMapper consumeMapper; + + /** * 添加问题 * @@ -102,6 +107,14 @@ public class QuestionServiceImpl extends ServiceImpl i sysUserService.updateUser(sysUser); + Consume consume = new Consume(); + consume.setUserId(SecurityUtils.getUserId()); + consume.setAmount(-questionRes.getAmount()); + consume.setType(4); + consume.setWallet(sysUser.getWallet()); + consumeMapper.insert(consume); + + // CommunityAdvice communityAdvice = new CommunityAdvice(); // communityAdvice.setTenantId(tenantId); // communityAdvice.setCommunityId(communityId); @@ -248,8 +261,14 @@ public class QuestionServiceImpl extends ServiceImpl i personHomeVo.setAvatar(questionUserAvatar); personHomeVo.setImageUrl(questionUrl); + QuestionDetailRes questionDetailRes = new QuestionDetailRes(); + questionDetailRes.setTenantId(questionVo.getTenantId()); + questionDetailRes.setCommunityId(questionVo.getCommunityId()); + questionDetailRes.setQuestionId(questionVo.getId()); - List questionCommentList = questionVo.getCommentList(); + List questionCommentList = questionCommentService.getComment(questionDetailRes); + +// List questionCommentList = questionVo.getCommentList(); List commentList = BeanUtil.copyToList(questionCommentList, CommentVo.class); diff --git a/mcwl-communityCenter/src/main/resources/mapper/communityCenter/QuestionCommentMapper.xml b/mcwl-communityCenter/src/main/resources/mapper/communityCenter/QuestionCommentMapper.xml index e3e5bdb..44be4f9 100644 --- a/mcwl-communityCenter/src/main/resources/mapper/communityCenter/QuestionCommentMapper.xml +++ b/mcwl-communityCenter/src/main/resources/mapper/communityCenter/QuestionCommentMapper.xml @@ -33,6 +33,7 @@ and qm.community_id = #{questionDetailRes.communityId} and qm.question_id = #{questionDetailRes.questionId} and qm.del_flag = '0' - order by qm.create_time desc + order by qm.is_accept desc, qm.create_time desc + \ No newline at end of file diff --git a/mcwl-myInvitation/src/main/java/com/mcwl/myInvitation/domain/Consume.java b/mcwl-myInvitation/src/main/java/com/mcwl/myInvitation/domain/Consume.java index a6ad7bd..d907456 100644 --- a/mcwl-myInvitation/src/main/java/com/mcwl/myInvitation/domain/Consume.java +++ b/mcwl-myInvitation/src/main/java/com/mcwl/myInvitation/domain/Consume.java @@ -29,12 +29,11 @@ public class Consume extends BaseEntity { // 商品id private Long productId; - // 商品类型 0模型 1工作流 2图片 3社区 + /** + * 商品类型 0模型 1工作流 2图片 3社区 4社区提问 5金币 6提现 + */ private Integer type; // 剩余金币 private Double wallet; - - // 消费时间 - private Date consumeDate; } diff --git a/mcwl-myInvitation/src/main/java/com/mcwl/myInvitation/domain/vo/ConsumeVo.java b/mcwl-myInvitation/src/main/java/com/mcwl/myInvitation/domain/vo/ConsumeVo.java index 70c3f1c..33bff8f 100644 --- a/mcwl-myInvitation/src/main/java/com/mcwl/myInvitation/domain/vo/ConsumeVo.java +++ b/mcwl-myInvitation/src/main/java/com/mcwl/myInvitation/domain/vo/ConsumeVo.java @@ -40,5 +40,5 @@ public class ConsumeVo { // 消费时间 @ApiModelProperty(value = "消费时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date consumeDate; + private Date createTime; } diff --git a/mcwl-myInvitation/src/main/java/com/mcwl/myInvitation/service/impl/ConsumeServiceImpl.java b/mcwl-myInvitation/src/main/java/com/mcwl/myInvitation/service/impl/ConsumeServiceImpl.java index 44d4be2..9a327b7 100644 --- a/mcwl-myInvitation/src/main/java/com/mcwl/myInvitation/service/impl/ConsumeServiceImpl.java +++ b/mcwl-myInvitation/src/main/java/com/mcwl/myInvitation/service/impl/ConsumeServiceImpl.java @@ -62,7 +62,7 @@ public class ConsumeServiceImpl extends ServiceImpl impl Long userId = SecurityUtils.getUserId(); LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); - lqw.eq(Consume::getUserId, userId); + lqw.eq(Consume::getUserId, userId).orderByDesc(Consume::getCreateTime); consumeMapper.selectPage(page, lqw); @@ -84,6 +84,15 @@ public class ConsumeServiceImpl extends ServiceImpl impl case 3: consumeVo.setProductName("社区"); break; + case 4: + consumeVo.setProductName("社区提问"); + break; + case 5: + consumeVo.setProductName("金币"); + break; + case 6: + consumeVo.setProductName("提现"); + break; } consumeVoList.add(consumeVo); diff --git a/mcwl-pay/src/main/java/com/mcwl/pay/service/impl/AliPayServiceImpl.java b/mcwl-pay/src/main/java/com/mcwl/pay/service/impl/AliPayServiceImpl.java index e8b4324..9d84a9d 100644 --- a/mcwl-pay/src/main/java/com/mcwl/pay/service/impl/AliPayServiceImpl.java +++ b/mcwl-pay/src/main/java/com/mcwl/pay/service/impl/AliPayServiceImpl.java @@ -35,6 +35,8 @@ import com.mcwl.common.utils.ShareCodeUtils; import com.mcwl.common.utils.StringUtils; import com.mcwl.memberCenter.domain.MemberLevel; import com.mcwl.memberCenter.service.MemberLevelService; +import com.mcwl.myInvitation.domain.Consume; +import com.mcwl.myInvitation.mapper.ConsumeMapper; import com.mcwl.pay.config.AliConfig; import com.mcwl.pay.domain.OrderTrade; import com.mcwl.pay.domain.OrderTradeDto; @@ -92,6 +94,9 @@ public class AliPayServiceImpl implements AliPayService { @Autowired private OrderTradeService orderTradeService; + @Autowired + private ConsumeMapper consumeMapper; + @Autowired private ThreadPoolTaskExecutor threadPoolTaskExecutor; @@ -535,6 +540,13 @@ public class AliPayServiceImpl implements AliPayService { sysUser.setWallet(wallet.subtract(amountBigDecimal).setScale(2, RoundingMode.HALF_UP).doubleValue()); sysUserService.updateUser(sysUser); + Consume consume = new Consume(); + consume.setUserId(SecurityUtils.getUserId()); + consume.setAmount(-Double.parseDouble(amount)); + consume.setType(6); + consume.setWallet(sysUser.getWallet()); + consumeMapper.insert(consume); + // 添加记录 SysUserPayAccountLog sysUserPayAccountLog = new SysUserPayAccountLog(); sysUserPayAccountLog.setUserId(sysUser.getUserId()); diff --git a/mcwl-pay/src/main/java/com/mcwl/pay/service/impl/OrderTradeServiceImpl.java b/mcwl-pay/src/main/java/com/mcwl/pay/service/impl/OrderTradeServiceImpl.java index 535154c..6155f08 100644 --- a/mcwl-pay/src/main/java/com/mcwl/pay/service/impl/OrderTradeServiceImpl.java +++ b/mcwl-pay/src/main/java/com/mcwl/pay/service/impl/OrderTradeServiceImpl.java @@ -26,6 +26,7 @@ import com.mcwl.memberCenter.service.RechargeRecordService; import com.mcwl.myInvitation.domain.Commission; import com.mcwl.myInvitation.domain.CommissionRatio; import com.mcwl.myInvitation.domain.Consume; +import com.mcwl.myInvitation.mapper.ConsumeMapper; import com.mcwl.myInvitation.service.CommissionRatioService; import com.mcwl.myInvitation.service.CommissionService; import com.mcwl.myInvitation.service.ConsumeService; @@ -111,6 +112,9 @@ public class OrderTradeServiceImpl extends ServiceImpl USER_LOCKS = CacheBuilder.newBuilder() .expireAfterAccess(3, TimeUnit.MINUTES) .build(); @@ -170,7 +174,6 @@ public class OrderTradeServiceImpl extends ServiceImpl