From 2be98321c477b47f40bb3994b4d7634a2722f335 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期二, 27 八月 2019 11:16:22 +0800 Subject: [PATCH] 领取金币 --- fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java | 86 +++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 82 insertions(+), 4 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java index e2b28ff..efc5294 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java @@ -9,6 +9,7 @@ import com.google.gson.Gson; import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO; +import com.yeshi.fanli.dto.msg.MsgOtherExchangeContentDTO; import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO; import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO; import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail; @@ -234,7 +235,7 @@ coupon.getSource(), coupon.getStartTime(), coupon.getEndTime()); try { msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), - coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "杩斿埄宸插埌璐﹀悗鍐嶅鍔辫繑鍒╃殑" + percent + "%")); + coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "浣跨敤鏈埜宸插埌璐︾殑杩斿埄鍐嶈繑" + percent + "%")); } catch (MsgOtherDetailException e) { e.printStackTrace(); } @@ -249,7 +250,7 @@ rewardMoney, orderId); try { msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), - coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "鍙備笌娲诲姩鍙幏鍙栨洿澶氬鍔卞埜")); + coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "瀹屾垚閲戝竵浠诲姟锛屽厬鎹㈡洿澶氬鍔卞埜")); } catch (MsgOtherDetailException e) { e.printStackTrace(); } @@ -263,7 +264,7 @@ getLeftDay(coupon), coupon.getSource(), coupon.getStartTime(), coupon.getEndTime()); try { msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), - coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "杩斿埄宸插埌璐﹀悗鍐嶅鍔辫繑鍒╃殑" + percent + "%")); + coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "浣跨敤鏈埜宸插埌璐︾殑杩斿埄鍐嶈繑" + percent + "%")); } catch (MsgOtherDetailException e) { e.printStackTrace(); } @@ -277,7 +278,7 @@ .createRewardCouponAlreadyOutOfDate(coupon.getSource(), coupon.getStartTime(), coupon.getEndTime()); try { MsgOtherDetail detail = MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), coupon.getId(), dto, - MsgTypeOtherTypeEnum.couponReward, "鍙備笌娲诲姩鍙幏鍙栨洿澶氬鍔卞埜"); + MsgTypeOtherTypeEnum.couponReward, "瀹屾垚閲戝竵浠诲姟锛屽厬鎹㈡洿澶氬鍔卞埜"); detail.setCreateTime(coupon.getEndTime()); msgOtherDetailService.addMsgOtherDetail(detail); } catch (MsgOtherDetailException e) { @@ -285,6 +286,66 @@ } } + + + @Override + public void couponUsingFreeSheet(UserSystemCoupon coupon, String orderId, BigDecimal money, MsgTypeOtherTypeEnum type) { + if (coupon == null || coupon.getUid() == null) + return; + MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponUsing(orderId, money, + coupon.getStartTime(), coupon.getEndTime()); + try { + msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), + coupon.getId(), dto, type, "瀹炰粯娆�-杩斿埄=0鍏冭喘锛堝厤鍗曪級")); + } catch (MsgOtherDetailException e) { + e.printStackTrace(); + } + } + + @Override + public void couponUsedFreeSheet(UserSystemCoupon coupon, String orderId, MsgTypeOtherTypeEnum type) { + if (coupon == null || coupon.getUid() == null) + return; + MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponUsed(orderId, + "瀹炰粯娆�-杩斿埄=0鍏冭喘锛堝厤鍗曪級", coupon.getStartTime(), coupon.getEndTime()); + try { + msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), + coupon.getId(), dto, type, "鍙備笌鍏朵粬娲诲姩鍙幏寰楁洿澶氬厤鍗曞埜")); + } catch (MsgOtherDetailException e) { + e.printStackTrace(); + } + } + + @Override + public void couponDrawBack(UserSystemCoupon coupon, String orderId, MsgTypeOtherTypeEnum type) { + if (coupon == null || coupon.getUid() == null) + return; + MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponDrawBack(getLeftDay(coupon), + orderId, coupon.getStartTime(), coupon.getEndTime()); + try { + msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), + coupon.getId(), dto, type, "閫�鍥炲悗渚濈劧鍙湪鏈夋晥鏈熷唴浣跨敤")); + } catch (MsgOtherDetailException e) { + e.printStackTrace(); + } + } + + + @Override + public void outOfDate(UserSystemCoupon coupon, MsgTypeOtherTypeEnum type) { + if (coupon == null || coupon.getUid() == null) + return; + MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory + .createRewardCouponAlreadyOutOfDate(coupon.getSource(), coupon.getStartTime(), coupon.getEndTime()); + try { + MsgOtherDetail detail = MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), coupon.getId(), dto, + type, "鍙備笌娲诲姩鍙幏鍙栨洿澶氬鍔卞埜"); + detail.setCreateTime(coupon.getEndTime()); + msgOtherDetailService.addMsgOtherDetail(detail); + } catch (MsgOtherDetailException e) { + e.printStackTrace(); + } + } @Override public void taoLiJinMsg(Long uid, String beiZhu, MsgOtherTaoLiJinContentDTO content) { @@ -318,4 +379,21 @@ e.printStackTrace(); } } + + + @Override + public void exchangeMsg(Long uid, String beiZhu, MsgOtherExchangeContentDTO content) { + try { + MsgOtherDetail detail = new MsgOtherDetail(); + detail.setBeiZhu(beiZhu); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setUser(new UserInfo(uid)); + detail.setContent(new Gson().toJson(content)); + detail.setType(MsgTypeOtherTypeEnum.exchange); + msgOtherDetailService.addMsgOtherDetail(detail); + } catch (MsgOtherDetailException e) { + e.printStackTrace(); + } + } } -- Gitblit v1.8.0