- 添加部门新增、编辑、删除接口及逻辑实现 - 添加员工新增、编辑、启用、禁用、删除接口及逻辑实现 - 更新配置文件支持组织ID配置 - 初始化金蝶客户端连接配置 - 优化部门与员工数据查询结构 - 增加提交、审核、反审等业务流程处理 - 完善错误处理与日志记录机制
48 lines
1.2 KiB
Go
48 lines
1.2 KiB
Go
package controller
|
|
|
|
import (
|
|
"context"
|
|
"ik3cloud/app/logic"
|
|
|
|
"git.kumo.work/shama/service/ik3cloud"
|
|
)
|
|
|
|
type Staff struct {
|
|
}
|
|
|
|
// List @TITLE 员工列表
|
|
func (s *Staff) List(ctx context.Context, args ik3cloud.ArgsStaffList, reply *ik3cloud.ReplyStaffList) error {
|
|
list, total, err := logic.StaffLogic.List(args.Page, args.Search)
|
|
*reply = ik3cloud.ReplyStaffList{
|
|
List: list,
|
|
Total: total,
|
|
}
|
|
return err
|
|
}
|
|
|
|
// Add @TITLE 添加员工
|
|
func (s *Staff) Add(ctx context.Context, args ik3cloud.ArgsStaffAdd, staffId *int64) (err error) {
|
|
*staffId, err = logic.StaffLogic.Add(args)
|
|
return
|
|
}
|
|
|
|
// Edit @TITLE 员工编辑
|
|
func (s *Staff) Edit(ctx context.Context, args ik3cloud.ArgsStaffEdit, reply *int) error {
|
|
return logic.StaffLogic.Edit(args.StaffId, args.ArgsStaffAdd)
|
|
}
|
|
|
|
// Disable @TITLE 禁用员工
|
|
func (s *Staff) Disable(ctx context.Context, numbers []string, reply *int) error {
|
|
return logic.StaffLogic.Disable(numbers)
|
|
}
|
|
|
|
// Enable @TITLE 启用员工
|
|
func (s *Staff) Enable(ctx context.Context, numbers []string, reply *int) error {
|
|
return logic.StaffLogic.Enable(numbers)
|
|
}
|
|
|
|
// Delete @TITLE 删除
|
|
func (s *Staff) Delete(ctx context.Context, numbers []string, reply *int) error {
|
|
return logic.StaffLogic.Delete(numbers)
|
|
}
|