From 8de8393c072fde521d85021e190dfe13d149bbef Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 4 Dec 2025 14:17:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(ik3cloud):=20=E6=96=B0=E5=A2=9E=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E8=81=8C=E4=BD=8D=E5=92=8C=E4=B8=9A=E5=8A=A1=E5=91=98?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 constant.go 中新增员工职位和业务员类型常量定义 - 在 ik3cloud.go 中新增 Position 字段以支持职位相关操作 - 在 staff.go 中实现员工职位和业务员类型的查询方法 - 新增 position.go 文件,实现职位的保存和删除功能 --- ik3cloud/constant/constant.go | 24 ++++++++++++++++------- ik3cloud/ik3cloud.go | 1 + ik3cloud/position.go | 37 +++++++++++++++++++++++++++++++++++ ik3cloud/staff.go | 35 +++++++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 ik3cloud/position.go 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 +}