From 2723b71882f6b34d7c443019d1bb5674250c1893 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Thu, 01 Jul 2021 16:50:05 +0800 Subject: [PATCH] fix --- gc-user/src/main/java/com/xzx/gc/user/service/JhyInfoService.java | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gc-user/src/main/java/com/xzx/gc/user/service/JhyInfoService.java b/gc-user/src/main/java/com/xzx/gc/user/service/JhyInfoService.java index ebd4953..b803ccc 100644 --- a/gc-user/src/main/java/com/xzx/gc/user/service/JhyInfoService.java +++ b/gc-user/src/main/java/com/xzx/gc/user/service/JhyInfoService.java @@ -119,7 +119,7 @@ List<AccountInfo> accountInfos = accountMapper.selectByExample(exampleAccount); if(CollUtil.isNotEmpty(accountInfos)){ AccountInfo accountInfo = accountInfos.get(0); - Integer collectScore = Integer.parseInt(accountInfo.getCollectScore()); + String collectScore = StrUtil.isEmpty(accountInfo.getCollectScore())?"0":accountInfo.getCollectScore(); // collectScore = collectScore + model.getScore(); accountInfo.setCollectScore(model.getScore().toString()); accountMapper.updateByPrimaryKey(accountInfo); @@ -127,9 +127,9 @@ ScoreDetails scoreDetailsRet = new ScoreDetails(); scoreDetailsRet.setUserId(model.getUserId()); scoreDetailsRet.setType(ScoreDetails.SCORE_TYPE_ADMIN_RECHARGE); - scoreDetailsRet.setOriginalScore(new BigDecimal(collectScore)); - scoreDetailsRet.setCurrentScore(new BigDecimal(model.getScore())); - scoreDetailsRet.setChangeScore(new BigDecimal(model.getScore())); + scoreDetailsRet.setOriginalScore(new BigDecimal(collectScore).setScale( 0, BigDecimal.ROUND_DOWN )); + scoreDetailsRet.setCurrentScore(new BigDecimal(model.getScore()).setScale( 0, BigDecimal.ROUND_DOWN )); + scoreDetailsRet.setChangeScore(new BigDecimal(model.getScore()).setScale( 0, BigDecimal.ROUND_DOWN )); scoreDetailsRet.setCreatedTime(new Date()); accountMapper.insertScoreDetailsRet(scoreDetailsRet); } @@ -143,7 +143,7 @@ List<AccountInfo> accountInfos = accountMapper.selectByExample(exampleAccount); if(CollUtil.isNotEmpty(accountInfos)){ AccountInfo accountInfo = accountInfos.get(0); - getScoreNumVo.setScore(new BigDecimal(StrUtil.isEmpty(accountInfo.getCollectScore())?"0":accountInfo.getCollectScore())); + getScoreNumVo.setScore(new BigDecimal(StrUtil.isEmpty(accountInfo.getCollectScore())?"0":accountInfo.getCollectScore()).setScale( 0, BigDecimal.ROUND_DOWN )); } return getScoreNumVo; } -- Gitblit v1.9.1