From d8359ddb48dab5cc797a9d552e11fde571f4920c Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期二, 27 八月 2019 12:32:46 +0800 Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div --- fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserMoneyMsgNotificationServiceImpl.java | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 105 insertions(+), 3 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserMoneyMsgNotificationServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserMoneyMsgNotificationServiceImpl.java index 9d597f0..accdf62 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserMoneyMsgNotificationServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserMoneyMsgNotificationServiceImpl.java @@ -1,17 +1,23 @@ package com.yeshi.fanli.service.impl.msg; import java.math.BigDecimal; +import java.util.Date; import javax.annotation.Resource; 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.user.AlipayAccountValidNormalHistory; import com.yeshi.fanli.entity.bus.user.Extract; +import com.yeshi.fanli.entity.config.push.PushMsgFactory; +import com.yeshi.fanli.exception.PushException; import com.yeshi.fanli.exception.msg.MsgMoneyDetailException; import com.yeshi.fanli.service.inter.msg.MsgMoneyDetailService; import com.yeshi.fanli.service.inter.msg.UserMoneyMsgNotificationService; +import com.yeshi.fanli.service.inter.push.PushService; +import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.factory.msg.MsgMoneyDetailFactory; @Service @@ -19,6 +25,8 @@ @Resource private MsgMoneyDetailService msgMoneyDetailService; + @Resource + private PushService pushService; @Override public void extractApplay(Extract extract) { @@ -41,6 +49,15 @@ 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 @@ -52,16 +69,33 @@ } catch (MsgMoneyDetailException e) { e.printStackTrace(); } - + PushContentDTO dto = PushMsgFactory.createMoneyExtractSuccess(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 alipayAccountValid(AlipayAccountValidNormalHistory history) { MsgMoneyDetail detail = MsgMoneyDetailFactory.createAlipayAccountValidMsg(history, history.getUid(), - "閲嶅簡灏忓奖璁扮鎶�鏈夐檺鍏徃", new BigDecimal("0.1"), null); + Constant.systemCommonConfig.getProjectChineseName(), new BigDecimal("0.1"), null); try { msgMoneyDetailService.addMsgMoneyDetail(detail); } catch (MsgMoneyDetailException e) { + e.printStackTrace(); + } + + PushContentDTO dto = PushMsgFactory.createAlipayAccountValid(history.getAccount(), new BigDecimal("0.1")); + try { + pushService.pushZNX(history.getUid(), dto.getTitle(), dto.getContent(), null, null); + } catch (NumberFormatException e) { + e.printStackTrace(); + } catch (PushException e) { e.printStackTrace(); } } @@ -77,6 +111,14 @@ e.printStackTrace(); } + PushContentDTO dto = PushMsgFactory.createMoneyFanliRecieved(orderType, orderId, money); + try { + pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null); + } catch (NumberFormatException e) { + e.printStackTrace(); + } catch (PushException e) { + e.printStackTrace(); + } } @Override @@ -86,6 +128,16 @@ try { msgMoneyDetailService.addMsgMoneyDetail(detail); } catch (MsgMoneyDetailException e) { + e.printStackTrace(); + } + + // TODO 闇�瑕佷紶鍏ユ槸鍚﹂儴鍒嗙淮鏉� + PushContentDTO dto = PushMsgFactory.createMoneyOrderFanLiWeiquan(orderType, orderId, false, money); + try { + pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null); + } catch (NumberFormatException e) { + e.printStackTrace(); + } catch (PushException e) { e.printStackTrace(); } } @@ -100,6 +152,14 @@ } catch (MsgMoneyDetailException e) { e.printStackTrace(); } + PushContentDTO dto = PushMsgFactory.createMoneyShareRecieved(orderType, money); + try { + pushService.pushZNX(uid, dto.getTitle(), dto.getContent(), null, null); + } catch (NumberFormatException e) { + e.printStackTrace(); + } catch (PushException e) { + e.printStackTrace(); + } } @Override @@ -109,6 +169,15 @@ 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(); } @@ -125,6 +194,14 @@ 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 @@ -136,7 +213,14 @@ } 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 @@ -148,6 +232,15 @@ } 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 @@ -158,6 +251,15 @@ } 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(); + } } } -- Gitblit v1.8.0