| | |
| | | List<AccountInfo> accountInfos = accountMapper.selectByExample(exampleAccount); |
| | | if(CollUtil.isNotEmpty(accountInfos)){ |
| | | AccountInfo accountInfo = accountInfos.get(0); |
| | | Integer collectScore = Integer.parseInt(StrUtil.isEmpty(accountInfo.getCollectScore())?"0":accountInfo.getCollectScore()); |
| | | String collectScore = StrUtil.isEmpty(accountInfo.getCollectScore())?"0":accountInfo.getCollectScore(); |
| | | // collectScore = collectScore + model.getScore(); |
| | | accountInfo.setCollectScore(model.getScore().toString()); |
| | | accountMapper.updateByPrimaryKey(accountInfo); |
| | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | | } |