From afe3952e5fbf565cba6a2e4da82eec89f383fd4c Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期一, 22 一月 2024 22:20:17 +0800
Subject: [PATCH] 优化代码

---
 service-job/src/main/java/com/java110/job/msgNotify/MsgNotifyFactory.java |   34 ++++++++++++++++++++++++++++------
 1 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/service-job/src/main/java/com/java110/job/msgNotify/MsgNotifyFactory.java b/service-job/src/main/java/com/java110/job/msgNotify/MsgNotifyFactory.java
index fe1d511..220caef 100644
--- a/service-job/src/main/java/com/java110/job/msgNotify/MsgNotifyFactory.java
+++ b/service-job/src/main/java/com/java110/job/msgNotify/MsgNotifyFactory.java
@@ -10,6 +10,8 @@
 import com.java110.vo.ResultVo;
 import org.slf4j.Logger;
 
+import java.util.List;
+
 /**
  * 娑堟伅閫氱煡宸ュ叿绫�
  */
@@ -54,19 +56,19 @@
      *
      * @param communityId 灏忓尯
      * @param userId      鐢ㄦ埛
-     * @param content     {
+     * @param contents     [{
      *                    "feeTypeName",
      *                    "payerObjName",
      *                    "billAmountOwed",
      *                    "date",
      *                    url
-     *                    }
+     *                    }]
      */
-    public static ResultVo sendOweFeeMsg(String communityId, String userId, JSONObject content) {
+    public static ResultVo sendOweFeeMsg(String communityId, String userId, String ownerId, List<JSONObject> contents, String notifyWay) {
         ResultVo resultVo = null;
         try {
-            IMsgNotify msgNotify = getMsgNotify();
-            resultVo = msgNotify.sendOweFeeMsg(communityId, userId, content);
+            IMsgNotify msgNotify = getMsgNotify(notifyWay);
+            resultVo = msgNotify.sendOweFeeMsg(communityId, userId,ownerId, contents);
         } catch (Exception e) {
             e.printStackTrace();
             logger.error("閫氱煡 鍙戦�佹瑺璐� 璐﹀崟淇℃伅 娑堟伅", e);
@@ -74,6 +76,23 @@
         }
 
         return resultVo;
+    }
+
+    /**
+     * 鍙戦�佹瑺璐� 璐﹀崟淇℃伅
+     *
+     * @param communityId 灏忓尯
+     * @param userId      鐢ㄦ埛
+     * @param contents     [{
+     *                    "feeTypeName",
+     *                    "payerObjName",
+     *                    "billAmountOwed",
+     *                    "date",
+     *                    url
+     *                    }]
+     */
+    public static ResultVo sendOweFeeMsg(String communityId, String userId,String ownerId, List<JSONObject> contents) {
+        return sendOweFeeMsg(communityId,userId, ownerId,contents,null);
     }
 
     /**
@@ -109,6 +128,7 @@
      * @param communityId 灏忓尯
      * @param userId      鐢ㄦ埛
      * @param content     {
+     *                    repairId,
      *                    repairTypeName锛�
      *                    repairObjName锛�
      *                    repairName锛�
@@ -136,6 +156,7 @@
      * @param communityId 灏忓尯
      * @param userId      鐢ㄦ埛
      * @param content     {
+     *                    repairId,
      *                    repairName锛�
      *                    tel锛�
      *                    time锛�
@@ -218,6 +239,7 @@
      * @param communityId 灏忓尯
      * @param userId      鐢ㄦ埛
      * @param content     {
+     *                    repairId,
      *                    repairTypeName锛�
      *                    repairObjName锛�
      *                    repairName锛�
@@ -309,7 +331,7 @@
      * @param notifyWay
      * @return
      */
-    private static IMsgNotify getMsgNotify(String notifyWay) {
+    public static IMsgNotify getMsgNotify(String notifyWay) {
         IMsgNotify notify = null;
         if (StringUtil.isEmpty(notifyWay)) {
             notifyWay = MappingCache.getValue(MappingConstant.ENV_DOMAIN, DEFAULT_MSG_NOTIFY_WAY);

--
Gitblit v1.8.0