init
This commit is contained in:
@@ -35,6 +35,7 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -225,6 +226,8 @@ public class LoginManager {
|
||||
UserExtend userExtend = new UserExtend();
|
||||
userExtend.setUsercode(usercode);
|
||||
userExtend.setUserId(add.getId());
|
||||
BigDecimal vipInviteRate = systemConfigManager.getSystemConfigOfBigDecimal(SystemConfigEnum.VIP_INVITE_RATE);
|
||||
userExtend.setVipInviteRate(vipInviteRate);
|
||||
userExtendService.save(userExtend);
|
||||
return add;
|
||||
}
|
||||
|
||||
56
ruoyi-xq/src/main/java/com/ruoyi/xq/manager/PayManager.java
Normal file
56
ruoyi-xq/src/main/java/com/ruoyi/xq/manager/PayManager.java
Normal file
@@ -0,0 +1,56 @@
|
||||
package com.ruoyi.xq.manager;
|
||||
|
||||
import com.ruoyi.xq.dto.app.pay.ConsumeResp;
|
||||
import com.ruoyi.xq.enums.common.OrderTypeEnum;
|
||||
import com.ruoyi.xq.enums.pay.PlatformTypeEnum;
|
||||
import com.ruoyi.xq.mq.AmqpProducer;
|
||||
import com.ruoyi.xq.mq.handle.dto.CalculateSalesHandleDTO;
|
||||
import com.ruoyi.xq.service.UserExtendService;
|
||||
import com.ruoyi.xq.service.VipOrderService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class PayManager {
|
||||
@Autowired
|
||||
private VipOrderService vipOrderService;
|
||||
@Autowired
|
||||
private UserExtendService userExtendService;
|
||||
@Autowired
|
||||
private AmqpProducer amqpProducer;
|
||||
public void callBack(String orderNo, Map<String,String> params, String appId, PlatformTypeEnum payTypeEnum){
|
||||
OrderTypeEnum orderTypeEnum = OrderNoUtil.getType(orderNo);
|
||||
if(orderTypeEnum == null){
|
||||
log.error("订单类型有误!orderNo={}",orderNo);
|
||||
return;
|
||||
}
|
||||
switch (orderTypeEnum){
|
||||
case VIP:
|
||||
ConsumeResp vipResp = vipOrderService.doSuccess(orderNo,params,appId,payTypeEnum);
|
||||
if(vipResp.isSuccess()){
|
||||
try {
|
||||
// 用户消费统计
|
||||
userExtendService.incsConsumeTotal(vipResp.getUserId(), vipResp.getPrice());
|
||||
}catch (Exception e){
|
||||
log.error("用户VIP消费统计",e);
|
||||
}
|
||||
try {
|
||||
if(vipResp.getConsumerId() != null){
|
||||
CalculateSalesHandleDTO dto = new CalculateSalesHandleDTO();
|
||||
dto.setConsumerLogId(vipResp.getConsumerId());
|
||||
amqpProducer.sendCommonMq(dto);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("RabbitMq 发送失败, 充值分销流程流转失败!",e);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,14 +42,6 @@ public class SystemConfigManager {
|
||||
sensitiveService.setSensitive(config);
|
||||
}
|
||||
|
||||
|
||||
public String getWebSocketUrl(){
|
||||
if(DEV_ACTIVE.equals(active)){
|
||||
return SystemConfigEnum.WS_SOCKET_URL.getDefaultValue();
|
||||
}
|
||||
return getSystemConfig(SystemConfigEnum.WS_SOCKET_URL);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配置信息返回boolean
|
||||
* @param systemConfig
|
||||
|
||||
Reference in New Issue
Block a user