From ecb82d98e523ffa025286ffa617096dfe18c0398 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期一, 19 八月 2024 21:00:51 +0800
Subject: [PATCH] 把微信证书文件放入resources/wxCert文件夹中,读取证书文件类是pipIrrGlobal模块的WxCertUtil类。
---
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/virtualCard/VirtualCardSv.java | 60 +++++++++++++++++++++++++++++++++++-------------------------
1 files changed, 35 insertions(+), 25 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/virtualCard/VirtualCardSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/virtualCard/VirtualCardSv.java
index 1b25e36..d6d9cd4 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/virtualCard/VirtualCardSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/virtualCard/VirtualCardSv.java
@@ -4,20 +4,15 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoSe.*;
-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.pojoSe.*;
import com.dy.pipIrrGlobal.voSe.VoOrders;
import com.dy.pipIrrGlobal.voSe.VoVcRecharge;
import com.dy.pipIrrGlobal.voSe.VoVirtualCard;
-
-import com.dy.pipIrrSell.result.SellResultCode;
-import com.dy.pipIrrSell.virtualCard.dto.DtoVcRecharge;
-import com.dy.pipIrrSell.virtualCard.dto.DtoVirtualCard;
-import com.dy.pipIrrSell.virtualCard.enums.LastOperateENUM;
-import com.dy.pipIrrSell.virtualCard.enums.OrderStateENUM;
-
+import com.dy.pipIrrWechat.virtualCard.dto.DtoVcRecharge;
+import com.dy.pipIrrWechat.virtualCard.dto.DtoVirtualCard;
+import com.dy.pipIrrWechat.virtualCard.enums.LastOperateENUM;
+import com.dy.pipIrrWechat.virtualCard.enums.OrderStateENUM;
+import com.dy.pipIrrWechat.result.WechatResultCode;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -30,8 +25,8 @@
/**
* @author ZhuBaoMin
- * @date 2024-07-11 15:49
- * @LastEditTime 2024-07-11 15:49
+ * @date 2024-07-15 9:39
+ * @LastEditTime 2024-07-15 9:39
* @Description
*/
@@ -52,6 +47,9 @@
@Autowired
private SeClientMapper seClientMapper;
+
+ @Autowired
+ private SeVcOperateMapper seVcOperateMapper;
/**
* 鏍规嵁鍐滄埛ID鑾峰彇5绾ц鏀垮尯鍒掍唬鐮侊紝娉ㄥ唽铏氭嫙鍗′娇鐢�
@@ -130,9 +128,10 @@
* 娣诲姞铏氭嫙鍗″厖鍊艰褰�
* JSAPI涓嬪崟鍚庣敓鎴愰儴鍒嗗厖鍊艰褰�
* @param po
- * @return
+ * @return -1锛氳櫄鎷熷崱涓嶅瓨鍦紝0锛氭坊鍔犲厖鍊艰褰曞け璐�
*/
- public BaseResponse<Boolean> insertVCRecharge(DtoVirtualCard po) {
+ //public BaseResponse<Boolean> insertVCRecharge(DtoVirtualCard po) {
+ public Long insertVCRecharge(DtoVirtualCard po) {
String orderNumber = po.getOrderNumber();
Long virtualId = po.getVirtualId();
Long clientId = po.getClientId();
@@ -140,8 +139,9 @@
// 楠岃瘉璇ヨ櫄鎷熷崱璐︽埛鏄惁瀛樺湪骞跺彇鍑哄綋鍓嶈处鎴蜂綑棰�
SeVirtualCard seVirtualCard = seVirtualCardMapper.selectByPrimaryKey(virtualId);
+
if(seVirtualCard == null) {
- return BaseResponseUtils.buildFail(SellResultCode.NO_ACCOUNT.getMessage());
+ return -1L;
}
Double money = seVirtualCard.getMoney();
@@ -154,11 +154,12 @@
seVcRecharge.setRechargeAmount(rechargeAmount);
seVcRecharge.setOrderTime(new Date());
seVcRecharge.setOrderState(OrderStateENUM.NON_PAYMENT.getCode());
- Integer rec = seVcRechargeMapper.insert(seVcRecharge);
- if(rec == null) {
- return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL.getMessage());
+ seVcRechargeMapper.insert(seVcRecharge);
+ Long rechargeId = seVcRecharge.getId();
+ if(rechargeId == null) {
+ return 0L;
}
- return BaseResponseUtils.buildSuccess(true) ;
+ return rechargeId;
}
/**
@@ -182,7 +183,7 @@
public BaseResponse<Boolean> updateVCRecharge(String orderNumber, Date rechargeTime) {
SeVcRecharge seVcRecharge = seVcRechargeMapper.getVCRechargeByorderNumber(orderNumber);
if(seVcRecharge == null) {
- return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_NOT_EXIST.getMessage());
+ return BaseResponseUtils.buildFail(WechatResultCode.RECHARGE_NOT_EXIST.getMessage());
}
Long virtualId = seVcRecharge.getVcId();
@@ -195,19 +196,19 @@
seVcRecharge.setOrderState(OrderStateENUM.PAID.getCode());
Integer rec = seVcRechargeMapper.updateByPrimaryKeySelective(seVcRecharge);
if(rec == null) {
- return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL.getMessage());
+ return BaseResponseUtils.buildFail(WechatResultCode.RECHARGE_FAIL.getMessage());
}
SeVirtualCard seVirtualCard = seVirtualCardMapper.selectByPrimaryKey(virtualId);
if(seVirtualCard == null) {
- return BaseResponseUtils.buildFail(SellResultCode.VIRTUAL_CARD_NOT_EXIST.getMessage());
+ return BaseResponseUtils.buildFail(WechatResultCode.VIRTUAL_CARD_NOT_EXIST.getMessage());
}
seVirtualCard.setMoney(afterRrecharge);
seVirtualCard.setLastOperate(LastOperateENUM.RECHARGE.getCode());
seVirtualCard.setLastOperateTime(new Date());
Integer rec2 = seVirtualCardMapper.updateByPrimaryKeySelective(seVirtualCard);
if(rec2 == null) {
- return BaseResponseUtils.buildFail(SellResultCode.RECHARGE_FAIL.getMessage());
+ return BaseResponseUtils.buildFail(WechatResultCode.RECHARGE_FAIL.getMessage());
}
return BaseResponseUtils.buildSuccess(true) ;
}
@@ -351,5 +352,14 @@
return rsVo;
}
-}
+ /**
+ * 娣诲姞铏氭嫙鍗℃搷浣滆褰�
+ * @param po
+ * @return
+ */
+ public Long insertVcOperate(SeVcOperate po) {
+ seVcOperateMapper.insert(po);
+ return po.getId();
+ }
+}
\ No newline at end of file
--
Gitblit v1.8.0