From 8222e8b237c5dfb0affcdc03335bfadc06403bf8 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期五, 19 七月 2019 15:49:39 +0800 Subject: [PATCH] 奖励券使用优化类型 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java | 33 +++++++++++++++++++++++++++++---- 1 files changed, 29 insertions(+), 4 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java index 2762ca9..2a3f556 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/TaoLiJinControllerV2.java @@ -233,11 +233,26 @@ BigDecimal thisMonthWin = userTaoLiJinOriginService.countMoneyByDate(uid, 3); BigDecimal lastMonthWin = userTaoLiJinOriginService.countMoneyByDate(uid, 4); + BigDecimal zero = new BigDecimal(0); // 娑堣�� BigDecimal todayUse = userTaoLiJinDetailService.countUseMoneyByDate(uid, 1); + if (todayUse == null || todayUse.compareTo(zero) > 0) { + todayUse = zero; + } + BigDecimal yesterdayUse = userTaoLiJinDetailService.countUseMoneyByDate(uid, 2); + if (yesterdayUse == null || yesterdayUse.compareTo(zero) > 0) { + yesterdayUse = zero; + } BigDecimal thisMonthUse = userTaoLiJinDetailService.countUseMoneyByDate(uid, 3); + if (thisMonthUse == null || thisMonthUse.compareTo(zero) > 0) { + thisMonthUse = zero; + } BigDecimal lastMonthUse = userTaoLiJinDetailService.countUseMoneyByDate(uid, 4); + if (lastMonthUse == null || lastMonthUse.compareTo(zero) > 0) { + lastMonthUse = zero; + } + // 闂彿閾炬帴 String helpLink = configTaoLiJinService.getValueByKey("hongbao_help_link"); @@ -409,6 +424,7 @@ } // 鐧诲綍鐢ㄦ埛 + boolean isReceive = false; JSONObject data = new JSONObject(); data.put("icon", configTaoLiJinService.getValueByKey("taolijin_system_icon")); @@ -443,6 +459,7 @@ UserTaoLiJinOrigin userTaoLiJin = userTaoLiJinOriginService.getRankByThisMonth(uid, type); if (userTaoLiJin != null) { // 宸查鍙� isRank = true; + isReceive = true; hasMoney = userTaoLiJin.getMoney(); } else { isRank = false; @@ -479,7 +496,11 @@ data.put("content", "鎺ㄥ箍绾㈠寘锛屽ソ鍙嬬鍒╋紒"); data.put("type", 1); data.put("money", hasMoney.setScale(2).toString()); - data.put("usage", "棰嗗彇鎴愬姛锛屽凡瀛樺叆鈥滄垜鐨�-鎺ㄥ箍绾㈠寘鈥�"); + if (isReceive) { + data.put("usage", "鏈湀棰嗗彇锛屽凡瀛樺叆鈥滄垜鐨�-鎺ㄥ箍绾㈠寘鈥�"); + } else { + data.put("usage", "棰嗗彇鎴愬姛锛屽凡瀛樺叆鈥滄垜鐨�-鎺ㄥ箍绾㈠寘鈥�"); + } data.put("jumpName", "鍘讳娇鐢�"); data.put("jumpDetail", jumpDetailV2Service.getByTypeCache("share_goods_hot")); data.put("tip", configTaoLiJinService.getValueByKey("hongbao_rank_tip")); @@ -740,6 +761,7 @@ out.print(JsonUtil.loadTrueResult(data)); } + /** * 鍒嗕韩鐖嗘鍟嗗搧-闄愪簬娣樼ぜ閲� * @@ -775,11 +797,12 @@ continue; } + GoodsDetailVO detailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, proportion, proportion); // 鍘绘帀鏍囩 detailVO.setLabels(null); - + MoneyInfoVO moneyInfo = detailVO.getMoneyInfo(); moneyInfo.setMoneyType(2); detailVO.setMoneyInfo(moneyInfo); @@ -787,14 +810,16 @@ String hongBao = spreadMoney.toString(); ReduceHongBao vo = new ReduceHongBao(); vo.setLeft(hotGoods.getLeftHongBaoCount()); - vo.setMoney(hongBao); - vo.setName("浠樻绔嬪噺 楼" + hongBao); + vo.setMoney(" 楼" + hongBao); + vo.setName("浠樻绔嬪噺 "); vo.setTip(""); vo.setTotal(hotGoods.getTotalHongBaoCount()); OtherInfo otherInfo = new OtherInfo(); otherInfo.setReduceHongBao(vo); detailVO.setOtherInfo(otherInfo); + + array.add(gson.toJson(detailVO)); } if (page > 1) -- Gitblit v1.8.0