From 742e0a8ec019ccb76f03fcc58859ed15e9264c4c Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期三, 31 一月 2024 08:26:30 +0800
Subject: [PATCH] 2024-01-31 朱宝民 电子钱包账户注册接口、充值接口
---
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletSv.java | 77 ++++++++++++++++----------------------
1 files changed, 33 insertions(+), 44 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletSv.java
index 2e7b236..96f565e 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/wallet/WalletSv.java
@@ -1,10 +1,11 @@
package com.dy.pipIrrSell.wallet;
+import com.dy.pipIrrGlobal.daoSe.SeConsumeMapper;
+import com.dy.pipIrrGlobal.daoSe.SeRefundMapper;
import com.dy.pipIrrGlobal.daoSe.SeWalletMapper;
-import com.dy.pipIrrGlobal.daoSe.SeWalletRechargeHistoryMapper;
import com.dy.pipIrrGlobal.daoSe.SeWalletRechargeMapper;
import com.dy.pipIrrGlobal.pojoSe.SeWallet;
-import com.dy.pipIrrGlobal.pojoSe.SeWalletRechargeHistory;
+import com.dy.pipIrrGlobal.pojoSe.SeWalletRecharge;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -26,54 +27,42 @@
private SeWalletRechargeMapper seWalletRechargeMapper;
@Autowired
- private SeWalletRechargeHistoryMapper seWalletRechargeHistoryMapper;
+ private SeConsumeMapper seConsumeMapper;
+
+ @Autowired
+ private SeRefundMapper seRefundMapper;
+
+ /**
+ * 鏍规嵁鍐滄埛ID鑾峰彇鐢靛瓙閽卞寘瀵硅薄
+ * @param clientId
+ * @return
+ */
+ public SeWallet getWalletByClientId(Long clientId) {
+ return seWalletMapper.getWalletByClientId(clientId);
+ }
/**
* 娉ㄥ唽鐢靛瓙閽卞寘璐﹀彿
+ * @param po 鐢靛瓙閽卞寘瀹炰綋绫�
+ * @return 鐢靛瓙閽卞寘ID
+ */
+ public Long addWallet(SeWallet po) {
+ seWalletMapper.insert(po);
+ return po.getId();
+ }
+
+ public Integer updateWallet(SeWallet po) {
+ return seWalletMapper.updateByPrimaryKeySelective(po);
+ }
+
+ /**
+ * 鐢靛瓙閽卞寘鍏呭��
* @param po
* @return
*/
- public Integer add(SeWallet po) {
- return seWalletMapper.insert(po);
+ public Long addRecharge(SeWalletRecharge po) {
+ seWalletRechargeMapper.insert(po);
+ return po.getId();
}
- /**
- * 鏍规嵁缂栧彿浠庨挶鍖呰〃涓幏鍙栬閽卞寘浣欓
- * @param id
- * @return
- */
- public Float getMoneyById(Long id) {
- SeWallet po = seWalletMapper.selectByPrimaryKey(id);
- return po.getMoney();
- }
-
- /**
- * 鏍规嵁閽卞寘缂栧彿淇敼閽卞寘浣欓
- * @param id 閽卞寘缂栧彿锛堜富閿級
- * @param money 閽卞寘浣欓
- * @return 淇敼璁板綍鏁伴噺
- */
- public Integer updateMoneyById(Long id, Float money) {
- SeWallet po = seWalletMapper.selectByPrimaryKey(id);
- po.setMoney(money);
- return seWalletMapper.updateByPrimaryKey(po);
- }
-
- /**
- * 鏍规嵁id鍒犻櫎鍏呭�艰褰�
- * @param id
- * @return
- */
- public Integer deleteWallerRechargeById(Long id) {
- return seWalletMapper.deleteByPrimaryKey(id);
- }
-
- /**
- * 灏嗗厖鍊艰褰曟坊鍔犲埌鍏呭�煎巻鍙茶〃
- * @param po 鍏呭�煎巻鍙插疄浣�
- * @return
- */
- public Integer addWallerRechargeHistory(SeWalletRechargeHistory po) {
- return seWalletRechargeHistoryMapper.insert(po);
- }
}
--
Gitblit v1.8.0