From 671a0b04e156bdb00e2eda3082bef87934bceeb3 Mon Sep 17 00:00:00 2001 From: yujian <yujian> Date: 星期一, 15 四月 2019 15:22:23 +0800 Subject: [PATCH] 后端订单统计 队友关系bug优化 --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserLotteryRecordServiceImpl.java | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserLotteryRecordServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserLotteryRecordServiceImpl.java index 5e942ae..372cff1 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserLotteryRecordServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserLotteryRecordServiceImpl.java @@ -92,6 +92,8 @@ record.setUid(uid); record.setType(type); record.setCount(num); + } else { + record.setCount(num); } return record; } @@ -164,14 +166,15 @@ throw new UserLotteryRecordException(2, "鎶藉娆℃暟涓嶈冻"); } + String prize = null; + String couponType = null; // 鏂颁汉鎶藉 -宸叉娊涓鍝� List<UserSystemCoupon> list = userSystemCouponService.getUserCouponBySource(uid, UserSystemCoupon.SOURCE_NEWBIES); - - String prize = null; + if (list == null || list.size() == 0) { prize = getLotteryPrizeNewbies(count, 0, null); } else if (list.size() == 1) { - String couponType = null; + UserSystemCoupon userSystemCoupon = list.get(0); SystemCoupon systemCoupon = userSystemCoupon.getSystemCoupon(); if (systemCoupon != null) { @@ -185,6 +188,9 @@ } if (prize == null || prize.trim().length() == 0) { + prize = "NoPrize"; + } else if (prize.equals(couponType)) { + // 宸插瓨鍦ㄦ鍒� prize = "NoPrize"; } else { try { @@ -363,7 +369,7 @@ String rebateCoupon = "rebateCoupon"; // 涓�寮犲鍔卞埜 String doubleCoupon = "doubleCoupon"; // 涓ゅ紶濂栧姳鍒� - if (count== 1) { + if (count == 1) { // 鍓╀綑鏈�鍚庝竴娆″繀涓� long result = (1 + Math.round(Math.random() * (9))); if (result <= 7) { -- Gitblit v1.8.0