OrgTime

package
v5.1.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//OpenSub 是否启动订阅
	OpenSub = false
)

Functions

func AuditLeave

func AuditLeave(args *ArgsAuditLeave) (err error)

AuditLeave 审核请假参数

func CheckIsWorkByOrgBindID

func CheckIsWorkByOrgBindID(orgBindID int64) bool

CheckIsWorkByOrgBindID 检查组织成语ID是否上班?

func CheckLeaveByBindID

func CheckLeaveByBindID(orgBindID int64) bool

CheckLeaveByBindID 检查是否正在请假

func CreateLeave

func CreateLeave(args *ArgsCreateLeave) (err error)

CreateLeave 创建请假

func DeleteByID

func DeleteByID(args *ArgsDeleteByID) (err error)

DeleteByID 删除数据

func DeleteLeave

func DeleteLeave(args *ArgsDeleteLeave) (err error)

DeleteLeave 删除请假

func Init

func Init()

func UpdateByID

func UpdateByID(args *ArgsUpdateByID) (err error)

UpdateByID 修改数据

Types

type ArgsAuditLeave

type ArgsAuditLeave struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
	//组织ID
	OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
	//审批人
	AskOrgBindID int64 `db:"ask_org_bind_id" json:"askOrgBindID" check:"id" empty:"true"`
}

ArgsAuditLeave 审核请假参数

type ArgsCheckIsWorkByID

type ArgsCheckIsWorkByID struct {
	//ID
	ID int64 `json:"id" check:"id"`
	//组织ID
	// 用于验证
	OrgID int64 `json:"orgID" check:"id" empty:"true"`
}

ArgsCheckIsWorkByID 检查某个ID,是否正在上班?参数

type ArgsCreate

type ArgsCreate struct {
	//过期时间
	// 过期后自动失效,用于排临时班
	ExpireAt time.Time `db:"expire_at" json:"expireAt" check:"isoTime" empty:"true"`
	//组织ID
	OrgID int64 `db:"org_id" json:"orgID" check:"id"`
	//分组ID列
	Groups pq.Int64Array `db:"groups" json:"groups" check:"ids" empty:"true"`
	//绑定人列
	Binds pq.Int64Array `db:"binds" json:"binds" check:"ids" empty:"true"`
	//名称
	Name string `db:"name" json:"name" check:"name"`
	//时间配置组
	Configs FieldsConfigs `db:"configs" json:"configs"`
	//轮动任务
	RotConfig FieldsConfigRot `db:"rot_config" json:"rotConfig"`
}

ArgsCreate 创建新的数据参数

type ArgsCreateLeave

type ArgsCreateLeave struct {
	//离开时间
	StartAt string `db:"start_at" json:"startAt" check:"defaultTime"`
	//结束时间
	EndAt string `db:"end_at" json:"endAt" check:"defaultTime"`
	//组织ID
	OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
	//请假人
	OrgBindID int64 `db:"org_bind_id" json:"orgBindID" check:"id" empty:"true"`
	//请假原因
	Des string `db:"des" json:"des" check:"des" min:"1" max:"600" empty:"true"`
}

ArgsCreateLeave 创建请假参数

type ArgsDeleteByID

type ArgsDeleteByID struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
	//组织ID
	OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
}

ArgsDeleteByID 删除数据参数

type ArgsDeleteLeave

type ArgsDeleteLeave struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
	//组织ID
	OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
}

ArgsDeleteLeave 删除请假参数

type ArgsGetAllByBind

type ArgsGetAllByBind struct {
	//组织分组
	GroupIDs pq.Int64Array `json:"groupIDs" check:"ids"`
	//组织成员
	BindID int64 `json:"bindID" check:"id"`
}

ArgsGetAllByBind 获取组织分组或成员参加的所有考勤安排参数

type ArgsGetLeaveList

type ArgsGetLeaveList struct {
	//分页
	Pages CoreSQLPages.ArgsDataList `json:"pages"`
	//组织ID
	// 必填
	OrgID int64 `json:"orgID" check:"id"`
	//请假人
	OrgBindID int64 `db:"org_bind_id" json:"orgBindID"`
	//是否审核
	IsAudit bool `json:"isAudit" check:"bool"`
	//是否删除
	IsRemove bool `json:"isRemove" check:"bool"`
	//搜索
	Search string `json:"search" check:"search" empty:"true"`
}

ArgsGetLeaveList 获取请假列表参数

type ArgsGetList

type ArgsGetList struct {
	//分页
	Pages CoreSQLPages.ArgsDataList `json:"pages"`
	//组织ID
	// 必填
	OrgID int64 `json:"orgID" check:"id"`
	//搜索
	Search string `json:"search" check:"search" empty:"true"`
}

ArgsGetList 获取列表参数

type ArgsGetOne

type ArgsGetOne struct {
	//ID
	ID int64 `json:"id" check:"id"`
	//组织ID
	// 用于验证
	OrgID int64 `json:"orgID" check:"id" empty:"true"`
}

ArgsGetOne 获取某一个数据参数

type ArgsUpdateByID

type ArgsUpdateByID struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
	//组织ID
	OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
	//过期时间
	// 过期后自动失效,用于排临时班
	ExpireAt time.Time `db:"expire_at" json:"expireAt" check:"isoTime" empty:"true"`
	//分组ID列
	Groups pq.Int64Array `db:"groups" json:"groups" check:"ids" empty:"true"`
	//绑定人列
	Binds pq.Int64Array `db:"binds" json:"binds" check:"ids" empty:"true"`
	//名称
	Name string `db:"name" json:"name" check:"name"`
	//时间配置组
	Configs FieldsConfigs `db:"configs" json:"configs"`
	//轮动任务
	RotConfig FieldsConfigRot `db:"rot_config" json:"rotConfig"`
}

