From 3f17034c768ba4fc330e01f014b4f880e6a1569c Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期二, 12 三月 2024 16:03:30 +0800
Subject: [PATCH] 2024-03-12 朱宝民 增加已挂失,未补卡接口

---
 pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/virtualCard/VirtualCardSv.java |  126 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 125 insertions(+), 1 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/virtualCard/VirtualCardSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/virtualCard/VirtualCardSv.java
index 10caf9c..1765f7b 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/virtualCard/VirtualCardSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/virtualCard/VirtualCardSv.java
@@ -3,9 +3,14 @@
 import com.dy.common.webUtil.BaseResponse;
 import com.dy.common.webUtil.BaseResponseUtils;
 import com.dy.pipIrrGlobal.daoSe.SeVcRechargeMapper;
+import com.dy.pipIrrGlobal.daoSe.SeVcRefundItemMapper;
+import com.dy.pipIrrGlobal.daoSe.SeVcRefundMapper;
 import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper;
 import com.dy.pipIrrGlobal.pojoSe.SeVcRecharge;
+import com.dy.pipIrrGlobal.pojoSe.SeVcRefund;
+import com.dy.pipIrrGlobal.pojoSe.SeVcRefundItem;
 import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard;
+import com.dy.pipIrrGlobal.voSe.VoOrders;
 import com.dy.pipIrrSell.result.SellResultCode;
 import com.dy.pipIrrSell.virtualCard.dto.DtoVirtualCard;
 import com.dy.pipIrrSell.virtualCard.enums.LastOperateENUM;
@@ -16,6 +21,7 @@
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * @author ZhuBaoMin
@@ -32,6 +38,12 @@
 
     @Autowired
     private SeVcRechargeMapper seVcRechargeMapper;
+
+    @Autowired
+    private SeVcRefundMapper seVcRefundMapper;
+
+    @Autowired
+    private SeVcRefundItemMapper seVcRefundItemMapper;
 
     /**
      * 娉ㄥ唽铏氭嫙鍗�
@@ -61,6 +73,7 @@
     public SeVirtualCard selectVirtuCardById(Long virtualId) {
         return seVirtualCardMapper.selectByPrimaryKey(virtualId);
     }
+
     /**
      * 娣诲姞铏氭嫙鍗″厖鍊艰褰�
      * JSAPI涓嬪崟鍚庣敓鎴愰儴鍒嗗厖鍊艰褰�
@@ -139,7 +152,7 @@
     }
 
     /**
-     * 淇敼铏氭嫙鍗″厖鍊艰褰�
+     * 淇敼铏氭嫙鍗″厖鍊艰褰曪紙搴熷純锛�
      * 寰俊灏忕▼搴忔敮浠橀�氱煡鍚庝慨鏀癸細浣欓銆佸厖鍊煎悗浣欓銆佸厖鍊煎畬鎴愭椂闂�
      * @param po
      * @return
@@ -147,4 +160,115 @@
     public Integer updateVCRecharge(SeVcRecharge po) {
         return seVcRechargeMapper.updateByPrimaryKeySelective(po);
     }
+
+    /**
+     * 鏍规嵁铏氭嫙鍗″彿鑾峰彇璁㈠崟鍒楄〃
+     * @param virtualId
+     * @return
+     */
+    public List<VoOrders> selectOrders(Long virtualId) {
+        List<VoOrders> rsVo = seVcRechargeMapper.getOrders(virtualId);
+        return rsVo ;
+    }
+
+    /**
+     * 鏍规嵁閫�娆綢D鑾峰彇閫�娆惧璞�
+     * @param refundId
+     * @return
+     */
+    public SeVcRefund selectRefundByRefundId(Long refundId) {
+        return seVcRefundMapper.selectByPrimaryKey(refundId);
+    }
+
+    /**
+     * 娣诲姞閫�娆剧敵璇�
+     * @param po
+     * @return
+     */
+    public Long addRefund(SeVcRefund po) {
+        seVcRefundMapper.insert(po);
+        return po.getId();
+    }
+
+    /**
+     * 淇敼閫�娆捐褰�
+     * @param po
+     * @return
+     */
+    public Integer updateRefund(SeVcRefund po) {
+        return seVcRefundMapper.updateByPrimaryKeySelective(po);
+    }
+
+    /**
+     * 鏍规嵁璁㈠崟鍙疯幏鍙栧叾鍚勭瑪閫�娆鹃噾棰�
+     * @param orderNumber
+     * @return
+     */
+    public List<Integer> selectRefundAmount(String orderNumber) {
+        List<Integer> rsVo = seVcRefundMapper.getRefundAmount(orderNumber);
+        return rsVo;
+    }
+
+    /**
+     * 娣诲姞閫�娆惧垎椤�
+     * @param po
+     * @return
+     */
+    public Long addRefundItem(SeVcRefundItem po) {
+        seVcRefundItemMapper.insert(po);
+        return po.getRefundId();
+    }
+
+    /**
+     * 缂栬緫閫�娆惧垎椤�
+     * @param po
+     * @return
+     */
+    public Integer updateRefundItem(SeVcRefundItem po) {
+        return seVcRefundItemMapper.updateByPrimaryKeySelective(po);
+    }
+
+    /**
+     * 鏍规嵁璁㈠崟鍙风敓鎴愰��娆惧崟鍙�
+     * @param orderNumber
+     * @return
+     */
+    public String generateRefundNumber(String orderNumber) {
+        String refundNumber = seVcRefundItemMapper.getLastRefundNumber(orderNumber);
+        if(refundNumber == null) {
+            refundNumber = orderNumber + "01";
+            return refundNumber;
+        }
+
+        String a = String.format("%02d", (Integer.parseInt(refundNumber.substring(29,30).trim()) + 1));
+        return  a;
+    }
+
+    /**
+     * 鏍规嵁璁㈠崟鍙疯幏鍙栧厖鍊奸噾棰濓紝璋冪敤閫�娆剧敵璇锋帴鍙d娇鐢�
+     * @param orderNumber
+     * @return
+     */
+    public Integer getRechargeAmountByOrderNumber(String orderNumber) {
+        return seVcRechargeMapper.getRechargeAmountByOrderNumber(orderNumber);
+
+    }
+
+    /**
+     * 鏍规嵁閫�娆鹃�氱煡鎺ュ彛杩斿洖鐨勯��娆惧崟鍙峰弽鏌ラ��娆綢D锛屾煡璇㈣閫�娆綢D涓嬫湭閫�娆捐褰曟暟閲�
+     * @param refundNumber
+     * @return
+     */
+    public Integer getNoRefundedCount(String refundNumber) {
+        return seVcRefundItemMapper.getNoRefundedCount(refundNumber);
+    }
+
+    /**
+     * 鏍规嵁閫�娆惧崟鍙疯幏鍙栭��娆綢D锛岄��娆鹃�氱煡鍚庢洿鏂伴��娆捐〃鎵�闇�
+     * @param refundNumber
+     * @return
+     */
+    public Long getRefundIdByRefundNumber(String refundNumber) {
+        return seVcRefundItemMapper.getRefundIdByRefundNumber(refundNumber);
+    }
 }

--
Gitblit v1.8.0