From a0625be567468d1b2ce53e840c9900541bc7a2b5 Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 8 Dec 2022 17:18:12 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A9=E7=8E=87?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/setting/rate.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/supply/setting/rate.go b/supply/setting/rate.go index 8ffb1fa..5d4f688 100644 --- a/supply/setting/rate.go +++ b/supply/setting/rate.go @@ -25,6 +25,16 @@ func (r *rate) All(ctx context.Context) (result []RateItem, err error) { return } +// Get @Title 获取利率信息 +func (r *rate) Get(ctx context.Context) (result RateItem, err error) { + xClient, err := client.GetClient(r) + if err != nil { + return + } + err = xClient.Call(ctx, "Get", 0, &result) + return +} + type ArgsRateChannel struct { ChannelId uint // 渠道id RateId uint // 费率id From 6d6c9310098fd2cbf3ff7863e34d1434bc00f399 Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 8 Dec 2022 17:26:40 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A9=E7=8E=87?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/setting/rate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supply/setting/rate.go b/supply/setting/rate.go index 5d4f688..07717b5 100644 --- a/supply/setting/rate.go +++ b/supply/setting/rate.go @@ -26,12 +26,12 @@ func (r *rate) All(ctx context.Context) (result []RateItem, err error) { } // Get @Title 获取利率信息 -func (r *rate) Get(ctx context.Context) (result RateItem, err error) { +func (r *rate) Get(ctx context.Context, rateId uint) (result RateItem, err error) { xClient, err := client.GetClient(r) if err != nil { return } - err = xClient.Call(ctx, "Get", 0, &result) + err = xClient.Call(ctx, "Get", rateId, &result) return } From 5167292432fc877722480b883974dc6f1e9d5366 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 9 Dec 2022 10:09:15 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A9=E7=8E=87?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wholesale/setting/rate.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wholesale/setting/rate.go b/wholesale/setting/rate.go index 8ffb1fa..07717b5 100644 --- a/wholesale/setting/rate.go +++ b/wholesale/setting/rate.go @@ -25,6 +25,16 @@ func (r *rate) All(ctx context.Context) (result []RateItem, err error) { return } +// Get @Title 获取利率信息 +func (r *rate) Get(ctx context.Context, rateId uint) (result RateItem, err error) { + xClient, err := client.GetClient(r) + if err != nil { + return + } + err = xClient.Call(ctx, "Get", rateId, &result) + return +} + type ArgsRateChannel struct { ChannelId uint // 渠道id RateId uint // 费率id From 8f6e6870509a6afb48fe5430b968659cb559c872 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 9 Dec 2022 10:59:05 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/service.go | 3 +- customer/service/audit.go | 74 +++++++++++++++++++++- customer/service/audit/audit.go | 5 -- customer/service/audit/supply.go | 101 ------------------------------- customer/user.go | 1 - 5 files changed, 74 insertions(+), 110 deletions(-) delete mode 100644 customer/service/audit/audit.go delete mode 100644 customer/service/audit/supply.go diff --git a/customer/service.go b/customer/service.go index 1712f31..cbc50ab 100644 --- a/customer/service.go +++ b/customer/service.go @@ -3,7 +3,8 @@ package customer type serviceId uint const ( - ServiceSupply serviceId = 1 // 供应链 + ServiceSupply serviceId = 1 // 供应链 + ServiceWholesale serviceId = 2 // 批发 UserServiceStatusNone = 0 // 无 UserServiceStatusWait = 1 // 待审核 diff --git a/customer/service/audit.go b/customer/service/audit.go index 13032f2..8df40eb 100644 --- a/customer/service/audit.go +++ b/customer/service/audit.go @@ -3,12 +3,11 @@ package service import ( "context" "git.oa00.com/supply-chain/service/client" - audit2 "git.oa00.com/supply-chain/service/customer/service/audit" "git.oa00.com/supply-chain/service/lib/bean" + "time" ) type audit struct { - audit2.Audit } type AuditSearch struct { ApplyUserId uint // 申请人 @@ -72,3 +71,74 @@ func (a *audit) History(ctx context.Context, args ArgsHistory) (reply ReplyHisto err = xClient.Call(ctx, "History", args, &reply) return } + +type ArgsAuditApply struct { + ServiceId uint `json:"serviceId"` // 服务id + ApplyUserId uint `json:"applyUserId"` // 申请人id + CustomerId uint `json:"customerId"` // 客户id + ExpirationAt time.Time `json:"expirationAt"` // 到期时间 + Expand any `json:"expand"` // 拓展参数 +} + +// Apply @Title 申请 +func (a *audit) Apply(ctx context.Context, args ArgsAuditApply) error { + reply := 0 + xClient, err := client.GetClient(a) + if err != nil { + return err + } + return xClient.Call(ctx, "Apply", args, &reply) +} + +type ArgsAuditAdopt struct { + AuditUserId uint // 审核人id + UserServiceId uint // 客户服务id +} + +// Adopt @Title 审核通过 +func (a *audit) Adopt(ctx context.Context, args ArgsAuditAdopt) error { + reply := 0 + xClient, err := client.GetClient(a) + if err != nil { + return err + } + return xClient.Call(ctx, "Adopt", args, &reply) +} + +type ArgsAuditReject struct { + AuditUserId uint // 审核人id + UserServiceId uint // 客户服务id + Reason string // 驳回原因 +} + +// Reject @Title 驳回 +func (a *audit) Reject(ctx context.Context, args ArgsAuditReject) error { + reply := 0 + xClient, err := client.GetClient(a) + if err != nil { + return err + } + return xClient.Call(ctx, "Reject", args, &reply) +} + +type ReplyAuditInfo 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"` + AuditStatus uint `json:"auditStatus"` + AuditAt int64 `json:"auditAt"` + Reason string `json:"reason"` + AuditUserId uint `json:"auditUserId"` + Expand any `json:"expand"` +} + +type ReplyProof struct { + Name string `json:"name"` + ChannelId uint `json:"channelId"` // 用户Id + AppKey string `json:"appKey"` + AppSecret string `json:"appSecret"` +} diff --git a/customer/service/audit/audit.go b/customer/service/audit/audit.go deleted file mode 100644 index ccbd49d..0000000 --- a/customer/service/audit/audit.go +++ /dev/null @@ -1,5 +0,0 @@ -package audit - -type Audit struct { - Supply supply -} diff --git a/customer/service/audit/supply.go b/customer/service/audit/supply.go deleted file mode 100644 index 3113f90..0000000 --- a/customer/service/audit/supply.go +++ /dev/null @@ -1,101 +0,0 @@ -package audit - -import ( - "context" - "git.oa00.com/supply-chain/service/client" -) - -type supply struct { -} - -type ArgsSupplyApply struct { - ApplyUserId uint // 申请人id - CustomerId uint // 客户id - RateId uint // 费率id - ExpirationAt string // 到期时间 - Enclosure string // 附件 -} - -// Apply @Title 申请 -func (s *supply) Apply(ctx context.Context, args ArgsSupplyApply) error { - reply := 0 - xClient, err := client.GetClient(s) - if err != nil { - return err - } - return xClient.Call(ctx, "Apply", args, &reply) -} - -type ArgsSupplyAdopt struct { - AuditUserId uint // 审核人id - UserServiceId uint // 客户服务id -} - -// Adopt @Title 审核通过 -func (s *supply) Adopt(ctx context.Context, args ArgsSupplyAdopt) error { - reply := 0 - xClient, err := client.GetClient(s) - if err != nil { - return err - } - return xClient.Call(ctx, "Adopt", args, &reply) -} - -type ArgsSupplyReject struct { - AuditUserId uint // 审核人id - UserServiceId uint // 客户服务id - Reason string // 驳回原因 -} - -// Reject @Title 驳回 -func (s *supply) Reject(ctx context.Context, args ArgsSupplyReject) error { - reply := 0 - xClient, err := client.GetClient(s) - if err != nil { - return err - } - return xClient.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) { - xClient, err := client.GetClient(s) - if err != nil { - return - } - err = xClient.Call(ctx, "Info", userServiceId, &reply) - return -} - -type ReplyProof struct { - Name string `json:"name"` - ChannelId uint `json:"channelId"` // 用户Id - AppKey string `json:"appKey"` - AppSecret string `json:"appSecret"` -} - -// GetProof @Title 获取凭证 -func (s *supply) GetProof(ctx context.Context, userServiceId uint) (reply ReplyProof, err error) { - xClient, err := client.GetClient(s) - if err != nil { - return - } - err = xClient.Call(ctx, "GetProof", userServiceId, &reply) - return -} diff --git a/customer/user.go b/customer/user.go index e0e571f..4bfdabc 100644 --- a/customer/user.go +++ b/customer/user.go @@ -31,7 +31,6 @@ type UserItem struct { Id uint `json:"id"` Name string `json:"name"` Account string `json:"account"` - RateId uint `json:"rateId"` Liaison string `json:"liaison"` Phone string `json:"phone"` Amount decimal.Decimal `json:"amount"`