diff --git a/ik3cloud/constant/constant.go b/ik3cloud/constant/constant.go index 4d183c1..1fe9b0c 100644 --- a/ik3cloud/constant/constant.go +++ b/ik3cloud/constant/constant.go @@ -3,11 +3,21 @@ package constant type Action = string // 方法 const ( - ActionDepartment Action = "BD_Department" // 部门 - ActionStaff Action = "BD_Empinfo" // 员工 - ActionFactory Action = "BD_Supplier" // 工厂 - ActionContact Action = "BD_CommonContact" // 联系人 - ActionCustom Action = "BD_Customer" // 客户 - ActionPayment Action = "AR_receivable" // 付款单 - ActionProduct Action = "BD_MATERIAL" // 物料 + ActionDepartment Action = "BD_Department" // 部门 + ActionStaff Action = "BD_Empinfo" // 员工 + ActionStaffPosition Action = "BD_NEWSTAFF" // 职位 + ActionOperatorType Action = "BD_OPERATOR" // 业务员类型 + ActionPosition Action = "HR_ORG_HRPOST" // 职位 + ActionFactory Action = "BD_Supplier" // 工厂 + ActionContact Action = "BD_CommonContact" // 联系人 + ActionCustom Action = "BD_Customer" // 客户 + ActionPayment Action = "AR_receivable" // 付款单 + ActionProduct Action = "BD_MATERIAL" // 物料 +) + +type OperatorType = string + +const ( + OperatorTypeXSY OperatorType = "XSY" // 业务员 + OperatorTypeCGY OperatorType = "CGY" // 采购员 ) diff --git a/ik3cloud/ik3cloud.go b/ik3cloud/ik3cloud.go index f0b6b42..1a38c40 100644 --- a/ik3cloud/ik3cloud.go +++ b/ik3cloud/ik3cloud.go @@ -3,6 +3,7 @@ package ik3cloud type Ik3cloud struct { Department department // 部门 Staff staff // 员工 + Position position // 职位 Contact contact // 联系人 Factory factory // 工厂 Custom custom // 客户 diff --git a/ik3cloud/position.go b/ik3cloud/position.go new file mode 100644 index 0000000..7fc3767 --- /dev/null +++ b/ik3cloud/position.go @@ -0,0 +1,37 @@ +package ik3cloud + +import ( + "context" + + "git.kumo.work/shama/service/client" +) + +type position struct { +} + +type ArgsPositionSave struct { + PositionId int64 // 职位id + Number string // 职位编码 + Name string // 职位名称 + DepartmentNumber string // 部门编码 +} + +// Save @TITLE 保存部门 +func (p *position) Save(ctx context.Context, args ArgsPositionSave) (entity Entity, err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + err = xClient.Call(ctx, "Save", args, &entity) + return +} + +// Delete @TITLE 删除部门 +func (p *position) Delete(ctx context.Context, numbers []string) (err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + var reply int + return xClient.Call(ctx, "Delete", numbers, &reply) +} diff --git a/ik3cloud/staff.go b/ik3cloud/staff.go index 78acf12..9fb0b75 100644 --- a/ik3cloud/staff.go +++ b/ik3cloud/staff.go @@ -4,6 +4,7 @@ import ( "context" "git.kumo.work/shama/service/client" + "git.kumo.work/shama/service/ik3cloud/constant" "git.kumo.work/shama/service/lib/bean" ) @@ -90,3 +91,37 @@ func (s *staff) Delete(ctx context.Context, args Unique) (err error) { var reply int return xClient.Call(ctx, "Delete", args, &reply) } + +type ArgsStaffPosition struct { + StaffPositionId int64 // 员工职位id + Number string // 编码 + StaffNumber string // 员工编码 + DepartmentNumber string // 部门编码 + PositionNumber string // 职位编码 +} + +// Position @TITLE 员工职位 +func (s *staff) Position(ctx context.Context, args ArgsStaffPosition) (entity Entity, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "Position", args, &entity) + return +} + +type StaffOperatorItem struct { + OperatorId int64 // 类型id + OperatorType constant.OperatorType // 业务类型 + StaffPositionNumbers []string // 员工职位编码 +} + +// Operator @TITLE 业务类型 +func (s *staff) Operator(ctx context.Context, args []StaffOperatorItem) (entities []Entity, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "Operator", args, &entities) + return +}