From febc33b84c7ac40c500c27dccd2a5c871c2c05f0 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期一, 28 六月 2021 11:07:49 +0800
Subject: [PATCH] 后台管理审核随手拍计算用户收益

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActUserWalletTradeServiceImpl.java |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActUserWalletTradeServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActUserWalletTradeServiceImpl.java
index 603851a..5e64158 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActUserWalletTradeServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActUserWalletTradeServiceImpl.java
@@ -10,6 +10,9 @@
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
+import java.util.Date;
+
 /**
  * @auther lyq
  * @create 2021-06-25 10:35:22
@@ -29,4 +32,34 @@
         return R.ok(this.baseMapper.getUserWalletTradeList(new Page(walletTradeDTO.getPageNum(),walletTradeDTO.getPageSize()),walletTradeDTO));
     }
 
+    /**
+     * 新增钱包交易记录
+     * @param userId    用户id
+     * @param communityId   社区id
+     * @param serviceId     交易业务id
+     * @param amount    交易金额
+     * @param type  交易类型(1.发布随手拍 2.结算)
+     * @param remark    交易备注
+     * @param createBy  操作人id
+     * @param walletId  钱包id
+     * @param changeType    变动类型(1.增加  2.减少)
+     */
+    @Override
+    public Long addWalletTrade(Long userId, Long communityId, Long serviceId
+            , BigDecimal amount, Integer type, String remark, Long createBy, Long walletId,Integer changeType){
+        ComActUserWalletTradeDO walletTradeDO = new ComActUserWalletTradeDO();
+        walletTradeDO.setUserId(userId);
+        walletTradeDO.setCommunityId(communityId);
+        walletTradeDO.setServiceId(serviceId);
+        walletTradeDO.setAmount(amount);
+        walletTradeDO.setType(type);
+        walletTradeDO.setRemark(remark);
+        walletTradeDO.setCreateBy(createBy);
+        walletTradeDO.setWalletId(walletId);
+        walletTradeDO.setChangeType(changeType);
+        walletTradeDO.setCreateAt(new Date());
+        this.baseMapper.insert(walletTradeDO);
+        return walletTradeDO.getId();
+    }
+
 }

--
Gitblit v1.7.1