jiaojiao7 преди 4 години
родител
ревизия
a99a6f653e

+ 3 - 2
api/integral.api

@@ -44,8 +44,9 @@ type previewRes {
 type recordReq {
 	AccountId string `form:"accountId,optional"` //企业标识
 	UserId    string `form:"userId,optional"`    //用户标识
-	Page      int    `form:"page,optional"`
-	PageSize  int    `form:"pageSize,optional"`
+	Page      int64  `form:"page,optional"`
+	PageSize  int64  `form:"pageSize,optional"`
+	State     int64  `form:"state,optional"` //0查消耗记录 1 查充值记录
 }
 
 type recordRes {

+ 25 - 5
api/internal/logic/findauthlogic.go

@@ -1,6 +1,7 @@
 package logic
 
 import (
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/resourcesCenterclient"
 	"context"
 	"log"
 
@@ -24,12 +25,31 @@ func NewFindAuthLogic(ctx context.Context, svcCtx *svc.ServiceContext) FindAuthL
 	}
 }
 
-func (l *FindAuthLogic) FindAuth(req types.AuthReq) (*types.RecordRes, error) {
+func (l *FindAuthLogic) FindAuth(req types.AuthReq) (*types.AuthRes, error) {
 	// todo: add your logic here and delete this line
 	result := &types.AuthRes{}
 	log.Println(req)
-	result.Code = 0
-	result.Message = "请求成功"
-
-	return &types.RecordRes{}, nil
+	lsi := l.svcCtx.ResourcesCenter
+	resp, err := lsi.FindResourcesAuth(l.ctx, &resourcesCenterclient.ResourcesReq{
+		AccountId: req.AccountId,
+	})
+	if err != nil {
+		return nil, err
+	}
+	data := make([]map[string]interface{}, 0)
+	if len(resp.Data) > 0 {
+		for _, v := range resp.Data {
+			data = append(data, map[string]interface{}{
+				"id":v.Id,
+				"name":v.Name,
+				"resourceType":v.ResourceType,
+				"spec":v.Spec,
+				"number":v.Number,
+			})
+		}
+	}
+	result.Code = resp.Code
+	result.Message = resp.Message
+	result.Data = data
+	return result, nil
 }

+ 22 - 19
api/internal/logic/findbalancelogic.go

@@ -1,6 +1,7 @@
 package logic
 
 import (
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/resourcesCenterclient"
 	"context"
 	"log"
 
@@ -28,26 +29,28 @@ func (l *FindBalanceLogic) FindBalance(req types.BalanceReq) (*types.BalanceRes,
 	// todo: add your logic here and delete this line
 	log.Println(req)
 	result := &types.BalanceRes{}
-	result.Code = 1
-	result.Message = "请求成功"
-	data := []map[string]interface{}{
-		{
-			"id":     1,
-			"name":   "高级字段包",
-			"number": 30000,
-			"thirtyNum": 100,
-			"resourceType":"001",
-		},
-		{
-			"id":     1,
-			"name":   "标准字段包",
-			"number": 30000,
-			"thirtyNum": 300,
-			"resourceType":"002",
-		},
+	lsi := l.svcCtx.ResourcesCenter
+	resp, err := lsi.FindAccountBalance(l.ctx, &resourcesCenterclient.ResourcesReq{
+		AccountId: req.AccountId,
+	})
+	log.Println(resp)
+	if err != nil {
+		return nil, err
 	}
-
+	data := make([]map[string]interface{}, 0)
+	if len(resp.Data) > 0 {
+		for _, v := range resp.Data {
+			data = append(data, map[string]interface{}{
+				"id":           v.Id,
+				"name":         v.Name,
+				"number":       v.Number,
+				"resourceType": v.ResourceType,
+				"thirtyNum":    v.ThirtyNum,
+			})
+		}
+	}
+	result.Code = resp.Code
+	result.Message = resp.Message
 	result.Data = data
-
 	return result, nil
 }

+ 33 - 16
api/internal/logic/findrecordlogic.go

@@ -1,6 +1,7 @@
 package logic
 
 import (
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/resourcesCenterclient"
 	"context"
 	"log"
 
@@ -28,23 +29,39 @@ func (l *FindRecordLogic) FindRecord(req types.RecordReq) (*types.RecordRes, err
 	// todo: add your logic here and delete this line
 	result := &types.RecordRes{}
 	log.Println(req)
-	result.Code = 0
-	result.Message = "成功"
-	result.Count = 20
-	data := []map[string]interface{}{
-		{
-			"userId":"用户名",
-			"resourceType":"资源类型",
-			"ruleId":"导出规则",
-			"exportNum":122,
-			"exportTime": "2021-08-09 16:17:10",
-			"deductionNumb":100,
-			"url":"/export/excel.xls",
-			"searchCriteria":"搜索条件",
-			"source":"数据来源",
-			"name":"资源名称",
-		},
+	lsi := l.svcCtx.ResourcesCenter
+	resp, err := lsi.FindConsumeRecord(l.ctx, &resourcesCenterclient.RecordReq{
+		AccountId: req.AccountId,
+		UserId:    req.UserId,
+		PageSize:  req.PageSize,
+		Page:      req.Page,
+		State:     req.State,
+	})
+	if err != nil {
+		return nil, err
 	}
+	data := make([]map[string]interface{}, 0)
+	if len(resp.Data) > 0 {
+		for _, val := range resp.Data {
+			data = append(data, map[string]interface{}{
+				"id":             val.Id,
+				"deductionNumb":  val.DeductionNumb,
+				"exportNum":      val.ExportNum,
+				"exportTime":     val.ExportTime,
+				"name":           val.Name,
+				"resourceType":   val.ResourceType,
+				"ruleId":         val.RuleId,
+				"searchCriteria": val.SearchCriteria,
+				"source":         val.Source,
+				"url":            val.Url,
+				"userId":         val.UserId,
+				"remarks":        val.Remarks,
+			})
+		}
+	}
+	result.Code = resp.Code
+	result.Message = resp.Message
 	result.Data = data
+	result.Count = resp.Count
 	return result, nil
 }

+ 3 - 2
api/internal/types/types.go

@@ -43,8 +43,9 @@ type PreviewRes struct {
 type RecordReq struct {
 	AccountId string `form:"accountId,optional"` //企业标识
 	UserId    string `form:"userId,optional"`    //用户标识
-	Page      int    `form:"page,optional"`
-	PageSize  int    `form:"pageSize,optional"`
+	Page      int64  `form:"page,optional"`
+	PageSize  int64  `form:"pageSize,optional"`
+	State     int64  `form:"state,optional"`
 }
 
 type RecordRes struct {

+ 1 - 0
entity/resources.go

@@ -31,4 +31,5 @@ type ConsumeRecord struct {
 	Url            string `xorm:"url" form:"url" json:"url"`
 	SearchCriteria string `xorm:"searchCriteria" form:"searchCriteria" json:"searchCriteria"`
 	Source         string `xorm:"source" form:"source" json:"source"`
+	Remarks        string `xorm:"remarks" form:"remarks" json:"remarks"`
 }

+ 2 - 1
rpc/internal/logic/findpreviewlogic.go

@@ -1,6 +1,7 @@
 package logic
 
 import (
+	"app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/config"
 	"context"
 
 	"app.yhyue.com/moapp/jyResourcesCenter/rpc/internal/svc"
@@ -26,7 +27,7 @@ func NewFindPreviewLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FindP
 // 预览信息
 func (l *FindPreviewLogic) FindPreview(in *resourcesCenter.PreviewReq) (*resourcesCenter.PreviewRes, error) {
 	// todo: add your logic here and delete this line
-	code, message, repeatNumb, deductionNumb := balanceService.FindPreview(in)
+	code, message, repeatNumb, deductionNumb := balanceService.FindPreview(in,config.ConfigJson.DedupUrl)
 	return &resourcesCenter.PreviewRes{
 		Code:          code,
 		Message:       message,

+ 2 - 0
rpc/resourcesCenter.proto

@@ -86,6 +86,7 @@ message ConsumeRecord {
     string url = 10; //下载地址
     string searchCriteria = 11; //导出搜索条件
     string source = 12; //数据来源
+    string remarks = 13;//备注字段
 }
 
 
@@ -125,6 +126,7 @@ message RecordReq {
     string userId = 2;
     int64 pageSize = 3;
     int64 page = 4;
+    int64 state = 5; //0 查消费,1查充值
 }
 
 message ConsumeRecordRes {

+ 100 - 81
rpc/resourcesCenter/resourcesCenter.pb.go

@@ -721,6 +721,7 @@ type ConsumeRecord struct {
 	Url            string `protobuf:"bytes,10,opt,name=url,proto3" json:"url,omitempty"`                       //下载地址
 	SearchCriteria string `protobuf:"bytes,11,opt,name=searchCriteria,proto3" json:"searchCriteria,omitempty"` //导出搜索条件
 	Source         string `protobuf:"bytes,12,opt,name=source,proto3" json:"source,omitempty"`                 //数据来源
+	Remarks        string `protobuf:"bytes,13,opt,name=remarks,proto3" json:"remarks,omitempty"`               //备注字段
 }
 
 func (x *ConsumeRecord) Reset() {
@@ -839,6 +840,13 @@ func (x *ConsumeRecord) GetSource() string {
 	return ""
 }
 
+func (x *ConsumeRecord) GetRemarks() string {
+	if x != nil {
+		return x.Remarks
+	}
+	return ""
+}
+
 type ResourcesReq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -1166,6 +1174,7 @@ type RecordReq struct {
 	UserId    string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"`
 	PageSize  int64  `protobuf:"varint,3,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
 	Page      int64  `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"`
+	State     int64  `protobuf:"varint,5,opt,name=state,proto3" json:"state,omitempty"` //0 查消费,1查充值
 }
 
 func (x *RecordReq) Reset() {
@@ -1228,6 +1237,13 @@ func (x *RecordReq) GetPage() int64 {
 	return 0
 }
 
+func (x *RecordReq) GetState() int64 {
+	if x != nil {
+		return x.State
+	}
+	return 0
+}
+
 type ConsumeRecordRes struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -1402,7 +1418,7 @@ var file_resourcesCenter_proto_rawDesc = []byte{
 	0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x06, 0x20,
 	0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x69,
 	0x72, 0x74, 0x79, 0x4e, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x68,
-	0x69, 0x72, 0x74, 0x79, 0x4e, 0x75, 0x6d, 0x22, 0xd9, 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x73,
+	0x69, 0x72, 0x74, 0x79, 0x4e, 0x75, 0x6d, 0x22, 0xf3, 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x73,
 	0x75, 0x6d, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
 	0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65,
 	0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
@@ -1424,89 +1440,92 @@ var file_resourcesCenter_proto_rawDesc = []byte{
 	0x74, 0x65, 0x72, 0x69, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x65, 0x61,
 	0x72, 0x63, 0x68, 0x43, 0x72, 0x69, 0x74, 0x65, 0x72, 0x69, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x73,
 	0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75,
-	0x72, 0x63, 0x65, 0x22, 0x2c, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
-	0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64,
-	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49,
-	0x64, 0x22, 0x66, 0x0a, 0x0a, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x12,
-	0x16, 0x0a, 0x06, 0x69, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x06, 0x69, 0x6e, 0x66, 0x6f, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75,
-	0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f,
-	0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
-	0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73,
-	0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x0a, 0x50, 0x72,
-	0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65,
+	0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x0d,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x22, 0x2c, 0x0a,
+	0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a,
+	0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x66, 0x0a, 0x0a, 0x50,
+	0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6e, 0x66,
+	0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x6e, 0x66, 0x6f, 0x49,
+	0x64, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12,
+	0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18,
+	0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54,
+	0x79, 0x70, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x0a, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52,
+	0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
+	0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+	0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x18, 0x03,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x4e, 0x75, 0x6d, 0x62,
+	0x12, 0x24, 0x0a, 0x0d, 0x64, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d,
+	0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x64, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69,
+	0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e,
+	0x4e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x6d, 0x61, 0x69,
+	0x6e, 0x4e, 0x75, 0x6d, 0x22, 0x74, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+	0x73, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65,
 	0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07,
 	0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d,
-	0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74,
-	0x4e, 0x75, 0x6d, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x65,
-	0x61, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x65, 0x64, 0x75, 0x63, 0x74,
-	0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x64,
-	0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x12, 0x1c, 0x0a, 0x09,
-	0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x4e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x09, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x4e, 0x75, 0x6d, 0x22, 0x74, 0x0a, 0x10, 0x52, 0x65,
-	0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x12, 0x12,
-	0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f,
-	0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x32, 0x0a, 0x04,
-	0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x65, 0x73,
-	0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73,
-	0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x41, 0x75, 0x74, 0x68, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61,
-	0x22, 0x77, 0x0a, 0x11, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e,
-	0x63, 0x65, 0x52, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73,
-	0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73,
-	0x61, 0x67, 0x65, 0x12, 0x34, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28,
-	0x0b, 0x32, 0x20, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e,
-	0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x61, 0x6c, 0x61,
-	0x6e, 0x63, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x71, 0x0a, 0x09, 0x52, 0x65, 0x63,
-	0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
-	0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75,
-	0x6e, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08,
-	0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08,
-	0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65,
-	0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0x8a, 0x01, 0x0a,
-	0x10, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65,
-	0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
-	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12,
-	0x32, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e,
-	0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e,
-	0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x04, 0x64,
-	0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01,
-	0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xf7, 0x03, 0x0a, 0x0f, 0x52, 0x65,
-	0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x56, 0x0a,
-	0x11, 0x66, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x41, 0x75,
-	0x74, 0x68, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65,
-	0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65,
-	0x71, 0x1a, 0x22, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e,
-	0x74, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e,
-	0x63, 0x65, 0x52, 0x65, 0x73, 0x12, 0x57, 0x0a, 0x12, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x63, 0x63,
-	0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x2e, 0x72, 0x65,
+	0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03,
+	0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
+	0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
+	0x41, 0x75, 0x74, 0x68, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x77, 0x0a, 0x11, 0x41, 0x63,
+	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x12,
+	0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63,
+	0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x34, 0x0a,
+	0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x72, 0x65,
 	0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65,
-	0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x72, 0x65, 0x73,
-	0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x63,
-	0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x12, 0x52,
-	0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x63,
-	0x6f, 0x72, 0x64, 0x12, 0x1a, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43,
-	0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a,
-	0x21, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65,
-	0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52,
-	0x65, 0x73, 0x12, 0x4c, 0x0a, 0x13, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x55, 0x73,
-	0x65, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x2e, 0x72, 0x65, 0x73, 0x6f,
-	0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f,
-	0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
-	0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
-	0x12, 0x48, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69,
-	0x6c, 0x65, 0x64, 0x12, 0x1a, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43,
-	0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a,
-	0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65,
-	0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0b, 0x66, 0x69,
-	0x6e, 0x64, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x73, 0x6f,
-	0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x65, 0x76,
-	0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
-	0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77,
-	0x52, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x04, 0x64,
+	0x61, 0x74, 0x61, 0x22, 0x87, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65,
+	0x71, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12,
+	0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53,
+	0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53,
+	0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65,
+	0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x8a, 0x01,
+	0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52,
+	0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
+	0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
+	0x12, 0x32, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e,
+	0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72,
+	0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x04,
+	0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xf7, 0x03, 0x0a, 0x0f, 0x52,
+	0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x56,
+	0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x41,
+	0x75, 0x74, 0x68, 0x12, 0x1d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43,
+	0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52,
+	0x65, 0x71, 0x1a, 0x22, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65,
+	0x6e, 0x74, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61,
+	0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x12, 0x57, 0x0a, 0x12, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x63,
+	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x2e, 0x72,
+	0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52,
+	0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x72, 0x65,
+	0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x41, 0x63,
+	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x12,
+	0x52, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65,
+	0x63, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
+	0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71,
+	0x1a, 0x21, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74,
+	0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64,
+	0x52, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x13, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x55,
+	0x73, 0x65, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x2e, 0x72, 0x65, 0x73,
+	0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73,
+	0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
+	0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+	0x65, 0x12, 0x48, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61,
+	0x69, 0x6c, 0x65, 0x64, 0x12, 0x1a, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
+	0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73,
+	0x1a, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74,
+	0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0b, 0x66,
+	0x69, 0x6e, 0x64, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x73,
+	0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x65,
+	0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
+	0x63, 0x65, 0x73, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65,
+	0x77, 0x52, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (

+ 7 - 7
rpc/resourcesCenterclient/resourcescenter.go

@@ -14,20 +14,20 @@ import (
 )
 
 type (
-	RecordReq         = resourcesCenter.RecordReq
 	ConsumeRecord     = resourcesCenter.ConsumeRecord
-	ResourcesReq      = resourcesCenter.ResourcesReq
-	AccountBalanceRes = resourcesCenter.AccountBalanceRes
 	PreviewReq        = resourcesCenter.PreviewReq
+	Response          = resourcesCenter.Response
 	Balance           = resourcesCenter.Balance
 	Resources         = resourcesCenter.Resources
-	ResourceBalance   = resourcesCenter.ResourceBalance
 	ResourcesAuthRes  = resourcesCenter.ResourcesAuthRes
-	Response          = resourcesCenter.Response
-	Detailed          = resourcesCenter.Detailed
+	RecordReq         = resourcesCenter.RecordReq
 	ResourcesAuth     = resourcesCenter.ResourcesAuth
-	PreviewRes        = resourcesCenter.PreviewRes
+	ResourceBalance   = resourcesCenter.ResourceBalance
+	AccountBalanceRes = resourcesCenter.AccountBalanceRes
 	ConsumeRecordRes  = resourcesCenter.ConsumeRecordRes
+	Detailed          = resourcesCenter.Detailed
+	ResourcesReq      = resourcesCenter.ResourcesReq
+	PreviewRes        = resourcesCenter.PreviewRes
 
 	ResourcesCenter interface {
 		// 查询账户资源权限

+ 6 - 4
rpc/test/resourcesRecord_test.go

@@ -44,10 +44,11 @@ func Test_FindConsumeRecord(t *testing.T) {
 	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
 	FileSystem := resourcesCenterclient.NewResourcesCenter(zrpc.MustNewClient(c.FileSystemConf))
 	req := &resourcesCenter.RecordReq{
-		AccountId: "111",
-		UserId:"1111111",
+		AccountId: "5c3442f3c9ebc2285f902119",
+		UserId:"5c3442f3c9ebc2285f902119",
 		Page:1,
 		PageSize:10,
+		State:0,
 	}
 	res, err := FileSystem.FindConsumeRecord(ctx, req)
 	log.Println("结果", res)
@@ -58,8 +59,9 @@ func Test_FindPreview(t *testing.T) {
 	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
 	FileSystem := resourcesCenterclient.NewResourcesCenter(zrpc.MustNewClient(c.FileSystemConf))
 	req := &resourcesCenter.PreviewReq{
-		AccountId: "111",
-		InfoId:"",
+		AccountId: "5b023122c9ebc25f793e14a7",
+		InfoId:"2258,2259,2222,3333,4444,111",
+		ResourceType:"001",
 	}
 	res, err := FileSystem.FindPreview(ctx, req)
 	log.Println("结果", res)

+ 15 - 13
service/balanceService.go

@@ -123,8 +123,8 @@ func (service *BalanceService) UseUserDetailed(duplicateRemoval int64, balanceDa
 	//去重
 	deductionNumb := detailedData.ExportNum
 	if duplicateRemoval == 1 {
-		url=url+"/data/dedupAndSave?personId="+detailedData.UserId+"&infoId="+infoId+"&accountId="+detailedData.AccountId
-		res, urlerr := http.PostForm( url, nil)
+		url = url + "/data/dedupAndSave?personId=" + detailedData.UserId + "&infoId=" + infoId + "&accountId=" + detailedData.AccountId
+		res, urlerr := http.PostForm(url, nil)
 		fmt.Println(url, urlerr)
 		defer res.Body.Close()
 		body, _ := ioutil.ReadAll(res.Body)
@@ -181,7 +181,7 @@ func (service *BalanceService) UseUserDetailed(duplicateRemoval int64, balanceDa
 		orm.Rollback()
 		return entity.ErrorCode, "新增流水失败"
 	}
-	if deductionNumb==0{
+	if deductionNumb == 0 {
 		return entity.SuccessCode, "修改结存成功"
 	}
 	//修改结存
@@ -225,24 +225,27 @@ func (service *BalanceService) UseUserDetailed(duplicateRemoval int64, balanceDa
 }
 
 //根据账户标识使用资源
-func (service *BalanceService) FindPreview(in *resourcesCenter.PreviewReq) (int64, string, int64, int64) {
+func (service *BalanceService) FindPreview(in *resourcesCenter.PreviewReq, url string) (int64, string, int64, int64) {
 	orm := entity.Engine
-	balance := &entity.AccountBalance{}
+	balance := []entity.AccountBalance{}
 	//先查询余额
 	err := orm.Table("account_resources").Select("number").
-		Where("accountId = ? and resourceType = ?", in.AccountId, in.ResourceType).Find(balance)
+		Where("accountId = ? and resourceType = ?", in.AccountId, in.ResourceType).Find(&balance)
 	if err != nil {
 		return entity.ErrorCode, "查询余额失败", 0, 0
 	}
-	//开始判重
-	//url := "http://192.168.3.204:8888/data/dedupByAcount?"+ fmt.Sprintf("personId=?&infoId=?&accountId=?",in.AccountId,in.AccountId,in.InfoId)
-	//reqData, _status, _ := HttpPost_M(qutil.ObjToString((*requstAdd)["bankaccount"]), appheader, param, 20)
 	var appheader = "application/x-www-form-urlencoded"
 	param := "personId=" + in.AccountId + "&infoId=" + in.InfoId + "&accountId=" + in.AccountId
-	resp, status, _ := HttpPost_M("http://192.168.3.204:8888/data/dedupByAcount", appheader, param, 20)
+	resp, status, _ := HttpPost_M(url+"/data/dedupByAcount", appheader, param, 20)
 	log.Println(resp, status)
-
-	return entity.SuccessCode, "去重", 1, 1
+	if status != 200 && resp == nil {
+		return entity.ErrorCode, "请求去重接口出错", 0, 0
+	}
+	data := resp["data"].(map[string]interface{})
+	repeatNumb := data["existCount"].(float64)
+	deductionNumb := data["newCount"].(float64)
+	log.Println(repeatNumb,deductionNumb)
+	return entity.SuccessCode, "去重", int64(repeatNumb), int64(deductionNumb)
 }
 
 func HttpPost_M(href, contentType, param string, timeout int) (map[string]interface{}, int, int64) {
@@ -268,5 +271,4 @@ func HttpPost_M(href, contentType, param string, timeout int) (map[string]interf
 
 	t2 := time.Now().UnixNano()
 	return resData, resp.StatusCode, t2 - t1
-
 }

+ 18 - 5
service/resourceManageService.go

@@ -67,12 +67,24 @@ func (service *ResourceManageService) FindConsumeRecord(in *resourcesCenter.Reco
 	orm := entity.Engine.NewSession()
 	var recordArr []*entity.ConsumeRecord
 	dataList := make([]*resourcesCenter.ConsumeRecord, 0)
-	count, err := orm.Table("consume_record").
-		Where("accountId = ? and userId = ?", in.AccountId, in.UserId).
-		Limit(int(in.PageSize), (int(in.Page)-1)*int(in.PageSize)).OrderBy("id desc").FindAndCount(&recordArr)
-	if err != nil && count == 0 {
-		return dataList, err
+	var count int64
+	var err error
+	if in.State == 0 {
+		count, err = orm.Table("consume_record").
+			Where("accountId = ? and userId = ? and userType = 0", in.AccountId, in.UserId).
+			Limit(int(in.PageSize), (int(in.Page)-1)*int(in.PageSize)).OrderBy("id desc").FindAndCount(&recordArr)
+		if err != nil && count == 0 {
+			return dataList, err
+		}
+	} else {
+		count, err = orm.Table("consume_record").
+			Where("accountId = ? and userId = ? and userType = 1", in.AccountId, in.UserId).
+			Limit(int(in.PageSize), (int(in.Page)-1)*int(in.PageSize)).OrderBy("id desc").FindAndCount(&recordArr)
+		if err != nil && count == 0 {
+			return dataList, err
+		}
 	}
+
 	for _, v := range recordArr {
 		dataList = append(dataList, &resourcesCenter.ConsumeRecord{
 			Id:             v.Id,
@@ -86,6 +98,7 @@ func (service *ResourceManageService) FindConsumeRecord(in *resourcesCenter.Reco
 			Url:            v.Url,
 			SearchCriteria: v.SearchCriteria,
 			Source:         v.Source,
+			Remarks:        v.Remarks,
 		})
 	}
 	return dataList, nil