From 15bedcc619b1edb6eb987f9288db7670e5b38c46 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 07 五月 2022 19:42:23 +0800
Subject: [PATCH] bug修复

---
 app/src/main/java/com/yeshi/makemoney/app/service/impl/money/ExtractServiceImpl.java |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/app/src/main/java/com/yeshi/makemoney/app/service/impl/money/ExtractServiceImpl.java b/app/src/main/java/com/yeshi/makemoney/app/service/impl/money/ExtractServiceImpl.java
index 24e239b..c72e872 100644
--- a/app/src/main/java/com/yeshi/makemoney/app/service/impl/money/ExtractServiceImpl.java
+++ b/app/src/main/java/com/yeshi/makemoney/app/service/impl/money/ExtractServiceImpl.java
@@ -21,10 +21,12 @@
 import com.yeshi.makemoney.app.service.inter.money.UserExtractMoneyLimitService;
 import com.yeshi.makemoney.app.service.inter.money.UserMoneyRecordService;
 import com.yeshi.makemoney.app.service.inter.money.UserMoneyService;
+import com.yeshi.makemoney.app.service.inter.msg.UserMsgNotifyService;
 import com.yeshi.makemoney.app.service.inter.user.UserInfoService;
 import com.yeshi.makemoney.app.service.query.money.ExtractQuery;
 import com.yeshi.makemoney.app.utils.Constant;
 import com.yeshi.makemoney.app.utils.factory.UserMoneyRecordFactory;
+import com.yeshi.makemoney.app.utils.factory.msg.UserMsgFactory;
 import com.yeshi.makemoney.app.utils.mq.CMQManager;
 import com.yeshi.makemoney.app.utils.pay.AlipayUtil;
 import org.slf4j.Logger;
@@ -67,6 +69,9 @@
 
     @Resource
     private UserExtractMoneyLimitService userExtractMoneyLimitService;
+
+    @Resource
+    private UserMsgNotifyService userMsgNotifyService;
 
     @Override
     public List<Extract> list(ExtractQuery extractQuery, int page, int pageSize) {
@@ -159,7 +164,7 @@
     @Override
     public boolean canExtractLittleMoney(Long uid, int maxNewerCount, Date date) {
         //鍒ゆ柇鏂颁汉
-        long count = countByMaxMoney(uid,Constant.EXTRACT_LITTLE_MONEY_LIMIT, Arrays.asList(new Integer[]{Extract.STATE_NOT_PROCESS, Extract.STATE_PROCESSING, Extract.STATE_PASS}), null);
+        long count = countByMaxMoney(uid, Constant.EXTRACT_LITTLE_MONEY_LIMIT, Arrays.asList(new Integer[]{Extract.STATE_NOT_PROCESS, Extract.STATE_PROCESSING, Extract.STATE_PASS}), null);
         if (maxNewerCount > count) {
             return true;
         }
@@ -281,7 +286,12 @@
         updateExtract.setState(Extract.STATE_REJECT);
         updateExtract.setReason(reason);
         extractMapper.updateByPrimaryKeySelective(updateExtract);
-        //TODO 娑堟伅
+        //娣诲姞娑堟伅閫氱煡
+        try {
+            userMsgNotifyService.notify(UserMsgFactory.createExtractFail(extract.getUser().getId(), extract.getMoney(), reason));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
     }
 
     @Override
@@ -407,7 +417,12 @@
                 userMoneyRecordService.update(update);
             }
         }
-        // TODO 閫氱煡杞处鎴愬姛
+        //娣诲姞娑堟伅閫氱煡
+        try {
+            userMsgNotifyService.notify(UserMsgFactory.createExtractSuccess(extract.getUser().getId(), extract.getMoney()));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
     }
 
 
@@ -435,8 +450,12 @@
             } catch (Exception e) {
                 e.printStackTrace();
             }
-            // 鏂扮増鎻愮幇
-            //TODO 閫氱煡杞处琚嫆缁�
+            //娣诲姞娑堟伅閫氱煡
+            try {
+                userMsgNotifyService.notify(UserMsgFactory.createExtractFail(extract.getUser().getId(), extract.getMoney(), null));
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
         }
     }
 

--
Gitblit v1.8.0