From dd24286b6da752433ba5b2360929a04e5040936c Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 29 五月 2019 10:57:15 +0800 Subject: [PATCH] 叮咚呛修改 --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java index 4ad0b51..7afddd7 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/ExtractServiceImpl.java @@ -254,10 +254,17 @@ return 3; } + // 鏈夊�熻捶鍏崇郴 + boolean isHaveToReplay = userMoneyDebtService.isHaveDebtToRepay(extract.getUserInfo().getId()); + if (isHaveToReplay) { + return 110; + } + Integer type = setExtractRecord(extract, maxCount, maxMoney); if (type != 0) { return type; } + extractMapper.insertSelective(extract); ExtractAuditRecord auditRecord = new ExtractAuditRecord(); @@ -287,7 +294,8 @@ if ("鏄�".equals(autoExtract)) { LogHelper.userInfo("uid=" + user.getId() + ",鎻愪氦杞处鐢宠!"); } else {// 鏆傛椂涓嶈嚜鍔ㄦ彁鐜� - transfer(extract, null); + // transfer(extract, null); + ; } return null; } @@ -507,9 +515,14 @@ @Transactional @Override public void checkExtract(Long uid) throws ExtractException { + BigDecimal compensateMoney = extractMapper.computeCompensateByUid(uid); + if (compensateMoney == null) + compensateMoney = new BigDecimal(0); + // 涓嶅垽瀹氬埌璐︾孩鍖呴棶棰� Long count = hongBaoV2Mapper.countByUidAndState(uid, HongBao.STATE_YILINGQU); - if (count == null || count == 0) + if ((count == null || count == 0) && compensateMoney.compareTo(new BigDecimal(0)) == 0) { throw new ExtractException(1, "娌℃湁宸插埌璐︾殑绾㈠寘"); + } // 鏌ヨ鏄惁鏈夋瑺璐� boolean isDebt = userMoneyDebtService.isHaveDebtToRepay(uid); if (isDebt) @@ -538,10 +551,6 @@ weiqaunMoney = weiqaunMoney.abs(); BigDecimal balance = userInfoService.selectByPKey(uid).getMyHongBao(); - - BigDecimal compensateMoney = extractMapper.computeCompensateByUid(uid); - if (compensateMoney == null) - compensateMoney = new BigDecimal(0); BigDecimal after = hongBaoMoney.subtract(extractMoney.add(weiqaunMoney).add(balance).add(compensateMoney)); -- Gitblit v1.8.0