更新去重索引
This commit is contained in:
parent
0876153953
commit
c8696a969f
@ -1,32 +1,32 @@
|
|||||||
package dao
|
package dao
|
||||||
|
|
||||||
// import (
|
import (
|
||||||
// "github.com/fonchain/fonchain-artistinfo/cmd/model"
|
"github.com/fonchain/fonchain-artistinfo/cmd/model"
|
||||||
// "github.com/fonchain/fonchain-artistinfo/pb/artistinfoStatement"
|
"github.com/fonchain/fonchain-artistinfo/pb/artistinfoStatement"
|
||||||
// db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
|
||||||
// "gorm.io/gorm/clause"
|
"gorm.io/gorm/clause"
|
||||||
// )
|
)
|
||||||
|
|
||||||
|
// =====================================
|
||||||
//
|
//
|
||||||
// // =====================================
|
// 对账单批次
|
||||||
// //
|
func CreateStatementBatch(in *artistinfoStatement.StatementBatchRequest) (res model.StatementBatch, err error) {
|
||||||
// // 对账单批次
|
res = model.StatementBatch{
|
||||||
// func CreateStatementBatch(in *artistinfoStatement.StatementBatchRequest) (res model.StatementBatch, err error) {
|
StType: in.StType,
|
||||||
// res = model.StatementBatch{
|
ArtistUid: in.ArtistUid,
|
||||||
// StType: in.StType,
|
ArtistRealName: in.ArtistRealName,
|
||||||
// ArtistUid: in.ArtistUid,
|
FlowStatus: in.FlowStatus,
|
||||||
// ArtistRealName: in.ArtistRealName,
|
BatchTime: in.BatchTime,
|
||||||
// FlowStatus: in.FlowStatus,
|
MinPrice: in.MinPrice,
|
||||||
// BatchTime: in.BatchTime,
|
GuaranteePrice: in.GuaranteePrice,
|
||||||
// MinPrice: in.MinPrice,
|
FileUrl: in.FileUrl,
|
||||||
// GuaranteePrice: in.GuaranteePrice,
|
}
|
||||||
// FileUrl: in.FileUrl,
|
err = db.DB.Clauses(clause.OnConflict{
|
||||||
// }
|
Columns: []clause.Column{{Name: "st_type"}, {Name: "artist_uid"}, {Name: "batch_time"}},
|
||||||
// err = db.DB.Clauses(clause.OnConflict{
|
UpdateAll: true,
|
||||||
// Columns: []clause.Column{{Name: "st_type"}, {Name: "artist_uid"}, {Name: "batch_time"}},
|
}).Create(&res).Error
|
||||||
// UpdateAll: true,
|
return
|
||||||
// }).Create(&res).Error
|
}
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
// func BatchCreateStatementBatch(in *artistinfoStatement.BatchCreateStatementBatchRequest) error {
|
// func BatchCreateStatementBatch(in *artistinfoStatement.BatchCreateStatementBatchRequest) error {
|
||||||
// var datas = []model.StatementBatch{}
|
// var datas = []model.StatementBatch{}
|
||||||
|
@ -5,13 +5,13 @@ type StatementBatch struct {
|
|||||||
Model
|
Model
|
||||||
// StType int32 `gorm:"column:st_type;unqiueIndex:sttype_uid_batchtime_idx;comment:对账单类型 1=版权 2=物权;"`
|
// StType int32 `gorm:"column:st_type;unqiueIndex:sttype_uid_batchtime_idx;comment:对账单类型 1=版权 2=物权;"`
|
||||||
ArtistUid string `gorm:"column:artist_uid;unqiueIndex:sttype_uid_batchtime_idx;comment:画家uid"`
|
ArtistUid string `gorm:"column:artist_uid;unqiueIndex:sttype_uid_batchtime_idx;comment:画家uid"`
|
||||||
// ArtistRealName string `gorm:"column:artist_real_name;comment:画家真实姓名;"`
|
ArtistName string `gorm:"column:artist_name;comment:画家姓名;"`
|
||||||
BatchTime string `gorm:"column:batch_time;unqiueIndex:sttype_uid_batchtime_idx;comment:批次时间;"`
|
BatchTime string `gorm:"column:batch_time;unqiueIndex:sttype_uid_batchtime_idx;comment:批次时间;"`
|
||||||
FlowStatus int32 `gorm:"column:flow_status;default:1;comment:流程状态 1=未生成 2=已生成未签署 3=已签署"`
|
FlowStatus int32 `gorm:"column:flow_status;default:1;comment:流程状态 1=未生成 2=已生成未签署 3=已签署"`
|
||||||
FileUrl string `gorm:"column:file_url,comment:对账单文件地址;"`
|
// FileUrl string `gorm:"column:file_url,comment:对账单文件地址;"`
|
||||||
|
|
||||||
EntrustList []ArtworkEntrustDetail `gorm:"foreignKey:BatchId"`
|
EntrustList []ArtworkEntrustDetail `gorm:"foreignKey:BatchId"` //当前批次的委托单详情
|
||||||
SalesList []ArtworkSalesDetail `gorm:"foreignKey:BatchId"`
|
SalesList []ArtworkSalesDetail `gorm:"foreignKey:BatchId"` //当前批次的销售单详情
|
||||||
}
|
}
|
||||||
|
|
||||||
func (StatementBatch) TableName() string {
|
func (StatementBatch) TableName() string {
|
||||||
|
@ -3,9 +3,9 @@ package model
|
|||||||
// User 用户模型
|
// User 用户模型
|
||||||
type User struct {
|
type User struct {
|
||||||
Model
|
Model
|
||||||
MgmtAccId int64 `gorm:"column:mgmt_acc_id;not null;uniqueIndex:mgmt_acc_mgmt_artist_idx;comment:账号id"`
|
MgmtAccId int64 `gorm:"column:mgmt_acc_id;not null;uniqueIndex:mgmt_acc_mgmt_artist_uid;comment:账号id"`
|
||||||
MgmtArtistId int64 `gorm:"column:mgmt_artist_id;not null;uniqueIndex:mgmt_acc_mgmt_artist_idx;comment:艺术家id"`
|
MgmtArtistId int64 `gorm:"column:mgmt_artist_id;not null;comment:艺术家id"`
|
||||||
MgmtArtistUid string `gorm:"column:mgmt_artist_uid;type:varchar(256);comment:艺术家uid"`
|
MgmtArtistUid string `gorm:"column:mgmt_artist_uid;type:varchar(256);uniqueIndex:mgmt_acc_mgmt_artist_uid;comment:艺术家uid"`
|
||||||
TelNum string `gorm:"column:tel_num;type:varchar(20);not null;电话号码"`
|
TelNum string `gorm:"column:tel_num;type:varchar(20);not null;电话号码"`
|
||||||
InviteCode string `gorm:"column:invited_code;type:varchar(16);default:'';comment:个人邀请码"`
|
InviteCode string `gorm:"column:invited_code;type:varchar(16);default:'';comment:个人邀请码"`
|
||||||
InvitedBy *Invite `gorm:"foreignKey:InvitedId"` //邀请者的相关信息
|
InvitedBy *Invite `gorm:"foreignKey:InvitedId"` //邀请者的相关信息
|
||||||
|
@ -8,7 +8,7 @@ import "google/protobuf/empty.proto"; //使用 google.protobuf.Empty
|
|||||||
|
|
||||||
// protoc -I . -I ./pb --proto_path=. --go_out=./pb/artistinfoStatement --go-triple_out=./pb/artistinfoStatement --validate_out="lang=go:./pb/artistinfoStatement" ./pb/artistinfoStatement.proto
|
// protoc -I . -I ./pb --proto_path=. --go_out=./pb/artistinfoStatement --go-triple_out=./pb/artistinfoStatement --validate_out="lang=go:./pb/artistinfoStatement" ./pb/artistinfoStatement.proto
|
||||||
service Statement {
|
service Statement {
|
||||||
rpc CreateStatementBatch(StatementBatchRequest)returns(CreateStatementBatchResponse){}; //创建对账单批次
|
rpc CreateOrUpdateStatementBatch(StatementBatchRequest)returns(CreateStatementBatchResponse){}; //创建或更新对账单,包括更新委托明细和销售明细
|
||||||
rpc BatchCreateStatementBatch(BatchCreateStatementBatchRequest)returns(google.protobuf.Empty){}; //批量创建对账单批次
|
rpc BatchCreateStatementBatch(BatchCreateStatementBatchRequest)returns(google.protobuf.Empty){}; //批量创建对账单批次
|
||||||
rpc GetStatementBatchList(GetStatementBatchListRequest)returns(GetStatementBatchListResponse){}; //批量查询对账单批次
|
rpc GetStatementBatchList(GetStatementBatchListRequest)returns(GetStatementBatchListResponse){}; //批量查询对账单批次
|
||||||
rpc GetStatementBatchTimeMenus(GetStatementBatchListRequest)returns(GetStatementBatchTimeMenusResponse){}; //获取对账单批次时间菜单列表
|
rpc GetStatementBatchTimeMenus(GetStatementBatchListRequest)returns(GetStatementBatchTimeMenusResponse){}; //获取对账单批次时间菜单列表
|
||||||
@ -24,19 +24,47 @@ message StatementPageInfo{
|
|||||||
int64 total=3;
|
int64 total=3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message StatementBatchRequest{
|
enum StatementCreateType{
|
||||||
int32 stType=1; // 字段注释请查看对账单结构体模型 cmd/model/artworkStatement.go
|
saveEntrust=0;
|
||||||
|
saveSalse=1;
|
||||||
|
}
|
||||||
|
message StatementBatchRequest{ // 字段注释请查看对账单结构体模型 cmd/model/artworkStatement.go
|
||||||
|
string artistUid=1;
|
||||||
|
string artistName=2;
|
||||||
|
string aatchTime=3;
|
||||||
|
int32 flowStatus=4;
|
||||||
|
StatementCreateType updateType=5;
|
||||||
|
repeated EntrustRequest entrustList=6;
|
||||||
|
repeated SalesRequest salesList=7;
|
||||||
|
}
|
||||||
|
message EntrustRequest{
|
||||||
|
string tfNum =1;
|
||||||
|
string artworkName =2;
|
||||||
|
string ruler =3;
|
||||||
|
string saleNo =4;
|
||||||
|
string completeDate =5;
|
||||||
|
float minPrice =6;
|
||||||
|
float guaranteePrice =7;
|
||||||
|
}
|
||||||
|
message SalesRequest {
|
||||||
|
string tfNum =1;
|
||||||
|
string artworkName =2;
|
||||||
|
string ruler =3;
|
||||||
|
string saleNo =4;
|
||||||
|
string completeDate =5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message StatementBatchInfo{ // 字段注释请查看对账单结构体模型 cmd/model/artworkStatement.go
|
||||||
|
// int32 stType=1;
|
||||||
string artistUid=2;
|
string artistUid=2;
|
||||||
string artistRealName=3;
|
string artistName=3;
|
||||||
int32 flowStatus=4;
|
int32 flowStatus=4;
|
||||||
string batchTime=5;
|
string batchTime=5;
|
||||||
float minPrice=6;
|
|
||||||
float guaranteePrice=7;
|
float guaranteePrice=7;
|
||||||
int64 id = 8;
|
int64 id = 8;
|
||||||
string createdAt =9;
|
string createdAt =9;
|
||||||
string updatedAt =10;
|
string updatedAt =10;
|
||||||
int64 deletedAt =11;
|
int64 deletedAt =11;
|
||||||
string fileUrl =12;
|
|
||||||
}
|
}
|
||||||
message CreateStatementBatchResponse{
|
message CreateStatementBatchResponse{
|
||||||
int64 id =1;
|
int64 id =1;
|
||||||
|
Loading…
Reference in New Issue
Block a user