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 |  144 ++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 138 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 8bada03..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锛�
@@ -185,6 +206,116 @@
     }
 
     /**
+     * 鎶ヤ慨瀹屾垚缁欎笟涓婚�氱煡
+     *
+     * @param communityId 灏忓尯
+     * @param userId      鐢ㄦ埛
+     * @param content     {
+     *                    repairObjName锛�
+     *                    staffName锛�
+     *                    time锛�
+     *                    url
+     *                    }
+     * @return
+     */
+    public static ResultVo sendFinishRepairOwnerMsg(String communityId, String userId, JSONObject content) {
+        ResultVo resultVo = null;
+        try {
+            IMsgNotify msgNotify = getMsgNotify();
+            resultVo = msgNotify.sendFinishRepairOwnerMsg(communityId, userId, content);
+        } catch (Exception e) {
+            e.printStackTrace();
+            logger.error("閫氱煡 鎶ヤ慨瀹屾垚缁欎笟涓婚�氱煡 娑堟伅", e);
+            resultVo = new ResultVo(ResultVo.CODE_ERROR, e.getMessage());
+        }
+
+        return resultVo;
+    }
+
+
+    /**
+     * 閫�鍗曠粰涓氫富鍙戦�佹秷鎭�
+     *
+     * @param communityId 灏忓尯
+     * @param userId      鐢ㄦ埛
+     * @param content     {
+     *                    repairId,
+     *                    repairTypeName锛�
+     *                    repairObjName锛�
+     *                    repairName锛�
+     *                    url
+     *                    }
+     * @return
+     */
+    public static ResultVo sendReturnRepairMsg(String communityId, String userId, JSONObject content) {
+        ResultVo resultVo = null;
+        try {
+            IMsgNotify msgNotify = getMsgNotify();
+            resultVo = msgNotify.sendReturnRepairMsg(communityId, userId, content);
+        } catch (Exception e) {
+            e.printStackTrace();
+            logger.error("閫氱煡 涓氫富鎶ヤ慨鏃� 娑堟伅", e);
+            resultVo = new ResultVo(ResultVo.CODE_ERROR, e.getMessage());
+        }
+
+        return resultVo;
+    }
+
+
+    /**
+     *  oa 娴佺▼寰呭鎵归�氱煡
+     *
+     * @param communityId 灏忓尯
+     * @param userId      鐢ㄦ埛
+     * @param content     {
+     *                    flowName锛�
+     *                    create_user_name锛�
+     *                    create_time锛�
+     *                    url
+     *                    }
+     * @return
+     */
+    public static ResultVo sendOaDistributeMsg(String communityId, String userId, JSONObject content) {
+        ResultVo resultVo = null;
+        try {
+            IMsgNotify msgNotify = getMsgNotify();
+            resultVo = msgNotify.sendOaDistributeMsg(communityId, userId, content);
+        } catch (Exception e) {
+            e.printStackTrace();
+            logger.error("閫氱煡 涓氫富鎶ヤ慨鏃� 娑堟伅", e);
+            resultVo = new ResultVo(ResultVo.CODE_ERROR, e.getMessage());
+        }
+
+        return resultVo;
+    }
+
+    /**
+     *  oa 娴佺▼閫氱煡鍙戣捣浜�
+     *
+     * @param communityId 灏忓尯
+     * @param userId      鐢ㄦ埛
+     * @param content     {
+     *                    flowName锛�
+     *                    staffName锛�
+     *                    url
+     *                    }
+     * @return
+     */
+    public static ResultVo sendOaCreateStaffMsg(String communityId, String userId, JSONObject content) {
+        ResultVo resultVo = null;
+        try {
+            IMsgNotify msgNotify = getMsgNotify();
+            resultVo = msgNotify.sendOaCreateStaffMsg(communityId, userId, content);
+        } catch (Exception e) {
+            e.printStackTrace();
+            logger.error("閫氱煡 涓氫富鎶ヤ慨鏃� 娑堟伅", e);
+            resultVo = new ResultVo(ResultVo.CODE_ERROR, e.getMessage());
+        }
+
+        return resultVo;
+    }
+
+    /**
      * 鑾峰彇閫氱煡閫傞厤鍣�
      *
      * @return
@@ -193,13 +324,14 @@
         return getMsgNotify(null);
     }
 
+
     /**
      * 鑾峰彇閫氱煡閫傞厤鍣�
      *
      * @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