feat(oa): 更新部门和员工金蝶信息接口返回结构
- 修改部门服务中 Ik3cloudInfo 方法的返回结构体为 ReplyDepartmentIk3cloudInfo - 新增 ReplyDepartmentIk3cloudInfo 结构体定义,包含金蝶相关字段 - 修改员工服务中 Ik3cloudInfo 方法的返回结构体为 ReplyStaffIk3cloudInfo - 新增 ReplyStaffIk3cloudInfo 结构体定义,扩展更多金蝶相关信息字段 - 调整工厂保存参数结构体 ArgsFactorySave,增加部门编号和员工编号字段 - 移除部门和员工服务对 ik3cloud 包的直接依赖引用
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
16
oa/staff.go
16
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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user