- 新增客户模块,支持客户信息保存功能 - 新增付款单模块,支持付款单据保存功能 - 新增物料模块,支持物料信息保存功能 - 修改部门和员工模块接口,统一使用Save方法替代原有的Add和Edit方法 - 调整金蝶集成接口参数,简化调用方式 - 更新常量定义,增加客户、付款单和物料相关枚举值
93 lines
2.1 KiB
Go
93 lines
2.1 KiB
Go
package ik3cloud
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.kumo.work/shama/service/client"
|
|
"git.kumo.work/shama/service/lib/bean"
|
|
)
|
|
|
|
type staff struct {
|
|
}
|
|
type ArgsStaffList struct {
|
|
Page bean.Page
|
|
Search StaffSearch
|
|
}
|
|
type StaffSearch struct {
|
|
Status int64 // 状态 1=启用 2=停用
|
|
Name string // 姓名
|
|
Phone string // 手机号
|
|
}
|
|
type ReplyStaffList struct {
|
|
List []StaffItem `json:"list"` // 员工列表
|
|
Total int64 `json:"total"` // 总数
|
|
}
|
|
type StaffItem struct {
|
|
Id int64 `json:"id"`
|
|
Number *string `json:"number"` // 工号
|
|
Name *string `json:"name"` // 姓名
|
|
Position *string `json:"position"` // 职位
|
|
Mobile *string `json:"mobile"` // 手机号
|
|
Tel *string `json:"tel"` // 座机
|
|
Status *string `json:"status"` // 状态
|
|
}
|
|
|
|
// List @TITLE 员工列表
|
|
func (s *staff) List(ctx context.Context, args ArgsStaffList) (reply ReplyStaffList, err error) {
|
|
xClient, err := client.GetClient(s)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = xClient.Call(ctx, "List", args, &reply)
|
|
return
|
|
}
|
|
|
|
type ArgsStaffSave struct {
|
|
StaffId int64 // 员工id
|
|
Name string // 姓名
|
|
Number string // 编码
|
|
Mobile any // 手机号
|
|
Tel string // 座机
|
|
Email string // 邮箱
|
|
}
|
|
|
|
// Save @TITLE 保存员工
|
|
func (s *staff) Save(ctx context.Context, args ArgsStaffSave) (entity Entity, err error) {
|
|
xClient, err := client.GetClient(s)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = xClient.Call(ctx, "Save", args, &entity)
|
|
return
|
|
}
|
|
|
|
// Disable @TITLE 禁用员工
|
|
func (s *staff) Disable(ctx context.Context, args Unique) (err error) {
|
|
xClient, err := client.GetClient(s)
|
|
if err != nil {
|
|
return
|
|
}
|
|
var reply int
|
|
return xClient.Call(ctx, "Disable", args, &reply)
|
|
}
|
|
|
|
// Enable @TITLE 启用员工
|
|
func (s *staff) Enable(ctx context.Context, args Unique) (err error) {
|
|
xClient, err := client.GetClient(s)
|
|
if err != nil {
|
|
return
|
|
}
|
|
var reply int
|
|
return xClient.Call(ctx, "Enable", args, &reply)
|
|
}
|
|
|
|
// Delete @TITLE 删除员工
|
|
func (s *staff) Delete(ctx context.Context, args Unique) (err error) {
|
|
xClient, err := client.GetClient(s)
|
|
if err != nil {
|
|
return
|
|
}
|
|
var reply int
|
|
return xClient.Call(ctx, "Delete", args, &reply)
|
|
}
|