Browse Source

更新

master
huangjiajun 2 months ago
parent
commit
b0a4f7244c
2 changed files with 35 additions and 29 deletions
  1. +34
    -28
      app/svc/svc_wx_data.go
  2. +1
    -1
      go.mod

+ 34
- 28
app/svc/svc_wx_data.go View File

@@ -94,6 +94,7 @@ func GenerateWxAdData(req md.GenerateWxAdData) (err error, generateWxAdData mode
MediumId: originalWxAdData.MediumId,
Uuid: originalWxAdData.Uuid,
AppId: originalWxAdData.AppId,
PlatformAppId: originalWxAdData.PlatformAppId,
OriginalDataId: originalWxAdData.Id,
SlotId: originalWxAdData.SlotId,
AdSlot: originalWxAdData.AdSlot,
@@ -135,6 +136,7 @@ func GenerateWxAdData(req md.GenerateWxAdData) (err error, generateWxAdData mode
generateWxAdDataWithAgentFlows = append(generateWxAdDataWithAgentFlows, &model.GenerateWxAdDataWithAgentFlow{
Uuid: generateWxAdData.Uuid,
AppId: generateWxAdData.AppId,
PlatformAppId: generateWxAdData.PlatformAppId,
AgentId: v.AgentId,
GenerateDataId: generateWxAdData.Id,
SlotId: generateWxAdData.SlotId,
@@ -275,6 +277,7 @@ func SettlementWxAdData(req md.SettlementWxAdData) (err error) {
Uuid: originalWxAdData.Uuid,
MediumId: originalWxAdData.MediumId,
AppId: originalWxAdData.AppId,
PlatformAppId: originalWxAdData.PlatformAppId,
BusinessKind: 1,
Kind: medium.SettlementType,
BasicIncome: generateWxAdData.MediaRevenue,
@@ -313,6 +316,7 @@ func SettlementWxAdData(req md.SettlementWxAdData) (err error) {
Uuid: originalWxAdData.Uuid,
MediumId: originalWxAdData.MediumId,
AppId: originalWxAdData.AppId,
PlatformAppId: originalWxAdData.PlatformAppId,
BusinessKind: 1,
Kind: medium.SettlementType,
BasicIncome: generateWxAdData.MediaRevenue,
@@ -401,20 +405,21 @@ func SettlementWxAdData(req md.SettlementWxAdData) (err error) {
if agentSettlement == nil {
//新增一条数据
agentSettlement = &model.AgentSettlement{
Uuid: v.Uuid,
AgentId: v.AgentId,
MediumId: originalWxAdData.MediumId,
AppId: v.AppId,
BusinessKind: 1,
Kind: agentMap[v.AgentId].SettlementType,
BasicIncome: v.AgentRevenue,
OtherIncome: v.ExtraRevenue,
State: agentSettlementState,
PayState: agentSettlementPayState,
StartDate: now.Format("2006-01-02"),
EndDate: "",
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
Uuid: v.Uuid,
AgentId: v.AgentId,
MediumId: originalWxAdData.MediumId,
AppId: v.AppId,
PlatformAppId: v.PlatformAppId,
BusinessKind: 1,
Kind: agentMap[v.AgentId].SettlementType,
BasicIncome: v.AgentRevenue,
OtherIncome: v.ExtraRevenue,
State: agentSettlementState,
PayState: agentSettlementPayState,
StartDate: now.Format("2006-01-02"),
EndDate: "",
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
}
_, err = agentSettlementDb.AgentSettlementInsertBySession(session, agentSettlement)
if err != nil {
@@ -434,20 +439,21 @@ func SettlementWxAdData(req md.SettlementWxAdData) (err error) {

//新增一条数据
agentSettlement = &model.AgentSettlement{
Uuid: v.Uuid,
AgentId: v.AgentId,
MediumId: originalWxAdData.MediumId,
AppId: v.AppId,
BusinessKind: 1,
Kind: agentMap[v.AgentId].SettlementType,
BasicIncome: v.AgentRevenue,
OtherIncome: v.ExtraRevenue,
State: agentSettlementState,
PayState: agentSettlementPayState,
StartDate: now.Format("2006-01-02"),
EndDate: "",
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
Uuid: v.Uuid,
AgentId: v.AgentId,
MediumId: originalWxAdData.MediumId,
AppId: v.AppId,
PlatformAppId: v.PlatformAppId,
BusinessKind: 1,
Kind: agentMap[v.AgentId].SettlementType,
BasicIncome: v.AgentRevenue,
OtherIncome: v.ExtraRevenue,
State: agentSettlementState,
PayState: agentSettlementPayState,
StartDate: now.Format("2006-01-02"),
EndDate: "",
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
}
_, err = agentSettlementDb.AgentSettlementInsertBySession(session, agentSettlement)
if err != nil {


+ 1
- 1
go.mod View File

@@ -5,7 +5,7 @@ go 1.18
//replace code.fnuoos.com/zhimeng/model.git => E:/company/ad/models

require (
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240906014333-2fe6da0384ee
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20240929103949-751c6e51e035
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
github.com/boombuler/barcode v1.0.1
github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5


Loading…
Cancel
Save