提交代码

dev-discount
胡锐 3 years ago
parent 6d838a7ed9
commit 7841ddf57d
  1. 4
      hai-bweb/src/main/java/com/bweb/config/msg/MerStoreAccountChgHandler.java
  2. 3
      hai-bweb/src/main/java/com/bweb/controller/HighMerStoreAmountController.java
  3. 20
      hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreAccountServiceImpl.java
  4. 2
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -51,6 +51,8 @@ public class MerStoreAccountChgHandler {
otherParam.put("sourceType", MapUtils.getString(param, "sourceType")); otherParam.put("sourceType", MapUtils.getString(param, "sourceType"));
otherParam.put("sourceId", MapUtils.getString(param, "sourceId")); otherParam.put("sourceId", MapUtils.getString(param, "sourceId"));
otherParam.put("sourceContent", MapUtils.getString(param, "sourceContent")); otherParam.put("sourceContent", MapUtils.getString(param, "sourceContent"));
otherParam.put("opUserId", MapUtils.getLong(param, "opUserId"));
otherParam.put("opUserName", MapUtils.getString(param, "opUserName"));
merchantStoreAccountService.recharge( merchantStoreAccountService.recharge(
MapUtils.getLong(param, "storeId"), MapUtils.getLong(param, "storeId"),
@ -63,6 +65,8 @@ public class MerStoreAccountChgHandler {
otherParam.put("sourceType", MapUtils.getString(param, "sourceType")); otherParam.put("sourceType", MapUtils.getString(param, "sourceType"));
otherParam.put("sourceId", MapUtils.getString(param, "sourceId")); otherParam.put("sourceId", MapUtils.getString(param, "sourceId"));
otherParam.put("sourceContent", MapUtils.getString(param, "sourceContent")); otherParam.put("sourceContent", MapUtils.getString(param, "sourceContent"));
otherParam.put("opUserId", MapUtils.getLong(param, "opUserId"));
otherParam.put("opUserName", MapUtils.getString(param, "opUserName"));
merchantStoreAccountService.consume( merchantStoreAccountService.consume(
MapUtils.getLong(param, "storeId"), MapUtils.getLong(param, "storeId"),

@ -21,6 +21,7 @@ import com.hai.model.UserInfoModel;
import com.hai.service.*; import com.hai.service.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -75,6 +76,8 @@ public class HighMerStoreAmountController {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("sourceType", MerStoreAmountSourceTypeEnum.type1.getType()); map.put("sourceType", MerStoreAmountSourceTypeEnum.type1.getType());
map.put("sourceContent", "充值额度:" + body.getBigDecimal("amount") + " 元"); 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); merchantStoreAccountService.recharge(body.getLong("storeId"), body.getBigDecimal("amount"), map);
return ResponseMsgUtil.success("操作成功"); return ResponseMsgUtil.success("操作成功");

@ -87,11 +87,6 @@ public class HighMerchantStoreAccountServiceImpl implements HighMerchantStoreAcc
if (merchant == null) { if (merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); 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); HighMerchantStoreAccount account = getStoreAccountDetail(storeId);
if (account == null) { if (account == null) {
@ -120,8 +115,8 @@ public class HighMerchantStoreAccountServiceImpl implements HighMerchantStoreAcc
record.setSourceType(MapUtils.getInteger(otherParam, "sourceType")); record.setSourceType(MapUtils.getInteger(otherParam, "sourceType"));
record.setSourceId(MapUtils.getLong(otherParam, "sourceId")); record.setSourceId(MapUtils.getLong(otherParam, "sourceId"));
record.setSourceContent(MapUtils.getString(otherParam, "sourceContent")); record.setSourceContent(MapUtils.getString(otherParam, "sourceContent"));
record.setOpUserId(sessionModel.getSecUser().getId()); record.setOpUserId(MapUtils.getLong(otherParam, "opUserId"));
record.setOpUserName(sessionModel.getSecUser().getUserName()); record.setOpUserName(MapUtils.getString(otherParam, "opUserName"));
merchantStoreAccountRecordService.editRecord(record); merchantStoreAccountRecordService.editRecord(record);
} }
@ -138,11 +133,6 @@ public class HighMerchantStoreAccountServiceImpl implements HighMerchantStoreAcc
if (merchant == null) { if (merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); 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); HighMerchantStoreAccount account = getStoreAccountDetail(storeId);
if (account == null) { if (account == null) {
@ -165,6 +155,8 @@ public class HighMerchantStoreAccountServiceImpl implements HighMerchantStoreAcc
record.setStoreAmountId(account.getId()); record.setStoreAmountId(account.getId());
record.setMerId(merchant.getId()); record.setMerId(merchant.getId());
record.setMerName(merchant.getMerchantName()); record.setMerName(merchant.getMerchantName());
record.setStoreId(store.getId());
record.setStoreName(store.getStoreName());
record.setAmount(amount); record.setAmount(amount);
record.setBeforeAmount(beforeAmount); record.setBeforeAmount(beforeAmount);
record.setAfterAmount(afterAmount); record.setAfterAmount(afterAmount);
@ -172,8 +164,8 @@ public class HighMerchantStoreAccountServiceImpl implements HighMerchantStoreAcc
record.setSourceType(MapUtils.getInteger(otherParam, "sourceType")); record.setSourceType(MapUtils.getInteger(otherParam, "sourceType"));
record.setSourceId(MapUtils.getLong(otherParam, "sourceId")); record.setSourceId(MapUtils.getLong(otherParam, "sourceId"));
record.setSourceContent(MapUtils.getString(otherParam, "sourceContent")); record.setSourceContent(MapUtils.getString(otherParam, "sourceContent"));
record.setOpUserId(sessionModel.getSecUser().getId()); record.setOpUserId(MapUtils.getLong(otherParam, "opUserId"));
record.setOpUserName(sessionModel.getSecUser().getUserName()); record.setOpUserName(MapUtils.getString(otherParam, "opUserName"));
merchantStoreAccountRecordService.editRecord(record); merchantStoreAccountRecordService.editRecord(record);
} }
} }

@ -371,6 +371,8 @@ public class HighOrderServiceImpl implements HighOrderService {
pushParam.put("sourceType", MerStoreAmountSourceTypeEnum.type2.getType()); pushParam.put("sourceType", MerStoreAmountSourceTypeEnum.type2.getType());
pushParam.put("sourceId", highOrder.getId()); pushParam.put("sourceId", highOrder.getId());
pushParam.put("sourceContent", "订单号:" + highOrder.getOrderNo() + ",加油金额:¥" + highOrder.getTotalPrice()); 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); this.redisTemplate.boundListOps(MsgTopic.MerStoreAccount.getName()).leftPush(pushParam);
} }

Loading…
Cancel
Save