huangjiajun pirms 3 mēnešiem
vecāks
revīzija
eb7939f74c
19 mainītis faili ar 190 papildinājumiem un 18 dzēšanām
  1. +1
    -0
      src/super/dao/agent_list_dao.go
  2. +2
    -1
      src/super/dao/agent_settlement_dao.go
  3. +2
    -1
      src/super/dao/generate_wx_ad_data_dao.go
  4. +1
    -0
      src/super/dao/medium_list_dao.go
  5. +3
    -1
      src/super/dao/medium_settlement_dao.go
  6. +1
    -1
      src/super/dao/original_wx_ad_data_dao.go
  7. +20
    -0
      src/super/implement/agent_list_implement.go
  8. +31
    -1
      src/super/implement/agent_settlement_implement.go
  9. +25
    -1
      src/super/implement/generate_wx_ad_data_implement.go
  10. +2
    -2
      src/super/implement/generate_wx_ad_data_with_agent_flow_implement.go
  11. +20
    -0
      src/super/implement/medium_list_implement.go
  12. +42
    -1
      src/super/implement/medium_settlement_implement.go
  13. +6
    -3
      src/super/implement/original_wx_ad_data_implement.go
  14. +12
    -0
      src/super/model/agent_invoice.go
  15. +3
    -2
      src/super/model/agent_settlement.go
  16. +1
    -0
      src/super/model/generate_wx_ad_data.go
  17. +12
    -0
      src/super/model/medium_invoice.go
  18. +5
    -4
      src/super/model/medium_settlement.go
  19. +1
    -0
      src/super/model/original_wx_ad_data.go

+ 1
- 0
src/super/dao/agent_list_dao.go Parādīt failu

@@ -11,4 +11,5 @@ type AgentListDao interface {
AgentListInsert(m *model.AgentList) (int64, error)
UpdateAgentList(m *model.AgentList, columns ...string) (int64, error)
FindAgentList(uuid, name, state string, minState, page, limit int) (list []model.AgentList, total int64, err error)
FindAgentListBySettleType(uuid, agentId, settleType string, page, limit int) (list []model.AgentList, total int64, err error)
}

+ 2
- 1
src/super/dao/agent_settlement_dao.go Parādīt failu

@@ -1,4 +1,4 @@
package dao
package dao

