From 395cd4c4caf01e1b3ad134834e5c1db284b59074 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期六, 11 四月 2020 18:18:15 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div --- fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java | 261 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 261 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java index e82da86..45a9682 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java @@ -1,11 +1,18 @@ package com.yeshi.fanli.util.factory.msg; +import java.util.ArrayList; import java.util.Date; +import java.util.List; +import com.google.gson.Gson; import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO; import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail; import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum; import com.yeshi.fanli.entity.bus.user.UserInfo; +import com.yeshi.fanli.util.TimeUtil; +import com.yeshi.fanli.vo.msg.ClientTextStyleVO; +import com.yeshi.fanli.vo.msg.CommonMsgItemVO; +import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory; public class MsgOtherDetailFactory { @@ -57,4 +64,258 @@ return detail; } + + + /** + * 鍏嶅崟鍒哥浉鍏虫彁閱� + * @param uid + * @param name + * @param source + * @param num + * @param stateDesc + * @param startTime + * @param endTime + * @param days + * @return + */ + public static MsgOtherDetail freeCouponMsg(Long uid, String name, String source, int num, String stateDesc, + Date startTime, Date endTime) { + Integer days = null; + if (endTime != null) { + int cha = TimeUtil.getDayDifferenceCount(new Date(), endTime); + if (cha < 0) + days = 0; + else + days = cha + 1; + } + + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绫诲埆", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(name, ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏉ユ簮", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(source, ClientTextStyleVO.COLOR_CONTENT))); + List<ClientTextStyleVO> contentList = new ArrayList<>(); + contentList.add(new ClientTextStyleVO(num+"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList.add(new ClientTextStyleVO("寮�", ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏁伴噺", ClientTextStyleVO.COLOR_TITLE),contentList)); + + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鐘舵��", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(stateDesc, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT))); + + if (days != null) { + List<ClientTextStyleVO> contentList2 = new ArrayList<>(); + contentList2.add(new ClientTextStyleVO(TimeUtil.formatDateDot(startTime) + "-" + TimeUtil.formatDateDot(endTime) + "-浜�", ClientTextStyleVO.COLOR_CONTENT)); + contentList2.add(new ClientTextStyleVO(days +"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList2.add(new ClientTextStyleVO("澶╄繃鏈�", ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏈夋晥鏈�", ClientTextStyleVO.COLOR_TITLE),contentList2)); + + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("浣跨敤鑼冨洿", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("\"棣栭〉-鍏嶅崟鍟嗗搧\"涓撻涓殑鍏ㄩ儴鍟嗗搧鍙厤鍗曡喘涔�", ClientTextStyleVO.COLOR_CONTENT))); + } + + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("鏃�", ClientTextStyleVO.COLOR_CONTENT))); + + MsgOtherDetail detail = new MsgOtherDetail(); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setUser(new UserInfo(uid)); + detail.setType(MsgTypeOtherTypeEnum.couponMianDan); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + + + + /** + * 濂栧姳鍒哥浉鍏虫彁閱� + * @param uid + * @param name + * @param source + * @param num + * @param stateDesc + * @param startTime + * @param endTime + * @param days + * @return + */ + public static MsgOtherDetail rewardCouponMsg(Long uid, String source, int num, String stateDesc, + Date startTime, Date endTime) { + Integer days = null; + if (endTime != null) { + int cha = TimeUtil.getDayDifferenceCount(new Date(), endTime); + if (cha < 0) + days = 0; + else + days = cha + 1; + } + + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏉ユ簮", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(source, ClientTextStyleVO.COLOR_CONTENT))); + + List<ClientTextStyleVO> contentList = new ArrayList<>(); + contentList.add(new ClientTextStyleVO(num+"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList.add(new ClientTextStyleVO("寮�", ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏁伴噺", ClientTextStyleVO.COLOR_TITLE),contentList)); + + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鐘舵��", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(stateDesc, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT))); + + if (days != null) { + List<ClientTextStyleVO> contentList2 = new ArrayList<>(); + contentList2.add(new ClientTextStyleVO(TimeUtil.formatDateDot(startTime) + "-" + TimeUtil.formatDateDot(endTime) + "-浜�", ClientTextStyleVO.COLOR_CONTENT)); + contentList2.add(new ClientTextStyleVO(days +"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList2.add(new ClientTextStyleVO("澶╄繃鏈�", ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏈夋晥鏈�", ClientTextStyleVO.COLOR_TITLE),contentList2)); + + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("浣跨敤鑼冨洿", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("鍦╘"鎴戠殑-璁㈠崟涓璡"锛屽彲浣�5澶╁唴浜х敓鐨勮繑鍒╄鍗曞啀杩�", ClientTextStyleVO.COLOR_CONTENT))); + } + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("濂栧姳鍒镐篃鍙湪銆怽"鎴戠殑-绂忓埄涓績\"銆戣禒閫佷粬浜�", ClientTextStyleVO.COLOR_CONTENT))); + + MsgOtherDetail detail = new MsgOtherDetail(); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setUser(new UserInfo(uid)); + detail.setType(MsgTypeOtherTypeEnum.couponReward); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + + + /** + * 绯荤粺璧犻�侀噾甯佹彁閱� + * @param uid + * @param num + * @param banlce + * @return + */ + public static MsgOtherDetail goldCoinSystemGiveMsg(Long uid, int num, int banlce) { + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绫诲埆", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("绯荤粺璧犻��", ClientTextStyleVO.COLOR_CONTENT))); + List<ClientTextStyleVO> contentList = new ArrayList<>(); + contentList.add(new ClientTextStyleVO(num+"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList.add(new ClientTextStyleVO("鏋�", ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鑾峰緱鏁伴噺", ClientTextStyleVO.COLOR_TITLE),contentList)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍓╀綑鎬绘暟", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(banlce + "鏋�", ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("浣跨敤鑼冨洿", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("鍙湪\"鎴戠殑-閲戝竵\"鍏戞崲濂界ぜ", ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("绯荤粺璧犻�侀噾甯佹棤闇�鎵嬪姩棰嗗彇锛屽凡鑷姩杩涘叆鍒伴噾甯佽处鎴蜂腑", ClientTextStyleVO.COLOR_CONTENT))); + + MsgOtherDetail detail = new MsgOtherDetail(); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setUser(new UserInfo(uid)); + detail.setType(MsgTypeOtherTypeEnum.goldCoin); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + + /** + * 閲戝竵濂栧姳鎻愰啋- 閭�璇锋垚鍔� + * @param uid + * @param num + * @param banlce + * @param directFans + * @return + */ + public static MsgOtherDetail goldCoinRewardInviteSucceedMsg(Long uid, int num, int banlce, boolean directFans) { + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绫诲埆", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("閲戝竵濂栧姳", ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏉ユ簮", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("鎴愬姛閭�璇�" + (directFans?"鐩存帴绮変笣":"闂存帴绮変笣"), ClientTextStyleVO.COLOR_CONTENT))); + List<ClientTextStyleVO> contentList = new ArrayList<>(); + contentList.add(new ClientTextStyleVO(num+"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList.add(new ClientTextStyleVO("鏋�", ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鑾峰緱鏁伴噺", ClientTextStyleVO.COLOR_TITLE),contentList)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍓╀綑鎬绘暟", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(banlce + "鏋�", ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("浣跨敤鑼冨洿", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("鍙湪\"鎴戠殑-閲戝竵\"鍏戞崲濂界ぜ", ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("绯荤粺璧犻�侀噾甯佹棤闇�鎵嬪姩棰嗗彇锛屽凡鑷姩杩涘叆鍒伴噾甯佽处鎴蜂腑", ClientTextStyleVO.COLOR_CONTENT))); + + MsgOtherDetail detail = new MsgOtherDetail(); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setUser(new UserInfo(uid)); + detail.setType(MsgTypeOtherTypeEnum.goldCoin); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + + + /** + * 閲戝竵濂栧姳鎻愰啋 - 璁㈠崟鍥㈤槦鏀剁泭涓嶈冻0.01鍏冧笉瓒�0.01鍏� + * @param uid + * @param num + * @param banlce + * @param directFans + * @return + */ + public static MsgOtherDetail goldCoinOrderSubsidyMsg(Long uid, int num, int banlce, boolean directFans) { + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绫诲埆", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("閲戝竵濂栧姳", ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏉ユ簮", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO((directFans?"鐩存帴绮変笣":"闂存帴绮変笣") +"涓嬪崟浜х敓鐨勫洟闃熸敹鐩婁笉瓒�0.01鍏�", ClientTextStyleVO.COLOR_CONTENT))); + List<ClientTextStyleVO> contentList = new ArrayList<>(); + contentList.add(new ClientTextStyleVO(num+"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList.add(new ClientTextStyleVO("鏋�", ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鑾峰緱鏁伴噺", ClientTextStyleVO.COLOR_TITLE),contentList)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍓╀綑鎬绘暟", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(banlce + "鏋�", ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("浣跨敤鑼冨洿", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("鍙湪\"鎴戠殑-閲戝竵\"鍏戞崲濂界ぜ", ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("绯荤粺璧犻�侀噾甯佹棤闇�鎵嬪姩棰嗗彇锛屽凡鑷姩杩涘叆鍒伴噾甯佽处鎴蜂腑", ClientTextStyleVO.COLOR_CONTENT))); + + MsgOtherDetail detail = new MsgOtherDetail(); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setUser(new UserInfo(uid)); + detail.setType(MsgTypeOtherTypeEnum.goldCoin); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + + + /** + * 閲戝竵鍏戞崲鎻愰啋 + * @param uid + * @param num + * @param banlce + * @param directFans + * @return + */ + public static MsgOtherDetail goldCoinExChangeMsg(Long uid, int num, int banlce, String name, String exNum) { + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绫诲埆", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("閲戝竵鍏戞崲", ClientTextStyleVO.COLOR_CONTENT))); + List<ClientTextStyleVO> contentList = new ArrayList<>(); + contentList.add(new ClientTextStyleVO(num+"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList.add(new ClientTextStyleVO("鏋�", ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("娑堣�楁暟閲�", ClientTextStyleVO.COLOR_TITLE),contentList)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍓╀綑鎬绘暟", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(banlce + "鏋�", ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍏戞崲鐗╁搧", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(String.format("绀煎搧:%s 鏁伴噺:%s",name, exNum), ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("鏃�", ClientTextStyleVO.COLOR_CONTENT))); + + MsgOtherDetail detail = new MsgOtherDetail(); + detail.setCreateTime(new Date()); + detail.setRead(false); + detail.setUser(new UserInfo(uid)); + detail.setType(MsgTypeOtherTypeEnum.goldCoin); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + } -- Gitblit v1.8.0