From 24a8d17e007545f7426c48352109aa1a9c6587ee Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 06 五月 2020 12:02:09 +0800 Subject: [PATCH] IOS上线隐藏我的界面的banner与超级会员升级信息 --- fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOrderDetailFactory.java | 255 ++++++++++++++------------------------------------ 1 files changed, 74 insertions(+), 181 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOrderDetailFactory.java b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOrderDetailFactory.java index f6cd80f..7367531 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOrderDetailFactory.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOrderDetailFactory.java @@ -8,176 +8,18 @@ import org.springframework.transaction.annotation.Transactional; import com.google.gson.Gson; -import com.yeshi.fanli.entity.bus.msg.MsgExtra; import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail; import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail.MsgTypeOrderTypeEnum; import com.yeshi.fanli.entity.bus.user.UserInfo; -import com.yeshi.fanli.exception.msg.MsgOrderDetailException; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.StringUtil; import com.yeshi.fanli.util.TimeUtil; +import com.yeshi.fanli.util.account.UserUtil; import com.yeshi.fanli.vo.msg.ClientTextStyleVO; import com.yeshi.fanli.vo.msg.CommonMsgItemVO; import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory; public class MsgOrderDetailFactory { - - /** - * 杩斿埄璁㈠崟 - * - * @param uid - * @param orderId - * @param goodsCount - * @param orderState - * @param payMoney - * @param money - * @param state - * @param beiZhu - * @return - */ - public static MsgOrderDetail createFanLiOrder(Long uid, String orderId, int orderType, int goodsCount, - int orderState, BigDecimal payMoney, BigDecimal money, String beiZhu) { - if (uid == null) - return null; - MsgOrderDetail detail = new MsgOrderDetail(); - detail.setBeiZhu(beiZhu); - detail.setCreateTime(new Date()); - detail.setGoodsCount(goodsCount); - detail.setHongBaoMoney(money); - detail.setOrderId(orderId); - detail.setOrderType(orderType); - detail.setPayMoney(payMoney); - detail.setRead(false); - detail.setState(orderState); - detail.setType(MsgTypeOrderTypeEnum.fanli); - detail.setUser(new UserInfo(uid)); - return detail; - } - - /** - * 閭�璇疯鍗� - * - * @param uid - * @param orderId - * @param goodsCount - * @param orderState - * @param payMoney - * @param money - * @param state - * @param beiZhu - * @return - */ - public static MsgOrderDetail createInviteOrder(Long uid, String orderId, int orderType, int goodsCount, - int orderState, BigDecimal payMoney, BigDecimal money, String beiZhu) { - if (payMoney == null || money == null || uid == null) - return null; - MsgOrderDetail detail = new MsgOrderDetail(); - detail.setBeiZhu(beiZhu); - detail.setCreateTime(new Date()); - detail.setGoodsCount(goodsCount); - detail.setHongBaoMoney(money); - detail.setOrderId(orderId); - detail.setOrderType(orderType); - detail.setPayMoney(payMoney); - detail.setRead(false); - detail.setState(orderState); - detail.setType(MsgTypeOrderTypeEnum.invite); - detail.setUser(new UserInfo(uid)); - return detail; - } - - /** - * 鍒嗕韩璁㈠崟 - * - * @param uid - * @param orderId - * @param goodsCount - * @param orderState - * @param payMoney - * @param money - * @param state - * @param beiZhu - * @return - */ - public static MsgOrderDetail createShareOrder(Long uid, String orderId, int orderType, int goodsCount, - int orderState, BigDecimal payMoney, BigDecimal money, String beiZhu) { - if (payMoney == null || money == null || uid == null) - return null; - MsgOrderDetail detail = new MsgOrderDetail(); - detail.setBeiZhu(beiZhu); - detail.setCreateTime(new Date()); - detail.setGoodsCount(goodsCount); - detail.setHongBaoMoney(money); - detail.setOrderId(orderId); - detail.setOrderType(orderType); - detail.setPayMoney(payMoney); - detail.setRead(false); - detail.setState(orderState); - detail.setType(MsgTypeOrderTypeEnum.share); - detail.setUser(new UserInfo(uid)); - return detail; - } - - /** - * 璁㈠崟鎵惧洖 - * - * @param uid - * @param orderId - * -璁㈠崟鍙� - * @param isSuccess-鏄惁鎵惧洖鎴愬姛 - * @param payMoney - * @param orderType - * 1-娣樺疂璁㈠崟 3-鎷煎澶氳鍗� 4-浜笢璁㈠崟 - * @param beiZhu - * @return - */ - public static MsgOrderDetail createFoundOrder(Long uid, String orderId, boolean isSuccess, BigDecimal payMoney, - int orderType, Date happendDate, String beiZhu) { - if (orderId == null || uid == null) - return null; - MsgOrderDetail detail = new MsgOrderDetail(); - detail.setBeiZhu(beiZhu); - detail.setCreateTime(new Date()); - detail.setOrderType(orderType); - detail.setPayMoney(payMoney); - detail.setRead(false); - detail.setState(isSuccess ? 1 : 0); - detail.setType(MsgTypeOrderTypeEnum.found); - detail.setUser(new UserInfo(uid)); - detail.setHappendDate(happendDate); - return detail; - } - - /** - * 楗夸簡涔堣鍗曟秷鎭� - * @param uid - * @param orderId - * @param orderType - * @param orderState - * @param payMoney - * @param money - * @param beiZhu - * @return - */ - public static MsgOrderDetail createElmeOrder(Long uid, String orderId, int orderType, - int orderState, BigDecimal payMoney, BigDecimal money, String beiZhu) { - if (uid == null) - return null; - MsgOrderDetail detail = new MsgOrderDetail(); - detail.setBeiZhu(beiZhu); - detail.setCreateTime(new Date()); - detail.setHongBaoMoney(money); - detail.setOrderId(orderId); - detail.setOrderType(orderType); - detail.setPayMoney(payMoney); - detail.setRead(false); - detail.setState(orderState); - detail.setType(MsgTypeOrderTypeEnum.elme); - detail.setUser(new UserInfo(uid)); - return detail; - } - - /** * 鍒涘缓璁㈠崟琚粺璁℃秷鎭� @@ -199,41 +41,47 @@ return null; String fanliName = ""; - MsgTypeOrderTypeEnum typeEnum = null; + MsgTypeOrderTypeEnum orderTypeEnum = null; String sourceName = Constant.getSourceName(source); if (Constant.TYPE_REBATE == type) { - fanliName = "杩斿埄锛�"; + fanliName = "棰勪及杩斿埄:"; sourceName += "-杩斿埄璁㈠崟"; - typeEnum = MsgTypeOrderTypeEnum.fanli; + orderTypeEnum = MsgTypeOrderTypeEnum.orderStatistics; } else if (Constant.TYPE_SHAER == type) { - fanliName = "濂栭噾锛�"; + fanliName = "棰勪及濂栭噾:"; sourceName += "-鍒嗕韩璁㈠崟"; - typeEnum = MsgTypeOrderTypeEnum.share; + orderTypeEnum = MsgTypeOrderTypeEnum.orderShare; } else if (Constant.TYPE_INVITE == type) { - fanliName = "鏀剁泭锛�"; + fanliName = "棰勪及鏀剁泭:"; sourceName += "-鍥㈤槦璁㈠崟"; - typeEnum = MsgTypeOrderTypeEnum.invite; + orderTypeEnum = MsgTypeOrderTypeEnum.orderInvite; } // 娣诲姞鍐呭 List<CommonMsgItemVO> listMsg = new ArrayList<>(); listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟璇︽儏", ClientTextStyleVO.COLOR_TITLE), new ClientTextStyleVO(sourceName, ClientTextStyleVO.COLOR_CONTENT))); - // 璁㈠崟鍙峰彲鐐瑰嚮 - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鍙�", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true)); + + if (Constant.TYPE_INVITE == type) { + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鍙�", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(UserUtil.filterOrderId(orderId), ClientTextStyleVO.COLOR_CONTENT), true)); + } else { + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鍙�", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true)); + } + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("涓嬪崟鏃堕棿", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(TimeUtil.formatDate(downTime), ClientTextStyleVO.COLOR_CONTENT))); + List<ClientTextStyleVO> contentList = new ArrayList<>(); - contentList - .add(new ClientTextStyleVO("涓嬪崟鏃堕棿锛�" + TimeUtil.formatDate(downTime), ClientTextStyleVO.COLOR_CONTENT)); - contentList.add(new ClientTextStyleVO("-鍟嗗搧鏁伴噺锛氬叡", ClientTextStyleVO.COLOR_CONTENT)); + contentList.add(new ClientTextStyleVO("鍏�", ClientTextStyleVO.COLOR_CONTENT)); contentList.add(new ClientTextStyleVO(goodsCount + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); contentList.add(new ClientTextStyleVO("浠跺晢鍝�", ClientTextStyleVO.COLOR_CONTENT)); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鐩稿叧", ClientTextStyleVO.COLOR_TITLE), + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍟嗗搧鏁伴噺", ClientTextStyleVO.COLOR_TITLE), contentList)); List<ClientTextStyleVO> contentList2 = new ArrayList<>(); - contentList2.add(new ClientTextStyleVO("瀹炰粯娆撅細", ClientTextStyleVO.COLOR_CONTENT)); + contentList2.add(new ClientTextStyleVO("瀹炰粯娆�:", ClientTextStyleVO.COLOR_CONTENT)); contentList2.add(new ClientTextStyleVO("楼" + filterMoney(payMoney), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); contentList2.add(new ClientTextStyleVO("&" + fanliName, ClientTextStyleVO.COLOR_CONTENT)); contentList2.add(new ClientTextStyleVO("楼" + filterMoney(money), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); @@ -253,7 +101,7 @@ detail.setOrderType(source); detail.setPayMoney(payMoney); detail.setRead(false); - detail.setType(typeEnum); + detail.setType(orderTypeEnum); detail.setUser(new UserInfo(uid)); detail.setExtraInfo(new Gson().toJson(listMsg)); return detail; @@ -288,10 +136,10 @@ String fanliName = ""; String sourceName = Constant.getSourceName(source); if (Constant.TYPE_REBATE == type) { - fanliName = "杩斿埄锛�"; + fanliName = "棰勪及杩斿埄:"; sourceName += "-杩斿埄璁㈠崟"; } else if (Constant.TYPE_SHAER == type) { - fanliName = "濂栭噾锛�"; + fanliName = "棰勪及濂栭噾:"; sourceName += "-鍒嗕韩璁㈠崟"; } @@ -306,15 +154,17 @@ listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鍙�", ClientTextStyleVO.COLOR_TITLE), new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎻愪氦鏃堕棿", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(TimeUtil.formatDate(submitTime), ClientTextStyleVO.COLOR_CONTENT))); + List<ClientTextStyleVO> contentList = new ArrayList<>(); - contentList.add(new ClientTextStyleVO("鎻愪氦鏃堕棿锛�" + TimeUtil.formatDate(submitTime), ClientTextStyleVO.COLOR_CONTENT)); - contentList.add(new ClientTextStyleVO("-鍟嗗搧鏁伴噺锛氬叡", ClientTextStyleVO.COLOR_CONTENT)); + contentList.add(new ClientTextStyleVO("鍏�", ClientTextStyleVO.COLOR_CONTENT)); contentList.add(new ClientTextStyleVO(goodsCount + "", 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),contentList)); List<ClientTextStyleVO> contentList2 = new ArrayList<>(); - contentList2.add(new ClientTextStyleVO("瀹炰粯娆撅細", ClientTextStyleVO.COLOR_CONTENT)); + contentList2.add(new ClientTextStyleVO("瀹炰粯娆�:", ClientTextStyleVO.COLOR_CONTENT)); contentList2.add(new ClientTextStyleVO("楼" + filterMoney(payMoney), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); contentList2.add(new ClientTextStyleVO("&" + fanliName, ClientTextStyleVO.COLOR_CONTENT)); contentList2.add(new ClientTextStyleVO("楼" + filterMoney(money), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); @@ -325,6 +175,7 @@ MsgOrderDetail detail = new MsgOrderDetail(); + detail.setOrderId(orderId); detail.setBeiZhu(beiZhu); detail.setCreateTime(new Date()); detail.setOrderType(source); @@ -370,4 +221,46 @@ return detail; } + + /** + * 鍟嗗璺戣矾 + * @param uid + * @param orderId + * @param orderSource + * @param type + * @return + */ + public static MsgOrderDetail orderInvalidToBusinessRunning(Long uid, String orderId, int orderSource, int type) { + if (uid == null || StringUtil.isNullOrEmpty(orderId)) + return null; + + String fanliName = ""; + String sourceName = Constant.getSourceName(orderSource); + if (Constant.TYPE_REBATE == type) { + fanliName = "杩斿埄璁㈠崟"; + } else { + fanliName = "鍒嗕韩璁㈠崟"; + } + + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鐘舵��", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("鍟嗗搴楅摵宸茶"+sourceName+"灏佺锛屽晢鍝佷剑閲戝凡琚喕缁擄紝鏃犳硶缁撶畻浣i噾锛岃鍗曞凡澶辨晥", ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟璇︽儏", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(fanliName, ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鍙�", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT))); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("鏃�", ClientTextStyleVO.COLOR_CONTENT))); + + MsgOrderDetail detail = new MsgOrderDetail(); + detail.setOrderId(orderId); + detail.setOrderType(orderSource); + detail.setType(MsgTypeOrderTypeEnum.businessRunning); + detail.setUser(new UserInfo(uid)); + detail.setRead(false); + detail.setCreateTime(new Date()); + detail.setUniquekey(StringUtil.Md5(uid+"&"+ orderId + "&" +orderSource + "&" + MsgTypeOrderTypeEnum.businessRunning.name())); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } } -- Gitblit v1.8.0