import (
"code.fnuoos.com/zhimeng/model.git/src/super/model"
@@ -9,4 +9,5 @@ type AgentSettlementDao interface {
GetAgentSettlementForAvailable(agentId int) (agentSettlement *model.AgentSettlement, err error)
AgentSettlementInsertBySession(session *xorm.Session, m *model.AgentSettlement) (int64, error)
UpdateAgentSettlementBySession(session *xorm.Session, agentSettlement *model.AgentSettlement, columns ...string) (int64, error)
FindAgentSettlementList(uuid, mediumId, appId, payState, state, startDate, endDate string, page, limit int) (list []model.AgentSettlement, total int64, err error)
}

+ 2
- 1
src/super/dao/generate_wx_ad_data_dao.go Parādīt failu

@@ -1,4 +1,4 @@
package dao
package dao

import (
"code.fnuoos.com/zhimeng/model.git/src/super/model"
@@ -9,4 +9,5 @@ type GenerateWxAdDataDao interface {
GenerateWxAdDataInsertBySession(session *xorm.Session, m *model.GenerateWxAdData) (int64, error)
GetGenerateWxAdData(id int) (data *model.GenerateWxAdData, err error)
UpdateGenerateWxAdDataBySession(session *xorm.Session, m *model.GenerateWxAdData, columns ...string) (int64, error)
FindGenerateWxAdDataList(uuid, appId, slotId, startDate, endDate string, page, limit int) (list []model.GenerateWxAdData, total int64, err error)
}

+ 1
- 0
src/super/dao/medium_list_dao.go Parādīt failu

@@ -11,4 +11,5 @@ type MediumListDao interface {
MediumListInsert(m *model.MediumList) (int64, error)
UpdateMediumList(m *model.MediumList, columns ...string) (int64, error)
FindMediumList(uuid, name, state string, minState, page, limit int) (list []model.MediumList, total int64, err error)
FindMediumListBySettleType(uuid, mediumId, settleType string, page, limit int) (list []model.MediumList, total int64, err error)
}

+ 3
- 1
src/super/dao/medium_settlement_dao.go Parādīt failu

@@ -1,4 +1,4 @@
package dao
package dao

import (
"code.fnuoos.com/zhimeng/model.git/src/super/model"
@@ -7,6 +7,8 @@ import (

type MediumSettlementDao interface {
GetMediumSettlementForAvailable(mediumId int) (mediumSettlement *model.MediumSettlement, err error)
GetMediumSettlementById(id int) (mediumSettlement *model.MediumSettlement, err error)
MediumSettlementInsertBySession(session *xorm.Session, m *model.MediumSettlement) (int64, error)
UpdateMediumSettlementBySession(session *xorm.Session, mediumSettlement *model.MediumSettlement, columns ...string) (int64, error)
FindMediumSettlementList(uuid, mediumId, appId, payState, state, startDate, endDate string, page, limit int) (list []model.MediumSettlement, total int64, err error)
}

+ 1
- 1
src/super/dao/original_wx_ad_data_dao.go Parādīt failu

@@ -10,5 +10,5 @@ type OriginalWxAdDataDao interface {
GetOriginalWxAdDataSess(sess *xorm.Session, id int) (data *model.OriginalWxAdData, err error)
UpdateOriginalWxAdData(m *model.OriginalWxAdData, columns ...string) (int64, error)
UpdateOriginalWxAdDataBySession(session *xorm.Session, m *model.OriginalWxAdData, columns ...string) (int64, error)
FindOriginalWxAdDataList(uuid, appId, slotId, date string, page, limit int) (list []model.OriginalWxAdData, total int64, err error)
FindOriginalWxAdDataList(uuid, appId, slotId, startDate, endDate string, page, limit int) (list []model.OriginalWxAdData, total int64, err error)
}

+ 20
- 0
src/super/implement/agent_list_implement.go Parādīt failu

@@ -4,6 +4,7 @@ import (
"code.fnuoos.com/zhimeng/model.git/src/super/dao"
"code.fnuoos.com/zhimeng/model.git/src/super/model"
zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx"
"strings"
"xorm.io/xorm"
)

@@ -71,3 +72,22 @@ func (a AgentListDb) FindAgentList(uuid, name, state string, minState, page, lim
}
return
}

func (a AgentListDb) FindAgentListBySettleType(uuid, agentId, settleType string, page, limit int) (list []model.AgentList, total int64, err error) {
sess := a.Db.Desc("id").Limit(limit, (page-1)*limit)

if settleType != "" {
sess.And("settle_type = ?", settleType)
}
if agentId != "" {
sess.In("agent_id", strings.Split(agentId, ","))
}
if uuid != "" {
sess.And("uuid = ?", uuid)
}
total, err = sess.FindAndCount(&list)
if err != nil {
return nil, 0, err
}
return
}

+ 31
- 1
src/super/implement/agent_settlement_implement.go Parādīt failu

@@ -1,9 +1,10 @@
package implement
package implement

import (
"code.fnuoos.com/zhimeng/model.git/src/super/dao"
"code.fnuoos.com/zhimeng/model.git/src/super/model"
zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx"
"strings"
"xorm.io/xorm"
)

@@ -42,3 +43,32 @@ func (a AgentSettlementDb) AgentSettlementInsertBySession(session *xorm.Session,
}
return insertAffected, nil
}
func (a AgentSettlementDb) FindAgentSettlementList(uuid, agentId, appId, payState, state, startDate, endDate string, page, limit int) (list []model.AgentSettlement, total int64, err error) {
sess := a.Db.OrderBy("start_date desc,id desc").Limit(limit, (page-1)*limit)
if uuid != "" {
sess.And("uuid = ?", uuid)
}
if payState != "" {
sess.And("pay_state = ?", payState)
}
if state != "" {
sess.And("state = ?", state)
}
if startDate != "" {
sess.And("start_date>=", startDate)
}
if endDate != "" {
sess.And("end_date<=", endDate)
}
if appId != "" {
sess.In("app_id", strings.Split(appId, ","))
}
if agentId != "" {
sess.In("agent_id", strings.Split(agentId, ","))
}
total, err = sess.FindAndCount(&list)
if err != nil {
return nil, 0, err
}
return
}

+ 25
- 1
src/super/implement/generate_wx_ad_data_implement.go Parādīt failu

@@ -1,9 +1,10 @@
package implement
package implement

import (
"code.fnuoos.com/zhimeng/model.git/src/super/dao"
"code.fnuoos.com/zhimeng/model.git/src/super/model"
zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx"
"strings"
"xorm.io/xorm"
)

@@ -42,3 +43,26 @@ func (g GenerateWxAdDataDb) GenerateWxAdDataInsertBySession(session *xorm.Sessio
}
return insertAffected, nil
}
func (g GenerateWxAdDataDb) FindGenerateWxAdDataList(uuid, appId, slotId, startDate, endDate string, page, limit int) (list []model.GenerateWxAdData, total int64, err error) {
sess := g.Db.OrderBy("date desc,id desc").Limit(limit, (page-1)*limit)
if uuid != "" {
sess.And("uuid = ?", uuid)
}
if startDate != "" {
sess.And("date>=", startDate)
}
if endDate != "" {
sess.And("date<=", endDate)
}
if appId != "" {
sess.In("app_id", strings.Split(appId, ","))
}
if slotId != "" {
sess.In("slot_id", strings.Split(slotId, ","))
}
total, err = sess.FindAndCount(&list)
if err != nil {
return nil, 0, err
}
return
}

+ 2
- 2
src/super/implement/generate_wx_ad_data_with_agent_flow_implement.go Parādīt failu

@@ -1,4 +1,4 @@
package implement
package implement

import (
"code.fnuoos.com/zhimeng/model.git/src/super/dao"
@@ -25,7 +25,7 @@ func (g GenerateWxAdDataWithAgentFlowDb) BatchAddGenerateWxAdDataWithAgentFlow(s

func (g GenerateWxAdDataWithAgentFlowDb) FindGenerateWxAdDataWithAgentFlowByStrategyId(strategyId int) (*[]model.GenerateWxAdDataWithAgentFlow, error) {
var m []model.GenerateWxAdDataWithAgentFlow
if err := g.Db.Where("strategy_id = ?", strategyId).Asc("id").Find(&m); err != nil {
if err := g.Db.Where("generate_data_id = ?", strategyId).Asc("id").Find(&m); err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
return &m, nil


+ 20
- 0
src/super/implement/medium_list_implement.go Parādīt failu

@@ -4,6 +4,7 @@ import (
"code.fnuoos.com/zhimeng/model.git/src/super/dao"
"code.fnuoos.com/zhimeng/model.git/src/super/model"
zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx"
"strings"
"xorm.io/xorm"
)

@@ -71,3 +72,22 @@ func (m MediumListDb) FindMediumList(uuid, name, state string, minState, page, l
}
return
}

func (m MediumListDb) FindMediumListBySettleType(uuid, mediumId, settleType string, page, limit int) (list []model.MediumList, total int64, err error) {
sess := m.Db.Desc("id").Limit(limit, (page-1)*limit)

if settleType != "" {
sess.And("settle_type = ?", settleType)
}
if mediumId != "" {
sess.In("medium_id", strings.Split(mediumId, ","))
}
if uuid != "" {
sess.And("uuid = ?", uuid)
}
total, err = sess.FindAndCount(&list)
if err != nil {
return nil, 0, err
}
return
}

+ 42
- 1
src/super/implement/medium_settlement_implement.go Parādīt failu

@@ -1,9 +1,10 @@
package implement
package implement

import (
"code.fnuoos.com/zhimeng/model.git/src/super/dao"
"code.fnuoos.com/zhimeng/model.git/src/super/model"
zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx"
"strings"
"xorm.io/xorm"
)

@@ -42,3 +43,43 @@ func (m MediumSettlementDb) GetMediumSettlementForAvailable(mediumId int) (mediu
}
return mediumSettlement, nil
}
func (m MediumSettlementDb) GetMediumSettlementById(id int) (mediumSettlement *model.MediumSettlement, err error) {
mediumSettlement = new(model.MediumSettlement)
has, err := m.Db.Where("id =?", id).Get(mediumSettlement)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return mediumSettlement, nil
}
func (m MediumSettlementDb) FindMediumSettlementList(uuid, mediumId, appId, payState, state, startDate, endDate string, page, limit int) (list []model.MediumSettlement, total int64, err error) {
sess := m.Db.OrderBy("start_date desc,id desc").Limit(limit, (page-1)*limit)
if uuid != "" {
sess.And("uuid = ?", uuid)
}
if payState != "" {
sess.And("pay_state = ?", payState)
}
if state != "" {
sess.And("state = ?", state)
}
if startDate != "" {
sess.And("start_date>=", startDate)
}
if endDate != "" {
sess.And("end_date<=", endDate)
}
if appId != "" {
sess.In("app_id", strings.Split(appId, ","))
}
if mediumId != "" {
sess.In("medium_id", strings.Split(mediumId, ","))
}
total, err = sess.FindAndCount(&list)
if err != nil {
return nil, 0, err
}
return
}

+ 6
- 3
src/super/implement/original_wx_ad_data_implement.go Parādīt failu

@@ -54,13 +54,16 @@ func (o OriginalWxAdDataDb) GetOriginalWxAdDataSess(sess *xorm.Session, id int)
}
return data, nil
}
func (o OriginalWxAdDataDb) FindOriginalWxAdDataList(uuid, appId, slotId, date string, page, limit int) (list []model.OriginalWxAdData, total int64, err error) {
func (o OriginalWxAdDataDb) FindOriginalWxAdDataList(uuid, appId, slotId, startDate, endDate string, page, limit int) (list []model.OriginalWxAdData, total int64, err error) {
sess := o.Db.OrderBy("date desc,id desc").Limit(limit, (page-1)*limit)
if uuid != "" {
sess.And("uuid = ?", uuid)
}
if date != "" {
sess.In("date", strings.Split(date, ","))
if startDate != "" {
sess.And("date>=", startDate)
}
if endDate != "" {
sess.And("date<=", endDate)
}
if appId != "" {
sess.In("app_id", strings.Split(appId, ","))


+ 12
- 0
src/super/model/agent_invoice.go Parādīt failu

@@ -0,0 +1,12 @@
package model

type AgentInvoice struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
SettlementId int `json:"settlement_id" xorm:"not null default 0 comment('结算id') index unique INT(11)"`
CreateAt string `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP DATETIME"`
File string `json:"file" xorm:"VARCHAR(5000)"`
Count int `json:"count" xorm:"default 0 INT(11)"`
Type int `json:"type" xorm:"default 0 comment('0电子发票 1纸质发票') INT(1)"`
State int `json:"state" xorm:"default 0 comment('0待审核 1审核通过 2审核拒绝') INT(1)"`
}

+ 3
- 2
src/super/model/agent_settlement.go Parādīt failu

@@ -14,6 +14,7 @@ type AgentSettlement struct {
State int `json:"state" xorm:"not null default 0 comment('结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)') TINYINT(1)"`
StartDate string `json:"start_date" xorm:"not null default '0000-00-00' comment('开始时间') CHAR(50)"`
EndDate string `json:"end_date" xorm:"not null default '0000-00-00' comment('结束时间') CHAR(50)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
CreateAt string `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP DATETIME"`
SettleFile string `json:"settle_file" xorm:"comment('结算单文件') VARCHAR(255)"`
}

+ 1
- 0
src/super/model/generate_wx_ad_data.go Parādīt failu

@@ -31,4 +31,5 @@ type GenerateWxAdData struct {
IsGenerateReport int `json:"is_generate_report" xorm:"not null default 0 comment('是否已生成报表(0:未 1:已)') TINYINT(1)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Platform string `json:"platform" xorm:"not null default '' comment('来源平台') CHAR(50)"`
}

+ 12
- 0
src/super/model/medium_invoice.go Parādīt failu

@@ -0,0 +1,12 @@
package model

type MediumInvoice struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
SettlementId int `json:"settlement_id" xorm:"not null default 0 comment('结算id') index unique INT(11)"`
CreateAt string `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP DATETIME"`
File string `json:"file" xorm:"VARCHAR(5000)"`
Count int `json:"count" xorm:"default 0 INT(11)"`
Type int `json:"type" xorm:"default 0 comment('0电子发票 1纸质发票') INT(1)"`
State int `json:"state" xorm:"default 0 comment('0待审核 1审核通过 2审核拒绝') INT(1)"`
}

+ 5
- 4
src/super/model/medium_settlement.go Parādīt failu

@@ -11,8 +11,9 @@ type MediumSettlement struct {
OtherIncome int `json:"other_income" xorm:"not null default 0 comment('其他收益(分)') INT(11)"`
PayState int `json:"pay_state" xorm:"not null default 0 comment('结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)') TINYINT(1)"`
State int `json:"state" xorm:"not null default 0 comment('结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)') TINYINT(1)"`
StartDate string `json:"start_date" xorm:"not null default '0000-00-00' comment('开始时间') CHAR(50)"`
EndDate string `json:"end_date" xorm:"not null default '0000-00-00' comment('结束时间') CHAR(50)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
StartDate string `json:"start_date" xorm:"not null comment('开始时间') DATE"`
EndDate string `json:"end_date" xorm:"not null comment('结束时间') DATE"`
CreateAt string `json:"create_at" xorm:"not null default CURRENT_TIMESTAMP DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default CURRENT_TIMESTAMP DATETIME"`
SettleFile string `json:"settle_file" xorm:"comment('结算单文件') VARCHAR(255)"`
}

+ 1
- 0
src/super/model/original_wx_ad_data.go Parādīt failu

@@ -18,4 +18,5 @@ type OriginalWxAdData struct {
IsApply int `json:"is_apply" xorm:"not null default 0 comment('是否已应用(0:未 1:已)') TINYINT(1)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Platform string `json:"platform" xorm:"not null default '' comment('来源平台') CHAR(50)"`
}

Notiek ielāde…
Atcelt
Saglabāt