From a217652d33c75df23202828000d82d0ca8555ac2 Mon Sep 17 00:00:00 2001
From: Administrator <1101184511@qq.com>
Date: 星期一, 21 四月 2025 02:13:59 +0800
Subject: [PATCH] 初步完成积分后台管理相关页面

---
 src/main/java/com/taoke/autopay/service/impl/KeyOrderServiceImpl.java |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 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 b15c36a..c9c6dc0 100644
--- a/src/main/java/com/taoke/autopay/service/impl/KeyOrderServiceImpl.java
+++ b/src/main/java/com/taoke/autopay/service/impl/KeyOrderServiceImpl.java
@@ -10,8 +10,10 @@
 import com.taoke.autopay.entity.agent.ChannelAgentSettings;
 import com.taoke.autopay.exception.KeyOrderException;
 import com.taoke.autopay.exception.KeyVerifyException;
+import com.taoke.autopay.exception.UserCreditException;
 import com.taoke.autopay.exception.WxOrderCountException;
 import com.taoke.autopay.factory.OrderFactory;
+import com.taoke.autopay.manager.UserCreditManager;
 import com.taoke.autopay.service.*;
 import com.taoke.autopay.service.agent.ChannelAgentService;
 import com.taoke.autopay.service.agent.ChannelAgentSettingService;
@@ -22,6 +24,8 @@
 import com.taoke.autopay.vo.SubmitKeyInfo;
 import com.taoke.autopay.vo.admin.IgnoreAgentOrderSettingVO;
 import net.sf.json.JSONArray;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -40,6 +44,8 @@
  */
 @Service
 public class KeyOrderServiceImpl implements KeyOrderService {
+
+    private Logger loggerDebug= LoggerFactory.getLogger("debugLogger");
 
     @Resource
     private KeyOrderMapper keyOrderMapper;
@@ -70,6 +76,9 @@
 
     @Resource
     private WxUserService wxUserService;
+
+    @Resource
+    private UserCreditManager userCreditManager;
 
 
     @Override
@@ -208,6 +217,28 @@
             orderUpdate.setPayTime(new Date());
         }
         update(orderUpdate);
+        // 澧炲姞绉垎
+        try {
+            boolean creditEnable = true;
+            // 鍒ゆ柇浠g悊鏄惁鍏佽澧炲姞绉垎
+            Long agengId = old.getAgentId();
+            if(agengId!=null) {
+                ChannelAgentSettings agentSettings =   channelAgentSettingService.selectByAgentId(agengId);
+                if(agentSettings!=null&&agentSettings.getCreditEnable()!=null) {
+                    creditEnable =agentSettings.getCreditEnable();
+                }
+            }
+            if(creditEnable) {
+                if (old.getOrderType() == Constant.ORDER_TYPE_DY) {
+                    userCreditManager.addDYOrderPayRecord(old.getUid(), id);
+                } else if (old.getOrderType() == Constant.ORDER_TYPE_KS) {
+                    userCreditManager.addKSOrderPayRecord(old.getUid(), id);
+                }
+            }
+
+        } catch (UserCreditException e) {
+            loggerDebug.error("澧炲姞绉垎鍑洪敊锛�"+id, e);
+        }
     }
 
     @Transactional(rollbackFor = Exception.class)

--
Gitblit v1.8.0