| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.scheduling.annotation.Async;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dto.push.PushContentDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgMoneyDetail.MsgTypeMoneyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.AlipayAccountValidNormalHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractWeiXinRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.config.push.PushMsgFactory;
|
| | | import com.yeshi.fanli.exception.msg.MsgMoneyDetailException;
|
| | | import com.yeshi.fanli.exception.push.PushException;
|
| | | import com.yeshi.fanli.service.inter.money.msg.MsgMoneyDetailService;
|
| | | import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.msg.MsgExtraService;
|
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.factory.msg.MsgMoneyDetailFactory;
|
| | |
| | | @Resource
|
| | | private PushService pushService;
|
| | |
|
| | | @Resource
|
| | | private MsgExtraService msgExtraService;
|
| | |
|
| | | @Override
|
| | | public void extractApplay(Extract extract) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractApplyMsg(extract, extract.getUserInfo().getId(),
|
| | | null);
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("人工审核中", extract.getUserInfo().getId(), extract,
|
| | | null, null, "审核将会在24小时内完成");
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Async
|
| | | @Override
|
| | | public void extractAuto(ExtractWeiXinRecord extractRecord, String stateDesc, String desc, String beiZhu) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractAutoMsg(extractRecord, stateDesc, desc, beiZhu);
|
| | | public void extractFail(Extract extract, String reason) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("提现失败", extract.getUserInfo().getId(), extract,
|
| | | reason, null, "如有疑问请联系人工客服");
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void extractFail(Extract extract, String stateDesc) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractFailMsg(extract, extract.getUserInfo().getId(),
|
| | | stateDesc);
|
| | | public void extractSuccess(Extract extract, String alipayNo) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractMsg("提现成功", extract.getUserInfo().getId(), extract,
|
| | | null, alipayNo, "如有疑问请联系人工客服");
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createmoneyExtractFail(new Date(extract.getExtractTime()),
|
| | | extract.getMoney(), extract.getAccount());
|
| | | try {
|
| | | pushService.pushZNX(extract.getUserInfo().getId(), dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void extractSuccess(Extract extract) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createExtractSuccessMsg(extract, extract.getUserInfo().getId(),
|
| | | null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | PushContentDTO dto = PushMsgFactory.createMoneyExtractSuccess(new Date(extract.getExtractTime()),
|
| | | extract.getMoney(), extract.getAccount());
|
| | | try {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void alipayAccountValid(AlipayAccountValidNormalHistory history) {
|
| | | public void alipayAccountValid(AlipayAccountValidNormalHistory history, String limitDay, boolean change) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createAlipayAccountValidMsg(history, history.getUid(),
|
| | | Constant.systemCommonConfig.getProjectChineseName(), new BigDecimal("0.1"), null);
|
| | | Constant.alipayConfig.getAccountName(), new BigDecimal("0.1"), limitDay, change);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createAlipayAccountValid(history.getAccount(), new BigDecimal("0.1"));
|
| | | @Override
|
| | | public void alipayAccountValidFail(AlipayAccountValidNormalHistory history, int limitDay, boolean change) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createAlipayAccountValidFail(history, history.getUid(),
|
| | | Constant.systemCommonConfig.getProjectChineseName(), new BigDecimal("0.1"), limitDay, change);
|
| | | try {
|
| | | pushService.pushZNX(history.getUid(), dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void fanliOrderReceived(Long uid, String orderId, int orderType, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createFailiMsg(money, balance, orderId, orderType, goodsCount,
|
| | | uid, null);
|
| | | BigDecimal balance, Date downTime) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.fanLiOrderReceivedMsg(money, balance, orderId, orderType,
|
| | | goodsCount, uid, downTime, false);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void fanliOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createFailiWeiQuanMsg(uid, orderId, orderType, money, balance,
|
| | | null);
|
| | | public void rewardCounponReceived(Long uid, String orderId, int orderType, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance, Date downTime) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.fanLiOrderReceivedMsg(money, balance, orderId, orderType,
|
| | | goodsCount, uid, downTime, true);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // TODO 需要传入是否部分维权
|
| | | PushContentDTO dto = PushMsgFactory.createMoneyOrderFanLiWeiquan(orderType, orderId, false, money);
|
| | | PushContentDTO dto = PushMsgFactory.createMoneyFanliRecieved(orderType, orderId, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void shareOrderReceived(Long uid, int orderType, int orderCount, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createShareMsg(money, balance, orderType, orderCount, goodsCount,
|
| | | uid, null);
|
| | | public void fanliOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal fanliMoney,
|
| | | int goodsCount, Date downTime) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createOrderWeiQuanMsg(uid, orderId, orderType, money, fanliMoney,
|
| | | goodsCount, downTime, Constant.TYPE_REBATE);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void shareOrderReceived(Long uid, int orderType, BigDecimal money, BigDecimal balance, Date receivedDate) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.shareOrderReceivedMsg(money, balance, orderType, uid,
|
| | | receivedDate);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createMoneyShareRecieved(orderType, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void shareOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createShareWeiQuanMsg(uid, orderId, orderType, money, balance,
|
| | | null);
|
| | | public void shareOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal fanliMoney,
|
| | | int goodsCount, Date downTime) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createOrderWeiQuanMsg(uid, orderId, orderType, money, fanliMoney,
|
| | | goodsCount, downTime, Constant.TYPE_SHAER);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createMoneyOrderShareOrInviteWeiquan(orderType, orderId, false, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void inviteOrderReceived(Long uid, int orderType, int orderCount, int goodsCount, BigDecimal money,
|
| | | BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createInviteMsg(money, balance, orderType, orderCount, goodsCount,
|
| | | uid, null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createMoneyInviteRecieved(orderType, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void inviteOrderWeiQuan(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createInviteWeiQuanMsg(uid, orderId, orderType, money, balance,
|
| | | null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | PushContentDTO dto = PushMsgFactory.createMoneyOrderShareOrInviteWeiquan(orderType, orderId, false, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void orderReward(Long uid, String orderId, int orderType, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createOrderRewardMsg(uid, orderId, orderType, money, balance,
|
| | | null);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createMoneySystemReward("使用返利奖励券", money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void systemEqualize(Long uid, String reason, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createSystemEqualizeMsg(uid, reason, money, balance, null);
|
| | | // MsgMoneyDetail detail =
|
| | | // MsgMoneyDetailFactory.createSystemEqualizeMsg(uid, reason, money,
|
| | | // balance, null);
|
| | | // try {
|
| | | // msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | // } catch (MsgMoneyDetailException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | //
|
| | | // PushContentDTO dto =
|
| | | // PushMsgFactory.createMoneySystemCompensate(reason, money);
|
| | | // try {
|
| | | // pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null,
|
| | | // null);
|
| | | // } catch (NumberFormatException e) {
|
| | | // e.printStackTrace();
|
| | | // } catch (PushException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void redPackMsg(Long uid, MsgTypeMoneyTypeEnum type, String content, String beiZhu) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createRedPackMsg(uid, type, content, beiZhu);
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | PushContentDTO dto = PushMsgFactory.createMoneySystemCompensate(reason, money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void elmeFanli(Long uid, String orderId, BigDecimal money, BigDecimal balance) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createElmeFanliMsg(uid, orderId, money, balance, null);
|
| | | public void teamRedPackRewardMsg(Long uid, MsgTypeMoneyTypeEnum type, BigDecimal money, String stateDesc,
|
| | | String content) {
|
| | | MsgMoneyDetail detail = new MsgMoneyDetail();
|
| | | detail.setRead(false);
|
| | | detail.setMoney(money);
|
| | | detail.setMsgType(type);
|
| | | detail.setContent(content);
|
| | | detail.setStateDesc(stateDesc);
|
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setBeiZhu("系统已下发到“我的-红包”中");
|
| | | detail.setCreateTime(new Date());
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void teamReceive(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createTeamReceivedMsg(uid, money, balance, receivedDate, "团队收益");
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void teamDividend(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate) {
|
| | | MsgMoneyDetail detail = MsgMoneyDetailFactory.createTeamReceivedMsg(uid, money, balance, receivedDate, "团队分红");
|
| | | try {
|
| | | msgMoneyDetailService.addMsgMoneyDetail(detail);
|
| | | } catch (MsgMoneyDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // 推送消息
|
| | | PushContentDTO dto = PushMsgFactory.createMoneyTeamDividents(money);
|
| | | try {
|
| | | pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (PushException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|