ArgsUpdateByID 修改数据参数

type FieldsConfigRot

type FieldsConfigRot struct {
	//当前轮动到的位置
	NowKey int `db:"now_key" json:"nowKey"`
	//切换间隔日
	// 如果给1,则每个轮动间隔1天;必须大于0,否则自动修正为1
	DiffDay int `db:"diff_day" json:"diffDay"`
	//具体的分配时间组合
	WorkTime FieldsWorkTimeTimes `db:"work_time" json:"workTime"`
}

FieldsConfigRot 轮动任务

func (*FieldsConfigRot) Scan

func (t *FieldsConfigRot) Scan(value interface{}) error

func (FieldsConfigRot) Value

func (t FieldsConfigRot) Value() (driver.Value, error)

Value sql底层处理器

type FieldsConfigs

type FieldsConfigs struct {
	//每年月时间
	// 1-12月
	Month []int `db:"month" json:"month"`
	//每月时间
	// 检查1-31的天
	MonthDay []int `db:"month_day" json:"monthDay"`
	//每月第几个周
	// 1-6周
	MonthWeek []int `db:"month_week" json:"monthWeek"`
	//每周7天时间
	// 检查1\2\3\4\5\6\0
	Week []int `db:"week" json:"week"`
	//具体的分配时间组合
	WorkTime FieldsWorkTimeTimes `db:"work_time" json:"workTime"`
	//自动跳过节假日
	AllowHoliday bool `db:"allow_holiday" json:"allowHoliday"`
}

FieldsConfigs 配置组

func (*FieldsConfigs) Scan

func (t *FieldsConfigs) Scan(value interface{}) error

func (FieldsConfigs) Value

func (t FieldsConfigs) Value() (driver.Value, error)

Value sql底层处理器

type FieldsLeave

type FieldsLeave struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//删除时间
	DeleteAt time.Time `db:"delete_at" json:"deleteAt"`
	//审批时间
	AuditAt time.Time `db:"audit_at" json:"auditAt"`
	//离开时间
	StartAt time.Time `db:"start_at" json:"startAt"`
	//结束时间
	EndAt time.Time `db:"end_at" json:"endAt"`
	//组织ID
	OrgID int64 `db:"org_id" json:"orgID"`
	//请假人
	OrgBindID int64 `db:"org_bind_id" json:"orgBindID"`
	//请假原因
	Des string `db:"des" json:"des"`
	//审批人
	AskOrgBindID int64 `db:"ask_org_bind_id" json:"askOrgBindID"`
}

func GetLeaveList

func GetLeaveList(args *ArgsGetLeaveList) (dataList []FieldsLeave, dataCount int64, err error)

GetLeaveList 获取请假列表

type FieldsWorkTime

type FieldsWorkTime struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//更新时间
	UpdateAt time.Time `db:"update_at" json:"updateAt"`
	//过期时间
	// 过期后自动失效,用于排临时班
	ExpireAt time.Time `db:"expire_at" json:"expireAt"`
	//掌管该数据的组织ID
	OrgID int64 `db:"org_id" json:"orgID"`
	//分组ID列
	Groups pq.Int64Array `db:"groups" json:"groups"`
	//绑定人列
	Binds pq.Int64Array `db:"binds" json:"binds"`
	//名称
	Name string `db:"name" json:"name"`
	//当前上下班状态
	// 根据配置时间自动调整,外部读取即可使用
	IsWork bool `db:"is_work" json:"isWork"`
	//时间配置组
	Configs FieldsConfigs `db:"configs" json:"configs"`
	//轮动任务
	RotConfig FieldsConfigRot `db:"rot_config" json:"rotConfig"`
}

FieldsWorkTime 上下班处理,提供给用户

func Create

func Create(args *ArgsCreate) (data FieldsWorkTime, err error)

Create 创建新的数据

func GetAllByBind

func GetAllByBind(args *ArgsGetAllByBind) (dataList []FieldsWorkTime, err error)

GetAllByBind 获取组织分组或成员参加的所有考勤安排

func GetList

func GetList(args *ArgsGetList) (dataList []FieldsWorkTime, dataCount int64, err error)

GetList 获取列表

func GetOne

func GetOne(args *ArgsGetOne) (data FieldsWorkTime, err error)

GetOne 获取某一个数据

type FieldsWorkTimeTime

type FieldsWorkTimeTime struct {
	//上班时间
	StartHour   int `db:"start_hour" json:"startHour"`
	StartMinute int `db:"start_minute" json:"startMinute"`
	//下班时间
	EndHour   int `db:"end_hour" json:"endHour"`
	EndMinute int `db:"end_minute" json:"endMinute"`
}

func (*FieldsWorkTimeTime) Scan

func (t *FieldsWorkTimeTime) Scan(value interface{}) error

func (FieldsWorkTimeTime) Value

func (t FieldsWorkTimeTime) Value() (driver.Value, error)

Value sql底层处理器

type FieldsWorkTimeTimes

type FieldsWorkTimeTimes []FieldsWorkTimeTime

FieldsWorkTimeTimes 上下班时间 24小时制

func (*FieldsWorkTimeTimes) Scan

func (t *FieldsWorkTimeTimes) Scan(value interface{}) error

func (FieldsWorkTimeTimes) Value

func (t FieldsWorkTimeTimes) Value() (driver.Value, error)

Value sql底层处理器

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL