From 87e59e2fee3c9da8f1e3f96a2b804f5d081aa925 Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 9 Mar 2023 14:31:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E5=85=A5=E9=A9=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/enterprise.go | 115 +++++++++++++++++++++++++++++++++++++++++ supplier/supplier.go | 1 + 2 files changed, 116 insertions(+) create mode 100644 supplier/enterprise.go diff --git a/supplier/enterprise.go b/supplier/enterprise.go new file mode 100644 index 0000000..f5635ce --- /dev/null +++ b/supplier/enterprise.go @@ -0,0 +1,115 @@ +package supplier + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" +) + +const ( + EnterpriseAuditStatusNone = 1 // 未审核 + EnterpriseAuditStatusAdopt = 2 // 通过 + EnterpriseAuditStatusReject = 3 // 驳回 +) + +type enterprise struct { +} +type ArgsEnterpriseLists struct { + bean.Page +} +type EnterpriseSearch struct { + Name string // 企业名称 + AuditStatus uint // 审核状态 1=待审核 2=通过 3=驳回 +} +type ReplyEnterpriseLists struct { + Lists []EnterpriseItem `json:"lists"` + Total int64 `json:"total"` +} +type EnterpriseItem struct { + Id uint `json:"id"` + Name string `json:"name"` + CreatedAt int64 `json:"createdAt"` + AuditStatus uint `json:"auditStatus"` + AuditUserId uint `json:"auditUserId"` + AuditAt int64 `json:"auditAt"` +} + +// Lists @Title 审核列表 +func (e *enterprise) Lists(ctx context.Context, args ArgsEnterpriseLists) (reply ReplyEnterpriseLists, err error) { + xClient, err := client.GetClient(e) + if err != nil { + return ReplyEnterpriseLists{}, err + } + err = xClient.Call(ctx, "Lists", args, &reply) + return +} + +type ReplyEnterpriseInfo struct { + Id uint `json:"id"` + AuditStatus uint `json:"auditStatus"` + AuditUserId uint `json:"auditUserId"` + AuditAt int64 `json:"auditAt"` + Reason string `json:"reason"` + Name string `json:"name"` + BusinessAddress string `json:"businessAddress"` + LegalPersonName string `json:"legalPersonName"` + PayTaxes uint `json:"payTaxes"` + TaxNumber string `json:"taxNumber"` + BankName string `json:"bankName"` + BankCode string `json:"bankCode"` + BankAddress string `json:"bankAddress"` + Phone string `json:"phone"` + CreatedAt int64 `json:"createdAt"` + BusinessLicense string `json:"businessLicense"` + IdPhotoFront string `json:"idPhotoFront"` + IdPhotoBack string `json:"idPhotoBack"` + AccountPhoto string `json:"accountPhoto"` + ContactName string `json:"contactName"` + ContactEmail string `json:"contactEmail"` + ContactPhone string `json:"contactPhone"` + Position string `json:"position"` +} + +// Info @Title 审核详情 +func (e *enterprise) Info(ctx context.Context, enterpriseId uint) (reply ReplyEnterpriseInfo, err error) { + xClient, err := client.GetClient(e) + if err != nil { + return ReplyEnterpriseInfo{}, err + } + err = xClient.Call(ctx, "Info", enterpriseId, &reply) + return +} + +type ArgsEnterpriseAdopt struct { + AuditUserId uint // 审核人id + EnterpriseId uint // 企业id + Account string // 账号 + Password string // 密码 + PayType uint +} + +// Adopt @Title 审核通过 +func (e *enterprise) Adopt(ctx context.Context, args ArgsEnterpriseAdopt) error { + xClient, err := client.GetClient(e) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Adopt", args, &reply) +} + +type ArgsEnterpriseReject struct { + AuditUserId uint // 审核人id + EnterpriseId uint // 企业id + Reason string // 驳回原因 +} + +// Reject @Title 审核驳回 +func (e *enterprise) Reject(ctx context.Context, args ArgsEnterpriseReject) error { + xClient, err := client.GetClient(e) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Reject", args, &reply) +} diff --git a/supplier/supplier.go b/supplier/supplier.go index 0862e2f..7f2efe0 100644 --- a/supplier/supplier.go +++ b/supplier/supplier.go @@ -19,6 +19,7 @@ type Supplier struct { Afs afs AfsAudit afsAudit BatchGoods batch.Goods + Enterprise enterprise } type supplier struct {