| | |
| | | package com.yeshi.fanli.entity.config.push;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.yeshi.fanli.dto.push.PushContentDTO;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | |
|
| | | public class PushMsgFactory {
|
| | |
|
| | | /**
|
| | | * 返利订单被统计
|
| | | * |
| | | * @param sourceType
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createFanLiOrderStatisticed(int sourceType, String orderId, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getFanliOrderStatisticedTitle();
|
| | | String content = Constant.znxConfig.getFanliOrderStatisticedMsg();
|
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType)).replace("[订单号]", orderId)
|
| | | .replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 分享订单被统计
|
| | | * |
| | | * @param sourceType
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createShareOrderStatisticed(int sourceType, String orderId, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getShareOrderStatisticedTitle();
|
| | | String content = Constant.znxConfig.getShareOrderStatisticedMsg();
|
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType))
|
| | | .replace("[订单号]",UserUtil.filterOrderId(orderId))
|
| | | .replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 邀请订单被统计
|
| | | * |
| | | * @param sourceType
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createInviteOrderStatisticed(int sourceType, String orderId, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getInviteOrderStatisticedTitle();
|
| | | String content = Constant.znxConfig.getInviteOrderStatisticedMsg();
|
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType))
|
| | | .replace("[订单号]",UserUtil.filterOrderId(orderId))
|
| | | .replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 返利到账
|
| | | * |
| | | * @param sourceType
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createMoneyFanliRecieved(int sourceType, String orderId, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getMoneyFanliRecievedTitle();
|
| | | String content = Constant.znxConfig.getMoneyFanliRecievedMsg();
|
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType)).replace("[订单号]", orderId)
|
| | | .replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 分享奖金到账
|
| | | * |
| | | * @param sourceType
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | |
|
| | | public static PushContentDTO createMoneyShareRecieved(int sourceType, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getMoneyShareRecievedTitle();
|
| | | String content = Constant.znxConfig.getMoneyShareRecievedMsg();
|
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType)).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 邀请奖金到账
|
| | | * |
| | | * @param sourceType
|
| | | * @param orderId
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createMoneyInviteRecieved(int sourceType, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getMoneyInviteRecievedTitle();
|
| | | String content = Constant.znxConfig.getMoneyInviteRecievedMsg();
|
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType)).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 系统补齐
|
| | | * |
| | | * @param reason
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createMoneySystemCompensate(String reason, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getMoneySystemCompensateTitle();
|
| | | String content = Constant.znxConfig.getMoneySystemCompensateMsg();
|
| | | content = content.replace("[原因]", reason).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 系统扣除
|
| | | * @param reason
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createMoneySystemSub(String reason, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getMoneySystemSubTitle();
|
| | | String content = Constant.znxConfig.getMoneySystemSubMsg();
|
| | | content = content.replace("[原因]", reason).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 系统奖励
|
| | | * @param reason
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createMoneySystemReward(String reason, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getMoneySystemRewardTitle();
|
| | | String content = Constant.znxConfig.getMoneySystemRewardMsg();
|
| | | content = content.replace("[原因]", reason).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 返利维权扣除
|
| | | * |
| | | * @param sourceType
|
| | | * @param orderId
|
| | | * @param part-是否为部分维权
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createMoneyOrderFanLiWeiquan(int sourceType, String orderId, boolean part,
|
| | | BigDecimal money) {
|
| | | String title = Constant.znxConfig.getMoneyWeiquanTitle();
|
| | | String content = Constant.znxConfig.getMoneyWeiquanMsg();
|
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType)).replace("[订单号]", orderId)
|
| | | .replace("[部分]", part ? "部分" : "").replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 分享或邀请维权扣除
|
| | | * |
| | | * @param sourceType
|
| | | * @param orderId
|
| | | * @param part
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | |
|
| | | public static PushContentDTO createMoneyOrderShareOrInviteWeiquan(int sourceType, String orderId, boolean part,
|
| | | BigDecimal money) {
|
| | | String title = Constant.znxConfig.getMoneyWeiquanTitle();
|
| | | String content = Constant.znxConfig.getMoneyWeiquanMsg();
|
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType))
|
| | | .replace("[订单号]", UserUtil.filterOrderId(orderId))
|
| | | .replace("[部分]", part ? "部分" : "").replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 提现成功
|
| | | * @param applyTime
|
| | | * @param money
|
| | | * @param alipayAccount
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createMoneyExtractSuccess(Date applyTime, BigDecimal money, String alipayAccount) {
|
| | | String title = Constant.znxConfig.getMoneyExtractSuccessTitle();
|
| | | String content = Constant.znxConfig.getMoneyExtractSuccessMsg();
|
| | | content = content.replace("[提现时间]", TimeUtil.getGernalTime(applyTime.getTime(), "yyyy.MM.dd HH:mm"))
|
| | | .replace("[支付宝账号]",UserUtil.filterAlipayAccount(alipayAccount)).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 提现失败
|
| | | * @param applyTime
|
| | | * @param money
|
| | | * @param alipayAccount
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createmoneyExtractFail(Date applyTime, BigDecimal money, String alipayAccount) {
|
| | | String title = Constant.znxConfig.getMoneyExtractFailTitle();
|
| | | String content = Constant.znxConfig.getMoneyExtractFailMsg();
|
| | | content = content.replace("[提现时间]", TimeUtil.getGernalTime(applyTime.getTime(), "yyyy.MM.dd HH:mm"))
|
| | | .replace("[支付宝账号]", UserUtil.filterAlipayAccount(alipayAccount)).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 现金红包
|
| | | * @param reason
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createHongbaoRecieved(String reason, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getHongbaoRecievedTitle();
|
| | | String content = Constant.znxConfig.getHongbaoRecievedMsg();
|
| | | content = content.replace("[原因]", reason).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 支付宝账号验证
|
| | | * @param alipayAccount
|
| | | * @param money
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createAlipayAccountValid(String alipayAccount, BigDecimal money) {
|
| | | String title = Constant.znxConfig.getAlipayAccountValidTitle();
|
| | | String content = Constant.znxConfig.getAlipayAccountValidMsg();
|
| | | content = content.replace("[支付宝账号]", UserUtil.filterAlipayAccount(alipayAccount)).replace("[金额]", money.toString());
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 积分兑换成功
|
| | | * @param reason
|
| | | * @param time
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createScoreExchangeSuccess(Date time, int score) {
|
| | | String title = Constant.znxConfig.getScoreExchangeSuccessTitle();
|
| | | String content = Constant.znxConfig.getScoreExchangeSuccessMsg();
|
| | | content = content.replace("[时间]", TimeUtil.getGernalTime(time.getTime(), "yyyy.MM.dd HH:mm")).replace("[积分数额]",
|
| | | score + "");
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 积分兑换失败
|
| | | * @param reason
|
| | | * @param time
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createScoreExchangeFail(String reason, Date time) {
|
| | | String title = Constant.znxConfig.getScoreExchangeFailTitle();
|
| | | String content = Constant.znxConfig.getScoreExchangeFailMsg();
|
| | | content = content.replace("[时间]", TimeUtil.getGernalTime(time.getTime(), "yyyy.MM.dd HH:mm")).replace("[原因]",
|
| | | reason);
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 功能开通成功
|
| | | * @param functionName
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createFunctionGetSuccess(String functionName) {
|
| | | String title = Constant.znxConfig.getFunctionGetSuccessTitle();
|
| | | String content = Constant.znxConfig.getFunctionGetSuccessMsg();
|
| | | content = content.replace("[增值功能]", functionName);
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 功能开通失败
|
| | | * @param functionName
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createFunctionGetFail(String functionName) {
|
| | | String title = Constant.znxConfig.getFunctionGetFailTitle();
|
| | | String content = Constant.znxConfig.getFunctionGetFailMsg();
|
| | | content = content.replace("[增值功能]", functionName);
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 邀请队员成功
|
| | | * @param time
|
| | | * @param nickName
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createInviteTeamSuccess(Date time, String nickName) {
|
| | | String title = Constant.znxConfig.getInviteTeamSuccessTitle();
|
| | | String content = Constant.znxConfig.getInviteTeamSuccessMsg();
|
| | | content = content.replace("[时间]", TimeUtil.getGernalTime(time.getTime(), "yyyy.MM.dd HH:mm")).replace("[队员昵称]",
|
| | | nickName);
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 客服唤起
|
| | | * @return
|
| | | */
|
| | | public static PushContentDTO createMsgKefu() {
|
| | | String title = Constant.znxConfig.getMsgKefuTitle();
|
| | | String content = Constant.znxConfig.getMsgKefuMsg();
|
| | | return new PushContentDTO(title, content);
|
| | | }
|
| | |
|
| | | }
|
| | | package com.yeshi.fanli.entity.config.push; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | import com.yeshi.fanli.dto.push.PushContentDTO; |
| | | import com.yeshi.fanli.util.Constant; |
| | | import org.yeshi.utils.TimeUtil; |
| | | import com.yeshi.fanli.util.account.UserUtil; |
| | | |
| | | public class PushMsgFactory { |
| | | |
| | | /** |
| | | * 返利订单被统计 |
| | | * |
| | | * @param sourceType |
| | | * @param orderId |
| | | * @param money |
| | | * @return |
| | | */ |
| | | public static PushContentDTO createFanLiOrderStatisticed(int sourceType, String orderId, BigDecimal money) { |
| | | String title = Constant.znxConfig.getFanliOrderStatisticedTitle(); |
| | | String content = Constant.znxConfig.getFanliOrderStatisticedMsg(); |
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType)).replace("[订单号]", orderId) |
| | | .replace("[金额]", money.toString()); |
| | | return new PushContentDTO(title, content); |
| | | } |
| | | |
| | | /** |
| | | * 分享订单被统计 |
| | | * |
| | | * @param sourceType |
| | | * @param orderId |
| | | * @param money |
| | | * @return |
| | | */ |
| | | public static PushContentDTO createShareOrderStatisticed(int sourceType, String orderId, BigDecimal money) { |
| | | String title = Constant.znxConfig.getShareOrderStatisticedTitle(); |
| | | String content = Constant.znxConfig.getShareOrderStatisticedMsg(); |
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType)) |
| | | .replace("[订单号]", orderId).replace("[金额]", money.toString()); |
| | | return new PushContentDTO(title, content); |
| | | } |
| | | |
| | | /** |
| | | * 邀请订单被统计 |
| | | * |
| | | * @param sourceType |
| | | * @param orderId |
| | | * @param money |
| | | * @return |
| | | */ |
| | | public static PushContentDTO createInviteOrderStatisticed(int sourceType, String orderId, BigDecimal money) { |
| | | String title = Constant.znxConfig.getInviteOrderStatisticedTitle(); |
| | | String content = Constant.znxConfig.getInviteOrderStatisticedMsg(); |
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType)) |
| | | .replace("[订单号]", UserUtil.filterOrderId(orderId)).replace("[金额]", money.toString()); |
| | | return new PushContentDTO(title, content); |
| | | } |
| | | |
| | | /** |
| | | * 返利到账 |
| | | * |
| | | * @param sourceType |
| | | * @param orderId |
| | | * @param money |
| | | * @return |
| | | */ |
| | | public static PushContentDTO createMoneyFanliRecieved(int sourceType, String orderId, BigDecimal money) { |
| | | String title = Constant.znxConfig.getMoneyFanliRecievedTitle(); |
| | | String content = Constant.znxConfig.getMoneyFanliRecievedMsg(); |
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType)).replace("[订单号]", orderId) |
| | | .replace("[金额]", money.toString()); |
| | | return new PushContentDTO(title, content); |
| | | } |
| | | |
| | | /** |
| | | * 分享奖金到账 |
| | | * |
| | | * @param sourceType |
| | | * @param orderId |
| | | * @param money |
| | | * @return |
| | | */ |
| | | |
| | | public static PushContentDTO createMoneyShareRecieved(int sourceType, BigDecimal money) { |
| | | String title = Constant.znxConfig.getMoneyShareRecievedTitle(); |
| | | String content = Constant.znxConfig.getMoneyShareRecievedMsg(); |
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType)).replace("[金额]", money.toString()); |
| | | return new PushContentDTO(title, content); |
| | | } |
| | | |
| | | /** |
| | | * 邀请奖金到账 |
| | | * |
| | | * @param sourceType |
| | | * @param orderId |
| | | * @param money |
| | | * @return |
| | | */ |
| | | public static PushContentDTO createMoneyInviteRecieved(int sourceType, BigDecimal money) { |
| | | String title = Constant.znxConfig.getMoneyInviteRecievedTitle(); |
| | | String content = Constant.znxConfig.getMoneyInviteRecievedMsg(); |
| | | content = content.replace("[订单类型]", Constant.getSourceName(sourceType)).replace("[金额]", money.toString()); |
| | | return new PushContentDTO(title, content); |
| | | } |
| | | |
| | | /** |
| | | * 团队分红 |
| | | * @Title: createMoneyTeamDividents |
| | | * @Description: |
| | | * @param sourceType |
| | | * @param money |
| | | * @return |
| | | * PushContentDTO 返回类型 |
| | | * @throws |
| | | */ |
| | | public static PushContentDTO createMoneyTeamDividents(BigDecimal money) { |
| | | String title = Constant.znxConfig.getMoneyTeamDividentsRecievedTitle(); |
| | | String content = Constant.znxConfig.getMoneyTeamDividentsRecievedMsg(); |
| | | content = content.replace("[金额]", money.toString()); |
| | | return new PushContentDTO(title, content); |
| | | } |
| | | |
| | | /** |
| | | * 系统补齐 |
| | | * |
| | | * @param reason |
| | | * @param money |
| | | * @return |
| | | */ |
| | | public static PushContentDTO createMoneySystemCompensate(String reason, BigDecimal money) { |
| | | String title = Constant.znxConfig.getMoneySystemCompensateTitle(); |
| | | String content = Constant.znxConfig.getMoneySystemCompensateMsg(); |
| | | content = content.replace("[原因]", reason).replace("[金额]", money.toString()); |
| | | return new PushContentDTO(title, content); |
| | | } |
| | | |
| | | /** |
| | | * 提现成功 |
| | | * @param applyTime |
| | | * @param money |
| | | * @param alipayAccount |
| | | * @return |
| | | */ |
| | | public static PushContentDTO createMoneyExtractSuccess(Date applyTime, BigDecimal money, String alipayAccount) { |
| | | String title = Constant.znxConfig.getMoneyExtractSuccessTitle(); |
| | | String content = Constant.znxConfig.getMoneyExtractSuccessMsg(); |
| | | content = content.replace("[提现时间]", TimeUtil.getGernalTime(applyTime.getTime(), "yyyy.MM.dd HH:mm")) |
| | | .replace("[支付宝账号]", UserUtil.filterAlipayAccount(alipayAccount)).replace("[金额]", money.toString()); |
| | | return new PushContentDTO(title, content); |
| | | } |
| | | |
| | | /** |
| | | * 邀请队员成功 |
| | | * @param time |
| | | * @param nickName |
| | | * @return |
| | | */ |
| | | public static PushContentDTO createInviteTeamSuccess(Date time, String nickName) { |
| | | String title = Constant.znxConfig.getInviteTeamSuccessTitle(); |
| | | String content = Constant.znxConfig.getInviteTeamSuccessMsg(); |
| | | content = content.replace("[时间]", TimeUtil.getGernalTime(time.getTime(), "yyyy.MM.dd HH:mm")).replace("[队员昵称]", |
| | | nickName); |
| | | return new PushContentDTO(title, content); |
| | | } |
| | | |
| | | } |