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/MsgMoneyDetailFactory.java | 138 +++++++++++++++++++++++++++++++-------------- 1 files changed, 94 insertions(+), 44 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgMoneyDetailFactory.java b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgMoneyDetailFactory.java index 3d95283..82bba94 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgMoneyDetailFactory.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgMoneyDetailFactory.java @@ -29,7 +29,8 @@ * @param beiZhu * @return */ - public static MsgMoneyDetail createExtractMsg(String stateDesc, Long uid, Extract extract, String reason, String alipayNo) { + public static MsgMoneyDetail createExtractMsg(String stateDesc, Long uid, Extract extract, String reason, + String alipayNo, String beizu) { if (extract == null || uid == null) return null; @@ -41,7 +42,7 @@ new ClientTextStyleVO(String.format("鏀粯瀹�:%s-濮撳悕:%s",account, name), ClientTextStyleVO.COLOR_CONTENT))); List<ClientTextStyleVO> contentList = new ArrayList<>(); - contentList.add(new ClientTextStyleVO("楼" + extract.getMoney().setScale(2), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList.add(new ClientTextStyleVO("楼" + extract.getMoney().setScale(2, BigDecimal.ROUND_DOWN), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); if (!StringUtil.isNullOrEmpty(alipayNo)) { contentList.add(new ClientTextStyleVO(String.format("&鏀粯瀹濊鍗曞彿: %s", "*" + alipayNo.substring(alipayNo.length() - 10)), ClientTextStyleVO.COLOR_CONTENT)); } @@ -54,9 +55,8 @@ listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍘熷洜", ClientTextStyleVO.COLOR_TITLE), new ClientTextStyleVO(reason, ClientTextStyleVO.COLOR_CONTENT))); } - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO("濡傛湁鐤戦棶璇疯仈绯讳汉宸ュ鏈�", ClientTextStyleVO.COLOR_CONTENT))); + new ClientTextStyleVO(beizu, ClientTextStyleVO.COLOR_CONTENT))); MsgMoneyDetail detail = new MsgMoneyDetail(); detail.setBeiZhu(reason); @@ -98,9 +98,14 @@ listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎻愮幇璐﹀彿", ClientTextStyleVO.COLOR_TITLE), new ClientTextStyleVO(String.format("鏀粯瀹�:%s-濮撳悕:%s",account, name), ClientTextStyleVO.COLOR_CONTENT))); listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎵撴閲戦", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO(money + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT))); - listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎻愮幇璐﹀彿", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO(String.format("鎻愮幇璐﹀彿鏀跺埌涓�绗旓紝鏉ヨ嚜%s鐨勮浆璐︼紝鍗崇粦瀹氭垚鍔�", appName), ClientTextStyleVO.COLOR_CONTENT))); + new ClientTextStyleVO("楼" + money.setScale(2, BigDecimal.ROUND_DOWN), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT))); + + List<ClientTextStyleVO> contentList2 = new ArrayList<>(); + contentList2.add(new ClientTextStyleVO("鎻愮幇璐﹀彿鏀跺埌涓�绗旓紝鏉ヨ嚜", ClientTextStyleVO.COLOR_CONTENT)); + contentList2.add(new ClientTextStyleVO(appName, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList2.add(new ClientTextStyleVO("鐨勮浆璐︼紝鍗崇粦瀹氭垚鍔�", ClientTextStyleVO.COLOR_CONTENT)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璇存槑", ClientTextStyleVO.COLOR_TITLE),contentList2)); + List<ClientTextStyleVO> contentList = new ArrayList<>(); contentList.add(new ClientTextStyleVO(String.format("鎴愬姛%s鐨勬彁鐜拌处鍙�", changeWay), ClientTextStyleVO.COLOR_CONTENT)); contentList.add(new ClientTextStyleVO( limitDay+"", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); @@ -137,14 +142,12 @@ if (change) { changeWay = "淇敼"; } - String name = filterName(valid.getName()); - String account = filterAccount(valid.getAccount()); List<CommonMsgItemVO> listMsg = new ArrayList<>(); listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("楠岃瘉鐘舵��", ClientTextStyleVO.COLOR_TITLE), new ClientTextStyleVO(String.format("鎻愮幇璐﹀彿%s澶辫触", changeWay), ClientTextStyleVO.COLOR_CONTENT))); listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎻愮幇璐﹀彿", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO(String.format("鏀粯瀹�:%s-濮撳悕:%s",account, name), ClientTextStyleVO.COLOR_CONTENT))); + new ClientTextStyleVO(String.format("鏀粯瀹�:%s-濮撳悕:%s",valid.getAccount(), valid.getName()), ClientTextStyleVO.COLOR_CONTENT))); listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍘熷洜", ClientTextStyleVO.COLOR_TITLE), new ClientTextStyleVO("璇蜂粩缁嗘牳瀵瑰~鍐欒处鍙锋槸鍚︽湁璇垨璺濅笂涓�娆′慨鏀规椂闀挎槸鍚﹁秴杩�30澶�", ClientTextStyleVO.COLOR_CONTENT))); @@ -183,24 +186,13 @@ * @param beiZhu * @return */ - public static MsgMoneyDetail createOrderReceivedMsg(BigDecimal money, BigDecimal balance, String orderId, int source, - int goodsCount, Long uid, int type, Date downTime, boolean useCoupon) { + public static MsgMoneyDetail fanLiOrderReceivedMsg(BigDecimal money, BigDecimal balance, String orderId, int source, + int goodsCount, Long uid, Date downTime, boolean useCoupon) { if (money == null || balance == null || orderId == null || uid == null) return null; - String fanliName = ""; - MsgTypeMoneyTypeEnum typeEnum = null; - String sourceName = Constant.getSourceName(source); - if (Constant.TYPE_REBATE == type) { - fanliName = "鑷喘杩斿埄"; - sourceName += "-杩斿埄璁㈠崟"; - typeEnum = MsgTypeMoneyTypeEnum.fanli; - } else if (Constant.TYPE_SHAER == type) { - fanliName = "鍒嗕韩濂栭噾:"; - sourceName += "-鍒嗕韩璁㈠崟"; - typeEnum = MsgTypeMoneyTypeEnum.share; - } - + String fanliName = "鑷喘杩斿埄"; + String sourceName = Constant.getSourceName(source) + "-杩斿埄璁㈠崟"; if (useCoupon) { fanliName = "浣跨敤杩斿埄濂栧姳鍒�"; } @@ -209,20 +201,23 @@ 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)); + new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT))); + 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), contentList)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍟嗗搧鏁伴噺", ClientTextStyleVO.COLOR_TITLE), contentList)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍒拌处绫荤洰", ClientTextStyleVO.COLOR_TITLE), new ClientTextStyleVO(fanliName, ClientTextStyleVO.COLOR_CONTENT))); List<ClientTextStyleVO> contentList2 = new ArrayList<>(); - contentList2.add(new ClientTextStyleVO("楼" + money, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); - contentList2.add(new ClientTextStyleVO("锛堣处鎴蜂綑棰澛ワ級"+ balance, ClientTextStyleVO.COLOR_CONTENT)); + contentList2.add(new ClientTextStyleVO("楼" + money.setScale(2, BigDecimal.ROUND_DOWN), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList2.add(new ClientTextStyleVO("锛堣处鎴蜂綑棰澛�"+ balance.setScale(2, BigDecimal.ROUND_DOWN) + "锛�", 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))); @@ -232,7 +227,7 @@ detail.setCreateTime(new Date()); detail.setGoodsCount(goodsCount); detail.setMoney(money); - detail.setMsgType(typeEnum); + detail.setMsgType(MsgTypeMoneyTypeEnum.fanli); detail.setOrderId(orderId); detail.setOrderType(source); detail.setRead(false); @@ -241,6 +236,58 @@ return detail; } + + + /** + * 杩斿埄鍒拌处 + * + * @param money + * @param balance + * @param orderId + * @param goodsCount + * @param uid + * @param beiZhu + * @return + */ + public static MsgMoneyDetail shareOrderReceivedMsg(BigDecimal money, BigDecimal balance, int source, Long uid, Date receivedDate) { + if (money == null || balance == null || uid == null) + return null; + + String sourceName = Constant.getSourceName(source) + "-鍒嗕韩璁㈠崟"; + List<CommonMsgItemVO> listMsg = new ArrayList<>(); + + List<ClientTextStyleVO> contentList = new ArrayList<>(); + contentList.add(new ClientTextStyleVO(TimeUtil.getYearOnlyYYYY(receivedDate)+ "骞�", ClientTextStyleVO.COLOR_CONTENT)); + contentList.add(new ClientTextStyleVO(TimeUtil.getMonthOnlyMM(receivedDate), 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(sourceName, ClientTextStyleVO.COLOR_CONTENT))); + + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍒拌处绫荤洰", ClientTextStyleVO.COLOR_TITLE), + new ClientTextStyleVO("鍒嗕韩濂栭噾", ClientTextStyleVO.COLOR_CONTENT))); + + List<ClientTextStyleVO> contentList2 = new ArrayList<>(); + contentList2.add(new ClientTextStyleVO("楼" + money.setScale(2, BigDecimal.ROUND_DOWN), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList2.add(new ClientTextStyleVO("锛堣处鎴蜂綑棰澛�"+ balance.setScale(2, BigDecimal.ROUND_DOWN) + "锛�", 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))); + + MsgMoneyDetail detail = new MsgMoneyDetail(); + detail.setBalance(balance); + detail.setCreateTime(new Date()); + detail.setMoney(money); + detail.setMsgType(MsgTypeMoneyTypeEnum.share); + detail.setOrderType(source); + detail.setRead(false); + detail.setUser(new UserInfo(uid)); + detail.setExtraInfo(new Gson().toJson(listMsg)); + return detail; + } + /** * 杩斿埄缁存潈 * @@ -277,21 +324,23 @@ 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)); + new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT))); + 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), contentList)); + listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍟嗗搧鏁伴噺", ClientTextStyleVO.COLOR_TITLE), contentList)); listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("閫�鍥炲師鍥�", ClientTextStyleVO.COLOR_TITLE), new ClientTextStyleVO(weiquan, ClientTextStyleVO.COLOR_CONTENT))); listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍒拌处閲戦", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO("楼" +fanliMoney.setScale(2) + "锛堝師鍒拌处閲戦锛�", ClientTextStyleVO.COLOR_CONTENT))); + new ClientTextStyleVO("楼" +fanliMoney.setScale(2, BigDecimal.ROUND_DOWN) + "锛堝師鍒拌处閲戦锛�", ClientTextStyleVO.COLOR_CONTENT))); List<ClientTextStyleVO> contentList2 = new ArrayList<>(); - contentList2.add(new ClientTextStyleVO("楼" + money.setScale(2), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList2.add(new ClientTextStyleVO("楼" + money.setScale(2, BigDecimal.ROUND_DOWN), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); contentList2.add(new ClientTextStyleVO("锛�"+ weiquanMoney + "锛�", ClientTextStyleVO.COLOR_CONTENT)); listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("閫�鍥為噾棰�", ClientTextStyleVO.COLOR_TITLE), contentList2)); @@ -322,7 +371,8 @@ * @param beiZhu * @return */ - public static MsgMoneyDetail createTeamReceivedMsg(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate) { + public static MsgMoneyDetail createTeamReceivedMsg(Long uid, BigDecimal money, BigDecimal balance, Date receivedDate, + String teamName) { if (money == null || balance == null || uid == null) return null; @@ -334,11 +384,11 @@ listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("缁撶畻鏈堝害", ClientTextStyleVO.COLOR_TITLE), contentList)); listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍒拌处绫荤洰", ClientTextStyleVO.COLOR_TITLE), - new ClientTextStyleVO("鍥㈤槦鏀剁泭", ClientTextStyleVO.COLOR_CONTENT), true)); + new ClientTextStyleVO(teamName, ClientTextStyleVO.COLOR_CONTENT))); List<ClientTextStyleVO> contentList2 = new ArrayList<>(); - contentList2.add(new ClientTextStyleVO("楼" + money.setScale(2), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); - contentList2.add(new ClientTextStyleVO("锛堣处鎴蜂綑棰澛� "+ balance.setScale(2)+"锛�", ClientTextStyleVO.COLOR_CONTENT)); + contentList2.add(new ClientTextStyleVO("楼" + money.setScale(2, BigDecimal.ROUND_DOWN), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)); + contentList2.add(new ClientTextStyleVO("锛堣处鎴蜂綑棰澛� "+ balance.setScale(2, BigDecimal.ROUND_DOWN)+"锛�", 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))); @@ -392,14 +442,14 @@ } else {// 鍏朵粬 if (alipayAccount.length() >= 6) { for (int i = 0; i < alipayAccount.length(); i++) { - if (i < 3 || i >= alipayAccount.length() - 2) + if (i < alipayAccount.length() - 4) account += alipayAccount.charAt(i); else account += "*"; } } else { for (int i = 0; i < alipayAccount.length(); i++) { - if (i < 1 || i >= alipayAccount.length() - 1) + if (i < alipayAccount.length() - 1) account += alipayAccount.charAt(i); else account += "*"; -- Gitblit v1.8.0