From 30d8e227e8d823b6c38c3b9c90ac2df03b63befe Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 25 二月 2025 16:41:22 +0800 Subject: [PATCH] 淘宝转链接口更新 --- fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java | 598 +++++++++++++++++++++++++++++----------------------------- 1 files changed, 299 insertions(+), 299 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 1864b7a..8758270 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,299 +1,299 @@ -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.entity.bus.msg.MsgOtherDetail; -import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum; -import com.yeshi.fanli.entity.bus.user.UserInfo; -import org.yeshi.utils.TimeUtil; -import com.yeshi.common.vo.ClientTextStyleVO; -import com.yeshi.fanli.vo.msg.CommonMsgItemVO; -import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory; - -public class MsgOtherDetailFactory { - - - /** - * 鍏嶅崟鍒哥浉鍏虫彁閱� - * @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("濂栧姳鍒稿彲鍦ㄣ�怽"鎴戠殑-绂忓埄涓績\"銆戣禒閫佷粬浜�", 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; - } - - - /** - * 浜戝彂鍗曠浉鍏充俊鎭� - * @param uid - * @param category - * @param item - * @param desc - * @return - */ - public static MsgOtherDetail cloudMsg(Long uid, String category, String item, String desc) { - List<CommonMsgItemVO> listMsg = new ArrayList<>(); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绫诲埆", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO(category, ClientTextStyleVO.COLOR_CONTENT))); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("浜嬮」", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO(item, ClientTextStyleVO.COLOR_CONTENT))); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璇存槑", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO(desc, 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.cloudWX); - detail.setExtraInfo(new Gson().toJson(listMsg)); - return detail; - } - -} +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.entity.bus.msg.MsgOtherDetail; +import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum; +import com.yeshi.fanli.entity.bus.user.UserInfo; +import org.yeshi.utils.TimeUtil; +import com.yeshi.common.vo.ClientTextStyleVO; +import com.yeshi.fanli.vo.msg.CommonMsgItemVO; +import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory; + +public class MsgOtherDetailFactory { + + + /** + * 鍏嶅崟鍒哥浉鍏虫彁閱� + * @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("濂栧姳鍒稿彲鍦ㄣ�怽"鎴戠殑-绂忓埄涓績\"銆戣禒閫佷粬浜�", 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; + } + + + /** + * 浜戝彂鍗曠浉鍏充俊鎭� + * @param uid + * @param category + * @param item + * @param desc + * @return + */ + public static MsgOtherDetail cloudMsg(Long uid, String category, String item, String desc) { + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绫诲埆", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(category, ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("浜嬮」", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(item, ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璇存槑", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(desc, 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.cloudWX); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + +} -- Gitblit v1.8.0