Bladeren bron

优化带阿妈啊啊

wuxw 2 jaren geleden
bovenliggende
commit
6bbe7f2873

+ 4 - 1
service-job/src/main/java/com/java110/job/adapt/Repair/MachineReturnRepairAdapt.java

@@ -41,6 +41,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.client.RestTemplate;
 
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -306,6 +307,7 @@ public class MachineReturnRepairAdapt extends DatabusAdaptImpl {
         if (ownerAppUserDtos == null || ownerAppUserDtos.size() < 1) {
             userId = ownerAppUserDtos.get(0).getUserId();
         }
+        List<JSONObject> contents = new ArrayList<>();
         JSONObject content = new JSONObject();
         content.put("feeTypeName", "维修费");
         content.put("payerObjName", paramIn.getString("roomName"));
@@ -318,7 +320,8 @@ public class MachineReturnRepairAdapt extends DatabusAdaptImpl {
             wechatUrl += ("?wAppId=" + smallWeChatDtos.get(0).getAppId());
         }
         content.put("url", wechatUrl);
-        MsgNotifyFactory.sendOweFeeMsg(communityDto.getCommunityId(), userId, ownerId, content);
+        contents.add(content);
+        MsgNotifyFactory.sendOweFeeMsg(communityDto.getCommunityId(), userId, ownerId, contents);
 
     }
 }

+ 53 - 36
service-job/src/main/java/com/java110/job/adapt/fee/OweFeeCallableAdapt.java

