From d8ba3335066aa339ddce013901b8fd357d7ba1f7 Mon Sep 17 00:00:00 2001 From: khalil Date: Wed, 25 Oct 2023 17:52:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0-=E8=B5=A0=E9=80=81=E9=92=BB?= =?UTF-8?q?=E7=9F=B3=E6=B0=B4=E6=99=B6-=E9=92=BB=E7=9F=B3=E6=B6=88?= =?UTF-8?q?=E9=99=A4=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../record/OfficialGoldRecordService.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/OfficialGoldRecordService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/OfficialGoldRecordService.java index 5ab3ed737..ed43269c7 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/OfficialGoldRecordService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/OfficialGoldRecordService.java @@ -85,7 +85,7 @@ public class OfficialGoldRecordService extends BaseService { * @throws Exception */ @Transactional(rollbackFor = Exception.class) - public BusiResult handle(String ernos, OfficalSendTypeEnum type, Long num, int optId, + public BusiResult handle(String ernos, OfficalSendTypeEnum type, Long num, int optId, Double actualAmount, String remark, Integer busType) throws Exception { if (type == null) { throw new ServiceException(BusiStatus.REQUEST_PARAM_ERROR); @@ -101,7 +101,7 @@ public class OfficialGoldRecordService extends BaseService { case OFFICAL_REDUCE_DIAMONDS: return reduceDiamondNum(ernos, type.getValue(), num, optId, remark, busType); } - return new BusiResult(BusiStatus.SERVERERROR); + return new BusiResult<>(BusiStatus.SERVERERROR); } /** @@ -116,8 +116,8 @@ public class OfficialGoldRecordService extends BaseService { * @return * @throws Exception */ - public BusiResult reduceDiamondNum(String ernos, byte type, Long num, int optId, String remark, Integer busType) throws Exception { - BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); + @Transactional(rollbackFor = Exception.class) + public BusiResult reduceDiamondNum(String ernos, byte type, Long num, int optId, String remark, Integer busType) throws Exception { Users user = usersBaseService.getUsersByErBanNo(Long.valueOf(ernos.trim())); if (user == null) { throw new ServiceException(BusiStatus.USERNOTEXISTS); @@ -126,12 +126,14 @@ public class OfficialGoldRecordService extends BaseService { if (userPurse.getDiamonds() < num) { throw new ServiceException(BusiStatus.DIAMONDNUMNOTENOUGH); } - billRecordService.insertGeneralBillRecord(user.getUid(), user.getUid(), null, + int recordId = addGoldRecord(user, type, Constant.WalletCurrencyType.diamonds, num, optId, remark, busType); + //增加官方操作记录 + billRecordService.insertGeneralBillRecord(user.getUid(), user.getUid(), String.valueOf(recordId), BillObjTypeEnum.OFFICIAL_DIAMOND_REDUCE, Double.valueOf(num)); //更新剩余DB数量,//更新缓存中钻石的数量 this.userPurseService.subDiamond(user.getUid(), num.doubleValue(), BillObjTypeEnum.OFFICIAL_GOLD_REDUCE.getDesc()); - return busiResult; + return BusiResult.success(); } @@ -279,14 +281,14 @@ public class OfficialGoldRecordService extends BaseService { * @return */ @Transactional(rollbackFor = Exception.class) - public BusiResult giveGold(String ernos, byte type, Long num, int optId, String remark, Integer busType) { + public BusiResult giveGold(String ernos, byte type, Long num, int optId, String remark, Integer busType) { String lockval = null; try { lockval = this.jedisLockService.lock(RedisKey.lock_official_gold_send.getKey(), 3000); if (StringUtils.isEmpty(lockval)) { throw new ServiceException(BusiStatus.SERVER_BUSY); } - BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); + BusiResult busiResult = new BusiResult<>(BusiStatus.SUCCESS); // 根据配置,发送微信提示消息 List erbanNos = Arrays.asList(ernos.trim().split("\n"));