Merge branch 'dev-lzh-0905' into dev
This commit is contained in:
commit
d81c6b7aad
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-triple v1.0.5
|
||||
// - protoc v6.32.0
|
||||
// - protoc-gen-go-triple v1.0.8
|
||||
// - protoc v3.12.4
|
||||
// source: pb/bundle.proto
|
||||
|
||||
package bundle
|
||||
|
1
go.mod
1
go.mod
@ -112,6 +112,7 @@ require (
|
||||
github.com/mholt/archiver v3.1.1+incompatible
|
||||
github.com/natefinch/lumberjack v2.0.0+incompatible
|
||||
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd
|
||||
github.com/samber/lo v1.52.0
|
||||
github.com/signintech/gopdf v0.29.2
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
|
||||
github.com/spf13/viper v1.7.1
|
||||
|
2
go.sum
2
go.sum
@ -779,6 +779,8 @@ github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0
|
||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
|
||||
github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw=
|
||||
github.com/samber/lo v1.52.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
|
||||
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
|
||||
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM=
|
||||
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||
|
@ -3,5 +3,30 @@ package bundle
|
||||
type UserWorkConfirmReq struct {
|
||||
WorkUuid string `json:"workUuid"`
|
||||
ConfirmRemark string `json:"confirmRemark"`
|
||||
ConfirmStatus int `json:"confirmStatus"` // 1确认 2 驳回
|
||||
ConfirmStatus int `json:"confirmStatus"` // 1确认 2 驳回
|
||||
}
|
||||
|
||||
type GetBundleBalanceListResp struct {
|
||||
|
||||
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
|
||||
Data []*BundleBalanceItem `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"`
|
||||
}
|
||||
|
||||
type BundleBalanceItem struct {
|
||||
UserId int32 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"`
|
||||
UserName string `protobuf:"bytes,2,opt,name=userName,proto3" json:"userName,omitempty"`
|
||||
UserPhoneNumber string `protobuf:"bytes,3,opt,name=userPhoneNumber,proto3" json:"userPhoneNumber,omitempty"`
|
||||
Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"`
|
||||
BundleName string `protobuf:"bytes,5,opt,name=bundleName,proto3" json:"bundleName,omitempty"`
|
||||
ExpiredTime int64 `protobuf:"varint,6,opt,name=expiredTime,proto3" json:"expiredTime,omitempty"`
|
||||
AccountNumber int32 `protobuf:"varint,7,opt,name=accountNumber,proto3" json:"accountNumber,omitempty"`
|
||||
AccountConsumptionNumber int32 `protobuf:"varint,8,opt,name=accountConsumptionNumber,proto3" json:"accountConsumptionNumber,omitempty"`
|
||||
VideoNumber int32 `protobuf:"varint,9,opt,name=videoNumber,proto3" json:"videoNumber,omitempty"`
|
||||
VideoConsumptionNumber int32 `protobuf:"varint,10,opt,name=videoConsumptionNumber,proto3" json:"videoConsumptionNumber,omitempty"`
|
||||
ImageNumber int32 `protobuf:"varint,11,opt,name=imageNumber,proto3" json:"imageNumber,omitempty"`
|
||||
ImageConsumptionNumber int32 `protobuf:"varint,12,opt,name=imageConsumptionNumber,proto3" json:"imageConsumptionNumber,omitempty"`
|
||||
DataAnalysisNumber int32 `protobuf:"varint,13,opt,name=dataAnalysisNumber,proto3" json:"dataAnalysisNumber,omitempty"`
|
||||
DataAnalysisConsumptionNumber int32 `protobuf:"varint,14,opt,name=dataAnalysisConsumptionNumber,proto3" json:"dataAnalysisConsumptionNumber,omitempty"`
|
||||
ExpansionPacksNumber int32 `protobuf:"varint,15,opt,name=expansionPacksNumber,proto3" json:"expansionPacksNumber,omitempty"`
|
||||
Bought int32 `protobuf:"varint,16,opt,name=bought,proto3" json:"bought,omitempty"`
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ func BundleRouter(r *gin.RouterGroup) {
|
||||
bundleBalance := bundleClientRoute.Group("balance")
|
||||
{
|
||||
bundleBalance.POST("list", bundle.GetBundleBalance)
|
||||
bundleBalance.POST("account/list", bundle.GetAccountBundleBalance)
|
||||
bundleBalance.POST("used-record", bundle.GetUsedRecordList)
|
||||
bundleBalance.POST("activate", bundle.BundleActivate)
|
||||
bundleBalance.POST("export", bundle.BundleExport)
|
||||
|
@ -19,6 +19,7 @@ import (
|
||||
"fonchain-fiee/pkg/model/login"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/samber/lo"
|
||||
"github.com/xuri/excelize/v2"
|
||||
)
|
||||
|
||||
@ -444,3 +445,40 @@ func writeToExcel(filename string, items []*bundle.BundleBalanceExportItem) erro
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetAccountBundleBalance(c *gin.Context) {
|
||||
var req bundle.GetBundleBalanceListReq
|
||||
req.Month = time.Now().Format("2006-01")
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
res, err := service.BundleProvider.GetBundleBalanceList(context.Background(), &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
result := bundleModel.GetBundleBalanceListResp{
|
||||
Total: res.Total,
|
||||
}
|
||||
result.Data = lo.Map(res.Data, func(item *bundle.BundleBalanceItem, index int) *bundleModel.BundleBalanceItem {
|
||||
return &bundleModel.BundleBalanceItem{
|
||||
UserId: item.UserId,
|
||||
UserName: item.UserName,
|
||||
UserPhoneNumber: item.UserPhoneNumber,
|
||||
Status: item.Status,
|
||||
BundleName: item.BundleName,
|
||||
ExpiredTime: item.ExpiredTime,
|
||||
AccountNumber: item.BundleAccountNumber + item.IncreaseAccountNumber + item.ManualAccountNumber,
|
||||
AccountConsumptionNumber: item.BundleAccountConsumptionNumber + item.IncreaseAccountConsumptionNumber + item.ManualAccountConsumptionNumber,
|
||||
VideoNumber: item.BundleVideoNumber + item.IncreaseVideoNumber + item.ManualVideoNumber,
|
||||
VideoConsumptionNumber: item.BundleVideoConsumptionNumber + item.IncreaseVideoConsumptionNumber + item.ManualVideoConsumptionNumber,
|
||||
ImageNumber: item.BundleImageNumber + item.IncreaseImageNumber + item.ManualImageNumber,
|
||||
ImageConsumptionNumber: item.BundleImageConsumptionNumber + item.IncreaseImageConsumptionNumber + item.ManualImageNumber,
|
||||
DataAnalysisNumber: item.BundleDataAnalysisNumber + item.IncreaseDataAnalysisNumber + item.ManualDataAnalysisNumber,
|
||||
DataAnalysisConsumptionNumber: item.BundleDataAnalysisConsumptionNumber + item.IncreaseDataAnalysisConsumptionNumber + item.ManualDataAnalysisNumber,
|
||||
Bought: item.Bought,
|
||||
}
|
||||
})
|
||||
service.Success(c, result)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user