Merge branch 'main' of http://1.117.67.95:3000/team/hm-server
This commit is contained in:
@@ -80,13 +80,13 @@ func (l *AgentService) AgentProcess(ctx context.Context, order *model.Order) err
|
||||
return findAgentProductConfigModelErr
|
||||
}
|
||||
// 平台底价成本
|
||||
PlatformCostAmount, platformCostErr := l.PlatformCost(transCtx, agentID, agentProductConfigModel, session)
|
||||
PlatformCostAmount, platformCostErr := l.PlatformCost(transCtx, agentID, order.Id, agentProductConfigModel, session)
|
||||
if platformCostErr != nil {
|
||||
return platformCostErr
|
||||
}
|
||||
|
||||
// 平台提价成本
|
||||
PlatformPricingAmount, platformPricingErr := l.PlatformPricing(transCtx, agentID, order.Amount, agentProductConfigModel, session)
|
||||
PlatformPricingAmount, platformPricingErr := l.PlatformPricing(transCtx, agentID, order.Id, order.Amount, agentProductConfigModel, session)
|
||||
if platformPricingErr != nil {
|
||||
return platformPricingErr
|
||||
}
|
||||
@@ -227,10 +227,11 @@ func (l *AgentService) AncestorCommission(ctx context.Context, descendantId int6
|
||||
}
|
||||
|
||||
// PlatformCost 平台底价成本
|
||||
func (l *AgentService) PlatformCost(ctx context.Context, agentID int64, agentProductConfigModel *model.AgentProductConfig, session sqlx.Session) (float64, error) {
|
||||
func (l *AgentService) PlatformCost(ctx context.Context, agentID int64, orderID int64, agentProductConfigModel *model.AgentProductConfig, session sqlx.Session) (float64, error) {
|
||||
|
||||
costAgentPlatformDeductionModel := model.AgentPlatformDeduction{
|
||||
AgentId: agentID,
|
||||
OrderId: orderID,
|
||||
Amount: agentProductConfigModel.CostPrice,
|
||||
Type: model.AgentDeductionTypeCost,
|
||||
}
|
||||
@@ -243,7 +244,7 @@ func (l *AgentService) PlatformCost(ctx context.Context, agentID int64, agentPro
|
||||
}
|
||||
|
||||
// PlatformPricing 平台提价成本
|
||||
func (l *AgentService) PlatformPricing(ctx context.Context, agentID int64, pricing float64, agentProductConfigModel *model.AgentProductConfig, session sqlx.Session) (float64, error) {
|
||||
func (l *AgentService) PlatformPricing(ctx context.Context, agentID int64, orderID int64, pricing float64, agentProductConfigModel *model.AgentProductConfig, session sqlx.Session) (float64, error) {
|
||||
// 2. 计算平台提价成本
|
||||
if pricing > agentProductConfigModel.PricingStandard {
|
||||
// 超出部分
|
||||
@@ -254,6 +255,7 @@ func (l *AgentService) PlatformPricing(ctx context.Context, agentID int64, prici
|
||||
|
||||
pricingAgentPlatformDeductionModel := model.AgentPlatformDeduction{
|
||||
AgentId: agentID,
|
||||
OrderId: orderID,
|
||||
Amount: overpricingCost,
|
||||
Type: model.AgentDeductionTypePricing,
|
||||
}
|
||||
@@ -384,7 +386,7 @@ func (l *AgentService) GiveUpgradeReward(ctx context.Context, agentID int64, old
|
||||
// 获取各等级的奖励金额
|
||||
var vipRewardAmount float64
|
||||
var svipRewardAmount float64
|
||||
|
||||
|
||||
if agentMembershipConfigModel.LowerConvertVipReward.Valid {
|
||||
vipRewardAmount = agentMembershipConfigModel.LowerConvertVipReward.Float64
|
||||
}
|
||||
@@ -500,7 +502,7 @@ func (l *AgentService) GiveWithdrawReward(ctx context.Context, agentID int64, wi
|
||||
return nil
|
||||
}
|
||||
rewardAmount := withdrawAmount * rewardRatio
|
||||
|
||||
|
||||
if rewardAmount > 0 {
|
||||
// 创建奖励记录
|
||||
agentRewards := model.AgentRewards{
|
||||
|
||||
@@ -58,7 +58,7 @@ type APIResponseData struct {
|
||||
}
|
||||
|
||||
// ProcessRequests 处理请求
|
||||
func (a *ApiRequestService) ProcessRequests(params []byte, productID int64) ([]byte, error) {
|
||||
func (a *ApiRequestService) ProcessRequests(params []byte, productID int64) ([]APIResponseData, error) {
|
||||
var ctx, cancel = context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
build := a.productFeatureModel.SelectBuilder().Where(squirrel.Eq{
|
||||
@@ -166,12 +166,7 @@ func (a *ApiRequestService) ProcessRequests(params []byte, productID int64) ([]b
|
||||
return nil, fmt.Errorf("请求失败次数超过 %d 次: %v", errorLimit, allErrors)
|
||||
}
|
||||
|
||||
combinedResponse, err := json.Marshal(responseData)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("响应数据转 JSON 失败: %v", err)
|
||||
}
|
||||
|
||||
return combinedResponse, nil
|
||||
return responseData, nil
|
||||
}
|
||||
|
||||
// ------------------------------------请求处理器--------------------------
|
||||
@@ -1419,6 +1414,7 @@ func (a *ApiRequestService) ProcessIVYZ7F3ARequest(params []byte) ([]byte, error
|
||||
// 直接返回解密后的数据,而不是再次进行JSON编码
|
||||
return convertTianyuanResponse(resp)
|
||||
}
|
||||
|
||||
// ProcessIVYZ3P9MRequest 学历实时查询
|
||||
func (a *ApiRequestService) ProcessIVYZ3P9MRequest(params []byte) ([]byte, error) {
|
||||
idCard := gjson.GetBytes(params, "id_card")
|
||||
|
||||
Reference in New Issue
Block a user