From 1237f97014edcc8d7a64a9c6d5583db68009f59e Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 29 Jul 2022 09:06:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/service.go | 5 +++ customer/service/audit.go | 39 ++++++++++++++++++ customer/service/audit/supply.go | 68 ++++++++++++++++++++++++++++++++ supply/channel/channel.go | 3 +- supply/setting/setting.go | 5 +++ supply/supply.go | 6 ++- 6 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 customer/service/audit.go create mode 100644 customer/service/audit/supply.go create mode 100644 supply/setting/setting.go diff --git a/customer/service.go b/customer/service.go index 57cee5f..1712f31 100644 --- a/customer/service.go +++ b/customer/service.go @@ -4,4 +4,9 @@ type serviceId uint const ( ServiceSupply serviceId = 1 // 供应链 + + UserServiceStatusNone = 0 // 无 + UserServiceStatusWait = 1 // 待审核 + UserServiceStatusAdopt = 2 // 审核通过 + UserServiceStatusReject = 3 // 审核驳回 ) diff --git a/customer/service/audit.go b/customer/service/audit.go new file mode 100644 index 0000000..27ee3c6 --- /dev/null +++ b/customer/service/audit.go @@ -0,0 +1,39 @@ +package service + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" +) + +type audit struct { +} +type AuditSearch struct { + Status uint // 审核状态 1=未审核 2=通过 3=驳回 + Name string // 用户名称 +} +type ArgsAuditLists struct { + Search AuditSearch // 筛选 + Page bean.Page // 分页 +} +type AuditItem struct { + Id uint `json:"id"` + ServiceId uint `json:"serviceId"` + UserName string `json:"userName"` + ServiceName string `json:"serviceName"` + ApplyUserId uint `json:"applyUserId"` + ApplyAt int64 `json:"applyAt"` + AuditStatus uint `json:"auditStatus"` + AuditUserId uint `json:"auditUserId"` + AuditAt int64 `json:"auditAt"` +} +type ReplyAuditLists struct { + Lists []AuditItem `json:"lists"` + Total int64 `json:"total"` +} + +// Lists @Title 服务审核列表 +func (a *audit) Lists(ctx context.Context, args ArgsAuditLists) (reply ReplyAuditLists, err error) { + err = client.GetClient(a).Call(ctx, "Lists", args, &reply) + return +} diff --git a/customer/service/audit/supply.go b/customer/service/audit/supply.go new file mode 100644 index 0000000..64c7891 --- /dev/null +++ b/customer/service/audit/supply.go @@ -0,0 +1,68 @@ +package audit + +import ( + "context" + "git.oa00.com/supply-chain/service/client" +) + +type supply struct { +} + +type ArgsSupplyApply struct { + ApplyId uint // 申请人id + CustomerId uint // 客户id + RateId uint // 费率id + ExpirationAt int64 // 到期时间 + Enclosure string // 附件 +} + +// Apply @Title 申请 +func (s *supply) Apply(ctx context.Context, args ArgsSupplyApply) error { + reply := 0 + return client.GetClient(s).Call(ctx, "Apply", args, &reply) +} + +type ArgsSupplyAdopt struct { + AuditId uint // 审核人id + UserServiceId uint // 客户服务id +} + +// Adopt @Title 审核通过 +func (s *supply) Adopt(ctx context.Context, args ArgsSupplyAdopt) error { + reply := 0 + return client.GetClient(s).Call(ctx, "Adopt", args, &reply) +} + +type ArgsSupplyReject struct { + AuditId uint // 审核人id + UserServiceId uint // 客户服务id + Reason string // 驳回原因 +} + +// Reject @Title 驳回 +func (s *supply) Reject(ctx context.Context, args ArgsSupplyReject) error { + reply := 0 + return client.GetClient(s).Call(ctx, "Reject", args, &reply) +} + +type ReplySupplyInfo struct { + Id uint `json:"id"` + UserName string `json:"userName"` + ApplyUserId uint `json:"applyUserId"` + ApplyAt int64 `json:"applyAt"` + ServiceId uint `json:"serviceId"` + ServiceName string `json:"serviceName"` + ExpirationAt int64 `json:"expirationAt"` + RateId uint `json:"rateId"` + Enclosure string `json:"enclosure"` + AuditStatus uint `json:"auditStatus"` + AuditAt int64 `json:"auditAt"` + Reason string `json:"reason"` + AuditUserId uint `json:"auditUserId"` +} + +// Info @Title 详情 +func (s *supply) Info(ctx context.Context, userServiceId uint) (reply ReplySupplyInfo, err error) { + err = client.GetClient(s).Call(ctx, "Info", userServiceId, &reply) + return +} diff --git a/supply/channel/channel.go b/supply/channel/channel.go index 2bf7c0a..5d8b79f 100644 --- a/supply/channel/channel.go +++ b/supply/channel/channel.go @@ -1,5 +1,6 @@ package channel type Channel struct { - Sku sku + Sku sku + Order order } diff --git a/supply/setting/setting.go b/supply/setting/setting.go new file mode 100644 index 0000000..50e35c9 --- /dev/null +++ b/supply/setting/setting.go @@ -0,0 +1,5 @@ +package setting + +type Setting struct { + Rate rate +} diff --git a/supply/supply.go b/supply/supply.go index e5219f1..ba86bf6 100644 --- a/supply/supply.go +++ b/supply/supply.go @@ -1,6 +1,9 @@ package supply -import "git.oa00.com/supply-chain/service/supply/channel" +import ( + "git.oa00.com/supply-chain/service/supply/channel" + "git.oa00.com/supply-chain/service/supply/setting" +) type Supply struct { Brand brand @@ -8,4 +11,5 @@ type Supply struct { Sku sku SkuAudit skuAudit Channel channel.Channel + Setting setting.Setting }