From 7841ddf57d448a94fe95e23dbfb66bc5e2f205cc Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 19 May 2022 15:38:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/msg/MerStoreAccountChgHandler.java | 6 +++++- .../HighMerStoreAmountController.java | 3 +++ .../HighMerchantStoreAccountServiceImpl.java | 20 ++++++------------- .../service/impl/HighOrderServiceImpl.java | 2 ++ 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/config/msg/MerStoreAccountChgHandler.java b/hai-bweb/src/main/java/com/bweb/config/msg/MerStoreAccountChgHandler.java index e4c348c4..cd156a58 100644 --- a/hai-bweb/src/main/java/com/bweb/config/msg/MerStoreAccountChgHandler.java +++ b/hai-bweb/src/main/java/com/bweb/config/msg/MerStoreAccountChgHandler.java @@ -51,11 +51,13 @@ public class MerStoreAccountChgHandler { otherParam.put("sourceType", MapUtils.getString(param, "sourceType")); otherParam.put("sourceId", MapUtils.getString(param, "sourceId")); otherParam.put("sourceContent", MapUtils.getString(param, "sourceContent")); + otherParam.put("opUserId", MapUtils.getLong(param, "opUserId")); + otherParam.put("opUserName", MapUtils.getString(param, "opUserName")); merchantStoreAccountService.recharge( MapUtils.getLong(param, "storeId"), new BigDecimal(MapUtils.getString(param, "price")), - otherParam ); + otherParam); } if (MapUtils.getInteger(param, "businessType").equals(MerStoreAmountTypeEnum.type2.getType())) { @@ -63,6 +65,8 @@ public class MerStoreAccountChgHandler { otherParam.put("sourceType", MapUtils.getString(param, "sourceType")); otherParam.put("sourceId", MapUtils.getString(param, "sourceId")); otherParam.put("sourceContent", MapUtils.getString(param, "sourceContent")); + otherParam.put("opUserId", MapUtils.getLong(param, "opUserId")); + otherParam.put("opUserName", MapUtils.getString(param, "opUserName")); merchantStoreAccountService.consume( MapUtils.getLong(param, "storeId"), diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighMerStoreAmountController.java b/hai-bweb/src/main/java/com/bweb/controller/HighMerStoreAmountController.java index c86e4938..72f5b035 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighMerStoreAmountController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighMerStoreAmountController.java @@ -21,6 +21,7 @@ import com.hai.model.UserInfoModel; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -75,6 +76,8 @@ public class HighMerStoreAmountController { Map map = new HashMap<>(); map.put("sourceType", MerStoreAmountSourceTypeEnum.type1.getType()); map.put("sourceContent", "充值额度:" + body.getBigDecimal("amount") + " 元"); + map.put("opUserId", userInfoModel.getSecUser().getId()); + map.put("opUserName", userInfoModel.getSecUser().getUserName()); merchantStoreAccountService.recharge(body.getLong("storeId"), body.getBigDecimal("amount"), map); return ResponseMsgUtil.success("操作成功"); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountServiceImpl.java index 50908977..e4a5f2ad 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountServiceImpl.java @@ -87,11 +87,6 @@ public class HighMerchantStoreAccountServiceImpl implements HighMerchantStoreAcc if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); } - // 操作人 - UserInfoModel sessionModel = userCenter.getSessionModel(UserInfoModel.class); - if (sessionModel == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知用户"); - } // 是否开通了账户 HighMerchantStoreAccount account = getStoreAccountDetail(storeId); if (account == null) { @@ -120,8 +115,8 @@ public class HighMerchantStoreAccountServiceImpl implements HighMerchantStoreAcc record.setSourceType(MapUtils.getInteger(otherParam, "sourceType")); record.setSourceId(MapUtils.getLong(otherParam, "sourceId")); record.setSourceContent(MapUtils.getString(otherParam, "sourceContent")); - record.setOpUserId(sessionModel.getSecUser().getId()); - record.setOpUserName(sessionModel.getSecUser().getUserName()); + record.setOpUserId(MapUtils.getLong(otherParam, "opUserId")); + record.setOpUserName(MapUtils.getString(otherParam, "opUserName")); merchantStoreAccountRecordService.editRecord(record); } @@ -138,11 +133,6 @@ public class HighMerchantStoreAccountServiceImpl implements HighMerchantStoreAcc if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); } - // 操作人 - UserInfoModel sessionModel = userCenter.getSessionModel(UserInfoModel.class); - if (sessionModel == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知用户"); - } // 是否开通了账户 HighMerchantStoreAccount account = getStoreAccountDetail(storeId); if (account == null) { @@ -165,6 +155,8 @@ public class HighMerchantStoreAccountServiceImpl implements HighMerchantStoreAcc record.setStoreAmountId(account.getId()); record.setMerId(merchant.getId()); record.setMerName(merchant.getMerchantName()); + record.setStoreId(store.getId()); + record.setStoreName(store.getStoreName()); record.setAmount(amount); record.setBeforeAmount(beforeAmount); record.setAfterAmount(afterAmount); @@ -172,8 +164,8 @@ public class HighMerchantStoreAccountServiceImpl implements HighMerchantStoreAcc record.setSourceType(MapUtils.getInteger(otherParam, "sourceType")); record.setSourceId(MapUtils.getLong(otherParam, "sourceId")); record.setSourceContent(MapUtils.getString(otherParam, "sourceContent")); - record.setOpUserId(sessionModel.getSecUser().getId()); - record.setOpUserName(sessionModel.getSecUser().getUserName()); + record.setOpUserId(MapUtils.getLong(otherParam, "opUserId")); + record.setOpUserName(MapUtils.getString(otherParam, "opUserName")); merchantStoreAccountRecordService.editRecord(record); } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index fa8ab6d7..252bfa79 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -371,6 +371,8 @@ public class HighOrderServiceImpl implements HighOrderService { pushParam.put("sourceType", MerStoreAmountSourceTypeEnum.type2.getType()); pushParam.put("sourceId", highOrder.getId()); pushParam.put("sourceContent", "订单号:" + highOrder.getOrderNo() + ",加油金额:¥" + highOrder.getTotalPrice()); + pushParam.put("opUserId", highOrder.getMemId()); + pushParam.put("opUserName", highOrder.getMemName()); // 扣预存款 this.redisTemplate.boundListOps(MsgTopic.MerStoreAccount.getName()).leftPush(pushParam); }