From 96993c312a661102fc5c70fde8d990e88f50230a Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 4 Dec 2025 15:08:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(oa):=20=E6=9B=B4=E6=96=B0=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E5=92=8C=E5=91=98=E5=B7=A5=E9=87=91=E8=9D=B6=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改部门服务中 Ik3cloudInfo 方法的返回结构体为 ReplyDepartmentIk3cloudInfo - 新增 ReplyDepartmentIk3cloudInfo 结构体定义,包含金蝶相关字段 - 修改员工服务中 Ik3cloudInfo 方法的返回结构体为 ReplyStaffIk3cloudInfo - 新增 ReplyStaffIk3cloudInfo 结构体定义,扩展更多金蝶相关信息字段 - 调整工厂保存参数结构体 ArgsFactorySave,增加部门编号和员工编号字段 - 移除部门和员工服务对 ik3cloud 包的直接依赖引用 --- ik3cloud/factory.go | 26 ++++++++++++++------------ oa/department.go | 12 +++++++++--- oa/staff.go | 16 +++++++++++++--- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/ik3cloud/factory.go b/ik3cloud/factory.go index 75150a6..7d3dfad 100644 --- a/ik3cloud/factory.go +++ b/ik3cloud/factory.go @@ -9,18 +9,20 @@ import ( type factory struct { } type ArgsFactorySave struct { - FactoryId int64 // 工厂id - Number string // 工厂编码 - Name string // 工厂名称 - ShortName string // 简称 - Address string // 地址 - ZipCode string - LegalPerson string - TaxNumber string - RegAddress string - Bank string - BankAccount string - Contacts []FactoryContactItem + FactoryId int64 // 工厂id + Number string // 工厂编码 + Name string // 工厂名称 + ShortName string // 简称 + Address string // 地址 + ZipCode string + LegalPerson string + TaxNumber string + RegAddress string + Bank string + BankAccount string + Contacts []FactoryContactItem + DepartmentNumber string // 部门编号 + StaffNumber string // 员工编号 } type FactoryContactItem struct { diff --git a/oa/department.go b/oa/department.go index 36cea37..fb173f8 100644 --- a/oa/department.go +++ b/oa/department.go @@ -5,7 +5,6 @@ import ( "time" "git.kumo.work/shama/service/client" - "git.kumo.work/shama/service/ik3cloud" ) type department struct { @@ -97,13 +96,20 @@ func (d *department) SetStaff(ctx context.Context, args ArgsDepartmentSetStaff) return xClient.Call(ctx, "SetStaff", args, &reply) } +type ReplyDepartmentIk3cloudInfo struct { + Id int64 `json:"id"` // 金蝶员工id + Number string `json:"number"` // 金蝶员工编码 + PositionID int64 `json:"positionID"` // 金蝶部门职位id + PositionNumber string `json:"positionNumber"` // 金蝶部门职位编码 +} + // Ik3cloudInfo @TITLE 金蝶同步信息 -func (d *department) Ik3cloudInfo(ctx context.Context, departmentId int64) (entity ik3cloud.Entity, err error) { +func (d *department) Ik3cloudInfo(ctx context.Context, departmentId int64) (reply ReplyDepartmentIk3cloudInfo, err error) { xClient, err := client.GetClient(d) if err != nil { return } - err = xClient.Call(ctx, "Ik3cloudInfo", departmentId, &entity) + err = xClient.Call(ctx, "Ik3cloudInfo", departmentId, &reply) return } diff --git a/oa/staff.go b/oa/staff.go index 7807d52..8803898 100644 --- a/oa/staff.go +++ b/oa/staff.go @@ -5,7 +5,6 @@ import ( "time" "git.kumo.work/shama/service/client" - "git.kumo.work/shama/service/ik3cloud" "git.kumo.work/shama/service/lib/bean" ) @@ -267,13 +266,24 @@ func (s *staff) Enable(ctx context.Context, staffIds []int64) (err error) { return xClient.Call(ctx, "Enable", staffIds, &reply) } +type ReplyStaffIk3cloudInfo struct { + Id int64 `json:"id"` // 金蝶员工id + Number string `json:"number"` // 金蝶员工编码 + PositionId int64 `json:"positionId"` // 金蝶部门职位id + PositionNumber string `json:"positionNumber"` // 金蝶部门职位编码 + XsyId int64 `json:"xsyId"` // 金蝶员工销售员id + XsyNumber string `json:"xsyNumber"` // 金蝶员工销售员编码 + CgyId int64 `json:"cgyId"` // 金蝶员工采购员id + CgyNumber string `json:"cgyNumber"` // 金蝶员工采购员编码 +} + // Ik3cloudInfo @TITLE 金蝶同步信息 -func (s *staff) Ik3cloudInfo(ctx context.Context, staffId int64) (entity ik3cloud.Entity, err error) { +func (s *staff) Ik3cloudInfo(ctx context.Context, staffId int64) (reply ReplyStaffIk3cloudInfo, err error) { xClient, err := client.GetClient(s) if err != nil { return } - err = xClient.Call(ctx, "Ik3cloudInfo", staffId, &entity) + err = xClient.Call(ctx, "Ik3cloudInfo", staffId, &reply) return }