From 6927d3bed414fb1a44312668d4e9d91d62e91b3f Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 09 七月 2024 00:43:50 +0800
Subject: [PATCH] 口令付款不依赖与订单

---
 src/main/java/com/taoke/autopay/service/impl/KeyOrderServiceImpl.java |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/taoke/autopay/service/impl/KeyOrderServiceImpl.java b/src/main/java/com/taoke/autopay/service/impl/KeyOrderServiceImpl.java
index 2d8b142..9c0d573 100644
--- a/src/main/java/com/taoke/autopay/service/impl/KeyOrderServiceImpl.java
+++ b/src/main/java/com/taoke/autopay/service/impl/KeyOrderServiceImpl.java
@@ -12,11 +12,14 @@
 import com.taoke.autopay.service.KeyOrderService;
 import com.taoke.autopay.service.WxUserOrderCountService;
 import com.taoke.autopay.service.WxUserSettingService;
+import com.taoke.autopay.utils.StringUtil;
 import com.taoke.autopay.utils.TimeUtil;
+import com.taoke.autopay.vo.SubmitKeyInfo;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.math.BigDecimal;
 import java.util.*;
 
 /**
@@ -45,20 +48,23 @@
 
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public KeyOrder addKeyOrder(String key, Long uid, String day) throws KeyOrderException, WxOrderCountException {
+    public KeyOrder addKeyOrder(SubmitKeyInfo keyInfo, Long uid, String day) throws KeyOrderException, WxOrderCountException {
         // 鍒ゆ柇鎻愪氦娆℃暟鏄惁杩囬噺
         if (uid != null) {
             WxUserSettings settings = wxUserSettingService.selectByUid(uid);
             wxUserOrderCountService.addOrderCount(uid, OrderCountTypeEnum.SUBMIT_TOKEN_COUNT, day, 1, settings.getTotalOrderCountPerDay());
         }
-        String id = OrderFactory.createId(key);
+        String id = OrderFactory.createId(keyInfo.getKey());
         KeyOrder order = keyOrderMapper.selectById(id);
         if (order != null) {
             throw new KeyOrderException("璇峰嬁閲嶅鎻愪氦鍙d护");
         }
         order = new KeyOrder();
         order.setId(id);
-        order.setKey(key);
+        order.setKey(keyInfo.getKey());
+        if(!StringUtil.isNullOrEmpty(keyInfo.getMoney())){
+            order.setOrderMoney(new BigDecimal(keyInfo.getMoney()));
+        }
         order.setUid(uid);
         order.setState(KeyOrder.STATE_NOT_PROCESS);
         order.setStateDesc("灏氭湭澶勭悊");

--
Gitblit v1.8.0