|
|
@@ -1,6 +1,7 @@
|
|
|
package org.dromara.server.mq.event.kafka.impl.local;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -12,11 +13,16 @@ import org.dromara.backstage.api.domain.bo.RemoteCardBo;
|
|
|
import org.dromara.backstage.api.domain.bo.RemotePurseInOutBo;
|
|
|
import org.dromara.backstage.api.domain.bo.RemoteUserAccountBo;
|
|
|
import org.dromara.backstage.api.domain.vo.RemoteUserAccountVo;
|
|
|
+import org.dromara.common.core.enums.BalanceUpdateEnum;
|
|
|
+import org.dromara.common.core.enums.CreditTypeEnum;
|
|
|
+import org.dromara.common.core.enums.SystemUseTypeEnum;
|
|
|
import org.dromara.common.message.kafka.constant.EventSenderConstants;
|
|
|
import org.dromara.common.message.kafka.constant.EventTypeConstants;
|
|
|
import org.dromara.server.mq.event.kafka.IYktEventStrategy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
+
|
|
|
/**
|
|
|
* @ClassName BackStageEventStrategyImpl
|
|
|
* @Description 处理管理平台消息队列
|
|
|
@@ -55,7 +61,17 @@ public class BackStageEventStrategyImpl implements IYktEventStrategy {
|
|
|
remoteCardService.saveOrUpdate(remoteBo);
|
|
|
}
|
|
|
case EventTypeConstants.RECHARGE -> {
|
|
|
- RemotePurseInOutBo remoteBo = JSONUtil.toBean(JSONUtil.parseObj(msg), RemotePurseInOutBo.class);
|
|
|
+ JSONObject object = JSONUtil.parseObj(msg);
|
|
|
+ RemotePurseInOutBo remoteBo = new RemotePurseInOutBo();
|
|
|
+ remoteBo.setUserId(Long.valueOf(object.getStr("userId")));
|
|
|
+ remoteBo.setBagCode(object.getStr("bagCode"));
|
|
|
+ remoteBo.setPayStyle(object.getStr("payStyle"));
|
|
|
+ remoteBo.setReceiptMoney(new BigDecimal(object.getStr("receiptMoney")));
|
|
|
+ remoteBo.setTakeCommission(object.getStr("takeCommission"));
|
|
|
+ remoteBo.setOperatorId(Long.valueOf(object.getStr("operatorId")));
|
|
|
+ remoteBo.setUseType(SystemUseTypeEnum.CONSUME);
|
|
|
+ remoteBo.setOperationMode(BalanceUpdateEnum.RECHARGE);
|
|
|
+ remoteBo.setCreditType(CreditTypeEnum.WECHAT_RECHARGE);
|
|
|
log.info("[处理云端->本地充值请求]-[充值信息:{}]", JSONUtil.toJsonStr(remoteBo));
|
|
|
remoteBagService.recharge(remoteBo);
|
|
|
}
|