作者 tangxvhui

Merge branch 'test'

正在显示 40 个修改的文件 包含 549 行增加101 行删除
... ... @@ -25,4 +25,5 @@ opp
/vendor
/*.exe~
logs
tmp
\ No newline at end of file
tmp
/partner
\ No newline at end of file
... ...
FROM 192.168.0.243:5000/mmm/mmmpartner:base
FROM golang:1.19-alpine
ENV APP_DIR $GOPATH/src/partner
RUN mkdir -p $APP_DIR
WORKDIR $APP_DIR/
... ...
# 合伙人项目
### 系统架构
### 对应的管理后台项目
### 领域驱动设计
http://gitlab.fjmaimaimai.com/mmm-go/partnermg
### 核心登录流程
### app对接的测试环境
```
服务端地址 http://mmm-partner-test.fjmaimaimai.com/
日志文件地址 http://mmm-partner-test.fjmaimaimai.com/log?id=12345
```
### app 对接的正式环境
```
服务端地址 https://public-interface.fjmaimaimai.com/mmm-partner
```
\ No newline at end of file
... ...
... ... @@ -3,7 +3,7 @@ runmode = "${RUN_MODE||dev}"
httpport = "${HTTP_PORT||8082}"
#开启https
EnableHTTPS = true
EnableHTTPS = false
HTTPSPort = "443"
HTTPSCertFile = "conf/fjmaimaimai.com_pem.crt"
HTTPSKeyFile = "conf/fjmaimaimai.com_rsa.key"
... ...
... ... @@ -52,9 +52,9 @@ spec:
ports:
- containerPort: 8082
- containerPort: 443
# volumeMounts:
# - mountPath: /opt/logs
# name: accesslogs
# volumeMounts:
# - mountPath: /opt/logs
# name: accesslogs
env:
- name: HTTP_PORT
value: "8082"
... ... @@ -84,6 +84,8 @@ spec:
value: "https://mmm-open-api-dev.fjmaimaimai.com"
- name: UCENTER_SERVICE_HOST
value: "https://suplus-ucenter-dev.fjmaimaimai.com"
- name: SERVICE_RUNMOD
value: "dev"
- name: BUSINESS_ADMIN_SERVICE_HOST
valueFrom:
configMapKeyRef:
... ... @@ -103,4 +105,4 @@ spec:
value: ""
# volumes:
# - name: accesslogs
# emptyDir: {}
\ No newline at end of file
# emptyDir: {}
... ...
... ... @@ -84,6 +84,8 @@ spec:
value: "https://public-interface.fjmaimaimai.com/openapi"
- name: UCENTER_SERVICE_HOST
value: "https://suplus-ucenter-prd.fjmaimaimai.com"
- name: SERVICE_RUNMOD
value: "prd"
- name: BUSINESS_ADMIN_SERVICE_HOST
valueFrom:
configMapKeyRef:
... ... @@ -103,4 +105,4 @@ spec:
value: ""
volumes:
- name: accesslogs
emptyDir: {}
\ No newline at end of file
emptyDir: {}
... ...
... ... @@ -52,9 +52,9 @@ spec:
ports:
- containerPort: 8082
- containerPort: 443
# volumeMounts:
# - mountPath: /opt/logs
# name: accesslogs
# volumeMounts:
# - mountPath: /opt/logs
# name: accesslogs
env:
- name: HTTP_PORT
value: "8082"
... ... @@ -84,6 +84,8 @@ spec:
value: "https://mmm-open-api-dev.fjmaimaimai.com"
- name: UCENTER_SERVICE_HOST
value: "https://suplus-ucenter-test.fjmaimaimai.com"
- name: SERVICE_RUNMOD
value: "dev"
- name: BUSINESS_ADMIN_SERVICE_HOST
valueFrom:
configMapKeyRef:
... ... @@ -103,4 +105,4 @@ spec:
value: ""
# volumes:
# - name: accesslogs
# emptyDir: {}
\ No newline at end of file
# emptyDir: {}
... ...
module gitlab.fjmaimaimai.com/mmm-go/partner
go 1.14
go 1.19
require (
github.com/Shopify/sarama v1.26.4
github.com/ajg/form v1.5.1 // indirect
github.com/Shopify/sarama v1.38.1
github.com/astaxie/beego v1.12.3
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 // indirect
github.com/gavv/httpexpect v2.0.0+incompatible
github.com/gin-gonic/gin v1.5.0
github.com/go-pg/pg/v10 v10.0.0-beta.2
github.com/imkira/go-interpol v1.1.0 // indirect
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
github.com/gin-gonic/gin v1.9.1
github.com/go-pg/pg/v10 v10.11.2
github.com/linmadan/egglib-go v0.0.0-20191217144343-ca4539f95bf9
github.com/moul/http2curl v1.0.0 // indirect
github.com/onsi/ginkgo v1.15.0
github.com/onsi/gomega v1.10.5
github.com/sergi/go-diff v1.1.0 // indirect
github.com/shopspring/decimal v1.2.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.30.0
github.com/shopspring/decimal v1.3.1
github.com/tiptok/gocomm v1.0.5
github.com/valyala/fasthttp v1.19.0 // indirect
)
require (
github.com/ajg/form v1.5.1 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/eapache/go-resiliency v1.3.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20230111030713-bf00bc1b83b6 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 // indirect
github.com/fatih/structs v0.0.0-20180123065059-ebf56d35bba7 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/garyburd/redigo v1.6.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-pg/zerochecker v0.2.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imkira/go-interpol v1.1.0 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.7.6 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.3 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.16.3 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/moul/http2curl v1.0.0 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/pelletier/go-toml v1.2.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pierrec/lz4/v4 v4.1.17 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.7.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.10.0 // indirect
github.com/prometheus/procfs v0.1.3 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect
github.com/sony/sonyflake v1.0.0 // indirect
github.com/spf13/afero v1.1.2 // indirect
github.com/spf13/cast v1.3.0 // indirect
github.com/spf13/jwalterweatherman v1.0.0 // indirect
github.com/spf13/pflag v1.0.3 // indirect
github.com/spf13/viper v1.4.0 // indirect
github.com/stretchr/testify v1.8.3 // indirect
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.50.0 // indirect
github.com/vmihailenco/bufpool v0.1.11 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.4 // indirect
github.com/vmihailenco/tagparser v0.1.2 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect
github.com/yudai/gojsondiff v1.0.0 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
github.com/yudai/pp v2.0.1+incompatible // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
mellium.im/sasl v0.3.1 // indirect
)
... ...
... ... @@ -4,11 +4,10 @@ import (
"github.com/astaxie/beego"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/event"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant"
_ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant"
_ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg"
_ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/redis"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log"
//"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/ginsvr"
_ "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/appsvr"
)
... ... @@ -18,13 +17,9 @@ func main() {
}()
log.Info("app start!")
log.Info(constant.POSTGRESQL_DB_NAME)
//ginsvr.Run()
//注册事件
event.InitEventCenter()
//启动kafaka消息订阅
//go sarama.Run()
beego.Run()
}
... ...
不能预览此文件类型
... ... @@ -226,6 +226,7 @@ func RefreshToken(request *protocol.RefreshTokenRequest) (rsp *protocol.RefreshT
// 验证短信验证码 T
func CheckSmsCode(phone, code string) (result bool, err error) {
sms, _ := factory.CreateSmsCodeService()
var data map[string]interface{}
data, err = sms.CheckSmsCode(phone, code)
... ...
... ... @@ -2,12 +2,13 @@ package dividend
import (
"fmt"
"time"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/factory"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol"
"time"
)
// 分红统计
... ... @@ -25,7 +26,13 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DividendStatis
}()
// 事业分红统计-查询订单
_, orderAll, e := OrderBaseResponsitory.Find(utils.ObjectJsonToMap(domain.OrderQueryOption{PartnerId: request.PartnerId, EndTime: utils.GetDayEnd(), SortBySalesTime: domain.DESC, OrderTypes: domain.UserOrderTypes(domain.Career)}))
_, orderAll, e := OrderBaseResponsitory.Find(utils.ObjectJsonToMap(
domain.OrderQueryOption{
PartnerId: request.PartnerId,
EndTime: utils.GetDayEnd(),
SortBySalesTime: domain.DESC,
OrderTypes: domain.UserOrderTypes(domain.Career),
}))
if e != nil {
log.Error(e)
}
... ... @@ -122,8 +129,8 @@ func AllBonusStatics(orders []*domain.OrderBase, action int) (bonus protocol.Bon
}
// 订单-季度分红统计
func QuartersBonusStatics(orders []*domain.OrderBase, action int) (bonus []protocol.Bonus) {
bonus = make([]protocol.Bonus, 4)
func QuartersBonusStatics(orders []*domain.OrderBase, action int) (bonus [4]protocol.Bonus) {
bonus = [4]protocol.Bonus{}
for i := range orders {
o := orders[i]
quarter := quarter(o.SaleDate)
... ...
package dividend
import (
"fmt"
"time"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/factory"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol"
)
// 分红统计
func StatisticsV2(header *protocol.RequestHeader, request *protocol.DividendStatisticsRequest) (rsp *protocol.DividendStatisticsV2Response, err error) {
var (
transactionContext, _ = factory.CreateTransactionContext(nil)
OrderBaseResponsitory, _ = factory.CreateOrderBaseRepository(transactionContext)
)
if err = transactionContext.StartTransaction(); err != nil {
return nil, err
}
defer func() {
transactionContext.RollbackTransaction()
}()
// 事业分红统计-查询订单
_, orderAll, e := OrderBaseResponsitory.Find(utils.ObjectJsonToMap(
domain.OrderQueryOption{
PartnerId: request.PartnerId,
EndTime: utils.GetDayEnd(),
SortBySalesTime: domain.DESC,
OrderTypes: domain.UserOrderTypes(domain.Career),
}))
if e != nil {
log.Error(e)
}
err = transactionContext.CommitTransaction()
if err != nil {
return nil, err
}
//获取营销年
t := time.Now()
var last time.Time
var first time.Time
boundDate := time.Date(t.Year(), time.March, 31, 23, 59, 59, 0, time.Local) // 营销年界限
fmt.Println("营销年界限:", boundDate)
if t.Before(boundDate) || t.Equal(boundDate) {
first = time.Date(t.Year()-1, time.April, 1, 0, 0, 0, 0, time.Local)
last = time.Date(t.Year(), time.March, 31, 23, 59, 59, 0, time.Local)
} else if t.After(boundDate) {
first = time.Date(t.Year(), time.April, 1, 0, 0, 0, 0, time.Local)
last = time.Date(t.Year()+1, time.March, 31, 23, 59, 59, 0, time.Local)
}
fmt.Println("当前营销年起始:", first, last)
// 请求开始时间和结束时间都为0时,默认从营销年开始统计
if request.StartTime == 0 && request.EndTime == 0 {
request.StartTime = first.Unix() * 1000
request.EndTime = last.Unix() * 1000
} else if request.StartTime > 0 && request.EndTime > 0 { // 判断结束时间是否超过今天,超过今天的结束时间到今天为止
currentDayEnd := utils.GetDayEnd().Unix() * 1000
if request.EndTime >= currentDayEnd {
request.EndTime = currentDayEnd
}
}
fmt.Println("StartTime: ", request.StartTime)
fmt.Println("EndTime: ", request.EndTime)
var orderBetween []*domain.OrderBase
for i := range orderAll {
if orderAll[i].SaleDate.Unix() >= (request.StartTime/1000) && orderAll[i].SaleDate.Unix() < (request.EndTime/1000) {
orderBetween = append(orderBetween, orderAll[i])
}
}
//0:全部分类,
//Career int = 1 //事业
//Business int = 2 //业务
//Develop int = 3 //研发
//App int = 4 //业务产品-应用
//累计分红
var (
bonusAll protocol.Bonus
bonusAllCareer protocol.Bonus
bonusAllBusiness protocol.Bonus
bonusAllDevelop protocol.Bonus
bonusAllApp protocol.Bonus
)
{
for _, val := range orderAll {
static := val.OrderBonusStatic()
bonusAll.Received = utils.Decimal(bonusAll.Received + static.OrderBonusReceive())
bonusAll.Outstanding = utils.Decimal(bonusAll.Outstanding + static.OrderBonusWait())
bonusAll.Receivable = utils.Decimal(bonusAll.Receivable + static.OrderTotalReceivable())
if val.PartnerCategory == nil {
continue
}
switch val.PartnerCategory.Id {
case int64(domain.Career):
bonusAllCareer.Received = utils.Decimal(bonusAllCareer.Received + static.OrderBonusReceive())
bonusAllCareer.Outstanding = utils.Decimal(bonusAllCareer.Outstanding + static.OrderBonusWait())
bonusAllCareer.Receivable = utils.Decimal(bonusAllCareer.Receivable + static.OrderTotalReceivable())
case int64(domain.Business):
bonusAllBusiness.Received = utils.Decimal(bonusAllBusiness.Received + static.OrderBonusReceive())
bonusAllBusiness.Outstanding = utils.Decimal(bonusAllBusiness.Outstanding + static.OrderBonusWait())
bonusAllBusiness.Receivable = utils.Decimal(bonusAllBusiness.Receivable + static.OrderTotalReceivable())
case int64(domain.App):
bonusAllApp.Received = utils.Decimal(bonusAllApp.Received + static.OrderBonusReceive())
bonusAllApp.Outstanding = utils.Decimal(bonusAllApp.Outstanding + static.OrderBonusWait())
bonusAllApp.Receivable = utils.Decimal(bonusAllApp.Receivable + static.OrderTotalReceivable())
case int64(domain.Develop):
bonusAllDevelop.Received = utils.Decimal(bonusAllDevelop.Received + static.OrderBonusReceive())
bonusAllDevelop.Outstanding = utils.Decimal(bonusAllDevelop.Outstanding + static.OrderBonusWait())
bonusAllDevelop.Receivable = utils.Decimal(bonusAllDevelop.Receivable + static.OrderTotalReceivable())
}
}
}
//0:全部分类,
//Career int = 1 //事业
//Business int = 2 //业务
//Develop int = 3 //研发
//App int = 4 //业务产品-应用
//季度分红
var (
bonusQuarters = [4]protocol.Bonus{}
bonusQuartersCareer = [4]protocol.Bonus{}
bonusQuartersBusiness = [4]protocol.Bonus{}
bonusQuartersDevelop = [4]protocol.Bonus{}
bonusQuartersApp = [4]protocol.Bonus{}
)
{
var (
quarterNum int // 对应季度在数组中的位置
)
for _, val := range orderBetween {
quarterNum = quarter(val.SaleDate)
static := val.OrderBonusStatic()
bonusQuarters[quarterNum].Receivable = utils.Decimal(bonusQuarters[quarterNum].Receivable + static.OrderTotalReceivable())
bonusQuarters[quarterNum].Received = utils.Decimal(bonusQuarters[quarterNum].Received + static.OrderBonusReceive())
bonusQuarters[quarterNum].Outstanding = utils.Decimal(bonusQuarters[quarterNum].Outstanding + static.OrderBonusWait())
if val.PartnerCategory == nil {
continue
}
// 分类合并计数
switch val.PartnerCategory.Id {
case int64(domain.Career):
bonusQuartersCareer[quarterNum].Receivable = utils.Decimal(bonusQuartersCareer[quarterNum].Receivable + static.OrderTotalReceivable())
bonusQuartersCareer[quarterNum].Received = utils.Decimal(bonusQuartersCareer[quarterNum].Received + static.OrderBonusReceive())
bonusQuartersCareer[quarterNum].Outstanding = utils.Decimal(bonusQuartersCareer[quarterNum].Outstanding + static.OrderBonusWait())
case int64(domain.Business):
bonusQuartersBusiness[quarterNum].Receivable = utils.Decimal(bonusQuartersBusiness[quarterNum].Receivable + static.OrderTotalReceivable())
bonusQuartersBusiness[quarterNum].Received = utils.Decimal(bonusQuartersBusiness[quarterNum].Received + static.OrderBonusReceive())
bonusQuartersBusiness[quarterNum].Outstanding = utils.Decimal(bonusQuartersBusiness[quarterNum].Outstanding + static.OrderBonusWait())
case int64(domain.App):
bonusQuartersApp[quarterNum].Receivable = utils.Decimal(bonusQuartersApp[quarterNum].Receivable + static.OrderTotalReceivable())
bonusQuartersApp[quarterNum].Received = utils.Decimal(bonusQuartersApp[quarterNum].Received + static.OrderBonusReceive())
bonusQuartersApp[quarterNum].Outstanding = utils.Decimal(bonusQuartersApp[quarterNum].Outstanding + static.OrderBonusWait())
case int64(domain.Develop):
bonusQuartersDevelop[quarterNum].Receivable = utils.Decimal(bonusQuartersDevelop[quarterNum].Receivable + static.OrderTotalReceivable())
bonusQuartersDevelop[quarterNum].Received = utils.Decimal(bonusQuartersDevelop[quarterNum].Received + static.OrderBonusReceive())
bonusQuartersDevelop[quarterNum].Outstanding = utils.Decimal(bonusQuartersDevelop[quarterNum].Outstanding + static.OrderBonusWait())
}
}
}
// 处理分月份的
//月度分红
var (
bonusMonths = [12]protocol.Bonus{}
bonusMonthsCareer = [12]protocol.Bonus{}
bonusMonthsBusiness = [12]protocol.Bonus{}
bonusMonthsDevelop = [12]protocol.Bonus{}
bonusMonthsApp = [12]protocol.Bonus{}
)
{
//按照自然年过滤数据
yearNum := time.Unix(request.StartTime/1000, 0).Local().Year()
var monthNum int //对应月份在数组中的位置
for i, val := range orderAll {
if orderAll[i].SaleDate.Year() != yearNum {
continue
}
monthNum = int(val.SaleDate.Month()) - 1
static := val.OrderBonusStatic()
bonusMonths[monthNum].Receivable = utils.Decimal(bonusMonths[monthNum].Receivable + static.OrderTotalReceivable())
bonusMonths[monthNum].Received = utils.Decimal(bonusMonths[monthNum].Received + static.OrderBonusReceive())
bonusMonths[monthNum].Outstanding = utils.Decimal(bonusMonths[monthNum].Outstanding + static.OrderBonusWait())
if val.PartnerCategory == nil {
continue
}
// 分类合并计数
switch val.PartnerCategory.Id {
case int64(domain.Career):
bonusMonthsCareer[monthNum].Receivable = utils.Decimal(bonusMonthsCareer[monthNum].Receivable + static.OrderTotalReceivable())
bonusMonthsCareer[monthNum].Received = utils.Decimal(bonusMonthsCareer[monthNum].Received + static.OrderBonusReceive())
bonusMonthsCareer[monthNum].Outstanding = utils.Decimal(bonusMonthsCareer[monthNum].Outstanding + static.OrderBonusWait())
case int64(domain.Business):
bonusMonthsBusiness[monthNum].Receivable = utils.Decimal(bonusMonthsBusiness[monthNum].Receivable + static.OrderTotalReceivable())
bonusMonthsBusiness[monthNum].Received = utils.Decimal(bonusMonthsBusiness[monthNum].Received + static.OrderBonusReceive())
bonusMonthsBusiness[monthNum].Outstanding = utils.Decimal(bonusMonthsBusiness[monthNum].Outstanding + static.OrderBonusWait())
case int64(domain.App):
bonusMonthsApp[monthNum].Receivable = utils.Decimal(bonusMonthsApp[monthNum].Receivable + static.OrderTotalReceivable())
bonusMonthsApp[monthNum].Received = utils.Decimal(bonusMonthsApp[monthNum].Received + static.OrderBonusReceive())
bonusMonthsApp[monthNum].Outstanding = utils.Decimal(bonusMonthsApp[monthNum].Outstanding + static.OrderBonusWait())
case int64(domain.Develop):
bonusMonthsDevelop[monthNum].Receivable = utils.Decimal(bonusMonthsDevelop[monthNum].Receivable + static.OrderTotalReceivable())
bonusMonthsDevelop[monthNum].Received = utils.Decimal(bonusMonthsDevelop[monthNum].Received + static.OrderBonusReceive())
bonusMonthsDevelop[monthNum].Outstanding = utils.Decimal(bonusMonthsDevelop[monthNum].Outstanding + static.OrderBonusWait())
}
}
}
// 整理输出数据
rsp = &protocol.DividendStatisticsV2Response{
Statistics: protocol.DividendStatistics{
Received: bonusAll.Received,
Outstanding: bonusAll.Outstanding,
Receivable: bonusAll.Receivable,
Quarters: bonusQuarters,
Months: bonusMonths,
},
StatisticsCareer: protocol.DividendStatistics{
Received: bonusAllCareer.Received,
Outstanding: bonusAllCareer.Outstanding,
Receivable: bonusAllCareer.Receivable,
Quarters: bonusQuartersCareer,
Months: bonusMonthsCareer,
},
StatisticsBusiness: protocol.DividendStatistics{
Received: bonusAllBusiness.Received,
Outstanding: bonusAllBusiness.Outstanding,
Receivable: bonusAllBusiness.Receivable,
Quarters: bonusQuartersBusiness,
Months: bonusMonthsBusiness,
},
StatisticsDevelop: protocol.DividendStatistics{
Received: bonusAllDevelop.Received,
Outstanding: bonusAllDevelop.Outstanding,
Receivable: bonusAllDevelop.Receivable,
Quarters: bonusQuartersDevelop,
Months: bonusMonthsDevelop,
},
StatisticsApp: protocol.DividendStatistics{
Received: bonusAllApp.Received,
Outstanding: bonusAllApp.Outstanding,
Receivable: bonusAllApp.Receivable,
Quarters: bonusQuartersApp,
Months: bonusMonthsApp,
},
Timestamp: 0,
}
rsp.Timestamp = time.Now().Unix() * 1000
return rsp, nil
}
... ...
package factory
import (
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain/service"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/svr"
)
func CreateSmsCodeService() (service.SmsCodeService, error) {
if constant.SERVICE_RUNMOD == "dev" {
return svr.NewHttplibMmmSmsApiEmpty(), nil
}
return svr.NewHttplibMmmSmsApiServiceGateway(), nil
}
... ...
... ... @@ -62,5 +62,11 @@ func StatisticsV2(header *protocol.RequestHeader, request *protocol.OrderStatist
)
err = transactionContext.CommitTransaction()
// 合并全部的
rsp.All.CumulativeMoney = rsp.Career.CumulativeMoney + rsp.Business.CumulativeMoney + rsp.Develop.CumulativeMoney + rsp.App.CumulativeMoney
rsp.All.CumulativeQuantity = rsp.Career.CumulativeQuantity + rsp.Business.CumulativeQuantity + rsp.Develop.CumulativeQuantity + rsp.App.CumulativeQuantity
rsp.All.Percent = 100
rsp.All.TodayRealMoney = rsp.Career.TodayRealMoney + rsp.Business.TodayRealMoney + rsp.Develop.TodayRealMoney + rsp.App.TodayRealMoney
rsp.All.TodayRealQuantity = rsp.Career.TodayRealQuantity + rsp.Business.TodayRealQuantity + rsp.Develop.TodayRealQuantity + rsp.App.TodayRealQuantity
return
}
... ...
... ... @@ -7,6 +7,8 @@ import (
const SERVICE_NAME = "partner"
var SERVICE_RUNMOD = "dev"
var LOG_LEVEL = "debug"
var LOG_File = "logs/app.log"
var LOG_PREFIX = "[partner_dev]"
... ... @@ -41,4 +43,8 @@ func init() {
if v := os.Getenv("DEFAULT_GUEST_COMPANY"); v != "" {
DEFAULT_GUEST_COMPANY, _ = strconv.Atoi(v)
}
if v := os.Getenv("SERVICE_RUNMOD"); v != "" {
SERVICE_RUNMOD = v
}
}
... ...
... ... @@ -4,9 +4,9 @@ import "os"
var POSTGRESQL_DB_NAME = "partner_test" //partner_test/partner_dev
var POSTGRESQL_USER = "postgres" //postgres
var POSTGRESQL_PASSWORD = "1993618jack" //pgsql@123/1993618jack/eagle1010
var POSTGRESQL_HOST = "127.0.0.1" //127.0.0.1/114.55.200.59
var POSTGRESQL_PORT = "5432" //5432/31543
var POSTGRESQL_PASSWORD = "eagle1010" //pgsql@123/1993618jack/eagle1010
var POSTGRESQL_HOST = "114.55.200.59" //127.0.0.1/114.55.200.59
var POSTGRESQL_PORT = "31543" //5432/31543
var DISABLE_CREATE_TABLE = true
var DISABLE_SQL_GENERATE_PRINT = false
... ...
... ... @@ -25,8 +25,8 @@ func (m *PartnerCategoryInfo) Identify() interface{} {
}
const (
Career = iota + 1
Business
Develop
App
Career int = 1 //事业
Business int = 2 //业务
Develop int = 3 //研发
App int = 4 //业务产品-应用
)
... ...
... ... @@ -2,6 +2,9 @@ package domain_service
import (
"fmt"
"strings"
"time"
"github.com/tiptok/gocomm/xa/eda"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
... ... @@ -14,8 +17,6 @@ import (
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol"
protocolx "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol/auth"
"strings"
"time"
)
type PgLoginService struct {
... ... @@ -182,7 +183,7 @@ func (svr *PgLoginService) PartnerLogin(phone string, password string) (err erro
return
}
//管理层登录
// 管理层登录
func (svr *PgLoginService) ManagerLogin(phone string, password string) (err error) {
if len(svr.Users) == 0 {
//子账号
... ... @@ -198,7 +199,7 @@ func (svr *PgLoginService) ManagerLogin(phone string, password string) (err erro
return
}
//合伙人统计信息
// 合伙人统计信息
func (svr *PgLoginService) PartnerStaticInfo() (interface{}, error) {
response := make(map[string]interface{})
response["id"] = protocolx.AdminTypePartner
... ... @@ -564,7 +565,7 @@ func (svr *PgLoginService) RegistryUser(phone string) error {
// 用户在正常公司存在且无效或者存在非高管或者不存在、合伙人在正常公司存在且无效或者不存在、合伙人在游客公司不存在、注册合伙人到游客公司
if !isGuestPartner && (isUser && !isUserAvailable || isUser && !isUserSenior || !isUser) && (isPartner && !isPartnerAvailable || !isPartner) {
id := time.Now().Unix()
errPartner = svr.transactionContext.PgDd.Insert(&models.PartnerInfo{
m := &models.PartnerInfo{
Id: id,
CompanyId: int64(constant.DEFAULT_GUEST_COMPANY),
PartnerName: phone,
... ... @@ -581,14 +582,16 @@ func (svr *PgLoginService) RegistryUser(phone string) error {
UpdateAt: time.Now(),
PartnerCategoryInfos: []*domain.PartnerCategoryInfo{{Id: 1, Code: phone}},
Salesman: []*domain.Salesman{{Name: phone, Telephone: phone}},
})
}
_, errPartner = svr.transactionContext.PgDd.Model(m).Insert()
}
// 合伙人不存在、用户存在、非高管(普通用户)-> 注册用户
// 合伙人不存在、用户不存在(游客)-> 注册用户
if errPartner != nil && errUser == nil {
id := time.Now().Unix()
errPartner = svr.transactionContext.PgDd.Insert(&models.PartnerInfo{
m := &models.PartnerInfo{
Id: id,
CompanyId: int64(constant.DEFAULT_GUEST_COMPANY),
PartnerName: phone,
... ... @@ -605,7 +608,8 @@ func (svr *PgLoginService) RegistryUser(phone string) error {
UpdateAt: time.Now(),
PartnerCategoryInfos: []*domain.PartnerCategoryInfo{{Id: 1, Code: phone}},
Salesman: []*domain.Salesman{{Name: phone, Telephone: phone}},
})
}
_, errPartner = svr.transactionContext.PgDd.Model(&m).Insert()
}
return errPartner
... ... @@ -688,7 +692,7 @@ func (svr *PgLoginService) RegistryGuest(phone string) error {
// 注册用户
if errUser != nil && errPartner != nil {
id := time.Now().Unix()
errPartner = svr.transactionContext.PgDd.Insert(&models.PartnerInfo{
m := &models.PartnerInfo{
Id: id,
CompanyId: int64(constant.DEFAULT_GUEST_COMPANY),
PartnerName: phone,
... ... @@ -705,7 +709,8 @@ func (svr *PgLoginService) RegistryGuest(phone string) error {
UpdateAt: time.Now(),
PartnerCategoryInfos: []*domain.PartnerCategoryInfo{{Id: 1, Code: phone}},
Salesman: []*domain.Salesman{{Name: phone, Telephone: phone}},
})
}
_, errPartner = svr.transactionContext.PgDd.Model(m).Insert()
}
// 删除用户
... ...
... ... @@ -3,6 +3,7 @@ package pg
import (
"context"
"fmt"
"github.com/go-pg/pg/v10"
"github.com/go-pg/pg/v10/orm"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant"
... ... @@ -38,7 +39,7 @@ func init() {
(*models.PartnerCategoryInfo)(nil),
(*models.Users)(nil),
} {
err := DB.CreateTable(model, &orm.CreateTableOptions{
err := DB.Model(model).CreateTable(&orm.CreateTableOptions{
Temp: false,
IfNotExists: true,
FKConstraints: true,
... ...
... ... @@ -2,6 +2,7 @@ package repository
import (
"fmt"
"github.com/go-pg/pg/v10"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg/models"
... ... @@ -23,12 +24,12 @@ func (repository *BusinessBonusRepository) Save(dm *domain.BusinessBonus) (*doma
return nil, err
}
if dm.Identify() == nil {
if err = tx.Insert(m); err != nil {
if _, err = tx.Model(m).Returning("id").Insert(); err != nil {
return nil, err
}
return dm, nil
}
if err = tx.Update(m); err != nil {
if _, err = tx.Model(m).Where("id=?", m.Id).Update(m); err != nil {
return nil, err
}
return dm, nil
... ...
... ... @@ -22,12 +22,12 @@ func (repository *CompanyRepository) Save(dm *domain.Company) (*domain.Company,
return nil, err
}
if dm.Id == 0 {
if err = tx.Insert(m); err != nil {
if _, err = tx.Model(m).Returning("id").Insert(); err != nil {
return nil, err
}
return dm, nil
}
if err = tx.Update(m); err != nil {
if _, err = tx.Model(m).Where("id=?", m.Id).Update(m); err != nil {
return nil, err
}
return dm, nil
... ...
... ... @@ -21,12 +21,12 @@ func (repository *ImCustomerServiceRepository) Save(dm *domain.ImCustomerService
return nil, err
}
if dm.Identify() == nil {
if err = tx.Insert(m); err != nil {
if _, err = tx.Model(m).Returning("id").Insert(m); err != nil {
return nil, err
}
return dm, nil
}
if err = tx.Update(m); err != nil {
if _, err = tx.Model(m).Where("id=?", m.Id).Update(m); err != nil {
return nil, err
}
return dm, nil
... ...
... ... @@ -21,12 +21,12 @@ func (repository *ImInfoRepository) Save(dm *domain.ImInfo) (*domain.ImInfo, err
return nil, err
}
if dm.Identify() == nil {
if err = tx.Insert(m); err != nil {
if _, err = tx.Model(m).Returning("id").Insert(m); err != nil {
return nil, err
}
return dm, nil
}
if err = tx.Update(m); err != nil {
if _, err = tx.Model(m).Where("id=?", m.Id).Update(m); err != nil {
return nil, err
}
return dm, nil
... ...
... ... @@ -2,6 +2,7 @@ package repository
import (
"encoding/json"
"github.com/go-pg/pg/v10"
"github.com/go-pg/pg/v10/orm"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
... ... @@ -28,12 +29,12 @@ func (repository *OrderBaseRepository) Save(dm *domain.OrderBase) (*domain.Order
// return dm, err
//}
//m.Id = dm.Id
if err = tx.Insert(m); err != nil {
if _, err = tx.Model(m).Returning("id").Insert(m); err != nil {
return nil, err
}
return dm, nil
}
if err = tx.Update(m); err != nil {
if _, err = tx.Model(m).Where("id=?", m.Id).Update(m); err != nil {
return nil, err
}
return dm, nil
... ...
... ... @@ -25,12 +25,12 @@ func (repository *OrderGoodRepository) Save(dm *domain.OrderGood) (*domain.Order
// return dm, err
//}
//m.Id = dm.Id
if err = tx.Insert(m); err != nil {
if _, err = tx.Model(m).Returning("id").Insert(m); err != nil {
return nil, err
}
return dm, nil
}
if err = tx.Update(m); err != nil {
if _, err = tx.Model(m).Where("id=?", m.Id).Update(m); err != nil {
return nil, err
}
return dm, nil
... ...
... ... @@ -2,6 +2,7 @@ package repository
import (
"fmt"
"github.com/go-pg/pg/v10"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg/models"
... ... @@ -23,12 +24,12 @@ func (repository *PartnerCategoryInfoRepository) Save(dm *domain.PartnerCategory
return nil, err
}
if dm.Identify() == nil {
if err = tx.Insert(m); err != nil {
if _, err = tx.Model(m).Returning("id").Insert(m); err != nil {
return nil, err
}
return dm, nil
}
if err = tx.Update(m); err != nil {
if _, err = tx.Model(m).Where("id=?", m.Id).Update(m); err != nil {
return nil, err
}
return dm, nil
... ...
... ... @@ -27,12 +27,12 @@ func (repository *PartnerInfoRepository) Save(dm *domain.PartnerInfo) (*domain.P
// return dm, err
//}
//m.Id = dm.Id
if err = tx.Insert(m); err != nil {
if _, err = tx.Model(m).Returning("id").Insert(m); err != nil {
return nil, err
}
return dm, nil
}
if err = tx.Update(m); err != nil {
if _, err = tx.Model(m).Where("id=?", m.Id).Update(m); err != nil {
return nil, err
}
return dm, nil
... ...
... ... @@ -25,12 +25,12 @@ func (repository *PartnerSubAccountRepository) Save(dm *domain.PartnerSubAccount
return dm, err
}
m.Id = dm.Id
if err = tx.Insert(m); err != nil {
if _, err = tx.Model(m).Returning("id").Insert(m); err != nil {
return nil, err
}
return dm, nil
}
if err = tx.Update(m); err != nil {
if _, err = tx.Model(m).Where("id=?", m.Id).Update(m); err != nil {
return nil, err
}
return dm, nil
... ...
... ... @@ -2,6 +2,7 @@ package repository
import (
"fmt"
"github.com/tiptok/gocomm/common"
. "github.com/tiptok/gocomm/pkg/orm/pgx"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
... ... @@ -23,12 +24,12 @@ func (repository *SysMessageConsumeRepository) Save(dm *domain.SysMessageConsume
return nil, err
}
if dm.Identify() == nil {
if err = tx.Insert(m); err != nil {
if _, err = tx.Model(m).Returning("id").Insert(m); err != nil {
return nil, err
}
return dm, nil
}
if err = tx.Update(m); err != nil {
if _, err = tx.Model(m).Where("id=?", m.Id).Update(m); err != nil {
return nil, err
}
return dm, nil
... ...
... ... @@ -2,6 +2,7 @@ package repository
import (
"fmt"
"github.com/tiptok/gocomm/common"
. "github.com/tiptok/gocomm/pkg/orm/pgx"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
... ... @@ -23,7 +24,7 @@ func (repository *SysMessageProduceRepository) Save(dm *domain.SysMessageProduce
return nil, err
}
if err = tx.Insert(m); err != nil {
if _, err = tx.Model(m).Returning("id").Insert(m); err != nil {
return nil, err
}
return dm, nil
... ...
... ... @@ -2,6 +2,7 @@ package repository
import (
"fmt"
"github.com/go-pg/pg/v10"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg/models"
... ... @@ -23,12 +24,12 @@ func (repository *UsersRepository) Save(dm *domain.Users) (*domain.Users, error)
return nil, err
}
if dm.Identify() == nil {
if err = tx.Insert(m); err != nil {
if _, err = tx.Model(m).Returning("id").Insert(m); err != nil {
return nil, err
}
return dm, nil
}
if err = tx.Update(m); err != nil {
if _, err = tx.Model(m).Where("id=?", m.Id).Update(m); err != nil {
return nil, err
}
return dm, nil
... ...
package svr
import (
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log"
"strings"
"time"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/constant"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/log"
)
type HttplibMmmSmsApiServiceGateway struct {
... ... @@ -49,3 +50,19 @@ func NewHttplibMmmSmsApiServiceGateway() *HttplibMmmSmsApiServiceGateway {
},
}
}
type HttplibMmmSmsApiEmpty struct{}
func NewHttplibMmmSmsApiEmpty() *HttplibMmmSmsApiEmpty {
return &HttplibMmmSmsApiEmpty{}
}
func (serviceGateway *HttplibMmmSmsApiEmpty) SendSms(phone string) (map[string]interface{}, error) {
log.Info("非正式环境调用HttplibMmmSmsApiEmpty.SendSms发送短信")
return map[string]interface{}{}, nil
}
func (serviceGateway *HttplibMmmSmsApiEmpty) CheckSmsCode(phone string, code string) (map[string]interface{}, error) {
log.Info("非正式环境调用HttplibMmmSmsApiEmpty.CheckSmsCode 检查短信验证码")
return map[string]interface{}{}, nil
}
... ...
... ... @@ -9,7 +9,7 @@ type DividendController struct {
BaseController
}
//DividendStatistics
// DividendStatistics
func (this *DividendController) DividendStatistics() {
var msg *protocol.ResponseMessage
defer func() {
... ... @@ -31,7 +31,29 @@ func (this *DividendController) DividendStatistics() {
msg = protocol.NewReturnResponse(dividend.Statistics(header, request))
}
//DividendOrders 分红订单
// DividendStatisticsV2 分红统计
func (this *DividendController) DividendStatisticsV2() {
var msg *protocol.ResponseMessage
defer func() {
this.Resp(msg)
}()
var request *protocol.DividendStatisticsRequest
if err := this.JsonUnmarshal(&request); err != nil {
msg = protocol.BadRequestParam(1)
return
}
if b, m := this.Valid(request); !b {
msg = m
return
}
header := this.GetRequestHeader(this.Ctx)
if request.PartnerId == 0 {
request.PartnerId = header.UserId
}
msg = protocol.NewReturnResponse(dividend.StatisticsV2(header, request))
}
// DividendOrders 分红订单
func (this *DividendController) DividendOrders() {
var msg *protocol.ResponseMessage
defer func() {
... ...
package controllers
import (
"time"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/application/order"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/domain"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol"
"time"
)
type OrderController struct {
BaseController
}
//OrderStatistics 订单统计
// OrderStatistics 订单统计
// @router /statistics [post]
func (this *OrderController) Statistics() {
var msg *protocol.ResponseMessage
... ... @@ -31,7 +32,7 @@ func (this *OrderController) Statistics() {
msg = protocol.NewReturnResponse(order.Statistics(header, request))
}
//OrderStatistics 订单统计
// OrderStatistics 订单统计
// @router /statistics [post]
func (this *OrderController) StatisticsV2() {
var msg *protocol.ResponseMessage
... ... @@ -54,7 +55,7 @@ func (this *OrderController) StatisticsV2() {
msg = protocol.NewReturnResponse(order.StatisticsV2(header, request))
}
//OrderDetail 订单详情
// OrderDetail 订单详情
// @router /orderDetail [post]
func (this *OrderController) OrderDetail() {
var msg *protocol.ResponseMessage
... ... @@ -74,7 +75,7 @@ func (this *OrderController) OrderDetail() {
msg = protocol.NewReturnResponse(order.Detail(header, request))
}
//OrderList
// OrderList
func (this *OrderController) OrderList() {
var msg *protocol.ResponseMessage
defer func() {
... ... @@ -97,7 +98,7 @@ func (this *OrderController) OrderList() {
msg = protocol.NewReturnResponse(order.List(header, request))
}
//OrderList
// OrderList
func (this *OrderController) Intentions() {
var msg *protocol.ResponseMessage
defer func() {
... ...
... ... @@ -47,7 +47,7 @@ func InitV2() {
nsV2.Router("/auth/login", &controllers.AuthController{}, "Post:LoginV2")
nsV2.Router("/user/userInfo", &controllers.UserController{}, "Post:UserInfoV2")
nsV2.Router("/company/partners", &controllers.CompanyController{}, "post:PartnersV2")
nsV2.Router("/dividend/statistics", &controllers.DividendController{}, "Post:DividendStatisticsV2")
nsV2.Router("/order/statistics", &controllers.OrderController{}, "Post:StatisticsV2")
beego.AddNamespace(nsV2)
}
... ...
... ... @@ -31,11 +31,11 @@ type LoginResponse struct {
type LoginRequestV2 struct {
Cid int `json:"cid"`
IdType int `json:"idType"` // 用户类型 1:合伙人 2:高管
Credentials string `json:"credentials"` // 登录类型 1:密码 2:验证码
Credentials string `json:"credentials"` // 凭证
ClientId string `json:"clientId"`
}
//JWT用户信息
// JWT用户信息
type JWTUserInfo struct {
UserId string `json:"id"` //用户id
PassWord string `json:"passWord"` //密码
... ...
... ... @@ -9,22 +9,36 @@ const (
/*DividendStatistics 分红统计*/
type DividendStatisticsRequest struct {
StartTime int64 `json:"startTime"`
EndTime int64 `json:"endTime"`
StartTime int64 `json:"startTime"` // 单位毫秒
EndTime int64 `json:"endTime"` // 单位毫秒
//分红类型(0累计分红、1分红支出)
//DividendAction int `json:"dividendAction"`
PartnerId int64 `json:"partnerId"`
}
type DividendStatisticsResponse struct {
Statistics DividendStatistics `json:"statistics"`
Statistics DividendStatistics `json:"statistics"` //全部
Timestamp int64 `json:"timestamp"`
}
// Career int = 1 //事业
// Business int = 2 //业务
// Develop int = 3 //研发
// App int = 4 //业务产品-应用
type DividendStatisticsV2Response struct {
Statistics DividendStatistics `json:"statistics"` // 全部
StatisticsCareer DividendStatistics `json:"statisticsCareer"` // 事业分类
StatisticsBusiness DividendStatistics `json:"statisticsBusiness"` // 业务分类
StatisticsDevelop DividendStatistics `json:"statisticsDevelop"` // 研发a分类
StatisticsApp DividendStatistics `json:"statisticsApp"` // 业务产品-应用
Timestamp int64 `json:"timestamp"`
}
type DividendStatistics struct {
Received float64 `json:"received"` //总已收分红
Outstanding float64 `json:"outstanding"` //总未收分红/分红支出
Receivable float64 `json:"receivable"` //总应收分红
Quarters []Bonus `json:"quarters"`
Received float64 `json:"received"` //总已收分红
Outstanding float64 `json:"outstanding"` //总未收分红/分红支出
Receivable float64 `json:"receivable"` //总应收分红
Quarters [4]Bonus `json:"quarters"` //4个季度分红
Months [12]Bonus `json:"months"` //12个月度分红
}
type Bonus struct {
... ...
... ... @@ -50,6 +50,7 @@ type OrderStatisticsRequest struct {
}
type OrderStatisticsResponse struct {
Statistics *OrderStatics `json:"statistics,omitempty"`
All OrderStatic `json:"all"` //全部
Career OrderStatic `json:"career,omitempty"` //事业
Business OrderStatic `json:"business,omitempty"` //业务
Develop OrderStatic `json:"develop,omitempty"` //开发
... ... @@ -72,7 +73,7 @@ type OrderStatics struct {
}
type OrderStatic struct {
Percent float64 `json:"percent"` // 事业占比
Percent float64 `json:"percent"` //事业占比
TodayRealQuantity int `json:"todayRealQuantity"` //今日新增实发订单
TodayRealMoney float64 `json:"todayRealMoney"` //今日新增实发订单金额
CumulativeQuantity int `json:"cumulativeQuantity"` //累计实发订单
... ...
此 diff 太大无法显示。