@@ -93,48 +93,65 @@ public class OweFeeCallableAdapt extends DatabusAdaptImpl {
         OweFeeCallablePo updateOweFeeCallablePo = null;
         OwnerAppUserDto ownerAppUserDto = null;
         String userId = "";
-        for (OweFeeCallablePo oweFeeCallablePo : oweFeeCallablePos) {
+        List<JSONObject> contents = null;
+        for (int roomIndex = 0; roomIndex < roomIds.size(); roomIndex++) {
+            contents = new ArrayList<>();
+            String notifyWay = MsgNotifyFactory.NOTIFY_WAY_WECHAT;
+            for (OweFeeCallablePo oweFeeCallablePo : oweFeeCallablePos) {
+                if (StringUtil.isEmpty(oweFeeCallablePo.getOwnerId()) || oweFeeCallablePo.getOwnerId().startsWith("-")) {
+                    updateOweFeeCallablePo = new OweFeeCallablePo();
+                    updateOweFeeCallablePo.setOfcId(oweFeeCallablePo.getOfcId());
+                    updateOweFeeCallablePo.setCommunityId(oweFeeCallablePo.getCommunityId());
+                    updateOweFeeCallablePo.setState(OweFeeCallableDto.STATE_FAIL);
+                    updateOweFeeCallablePo.setRemark(oweFeeCallablePo.getRemark() + "-业主不存在");
+                    oweFeeCallableV1InnerServiceSMOImpl.updateOweFeeCallable(updateOweFeeCallablePo);
+                    continue;
+                }
+                ownerAppUserDto = new OwnerAppUserDto();
+                ownerAppUserDto.setMemberId(oweFeeCallablePo.getOwnerId());
+                ownerAppUserDto.setCommunityId(oweFeeCallablePo.getCommunityId());
+                ownerAppUserDto.setAppType(OwnerAppUserDto.APP_TYPE_WECHAT);
+                List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
+                if (ownerAppUserDtos != null && ownerAppUserDtos.size() > 0) {
+                    userId = ownerAppUserDtos.get(0).getUserId();
+                }
+
+                oweUrl = FeeDto.PAYER_OBJ_TYPE_ROOM.equals(oweFeeCallablePo.getPayerObjType()) ? oweRoomUrl : oweCarUrl;
+                content = new JSONObject();
+                content.put("feeTypeName", oweFeeCallablePo.getFeeName());
+                content.put("payerObjName", oweFeeCallablePo.getPayerObjName());
+                content.put("billAmountOwed", oweFeeCallablePo.getAmountdOwed());
+                content.put("date", DateUtil.dateTimeToDate(oweFeeCallablePo.getStartTime()) + "~" + DateUtil.dateTimeToDate(oweFeeCallablePo.getEndTime()));
+                content.put("url", oweUrl + oweFeeCallablePo.getPayerObjId());
+
+                if (OweFeeCallableDto.CALLABLE_WAY_SMS.equals(oweFeeCallablePo.getCallableWay())) {
+                    notifyWay = MsgNotifyFactory.NOTIFY_WAY_ALI;
+                }
+                contents.add(content);
+
+            }
+
+            if(contents.size()< 1){
+                continue;
+            }
 
-            if (StringUtil.isEmpty(oweFeeCallablePo.getOwnerId()) || oweFeeCallablePo.getOwnerId().startsWith("-")) {
+            //todo 催缴
+            ResultVo resultVo = MsgNotifyFactory.sendOweFeeMsg(data.getString("communityId"), userId, oweFeeCallablePos.get(0).getOwnerId(), contents, notifyWay);
+            for (OweFeeCallablePo oweFeeCallablePo : oweFeeCallablePos) {
+                if (StringUtil.isEmpty(oweFeeCallablePo.getOwnerId()) || oweFeeCallablePo.getOwnerId().startsWith("-")) {
+                    continue;
+                }
                 updateOweFeeCallablePo = new OweFeeCallablePo();
                 updateOweFeeCallablePo.setOfcId(oweFeeCallablePo.getOfcId());
                 updateOweFeeCallablePo.setCommunityId(oweFeeCallablePo.getCommunityId());
-                updateOweFeeCallablePo.setState(OweFeeCallableDto.STATE_FAIL);
-                updateOweFeeCallablePo.setRemark(oweFeeCallablePo.getRemark() + "-业主不存在");
+                if (resultVo.getCode() != ResultVo.CODE_OK) {
+                    updateOweFeeCallablePo.setState(OweFeeCallableDto.STATE_FAIL);
+                    updateOweFeeCallablePo.setRemark(oweFeeCallablePo.getRemark() + "-" + resultVo.getMsg());
+                } else {
+                    updateOweFeeCallablePo.setState(OweFeeCallableDto.STATE_COMPLETE);
+                }
                 oweFeeCallableV1InnerServiceSMOImpl.updateOweFeeCallable(updateOweFeeCallablePo);
-                continue;
-            }
-            ownerAppUserDto = new OwnerAppUserDto();
-            ownerAppUserDto.setMemberId(oweFeeCallablePo.getOwnerId());
-            ownerAppUserDto.setCommunityId(oweFeeCallablePo.getCommunityId());
-            ownerAppUserDto.setAppType(OwnerAppUserDto.APP_TYPE_WECHAT);
-            List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
-            if (ownerAppUserDtos != null && ownerAppUserDtos.size() > 0) {
-                userId = ownerAppUserDtos.get(0).getUserId();
-            }
-
-            oweUrl = FeeDto.PAYER_OBJ_TYPE_ROOM.equals(oweFeeCallablePo.getPayerObjType()) ? oweRoomUrl : oweCarUrl;
-            content = new JSONObject();
-            content.put("feeTypeName", oweFeeCallablePo.getFeeName());
-            content.put("payerObjName", oweFeeCallablePo.getPayerObjName());
-            content.put("billAmountOwed", oweFeeCallablePo.getAmountdOwed());
-            content.put("date", DateUtil.dateTimeToDate(oweFeeCallablePo.getStartTime()) + "~" + DateUtil.dateTimeToDate(oweFeeCallablePo.getEndTime()));
-            content.put("url", oweUrl+oweFeeCallablePo.getPayerObjId());
-            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"), userId, oweFeeCallablePo.getOwnerId(), content, notifyWay);
-            updateOweFeeCallablePo = new OweFeeCallablePo();
-            updateOweFeeCallablePo.setOfcId(oweFeeCallablePo.getOfcId());
-            updateOweFeeCallablePo.setCommunityId(oweFeeCallablePo.getCommunityId());
-            if (resultVo.getCode() != ResultVo.CODE_OK) {
-                updateOweFeeCallablePo.setState(OweFeeCallableDto.STATE_FAIL);
-                updateOweFeeCallablePo.setRemark(oweFeeCallablePo.getRemark() + "-" + resultVo.getMsg());
-            } else {
-                updateOweFeeCallablePo.setState(OweFeeCallableDto.STATE_COMPLETE);
             }
-            oweFeeCallableV1InnerServiceSMOImpl.updateOweFeeCallable(updateOweFeeCallablePo);
         }
     }
 

+ 5 - 3
service-job/src/main/java/com/java110/job/msgNotify/IMsgNotify.java

@@ -3,6 +3,8 @@ package com.java110.job.msgNotify;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.vo.ResultVo;
 
+import java.util.List;
+
 /**
  * 消息通知 接口类
  */
@@ -22,16 +24,16 @@ public interface IMsgNotify {
      *
      * @param communityId 小区
      * @param userId 用户
-     * @param content {
+     * @param contents [{
      *                    "feeTypeName",
      *                     "payerObjName",
      *                     "billAmountOwed",
      *                     "date",
      *                url
-     * }
+     * }]
      * @return
      */
-    ResultVo sendOweFeeMsg(String communityId, String userId,String ownerId, JSONObject content);
+    ResultVo sendOweFeeMsg(String communityId, String userId,String ownerId, List<JSONObject> contents);
 
     /**
      * 发送缴费成功提醒

+ 10 - 8
service-job/src/main/java/com/java110/job/msgNotify/MsgNotifyFactory.java

@@ -10,6 +10,8 @@ import com.java110.utils.util.StringUtil;
 import com.java110.vo.ResultVo;
 import org.slf4j.Logger;
 
+import java.util.List;
+
 /**
  * 消息通知工具类
  */
@@ -54,19 +56,19 @@ public class MsgNotifyFactory {
      *
      * @param communityId 小区
      * @param userId      用户
-     * @param content     {
+     * @param contents     [{
      *                    "feeTypeName",
      *                    "payerObjName",
      *                    "billAmountOwed",
      *                    "date",
      *                    url
-     *                    }
+     *                    }]
      */
-    public static ResultVo sendOweFeeMsg(String communityId, String userId,String ownerId, JSONObject content,String notifyWay) {
+    public static ResultVo sendOweFeeMsg(String communityId, String userId, String ownerId, List<JSONObject> contents, String notifyWay) {
         ResultVo resultVo = null;
         try {
             IMsgNotify msgNotify = getMsgNotify(notifyWay);
-            resultVo = msgNotify.sendOweFeeMsg(communityId, userId,ownerId, content);
+            resultVo = msgNotify.sendOweFeeMsg(communityId, userId,ownerId, contents);
         } catch (Exception e) {
             e.printStackTrace();
             logger.error("通知 发送欠费 账单信息 消息", e);
@@ -81,16 +83,16 @@ public class MsgNotifyFactory {
      *
      * @param communityId 小区
      * @param userId      用户
-     * @param content     {
+     * @param contents     [{
      *                    "feeTypeName",
      *                    "payerObjName",
      *                    "billAmountOwed",
      *                    "date",
      *                    url
-     *                    }
+     *                    }]
      */
-    public static ResultVo sendOweFeeMsg(String communityId, String userId,String ownerId, JSONObject content) {
-        return sendOweFeeMsg(communityId,userId, ownerId,content,null);
+    public static ResultVo sendOweFeeMsg(String communityId, String userId,String ownerId, List<JSONObject> contents) {
+        return sendOweFeeMsg(communityId,userId, ownerId,contents,null);
     }
 
     /**

+ 16 - 9
service-job/src/main/java/com/java110/job/msgNotify/ali/AliMsgNotifyImpl.java

@@ -28,6 +28,7 @@ import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 @Service("aliMsgNotifyImpl")
@@ -46,21 +47,21 @@ public class AliMsgNotifyImpl implements IMsgNotify {
      * 发送欠费 账单信息
      * <p>
      * 需要在阿里云 申请短信模板为
-     * 尊敬的业主,您${house}的${feeType},账单日期${date}至${date2},缴费金额:${mount}元,请及时缴费
+     * 尊敬的业主,您${house}的账单已生成,缴费金额:${mount}元,请及时缴费
      *
      * @param communityId 小区
      * @param userId      用户
-     * @param content     {
+     * @param contents     [{
      *                    "feeTypeName",
      *                    "payerObjName",
      *                    "billAmountOwed",
      *                    "date",
      *                    url
-     *                    }
+     *                    }]
      * @return
      */
     @Override
-    public ResultVo sendOweFeeMsg(String communityId, String userId, String ownerId, JSONObject content) {
+    public ResultVo sendOweFeeMsg(String communityId, String userId, String ownerId, List<JSONObject> contents) {
 
 
         if (StringUtil.isEmpty(ownerId) || ownerId.startsWith("-")) {
@@ -95,12 +96,18 @@ public class AliMsgNotifyImpl implements IMsgNotify {
         request.putQueryParameter("SignName", signName);
         request.putQueryParameter("TemplateCode", templateCode);
 
+        BigDecimal oweFee = new BigDecimal(0);
+
+        for(JSONObject content : contents){
+            oweFee = oweFee.add(new BigDecimal(content.getDouble("billAmountOwed")));
+        }
+
         JSONObject param = new JSONObject();
-        param.put("house", content.getString("payerObjName"));
-        param.put("feeType", content.getString("feeTypeName"));
-        param.put("date", content.getString("date").split("~")[0]);
-        param.put("date2", content.getString("date").split("~")[1]);
-        param.put("mount", content.getString("billAmountOwed"));
+        param.put("house", contents.get(0).getString("payerObjName"));
+//        param.put("feeType", content.getString("feeTypeName"));
+//        param.put("date", content.getString("date").split("~")[0]);
+//        param.put("date2", content.getString("date").split("~")[1]);
+        param.put("mount", oweFee.doubleValue());
         request.putQueryParameter("TemplateParam", param.toString());
 
         String resParam = "";

+ 24 - 19
service-job/src/main/java/com/java110/job/msgNotify/wechat/WechatMsgNotifyImpl.java

@@ -138,17 +138,17 @@ public class WechatMsgNotifyImpl implements IMsgNotify {
      *
      * @param communityId 小区
      * @param userId      用户
-     * @param content     {
+     * @param contents     [{
      *                    "feeTypeName",
      *                    "payerObjName",
      *                    "billAmountOwed",
      *                    "date",
      *                    url
-     *                    }
+     *                    }]
      * @return
      */
     @Override
-    public ResultVo sendOweFeeMsg(String communityId, String userId,String ownerId, JSONObject content) {
+    public ResultVo sendOweFeeMsg(String communityId, String userId,String ownerId, List<JSONObject> contents) {
 
         if(StringUtil.isEmpty(userId) || userId.startsWith("-")){
             throw new IllegalArgumentException("业主未绑定,没有获取到微信openId");
@@ -174,22 +174,27 @@ public class WechatMsgNotifyImpl implements IMsgNotify {
         String templateId = wechatTemplateImpl.getTemplateId(communityId, mapping.getValue(), mapping.getName(), templateKeys.get(SPEC_CD_OWE_FEE_TEMPLATE));
 
         String url = sendMsgUrl + accessToken;
-        JSONObject data = new JSONObject();
-        PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage();
-        templateMessage.setTemplate_id(templateId);
-        templateMessage.setTouser(openId);
-        data.put("thing2",new Content(content.getString("feeTypeName")));
-        data.put("thing12",new Content(content.getString("payerObjName")));
-        data.put("amount3",new Content(content.getString("billAmountOwed")));
-        data.put("time19",new Content(content.getString("date")));
-        templateMessage.setData(data);
-        templateMessage.setUrl(content.getString("url")+"&wAppId="+wechatTemplateImpl.getAppId(communityId));
-        logger.info("发送模板消息内容:{}", JSON.toJSONString(templateMessage));
-        ResponseEntity<String> responseEntity = outRestTemplate.postForEntity(url, JSON.toJSONString(templateMessage), String.class);
-        logger.info("微信模板返回内容:{}", responseEntity);
-
-        JSONObject paramOut = JSONObject.parseObject(responseEntity.getBody());
-        return new ResultVo(paramOut.getIntValue("errcode"), paramOut.getString("errmsg"));
+        JSONObject paramOut = null;
+        for(JSONObject content: contents) {
+            JSONObject data = new JSONObject();
+            PropertyFeeTemplateMessage templateMessage = new PropertyFeeTemplateMessage();
+            templateMessage.setTemplate_id(templateId);
+            templateMessage.setTouser(openId);
+            data.put("thing2", new Content(content.getString("feeTypeName")));
+            data.put("thing12", new Content(content.getString("payerObjName")));
+            data.put("amount3", new Content(content.getString("billAmountOwed")));
+            data.put("time19", new Content(content.getString("date")));
+            templateMessage.setData(data);
+            templateMessage.setUrl(content.getString("url") + "&wAppId=" + wechatTemplateImpl.getAppId(communityId));
+            logger.info("发送模板消息内容:{}", JSON.toJSONString(templateMessage));
+            ResponseEntity<String> responseEntity = outRestTemplate.postForEntity(url, JSON.toJSONString(templateMessage), String.class);
+            logger.info("微信模板返回内容:{}", responseEntity);
+            paramOut = JSONObject.parseObject(responseEntity.getBody());
+            if(paramOut.getIntValue("errcode")!=0){
+                return new ResultVo(paramOut.getIntValue("errcode"), paramOut.getString("errmsg"));
+            }
+        }
+        return new ResultVo(ResultVo.CODE_OK, "成功");
     }
 
     @Override

+ 80 - 46
service-job/src/main/java/com/java110/job/task/wechat/PublicWeChatPushMessageTemplate.java

@@ -1,24 +1,14 @@
 package com.java110.job.task.wechat;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.core.factory.WechatFactory;
 import com.java110.core.log.LoggerFactory;
 import com.java110.dto.community.CommunityDto;
-import com.java110.dto.fee.BillOweFeeDto;
 import com.java110.dto.fee.FeeDto;
 import com.java110.dto.oweFeeCallable.OweFeeCallableDto;
 import com.java110.dto.owner.OwnerAppUserDto;
 import com.java110.dto.reportFee.ReportOweFeeDto;
-import com.java110.dto.wechat.SmallWeChatDto;
-import com.java110.dto.wechat.SmallWechatAttrDto;
 import com.java110.dto.task.TaskDto;
-import com.java110.dto.wechat.Content;
-import com.java110.dto.wechat.Data;
-import com.java110.dto.wechat.Miniprogram;
-import com.java110.dto.wechat.PropertyFeeTemplateMessage;
 import com.java110.intf.fee.IFeeInnerServiceSMO;
 import com.java110.intf.fee.IOweFeeCallableV1InnerServiceSMO;
 import com.java110.intf.report.IReportOweFeeInnerServiceSMO;
@@ -37,15 +27,13 @@ import com.java110.utils.util.StringUtil;
 import com.java110.vo.ResultVo;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
 import org.springframework.web.client.RestTemplate;
 
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @program: MicroCommunity
@@ -166,48 +154,94 @@ public class PublicWeChatPushMessageTemplate extends TaskSystemQuartz {
 
         ResultVo resultVo = null;
         String userId = "";
-        for (OweFeeCallablePo tmpOweFeeCallablePo : oweFeeCallablePos) {
-            if (StringUtil.isEmpty(tmpOweFeeCallablePo.getOwnerId()) || tmpOweFeeCallablePo.getOwnerId().startsWith("-")) {
+
+        //todo 根据房屋发送欠费信息
+        Map<String, List<OweFeeCallablePo>> roomOweFeeCallables = computeRoomOweFeeCallable(oweFeeCallablePos);
+        List<JSONObject> contents = null;
+        for (String key : roomOweFeeCallables.keySet()) {
+            contents = new ArrayList<>();
+            for (OweFeeCallablePo tmpOweFeeCallablePo : roomOweFeeCallables.get(key)) {
+                if (StringUtil.isEmpty(tmpOweFeeCallablePo.getOwnerId()) || tmpOweFeeCallablePo.getOwnerId().startsWith("-")) {
+                    updateOweFeeCallablePo = new OweFeeCallablePo();
+                    updateOweFeeCallablePo.setOfcId(tmpOweFeeCallablePo.getOfcId());
+                    updateOweFeeCallablePo.setCommunityId(tmpOweFeeCallablePo.getCommunityId());
+                    updateOweFeeCallablePo.setState(OweFeeCallableDto.STATE_FAIL);
+                    updateOweFeeCallablePo.setRemark(tmpOweFeeCallablePo.getRemark() + "-业主不存在");
+                    oweFeeCallableV1InnerServiceSMOImpl.updateOweFeeCallable(updateOweFeeCallablePo);
+                    continue;
+                }
+
+                oweUrl = FeeDto.PAYER_OBJ_TYPE_ROOM.equals(tmpOweFeeCallablePo.getPayerObjType()) ? oweRoomUrl : oweCarUrl;
+                content = new JSONObject();
+                content.put("feeTypeName", tmpOweFeeCallablePo.getFeeName());
+                content.put("payerObjName", tmpOweFeeCallablePo.getPayerObjName());
+                content.put("billAmountOwed", tmpOweFeeCallablePo.getAmountdOwed());
+                content.put("date", DateUtil.dateTimeToDate(tmpOweFeeCallablePo.getStartTime()) + "~" + DateUtil.dateTimeToDate(tmpOweFeeCallablePo.getEndTime()));
+                content.put("url", oweUrl);
+
+                ownerAppUserDto = new OwnerAppUserDto();
+                ownerAppUserDto.setMemberId(tmpOweFeeCallablePo.getOwnerId());
+                ownerAppUserDto.setCommunityId(tmpOweFeeCallablePo.getCommunityId());
+                ownerAppUserDto.setAppType(OwnerAppUserDto.APP_TYPE_WECHAT);
+                List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
+                if (ownerAppUserDtos != null && ownerAppUserDtos.size() > 0) {
+                    userId = ownerAppUserDtos.get(0).getUserId();
+                }
+                contents.add(content);
+
+            }
+            if (contents.size() < 1) {
+                continue;
+            }
+
+            //todo 发送推送消息
+            resultVo = MsgNotifyFactory.sendOweFeeMsg(communityDto.getCommunityId(), userId, roomOweFeeCallables.get(key).get(0).getOwnerId(), contents);
+
+
+            for (OweFeeCallablePo tmpOweFeeCallablePo : roomOweFeeCallables.get(key)) {
+                if (StringUtil.isEmpty(tmpOweFeeCallablePo.getOwnerId()) || tmpOweFeeCallablePo.getOwnerId().startsWith("-")) {
+                    continue;
+                }
                 updateOweFeeCallablePo = new OweFeeCallablePo();
                 updateOweFeeCallablePo.setOfcId(tmpOweFeeCallablePo.getOfcId());
                 updateOweFeeCallablePo.setCommunityId(tmpOweFeeCallablePo.getCommunityId());
-                updateOweFeeCallablePo.setState(OweFeeCallableDto.STATE_FAIL);
-                updateOweFeeCallablePo.setRemark(tmpOweFeeCallablePo.getRemark() + "-业主不存在");
+                if (resultVo.getCode() != ResultVo.CODE_OK) {
+                    updateOweFeeCallablePo.setState(OweFeeCallableDto.STATE_FAIL);
+                    updateOweFeeCallablePo.setRemark(tmpOweFeeCallablePo.getRemark() + "-" + resultVo.getMsg());
+                } else {
+                    updateOweFeeCallablePo.setState(OweFeeCallableDto.STATE_COMPLETE);
+                }
                 oweFeeCallableV1InnerServiceSMOImpl.updateOweFeeCallable(updateOweFeeCallablePo);
-                continue;
             }
 
-            oweUrl = FeeDto.PAYER_OBJ_TYPE_ROOM.equals(tmpOweFeeCallablePo.getPayerObjType()) ? oweRoomUrl : oweCarUrl;
-            content = new JSONObject();
-            content.put("feeTypeName", tmpOweFeeCallablePo.getFeeName());
-            content.put("payerObjName", tmpOweFeeCallablePo.getPayerObjName());
-            content.put("billAmountOwed", tmpOweFeeCallablePo.getAmountdOwed());
-            content.put("date", DateUtil.dateTimeToDate(tmpOweFeeCallablePo.getStartTime()) + "~" + DateUtil.dateTimeToDate(tmpOweFeeCallablePo.getEndTime()));
-            content.put("url", oweUrl);
-
-            ownerAppUserDto = new OwnerAppUserDto();
-            ownerAppUserDto.setMemberId(tmpOweFeeCallablePo.getOwnerId());
-            ownerAppUserDto.setCommunityId(tmpOweFeeCallablePo.getCommunityId());
-            ownerAppUserDto.setAppType(OwnerAppUserDto.APP_TYPE_WECHAT);
-            List<OwnerAppUserDto> ownerAppUserDtos = ownerAppUserInnerServiceSMOImpl.queryOwnerAppUsers(ownerAppUserDto);
-            if (ownerAppUserDtos != null && ownerAppUserDtos.size() > 0) {
-                userId = ownerAppUserDtos.get(0).getUserId();
-            }
+        }
 
-            //todo 发送推送消息
-            resultVo = MsgNotifyFactory.sendOweFeeMsg(communityDto.getCommunityId(), userId, tmpOweFeeCallablePo.getOwnerId(), content);
 
+    }
 
-            updateOweFeeCallablePo = new OweFeeCallablePo();
-            updateOweFeeCallablePo.setOfcId(tmpOweFeeCallablePo.getOfcId());
-            updateOweFeeCallablePo.setCommunityId(tmpOweFeeCallablePo.getCommunityId());
-            if (resultVo.getCode() != ResultVo.CODE_OK) {
-                updateOweFeeCallablePo.setState(OweFeeCallableDto.STATE_FAIL);
-                updateOweFeeCallablePo.setRemark(tmpOweFeeCallablePo.getRemark() + "-" + resultVo.getMsg());
-            } else {
-                updateOweFeeCallablePo.setState(OweFeeCallableDto.STATE_COMPLETE);
+    /**
+     * 根据房屋
+     *
+     * @param oweFeeCallablePos
+     * @return
+     */
+    private Map<String, List<OweFeeCallablePo>> computeRoomOweFeeCallable(List<OweFeeCallablePo> oweFeeCallablePos) {
+
+        Map<String, List<OweFeeCallablePo>> infos = new HashMap<>();
+
+        List<OweFeeCallablePo> tmps = null;
+        for (OweFeeCallablePo oweFeeCallablePo : oweFeeCallablePos) {
+            if (infos.containsKey(oweFeeCallablePo.getPayerObjId())) {
+                tmps = infos.get(oweFeeCallablePo.getPayerObjId());
+                tmps.add(oweFeeCallablePo);
+                continue;
             }
-            oweFeeCallableV1InnerServiceSMOImpl.updateOweFeeCallable(updateOweFeeCallablePo);
+
+            tmps = new ArrayList<>();
+            tmps.add(oweFeeCallablePo);
+            infos.put(oweFeeCallablePo.getPayerObjId(), tmps);
         }
+
+        return infos;
     }
 }