소스 검색

优化代码

java110 2 년 전
부모
커밋
563f808712

+ 5 - 1
service-job/src/main/java/com/java110/job/adapt/fee/OweFeeCallableAdapt.java

@@ -125,7 +125,11 @@ public class OweFeeCallableAdapt extends DatabusAdaptImpl {
             content.put("billAmountOwed", oweFeeCallablePo.getAmountdOwed());
             content.put("billAmountOwed", oweFeeCallablePo.getAmountdOwed());
             content.put("date", DateUtil.dateTimeToDate(oweFeeCallablePo.getStartTime()) + "~" + DateUtil.dateTimeToDate(oweFeeCallablePo.getEndTime()));
             content.put("date", DateUtil.dateTimeToDate(oweFeeCallablePo.getStartTime()) + "~" + DateUtil.dateTimeToDate(oweFeeCallablePo.getEndTime()));
             content.put("url", oweUrl);
             content.put("url", oweUrl);
-            ResultVo resultVo = MsgNotifyFactory.sendOweFeeMsg(data.getString("communityId"), ownerAppUserDtos.get(0).getUserId(), content);
+            String notifyWay = MsgNotifyFactory.NOTIFY_WAY_WECHAT;
+            if (OweFeeCallableDto.CALLABLE_WAY_SMS.equals(oweFeeCallablePo.getCallableWay())) {
+                notifyWay = MsgNotifyFactory.NOTIFY_WAY_ALI;
+            }
+            ResultVo resultVo = MsgNotifyFactory.sendOweFeeMsg(data.getString("communityId"), ownerAppUserDtos.get(0).getUserId(), content, notifyWay);
             updateOweFeeCallablePo = new OweFeeCallablePo();
             updateOweFeeCallablePo = new OweFeeCallablePo();
             updateOweFeeCallablePo.setOfcId(oweFeeCallablePo.getOfcId());
             updateOweFeeCallablePo.setOfcId(oweFeeCallablePo.getOfcId());
             updateOweFeeCallablePo.setCommunityId(oweFeeCallablePo.getCommunityId());
             updateOweFeeCallablePo.setCommunityId(oweFeeCallablePo.getCommunityId());

+ 19 - 2
service-job/src/main/java/com/java110/job/msgNotify/MsgNotifyFactory.java

@@ -62,10 +62,10 @@ public class MsgNotifyFactory {
      *                    url
      *                    url
      *                    }
      *                    }
      */
      */
-    public static ResultVo sendOweFeeMsg(String communityId, String userId, JSONObject content) {
+    public static ResultVo sendOweFeeMsg(String communityId, String userId, JSONObject content,String notifyWay) {
         ResultVo resultVo = null;
         ResultVo resultVo = null;
         try {
         try {
-            IMsgNotify msgNotify = getMsgNotify();
+            IMsgNotify msgNotify = getMsgNotify(notifyWay);
             resultVo = msgNotify.sendOweFeeMsg(communityId, userId, content);
             resultVo = msgNotify.sendOweFeeMsg(communityId, userId, content);
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
@@ -76,6 +76,23 @@ public class MsgNotifyFactory {
         return resultVo;
         return resultVo;
     }
     }
 
 
+    /**
+     * 发送欠费 账单信息
+     *
+     * @param communityId 小区
+     * @param userId      用户
+     * @param content     {
+     *                    "feeTypeName",
+     *                    "payerObjName",
+     *                    "billAmountOwed",
+     *                    "date",
+     *                    url
+     *                    }
+     */
+    public static ResultVo sendOweFeeMsg(String communityId, String userId, JSONObject content) {
+        return sendOweFeeMsg(communityId,userId,content,null);
+    }
+
     /**
     /**
      * 发送缴费成功提醒
      * 发送缴费成功提醒
      *
      *