| | |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 消息通知工具类 |
| | | */ |
| | |
| | | * |
| | | * @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); |
| | |
| | | } |
| | | |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param communityId 小区 |
| | | * @param userId 用户 |
| | | * @param content { |
| | | * repairId, |
| | | * repairTypeName, |
| | | * repairObjName, |
| | | * repairName, |
| | |
| | | * @param communityId 小区 |
| | | * @param userId 用户 |
| | | * @param content { |
| | | * repairId, |
| | | * repairName, |
| | | * tel, |
| | | * time, |
| | |
| | | } |
| | | |
| | | /** |
| | | * 报修完成给业主通知 |
| | | * |
| | | * @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 |
| | |
| | | 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); |