From e6269b00183bf7f46c494fa15ab75d702d2764ab Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期四, 12 九月 2019 15:16:01 +0800 Subject: [PATCH] 红包口令 失效金额bug --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java index 0a5cffd..15c6e2c 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java @@ -221,20 +221,22 @@ } } else if (tokenType == TokenTypeEnum.taoLiJin) { type = 12; - UserTaoLiJinGiveRecord giveRecord = userTaoLiJinGiveRecordService - .selectByPrimaryKey(Long.parseLong(identify)); - if (giveRecord == null || giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_OVERDUE) { + + UserTaoLiJinGiveRecord giveRecord = userTaoLiJinGiveRecordService.selectByPrimaryKey(Long.parseLong(identify)); + if (giveRecord == null) + throw new TokenRecordException(1, "鍙d护宸插け鏁�"); + + BigDecimal amount = giveRecord.getAmount(); + num = Integer.parseInt(amount.setScale(0).toString()); + + if(giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_OVERDUE) { tips.add("鍝庡憖锛屾帹骞跨孩鍖呭凡澶辨晥浜嗭紒"); } else if (giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_RECEIVE) { tips.add("鍝庡憖锛屾帹骞跨孩鍖呭凡琚鍙栦簡锛�"); } else if (giveRecord.getState() == UserTaoLiJinGiveRecord.STATE_INIT) { if (uid == null || uid <= 0) throw new TokenRecordException(1001, "娓╅Θ鎻愮ず锛孾鎺ㄥ箍绾㈠寘]闇�瑕佺櫥褰曞悗棰嗗彇"); - state = true; - BigDecimal amount = giveRecord.getAmount(); - num = Integer.parseInt(amount.setScale(0).toString()); - UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid); if (userInfoExtra == null || StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode())) { tips.add("纭棰嗗彇鍚庯紝浣犲皢鎴愪负璧犻�佽�呯殑涓�绾ч槦鍛橈紱"); -- Gitblit v1.8.0