feat(ik3cloud): 新增员工职位和业务员类型功能
- 在 constant.go 中新增员工职位和业务员类型常量定义 - 在 ik3cloud.go 中新增 Position 字段以支持职位相关操作 - 在 staff.go 中实现员工职位和业务员类型的查询方法 - 新增 position.go 文件,实现职位的保存和删除功能
This commit is contained in:
@@ -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" // 采购员
|
||||
)
|
||||
|
||||
@@ -3,6 +3,7 @@ package ik3cloud
|
||||
type Ik3cloud struct {
|
||||
Department department // 部门
|
||||
Staff staff // 员工
|
||||
Position position // 职位
|
||||
Contact contact // 联系人
|
||||
Factory factory // 工厂
|
||||
Custom custom // 客户
|
||||
|
||||
37
ik3cloud/position.go
Normal file
37
ik3cloud/position.go
Normal file
@@ -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)
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user